/* ============================================================
   SEASONS — CRAFT LAYER
   Shared across every page. Loaded after each page's own <style>.
   Sources: emil-design-eng · animate · mobile-native · apple-design
   Brand rules (DESIGN.md) are untouched: 1px corners, one accent
   per page, tinted shadows, 0.7rem label floor, fade-up vocabulary.
   ============================================================ */

:root {
  /* Motion tokens — strong curves (built-in CSS easings are too weak) */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);     /* enter / exit, press */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);    /* things moving on screen */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);     /* sheets, menus */
  --dur-press:   120ms;
  --dur-ui:      220ms;
}

/* ── Platform baseline (mobile-native) ─────────────────────── */
html {
  -webkit-tap-highlight-color: transparent;   /* kill the grey tap flash */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--nav-h, 0px);      /* anchors land below the fixed nav */
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto !important; } }

a, button, [role="button"], label, summary { touch-action: manipulation; } /* no 300ms wait */

/* Controls are not content: no long-press selection or callout */
button, [role="button"],
.btn-primary, .btn-sand, .btn-outline, .btn-ghost, .btn-ghost-brown,
.btn-olive-outline, .btn-orange-outline, .btn-instagram,
.ncta, .mob-cta, .filter-btn, .cat-btn, .ham, .lang-toggle, .nav-back,
.nav-links a, .mob a, .svc-card, .tg-card, .cat-card, .brand-card {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

/* iOS zooms into inputs under 16px and never zooms back out */
@media (pointer: coarse) {
  input, textarea, select { font-size: 16px !important; }
}

/* Typography: tidy rag and widows, optical sizing where the face supports it */
h1, h2, h3 { text-wrap: balance; }
p, li      { text-wrap: pretty; }
body       { font-optical-sizing: auto; }

/* ── Focus — visible for keyboards only ─────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 1.5px solid currentColor;
  outline-offset: 3px;
  border-radius: 1px;
}
input:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* ── Press feedback — on pointer-down, every input type ────────
   Fast in (120ms), the page's own 220ms transition carries the
   release back out: snap where the user acts, settle after.       */
.btn-primary, .btn-sand, .btn-outline, .btn-ghost, .btn-ghost-brown,
.btn-olive-outline, .btn-orange-outline, .btn-instagram,
.ncta, .mob-cta, .cat-btn, .filter-btn, .lang-toggle, .ft-btn {
  will-change: transform;
}
.btn-primary:active, .btn-sand:active, .btn-outline:active,
.btn-ghost-brown:active, .btn-olive-outline:active, .btn-orange-outline:active,
.btn-instagram:active, .ncta:active, .mob-cta:active,
.cat-btn:active, .filter-btn:active, .lang-toggle:active {
  transform: scale(0.97) !important;
  transition-duration: var(--dur-press) !important;
}
.btn-ghost:active, .nav-back:active, .ft-btn:active {
  opacity: .72; transition: opacity var(--dur-press) var(--ease-out);
}
/* Large tappable cards: a much smaller press so imagery doesn't lurch */
a.svc-card:active, a.tg-card:active, .cat-card.is-live:active,
a.brand-card:active, .g-item:active {
  transform: scale(0.985) !important;
  transition: transform var(--dur-press) var(--ease-out) !important;
}
.ham:active span { opacity: .6; }

/* ── Nav underline — transform, not width ───────────────────── */
.nav-links a::after {
  width: 100% !important;
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--dur-ui) var(--ease-out) !important;
}
.nav-links a.active::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover::after { transform: scaleX(1); }
}

/* ── Nav as material (apple-design §12) ────────────────────────
   Translucent layer that content scrolls beneath; the hairline
   stays because it is part of the brand. Safe-area insets are
   added as transparent borders so each page's own padding holds. */
#nav {
  border-left:  env(safe-area-inset-left, 0px)  solid transparent;
  border-right: env(safe-area-inset-right, 0px) solid transparent;
}
#footer { border-bottom: env(safe-area-inset-bottom, 0px) solid transparent; }

