/* ===== 2Tap — style.css =====
   Tokens, reset, chrome (loader, nav, buttons, cart, toast).
   Section layouts live in sections.css.
   Color logic: blue = the tap (cause), gold = the stars (effect). */

:root {
  --void: #08080b;
  --void-2: #0d0d12;
  --paper: #f3f1ea;
  --paper-2: #ebe8df;
  --ink: #121216;
  --ink-60: rgba(18, 18, 22, 0.62);
  --chalk: #f5f4ef;
  --chalk-60: rgba(245, 244, 239, 0.6);
  --chalk-40: rgba(245, 244, 239, 0.4);
  --blue: #3f6dff;
  --blue-soft: rgba(63, 109, 255, 0.14);
  --gold: #ffb42e;
  --line: rgba(245, 244, 239, 0.12);
  --line-ink: rgba(18, 18, 22, 0.14);

  --font-display: "Clash Display", "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-tech: "Space Grotesk", monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--void);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: #fff; }

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { font-weight: 600; }

/* ---------- type utilities ---------- */
.eyebrow {
  font-family: var(--font-tech);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--chalk-60);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.split-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split-line > span { display: block; will-change: transform; }

/* ---------- stage (fixed WebGL canvas) ---------- */
#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease 0.15s;
}
body.ready #stage { opacity: 1; }

.stage-dim {
  position: fixed; inset: 0; z-index: 2;
  background: radial-gradient(120% 90% at 50% 45%, transparent 30%, rgba(4, 4, 7, 0.92) 100%),
              rgba(4, 4, 7, 0.55);
  opacity: 0;
  pointer-events: none;
}

.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

.grain {
  position: fixed; inset: -60px; z-index: 60; pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-14px, 9px); }
  50% { transform: translate(11px, -12px); }
  75% { transform: translate(-8px, -7px); }
  100% { transform: translate(0, 0); }
}

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.shutter {
  position: absolute; left: 0; width: 100%; height: 50.5%;
  background: var(--void-2);
}
.shutter.top { top: 0; }
.shutter.bottom { bottom: 0; }

.loader-core {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 26px;
}
.loader-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  display: flex; overflow: hidden;
}
.loader-word span { display: inline-block; transform: translateY(110%); white-space: pre; }
.loader-word .blue { color: var(--blue); }
.loader-bar {
  width: min(280px, 60vw); height: 1px;
  background: var(--line);
  position: relative; overflow: hidden;
}
.loader-bar i {
  position: absolute; inset: 0;
  background: var(--chalk);
  transform-origin: left;
  transform: scaleX(0);
}
.loader-pct {
  position: absolute; right: 5vw; bottom: 4.5vh; z-index: 2;
  font-family: var(--font-tech);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 500;
  color: transparent;
  -webkit-text-stroke: 1px var(--chalk-40);
  line-height: 1;
}
#loader.done { visibility: hidden; transition: visibility 0s 1.3s; pointer-events: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  transition: background 0.5s, border-color 0.5s, color 0.4s, transform 0.4s var(--ease-out);
  border-bottom: 1px solid transparent;
  color: var(--chalk);
}
.nav.nav-hidden { transform: translateY(-100%); }
.nav.scrolled {
  background: rgba(8, 8, 11, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}
body.light-act .nav { color: var(--ink); }
body.light-act .nav.scrolled {
  background: rgba(243, 241, 234, 0.6);
  border-bottom-color: var(--line-ink);
}

.nav-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--blue);
  transform-origin: left;
  transform: scaleX(0);
}

.nav-logo { display: inline-flex; align-items: center; }

/* The source PNG is a square canvas with the mark inset in it (~76% wide,
   ~39% tall). Crop it in place instead of shipping a re-exported asset:
   render it oversized inside a clipped box and shift it into frame. Dark
   sections need a flat-white knockout (the logo's own ink reads near-
   invisible on near-black); paper sections show it true-color. */
.brand-mark {
  position: relative;
  display: block;
  width: 61.9px; height: 32px;
  overflow: hidden;
}
.brand-mark img {
  position: absolute;
  left: -8.98px; top: -24.33px;
  width: 81.6px; height: 81.6px;
  max-width: none;
  filter: brightness(0) invert(1);
  transition: filter 0.4s;
}
body.light-act .brand-mark img { filter: none; }

