@import url("tokens.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 10px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body.nav-open,
body.modal-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
}

.wrap {
  width: min(100% - 2.75rem, var(--max));
  margin-inline: auto;
}

/* Header */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: #fff;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.header.is-scrolled {
  background: #fff;
  border-bottom-color: var(--line);
  box-shadow: 0 4px 24px rgba(18, 54, 95, 0.05);
}

body.nav-open .header {
  background: #fff;
}

.nav-bar {
  height: var(--header-h);
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--brand-deep);
}

.logo:hover {
  color: var(--brand-deep);
}

.logo-badge {
  flex-shrink: 0;
  height: 34px;
  padding: 0 0.6rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  display: grid;
  place-items: center;
}

.logo-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: none;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(18, 54, 95, 0.35);
  border: none;
}

.nav-backdrop.is-visible {
  display: block;
}

/* Hero — full bleed, brand first */
.hero {
  position: relative;
  margin-top: calc(var(--header-h) + var(--safe-top));
  min-height: min(90vh, 780px);
  display: flex;
  align-items: flex-end;
  padding: 0 0 clamp(3.5rem, 9vw, 5rem);
  overflow: hidden;
}

.hero-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-slides {
  display: flex;
  height: 100%;
  will-change: transform;
}

.hero-slide {
  flex: 0 0 auto;
  height: 100%;
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  animation: drift 24s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: scale(1.03) translateY(0);
  }
  to {
    transform: scale(1.07) translateY(-1.5%);
  }
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18, 54, 95, 0.25) 0%, rgba(18, 54, 95, 0.15) 35%, rgba(18, 54, 95, 0.82) 100%);
}

.hero-dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 0.4rem;
}

.hero-dots button {
  width: 7px;
  height: 7px;
  border: none;
  border-radius: 99px;
  padding: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: width 0.3s var(--ease), background 0.3s var(--ease);
}

.hero-dots button.active {
  width: 22px;
  background: #fff;
}

.hero-body {
  position: relative;
  z-index: 3;
  width: min(100% - 2.75rem, var(--max));
  margin-inline: auto;
  color: #fff;
  text-align: left;
  animation: rise 0.85s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-brand {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.8vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #b8d4ff;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2.15rem, 8vw, 3.4rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.02em;
}

.hero-desc {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 24em;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 17rem;
}

.btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1.35rem;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: #fff;
  color: var(--brand-deep);
}

.btn-primary:hover {
  color: var(--brand-deep);
  background: #eef4ff;
}

.btn-soft {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
}

.btn-soft:hover {
  color: #fff;
  border-color: #fff;
}

/* Trust strip */
.trust {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 1.15rem 0;
  text-align: center;
}

.trust-row strong {
  display: block;
  font-size: 0.92rem;
  color: var(--brand);
  margin-bottom: 0.15rem;
}

.trust-row span {
  font-size: 0.7rem;
  color: var(--text-2);
}

/* Sections */
.block {
  padding: clamp(2.75rem, 7vw, 4.5rem) 0;
}

.block-alt {
  background: var(--surface);
}

.block h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  color: var(--brand-deep);
  font-weight: 700;
}

.block-head p {
  margin: -0.65rem 0 1.35rem;
  color: var(--text-2);
  font-size: 0.9rem;
}

.about-layout {
  display: grid;
  gap: 1.25rem;
}