/* ── Hamburger — morph on screen, so ease-in-out ────────────── */
.ham { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.ham span {
  transition: transform var(--dur-ui) var(--ease-in-out),
              opacity   var(--dur-ui) var(--ease-in-out) !important;
}

/* ── Mobile menu — frosted sheet, staggered links ───────────── */
.mob {
  height: 100dvh;
  overscroll-behavior: contain;
  background: color-mix(in srgb, var(--mob-bg, #5A3B1E) 90%, transparent) !important;
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
           env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  transition: opacity 260ms var(--ease-out) !important;
}
.mob:not(.open) { transition-duration: 160ms !important; }   /* exits snap */
.mob .ml {
  opacity: 0; transform: translateY(10px);
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out),
              color var(--dur-ui) ease;
}
.mob.open .ml { opacity: 1; transform: none; }
.mob.open .ml:nth-child(1) { transition-delay: 40ms; }
.mob.open .ml:nth-child(2) { transition-delay: 80ms; }
.mob.open .ml:nth-child(3) { transition-delay: 120ms; }
.mob.open .ml:nth-child(4) { transition-delay: 160ms; }
.mob.open .ml:nth-child(5) { transition-delay: 200ms; }
.mob.open .ml:nth-child(6) { transition-delay: 240ms; }
.mob.open .ml:nth-child(7) { transition-delay: 280ms; }
.mob:not(.open) .ml { transition-duration: 120ms; transition-delay: 0ms; }
/* Keyboard-initiated close (Escape) never animates */
.mob.instant, .mob.instant .ml { transition: none !important; }
body.menu-open { overflow: hidden; }

/* ── Hero — one orchestrated page-load moment ───────────────── */
.hero-body {
  animation: none !important; opacity: 1 !important; transform: none !important;
}
.hero-body > * {
  opacity: 0; transform: translateY(12px);
  animation: craftHeroIn 900ms var(--ease-out) forwards;
}
.hero-body > *:nth-child(1) { animation-delay: 250ms; }
.hero-body > *:nth-child(2) { animation-delay: 320ms; filter: blur(4px);
  animation-name: craftHeroInBlur; }
.hero-body > *:nth-child(3) { animation-delay: 390ms; }
.hero-body > *:nth-child(4) { animation-delay: 460ms; }
.hero-body > *:nth-child(5) { animation-delay: 530ms; }
@keyframes craftHeroIn     { to { opacity: 1; transform: none; } }
@keyframes craftHeroInBlur { to { opacity: 1; transform: none; filter: blur(0); } }

/* After the reveal lands, hover transitions shouldn't inherit its stagger */
.rv.rv-done { transition-delay: 0s !important; }

/* Marquee pauses when off-screen (set by JS) */
.mq.is-paused { animation-play-state: paused !important; }

/* ── Touch devices never see hover, so hover-only content
      must be visible by default there ─────────────────────────── */
@media (hover: none), (pointer: coarse) {
  .svc-desc, .tg-desc { max-height: none !important; opacity: 1 !important; }
  .svc-lnk { opacity: 1 !important; transform: none !important; }
  .g-cap   { opacity: 1 !important; }
}

/* ── Accessibility preferences ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  /* gentler, not zero: keep opacity, drop movement */
  .rv { transform: none !important; transition: opacity 300ms ease !important; }
  .hero-img { animation: none !important; transform: none !important; }
  .hero-body > * { transform: none !important; filter: none !important;
    animation: craftFade 400ms ease forwards !important; }
  .mq, .scroll-line { animation: none !important; }
  .mob .ml { transform: none !important; }
  img { transition: none !important; }
  a.svc-card:active, a.tg-card:active, .cat-card.is-live:active,
  a.brand-card:active, .g-item:active { transform: none !important; }
}
@keyframes craftFade { to { opacity: 1; } }

@media (prefers-reduced-transparency: reduce) {
  #nav, #nav.scrolled { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  #nav.scrolled { background: var(--nav-solid, #5A3B1E) !important; }
  .mob { background: var(--mob-bg, #5A3B1E) !important;
         -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  #nav.scrolled { background: var(--nav-solid, #5A3B1E) !important; }
  .filter-btn, .field input, .cform input, .cform textarea { border-color: currentColor !important; }
}