.nav-links { display: flex; gap: clamp(18px, 2.6vw, 38px); }
.nav-links a {
  font-size: 13.5px; font-weight: 500;
  opacity: 0.75;
  position: relative;
  transition: opacity 0.3s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-actions { display: flex; align-items: center; gap: 16px; }

.cart-btn { position: relative; padding: 8px; display: inline-flex; }
.cart-count {
  position: absolute; top: 0; right: -2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px;
  background: var(--blue); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

.burger { display: none; flex-direction: column; gap: 5px; padding: 10px 6px; }
.burger span { width: 22px; height: 1.6px; background: currentColor; transition: transform 0.35s var(--ease-out); }
.burger.open span:first-child { transform: translateY(3.3px) rotate(45deg); }
.burger.open span:last-child { transform: translateY(-3.3px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8, 8, 11, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s, visibility 0.45s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 600;
  color: var(--chalk);
}
.mobile-menu .btn { font-size: 1rem; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-size: 14.5px; font-weight: 600;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.35s var(--ease-out), border-color 0.35s, transform 0.25s var(--ease-out);
  will-change: transform;
}
.btn span { position: relative; z-index: 2; }
.btn::before {
  content: ""; position: absolute; inset: -2px; z-index: 1;
  border-radius: inherit;
  transform: translateY(103%);
  transition: transform 0.5s var(--ease-out);
}
.btn:hover::before { transform: translateY(0); }
.btn:active { transform: scale(0.97); }

.btn-light { background: var(--chalk); color: var(--ink); }
.btn-light::before { background: var(--blue); }
.btn-light:hover { color: #fff; }

.btn-ghost { border: 1px solid var(--line); color: var(--chalk); }
.btn-ghost::before { background: var(--chalk); }
.btn-ghost:hover { color: var(--ink); border-color: var(--chalk); }

.btn-blue { background: var(--blue); color: #fff; }
.btn-blue::before { background: var(--chalk); }
.btn-blue:hover { color: var(--ink); }

/* ---------- cart drawer ---------- */
.cart-overlay {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(4, 4, 7, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 150;
  width: min(400px, 92vw);
  background: var(--void-2);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.55s var(--ease-out);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
}
.cart-drawer-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
#cartClose { padding: 6px; opacity: 0.7; transition: opacity 0.3s, transform 0.3s; }
#cartClose:hover { opacity: 1; transform: rotate(90deg); }

.cart-items { flex: 1; overflow-y: auto; padding: 10px 28px; }
.cart-empty { color: var(--chalk-40); font-size: 14px; padding: 26px 0; }

.cart-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-info { display: flex; flex-direction: column; gap: 3px; }
.cart-item-name { font-weight: 600; font-size: 14.5px; }
.cart-item-price { color: var(--chalk-60); font-size: 13px; }
.cart-item-qty { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.3s, color 0.3s;
}
.qty-btn:hover { background: var(--chalk); color: var(--ink); }

.cart-footer { padding: 24px 28px 30px; border-top: 1px solid var(--line); }
.cart-subtotal {
  display: flex; justify-content: space-between;
  font-size: 14px; color: var(--chalk-60);
  margin-bottom: 16px;
}
.cart-subtotal span:last-child { color: var(--chalk); font-weight: 700; font-size: 16px; }
.cart-checkout { width: 100%; }

/* ---------- drawer views (cart → checkout → success) ---------- */
.cart-drawer .cart-view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.cart-drawer[data-view="cart"] .cart-view[data-cart-view="cart"],
.cart-drawer[data-view="checkout"] .cart-view[data-cart-view="checkout"],
.cart-drawer[data-view="success"] .cart-view[data-cart-view="success"] { display: flex; }

.checkout { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.checkout-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 24px; }

.checkout-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--chalk-60);
  padding: 4px 0; margin-bottom: 14px;
  transition: color 0.3s;
}
.checkout-back:hover { color: var(--chalk); }

.checkout-summary { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.sum-row {
  display: flex; justify-content: space-between; gap: 14px;
  font-size: 13.5px; padding: 5px 0;
  color: var(--chalk-60);
}
.sum-row span:last-child { color: var(--chalk); white-space: nowrap; }

.checkout-total {
  display: flex; justify-content: space-between;
  padding: 12px 0 20px;
  font-size: 14px; color: var(--chalk-60);
}
.checkout-total span:last-child { color: var(--chalk); font-weight: 700; font-size: 16px; }

.field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
  font-size: 12px; letter-spacing: 0.02em;
  color: var(--chalk-60);
}
.field input, .field textarea {
  background: rgba(245, 244, 239, 0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--chalk);
  font-size: 14px;
  resize: none;
  transition: border-color 0.3s, background 0.3s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: rgba(63, 109, 255, 0.07);
}

.checkout-info {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 16px;
  display: flex; flex-direction: column; gap: 11px;
  margin-top: 4px;
}
.checkout-info p {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 12.5px; line-height: 1.55;
  color: var(--chalk-60);
}
.checkout-info svg { flex-shrink: 0; margin-top: 2px; color: var(--blue); }

.checkout-nopay {
  font-size: 12px; color: var(--chalk-40);
  text-align: center; margin-bottom: 12px;
}
.checkout-submit { width: 100%; }

.checkout-success {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 40px 34px;
  gap: 12px;
}
.success-mark {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(63, 109, 255, 0.12);
  border: 1px solid rgba(63, 109, 255, 0.4);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.checkout-success h4 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; }
.checkout-success p { font-size: 14px; color: var(--chalk-60); max-width: 290px; }
.checkout-success .btn { margin-top: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 160;
  /* 100% of its own (content-driven) height plus a fixed buffer that
     clears the bottom offset — a plain percentage isn't enough on its
     own and leaves a sliver of the pill sitting in view even "hidden" */
  transform: translate(-50%, calc(100% + 50px));
  background: var(--chalk); color: var(--ink);
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transition: transform 0.5s var(--ease-out);
  pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- scrollbar / focus ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: #26262e; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #34343e; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

@media (max-width: 860px) {
  .nav-links, .nav .nav-cta { display: none; }
  .burger { display: flex; }
}
