/* ═══════════════════════════════════════════════════════════
   KODAMA shared base — tokens, reset, nav, buttons, utilities
   Loaded by every page. Page-specific styles stay in each page.
   Maps to a future Shopify Liquid layout + snippets.
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --black: #0a0a0a;
  --paper: #E8DCC8;
  --paper-dark: #D4C9B5;
  --paper-light: #F0E8D8;
  --accent: #00E68A;
  --white: #FFFFFF;
  --ink: #1a1a1a;
  --border-subtle: 1px solid rgba(255,255,255,0.08);
  --max-w: 1400px;
  --px: 24px;
  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-sub: 'Oswald', sans-serif;
  --font-body: 'Barlow Condensed', sans-serif;
  --font-jp: 'Noto Sans JP', sans-serif;
}

html { overflow-x: hidden; overflow-y: scroll; scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--paper);
  font-family: var(--font-body);
  /* clip (not hidden): hidden makes body a scroll container, which breaks
     position:sticky on the nav — body would be the sticky root instead of
     the viewport. clip clips without creating a scroll container. */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--ink); }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 2px; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ── Accessibility utilities ── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000;
  background: var(--accent); color: var(--ink);
  font-family: var(--font-sub); font-weight: 700; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 10px 16px; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ── Typography helpers ── */
.font-display { font-family: var(--font-display); }
.font-sub { font-family: var(--font-sub); }
.font-body { font-family: var(--font-body); }
.font-jp { font-family: var(--font-jp); }

/* ── Speckle texture (pre-baked PNG, no runtime canvas) ── */
.speckle-overlay {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: url('../assets/speckle.png') repeat;
  background-size: 512px 512px;
}

/* ── Responsive helpers ── */
.show-mobile { display: none; }
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}

/* ═══════════════════ SITE NAV ═══════════════════ */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 12px var(--px);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { text-decoration: none; display: flex; align-items: center; }
.nav-brand img { height: 32px; width: auto; object-fit: contain; display: block; }
.nav-group { display: flex; align-items: center; gap: 28px; }
.nav-social { display: flex; align-items: center; gap: 16px; }
.nav-icon-link {
  color: var(--paper); text-decoration: none; display: flex; transition: color 0.2s;
}
.nav-icon-link:hover { color: var(--accent); }
.nav-divider { width: 1px; height: 16px; background: rgba(232,220,200,0.2); }

.nav-link {
  position: relative;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-sub);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-link:hover { color: var(--accent); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--accent); }
.nav-link.active::after { width: 100%; }

.nav-cart {
  color: var(--paper); text-decoration: none; position: relative;
  display: flex; transition: color 0.2s;
}
.nav-cart:hover { color: var(--accent); }
.cart-badge {
  position: absolute; top: -7px; right: -9px;
  background: var(--accent); color: var(--ink);
  font-family: var(--font-sub); font-size: 0.625rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
@keyframes badge-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.6) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.cart-badge.bump { animation: badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1); }

/* ── Mobile menu ── */
.nav-toggle {
  background: none; border: none; color: var(--paper);
  cursor: pointer; display: none; padding: 4px;
}
@media (max-width: 767px) { .nav-toggle { display: flex; } }

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mobile-menu {
  background: var(--black);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 8px var(--px) 24px;
  display: flex; flex-direction: column; gap: 18px;
  animation: menu-in 0.25s ease;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu .nav-link { font-size: 1rem; padding: 4px 0; }
.mobile-menu-row {
  display: flex; align-items: center; gap: 20px;
  padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08);
}

/* ═══════════════════ BUTTONS / STAMPS ═══════════════════ */
/* Die-cut sticker look: outline ring + tiny hard offset */
.ink-stamp {
  display: inline-block;
  background: var(--accent); color: var(--ink);
  padding: 3px 12px;
  font-family: var(--font-sub); font-weight: 700;
  text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.15em;
  transform: rotate(-1deg);
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 2px var(--paper-light), 3px 3px 0 2px rgba(26,26,26,0.28);
}

@keyframes wiggle {
  0%, 100% { transform: rotate(3deg); }
  30% { transform: rotate(-5deg); }
  60% { transform: rotate(6deg); }
}

.btn-ink {
  display: inline-block;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-sub); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem;
  padding: 12px 28px; border: none; cursor: pointer;
  border-radius: var(--r-pill);
  transition: background 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.btn-ink:hover {
  background: var(--accent); color: var(--ink);
  transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink);
}
.btn-ink:active { transform: translate(0, 0); box-shadow: 0 0 0 var(--ink); }

.btn-outline {
  display: inline-block;
  background: transparent; color: var(--ink);
  font-family: var(--font-sub); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.875rem;
  padding: 10px 24px; border: 2px solid var(--ink); cursor: pointer;
  border-radius: var(--r-pill);
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.btn-shop {
  display: inline-block;
  background: transparent; color: var(--white);
  font-family: var(--font-sub); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.875rem;
  padding: 10px 24px; border: 1px solid rgba(255,255,255,0.25); cursor: pointer;
  border-radius: var(--r-pill);
  transition: all 0.2s;
}
.btn-shop:hover { background: var(--white); color: var(--black); border-color: var(--white); }
.btn-shop.added { background: rgba(255,255,255,0.1); color: var(--accent); border-color: transparent; pointer-events: none; }
@keyframes added-pop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.btn-shop.added { animation: added-pop 0.3s cubic-bezier(0.34,1.56,0.64,1); }

/* ═══════════════════ SIMPLE FOOTER (subpages) ═══════════════════ */
.footer-simple {
  max-width: var(--max-w); margin: 0 auto;
  padding: 24px var(--px); text-align: center;
  border-top: var(--border-subtle);
}
.footer-simple p {
  font-family: var(--font-sub); font-size: 0.75rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.25em; text-transform: uppercase;
}

/* ═══════════════════ REDUCED MOTION ═══════════════════ */
/* Near-zero durations (instead of none) so animations with
   forwards/both fill still land on their end state instantly. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
