@layer tokens, base, layout, components, sections, motion;

@layer tokens {
  :root {
    --bg: #f4fbfb;
    --surface: #ffffff;
    --ink: #062a33;
    --muted: #4f6b73;
    --teal: #0aa5a8;
    --teal-2: #2fc4c0;
    --deep: #067a86;
    --aqua: #8ee3e0;
    --soft: #e3f6f5;
    --line: rgb(6 42 51 / 0.09);

    --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --gutter: clamp(18px, 4vw, 40px);
    --header-h: 72px;
    --radius: 28px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    color-scheme: light;
  }
}

@layer base {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

  body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: clip;
  }

  body:has(.sheet[open]) { overflow: hidden; }

  img, svg { display: block; max-width: 100%; }
  img { height: auto; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
  ul { list-style: none; }
  h1, h2, h3 { line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
  p { text-wrap: pretty; }
  em { font-style: normal; }
  [hidden] { display: none !important; }

  :focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 10px; }
  ::selection { background: var(--teal); color: #fff; }

  .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

  .icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .skip-link { position: fixed; top: -100px; left: 12px; z-index: 1000; padding: 10px 16px; border-radius: 12px; background: var(--deep); color: #fff; font-weight: 600; }
  .skip-link:focus-visible { top: 12px; }
}

@layer layout {
  .wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)); }

  .section { padding-block: clamp(72px, 10vw, 136px); }
  .section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 44px); }

  .eyebrow { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal); }
  .eyebrow::before { content: ''; width: 26px; height: 2px; border-radius: 2px; background: currentColor; }
  .eyebrow--light { color: var(--aqua); }

  .section-title { font-size: clamp(34px, 5.6vw, 72px); font-weight: 800; }
  .section-title em, .hero__title em { color: var(--teal); }
}