.about-text p {
  margin: 0 0 0.9rem;
  color: var(--text-2);
  font-size: 0.94rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-quote {
  margin: 0;
  padding: 1.25rem 1.35rem;
  border-radius: var(--r-lg);
  background: linear-gradient(145deg, var(--accent-soft), #f0f6ff);
  border: none;
  color: var(--brand-deep);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.55;
}

.tags {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags li {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--text-2);
  font-weight: 500;
}

.block-alt .tags li {
  background: var(--bg);
}

/* Products */
.product-filters {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
}

.product-filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}

.filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 0;
  text-align: left;
  font-family: inherit;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.block-alt .product-card {
  background: var(--bg);
  box-shadow: none;
}

.product-card:hover {
  border-color: var(--accent);
}

.product-card:active {
  transform: scale(0.98);
}

.product-card-img-wrap {
  aspect-ratio: 1;
  background: linear-gradient(180deg, var(--accent-soft), #fff);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card-body {
  padding: 0.75rem 0.85rem 0.95rem;
}

.product-card-cat {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
}

.product-card-body h3 {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: var(--brand-deep);
}

.product-card-body p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem;
  color: var(--text-2);
}

/* Contact */
.contact-board {
  display: grid;
  gap: 1rem;
}

.contact-main {
  display: block;
  padding: 1.5rem 1.35rem;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
  box-shadow: var(--shadow);
}

.contact-main:hover {
  color: #fff;
}

.contact-main span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.75;
  margin-bottom: 0.35rem;
}

.contact-main strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2rem);
  letter-spacing: 0.02em;
}

.contact-main small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.contact-side {
  display: grid;
  gap: 0.75rem;
}

.contact-side a,
.contact-side p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
}

.contact-side svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-side a:hover {
  border-color: var(--accent);
  color: var(--brand);
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-bottom));
  background: var(--brand-deep);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.footer p {
  margin: 0.2rem 0;
}

.footer a {
  color: rgba(255, 255, 255, 0.45);
}

/* Modal */
.modal {
  padding: 0;
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  max-width: 100%;
}

.modal::backdrop {
  background: rgba(18, 54, 95, 0.5);
}

.modal-panel {
  margin: auto 0 0;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  overflow-y: auto;
  position: relative;
}

.modal-panel > img {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  background: var(--accent-soft);
  padding: 1.25rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 1.1rem 1.25rem calc(1.25rem + var(--safe-bottom));
}

.modal-body > span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}

.modal-body h3 {
  margin: 0.3rem 0;
  font-size: 1.25rem;
  color: var(--brand-deep);
}

.modal-spec {
  font-size: 0.88rem;
  color: var(--text-2);
  white-space: pre-line;
  margin: 0 0 0.85rem;
}

.modal-detail {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.7;
}

.modal-detail p {
  margin: 0 0 0.75rem;
}

.modal-detail p:last-child {
  margin-bottom: 0;
}

.modal-detail strong {
  color: var(--brand-deep);
  font-weight: 600;
}

.modal-detail ul {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
}

.modal-detail li {
  margin-bottom: 0.35rem;
}

.modal-detail li:last-child {
  margin-bottom: 0;
}

/* Mobile nav */
@media (max-width: 767px) {
  .nav {
    position: fixed;
    top: calc(var(--header-h) + var(--safe-top));
    right: 0;
    bottom: 0;
    width: min(280px, 80vw);
    background: #fff;
    flex-direction: column;
    padding: 1rem;
    box-shadow: -12px 0 40px rgba(18, 54, 95, 0.12);
    transform: translateX(100%);
    transition: transform 0.28s var(--ease);
    z-index: 101;
    display: flex;
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav a {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    min-height: 48px;
    display: flex;
    align-items: center;
    color: var(--text);
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .nav {
    display: flex;
    gap: 1.75rem;
  }

  .nav a {
    color: var(--text-2);
    font-weight: 500;
    font-size: 0.9rem;
  }

  .nav a:hover {
    color: var(--brand);
  }

  .logo-name {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: row;
    max-width: none;
  }

  .hero-dots {
    left: auto;
    right: max(2rem, calc((100% - var(--max)) / 2));
    transform: none;
    bottom: 2rem;
  }

  .about-layout {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: start;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
  }

  .contact-board {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.25rem;
    align-items: stretch;
  }

  .contact-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .modal-panel {
    width: min(520px, 92vw);
    margin: 6vh auto;
    border-radius: var(--r-lg);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-body {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