@layer components {
  .brand { display: inline-flex; align-items: center; gap: 10px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__name { font-size: 24px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
  .brand__name b { font-weight: 800; color: var(--teal); }
  .brand--small .brand__mark { width: 28px; height: 28px; }
  .brand--small .brand__name { font-size: 20px; }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 26px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-out), background-color 0.25s;
  }
  .btn:active { transform: scale(0.97); }
  .btn--primary { background: linear-gradient(135deg, var(--teal-2), var(--deep)); color: #fff; box-shadow: 0 14px 34px rgb(6 122 134 / 0.32); }
  .btn--ghost { background: rgb(255 255 255 / 0.7); color: var(--deep); box-shadow: inset 0 0 0 1.5px rgb(10 165 168 / 0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .btn .icon { transition: transform 0.35s var(--ease-out); }

  @media (hover: hover) {
    .btn--primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgb(6 122 134 / 0.42); }
    .btn--ghost:hover { background: #fff; }
    .btn:hover .icon { transform: translateX(4px); }
  }

  .badge { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; background: var(--soft); color: var(--deep); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
  .badge--volume { background: var(--ink); color: #fff; }
  .badge--type { background: rgb(10 165 168 / 0.12); }

  .chip {
    flex-shrink: 0;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease-spring);
  }
  .chip:active { transform: scale(0.96); }
  .chip[aria-pressed='true'] { background: var(--ink); color: #fff; box-shadow: none; }

  .stores { display: flex; flex-wrap: wrap; gap: 12px; }
  .store { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 22px 10px 18px; border-radius: 18px; transition: transform 0.35s var(--ease-spring); }
  .store img { width: 22px; height: 22px; }
  .store span { display: grid; line-height: 1.15; }
  .store small { font-size: 10px; font-weight: 600; opacity: 0.7; }
  .store strong { font-size: 16px; font-weight: 700; white-space: nowrap; }
  .store:active { transform: scale(0.96); }
  .store--dark { background: var(--ink); color: #fff; }
  .store--light { background: #fff; color: var(--ink); }
  .store[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }

  .media { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(120% 90% at 50% 10%, #fff, var(--soft)); }
  .media__image { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
  .media__placeholder { display: grid; place-items: center; gap: 8px; }
  .media__mark { width: clamp(64px, 30%, 120px); aspect-ratio: 64 / 64; height: auto; filter: drop-shadow(0 18px 24px rgb(6 122 134 / 0.25)); }
  .media__volume { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.03em; color: var(--deep); }
}

@layer sections {
  .header { position: fixed; inset: 0 0 auto; z-index: 100; padding-top: env(safe-area-inset-top); transition: background-color 0.3s, box-shadow 0.3s; }
  .header.is-scrolled { background: rgb(244 251 251 / 0.82); backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%); box-shadow: 0 1px 0 var(--line); }
  .header__inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
  .nav { display: none; margin-left: auto; gap: 4px; }
  .nav__link { padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); transition: color 0.2s, background-color 0.2s; }
  .nav__link:hover { color: var(--ink); background: rgb(6 42 51 / 0.05); }

  .lang { display: flex; gap: 2px; padding: 3px; margin-left: auto; border-radius: 999px; background: rgb(6 42 51 / 0.06); }
  .lang__btn { min-width: 40px; min-height: 32px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); transition: background-color 0.25s, color 0.25s, box-shadow 0.25s; }
  .lang__btn[aria-pressed='true'] { background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgb(6 42 51 / 0.1); }

  .hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: calc(var(--header-h) + env(safe-area-inset-top) + 24px) 0 72px; overflow: hidden; isolation: isolate; }
  .hero__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
  .hero__bg i { position: absolute; border-radius: 50%; will-change: transform; }
  .hero__bg i:first-child { width: 70vmax; height: 70vmax; top: -32vmax; right: -24vmax; background: radial-gradient(circle, rgb(142 227 224 / 0.55), transparent 65%); animation: drift 20s var(--ease-in-out) infinite alternate; }
  .hero__bg i:last-child { width: 55vmax; height: 55vmax; bottom: -28vmax; left: -22vmax; background: radial-gradient(circle, rgb(10 165 168 / 0.16), transparent 65%); animation: drift 26s var(--ease-in-out) -9s infinite alternate-reverse; }

  .hero__grid { display: grid; gap: 40px; align-items: center; }
  .hero__copy { display: grid; gap: 22px; justify-items: start; }
  .hero__title { font-size: clamp(44px, 8vw, 104px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.98; }
  .hero__sub { max-width: 32em; font-size: clamp(15px, 1.2vw, 18px); color: var(--muted); }
  .hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

  .drop-scene { position: relative; justify-self: center; width: min(78vw, 420px); aspect-ratio: 200 / 260; }
  .drop { position: relative; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 40px 60px rgb(6 122 134 / 0.28)); }
  .drop__glass { fill: rgb(255 255 255 / 0.55); stroke: rgb(10 165 168 / 0.35); stroke-width: 2; }
  .drop__level { transform: translateY(0); }
  .drop__wave--front { fill: url(#drop-water); }
  .drop__wave--back { fill: var(--aqua); opacity: 0.85; }
  .drop__bubble { fill: rgb(255 255 255 / 0.55); }
  .drop__shine { fill: none; stroke: rgb(255 255 255 / 0.8); stroke-width: 8; stroke-linecap: round; }
  .ripple { position: absolute; left: 50%; bottom: -2%; width: 60%; aspect-ratio: 4 / 1; border-radius: 50%; border: 2px solid rgb(10 165 168 / 0.45); transform: translate(-50%, 50%) scale(0.4); opacity: 0; }

  .ticker { display: flex; overflow: hidden; padding-block: clamp(18px, 2.4vw, 28px); background: var(--ink); color: #fff; }
  .ticker__track { flex-shrink: 0; display: flex; align-items: center; }
  .ticker__track span { display: inline-flex; align-items: center; gap: clamp(22px, 3vw, 40px); padding-right: clamp(22px, 3vw, 40px); font-size: clamp(20px, 3vw, 36px); font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
  .ticker__track span::after { content: ''; width: 0.4em; height: 0.52em; background: var(--teal-2); clip-path: polygon(50% 0, 100% 62%, 85% 92%, 50% 100%, 15% 92%, 0 62%); }

  .catalog { background: var(--surface); }
  .filters { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .catalog__status { margin-bottom: 22px; font-size: 14px; font-weight: 500; color: var(--muted); }
  .catalog__status[data-state='error'] { color: #b42318; }

  .grid { display: grid; gap: 18px; }
  .card { animation: card-in 0.8s var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); }
  .card__link { display: grid; height: 100%; border-radius: var(--radius); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; transition: transform 0.45s var(--ease-spring), box-shadow 0.45s var(--ease-out); }
  .card__media { aspect-ratio: 1; }
  .card__media .media__image { transition: transform 0.7s var(--ease-out); }
  .card__body { display: grid; gap: 10px; align-content: start; padding: 20px 22px 24px; }
  .card__badges { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
  .card__title { font-size: 20px; font-weight: 700; }
  .card__text { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .card__more { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--teal); }
  .card__more .icon { width: 16px; height: 16px; transition: transform 0.35s var(--ease-out); }

  @media (hover: hover) {
    .card__link:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px rgb(10 165 168 / 0.3), 0 24px 50px rgb(6 42 51 / 0.1); }
    .card__link:hover .media__image { transform: scale(1.06) rotate(-2deg); }
    .card__link:hover .card__more .icon { transform: translateX(4px); }
  }

  .order { padding-top: 0; background: var(--surface); }
  .order__box {
    position: relative;
    display: grid;
    gap: 32px;
    padding: clamp(36px, 6vw, 80px);
    border-radius: clamp(28px, 4vw, 44px);
    background: radial-gradient(120% 120% at 0% 0%, #0d4b57, var(--ink) 60%);
    color: rgb(255 255 255 / 0.82);
    overflow: hidden;
    isolation: isolate;
  }
  .order__box::before { content: ''; position: absolute; right: -15%; top: -40%; width: 70%; aspect-ratio: 1; border-radius: 50%; z-index: -1; background: radial-gradient(circle, rgb(47 196 192 / 0.35), transparent 65%); animation: drift 16s var(--ease-in-out) infinite alternate; }
  .order__copy { display: grid; gap: 18px; justify-items: start; }
  .order .section-title { color: #fff; font-size: clamp(30px, 4.6vw, 56px); }
  .order .section-title em { color: var(--aqua); }
  .order__sub { max-width: 34em; font-size: clamp(15px, 1.2vw, 17px); }
  .order__site { display: inline-flex; align-items: center; gap: 10px; justify-self: start; align-self: end; font-weight: 700; color: var(--aqua); }
  .order__site .icon { transition: transform 0.35s var(--ease-out); }
  .order__site:hover .icon { transform: translateX(4px); }

  .footer { padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
  .footer__copy { font-size: 13px; color: var(--muted); }
  .footer__copy a { font-weight: 700; color: var(--teal); }

  .sheet {
    margin: auto auto 0;
    width: 100%;
    max-width: 100%;
    max-height: 92svh;
    border: 0;
    border-radius: 28px 28px 0 0;
    background: var(--surface);
    color: var(--ink);
    overflow: auto;
    overscroll-behavior: contain;
    transition: transform 0.5s var(--ease-out), opacity 0.3s, overlay 0.5s allow-discrete, display 0.5s allow-discrete;
    transform: translateY(100%);
  }
  .sheet[open] { transform: none; }
  @starting-style { .sheet[open] { transform: translateY(100%); } }
  .sheet::backdrop { background: rgb(6 42 51 / 0); backdrop-filter: blur(0); transition: background-color 0.4s, backdrop-filter 0.4s, overlay 0.4s allow-discrete, display 0.4s allow-discrete; }
  .sheet[open]::backdrop { background: rgb(6 42 51 / 0.45); backdrop-filter: blur(6px); }
  @starting-style { .sheet[open]::backdrop { background: rgb(6 42 51 / 0); backdrop-filter: blur(0); } }

  .sheet__panel { position: relative; display: grid; }
  .sheet__close { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgb(255 255 255 / 0.9); box-shadow: 0 4px 16px rgb(6 42 51 / 0.12); transition: transform 0.3s var(--ease-spring); }
  .sheet__close:hover { transform: rotate(90deg); }
  .sheet__media { display: grid; gap: 10px; padding: 12px 12px 0; }
  .gallery__stage { aspect-ratio: 1; max-height: 46svh; width: 100%; border-radius: 22px; }
  .gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; }
  .gallery__thumb { flex-shrink: 0; width: 64px; height: 64px; border-radius: 14px; background: var(--soft); overflow: hidden; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 0.25s; }
  .gallery__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
  .gallery__thumb[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--teal); }
  .sheet__body { display: grid; gap: 16px; align-content: start; padding: 22px 24px calc(28px + env(safe-area-inset-bottom)); }
  .sheet__meta { display: flex; flex-wrap: wrap; gap: 6px; }
  .sheet__title { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
  .sheet__text { display: grid; gap: 10px; font-size: 15px; color: var(--muted); }
  .sheet__cta { justify-self: start; margin-top: 6px; }

  @media (min-width: 600px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  }

  @media (min-width: 900px) {
    :root { --header-h: 84px; }
    .nav { display: flex; }
    .lang { margin-left: 8px; }
    .hero__grid { grid-template-columns: 1.15fr 0.85fr; }
    .drop-scene { justify-self: end; width: min(34vw, 440px); }
    .grid { grid-template-columns: repeat(3, 1fr); gap: 26px; }
    .order__box { grid-template-columns: 1fr auto; align-items: end; }
    .sheet { margin: auto; width: min(960px, calc(100% - 48px)); max-height: min(720px, calc(100svh - 48px)); border-radius: 32px; transform: translateY(24px) scale(0.96); opacity: 0; }
    .sheet[open] { transform: none; opacity: 1; }
    @starting-style { .sheet[open] { transform: translateY(24px) scale(0.96); opacity: 0; } }
    .sheet__panel { grid-template-columns: 1fr 1fr; align-items: stretch; }
    .sheet__media { padding: 16px; align-content: start; }
    .gallery__stage { max-height: none; }
    .sheet__body { padding: 56px 40px 40px 16px; align-content: center; }
  }
}

@layer motion {
  .js .intro { animation: rise-in 1s var(--ease-out) both; }
  .js .intro:nth-child(2) { animation-delay: 0.1s; }
  .js .intro:nth-child(3) { animation-delay: 0.2s; }
  .js .intro:nth-child(4) { animation-delay: 0.3s; }

  .drop-scene { animation: drop-in 1.2s var(--ease-spring) 0.2s both; }
  .drop__level { animation: fill 2.8s var(--ease-out) 0.6s both, bob 6s var(--ease-in-out) 3.4s infinite; }
  .drop__wave--front { animation: wave 4s linear infinite; }
  .drop__wave--back { animation: wave 6.5s linear infinite reverse; }
  .drop__bubble { animation: bubble 5s var(--ease-in-out) infinite; }
  .drop__bubble:nth-of-type(2) { animation-delay: -1.6s; animation-duration: 6s; }
  .drop__bubble:nth-of-type(3) { animation-delay: -3.2s; animation-duration: 4.4s; }
  .ripple { animation: ripple 3.6s var(--ease-out) 1.2s infinite; }
  .ripple:nth-child(2) { animation-delay: 2.4s; }
  .ripple:nth-child(3) { animation-delay: 3.6s; }

  .ticker__track { animation: ticker 30s linear infinite; }

  .js [data-reveal] { opacity: 0; translate: 0 32px; transition: opacity 0.9s var(--ease-out), translate 0.9s var(--ease-out); }
  .js [data-reveal].is-visible { opacity: 1; translate: none; }

  @keyframes rise-in { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: none; } }
  @keyframes drop-in { from { opacity: 0; transform: translateY(-60px) scale(0.85); } to { opacity: 1; transform: none; } }
  @keyframes fill { from { transform: translateY(150px); } to { transform: translateY(0); } }
  @keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }
  @keyframes wave { from { transform: translateX(0); } to { transform: translateX(-100px); } }
  @keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-120px); opacity: 0; } }
  @keyframes ripple { 0% { transform: translate(-50%, 50%) scale(0.4); opacity: 0.9; } 100% { transform: translate(-50%, 50%) scale(1.6); opacity: 0; } }
  @keyframes ticker { to { transform: translateX(-100%); } }
  @keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6%, 8%) scale(1.12); } }
  @keyframes card-in { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: none; } }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      animation-delay: 0s !important;
      transition-duration: 0.01ms !important;
      transition-delay: 0s !important;
    }
  }
}
