/* ==========================================================================
   ANNIE'S TATTOO — base: reset, type, shared components, motion utilities
   Section-specific styles live in assets/css/sections/<name>.css
   ========================================================================== */

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
html:not(.lenis) { scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
[hidden] { display: none !important; }

/* ---- page ---- */
body {
  background-color: var(--parchment);
  /* paper: fine fibre noise (large soft mottling is the fixed body::before layer below) */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* uneven paper tone: one viewport-sized tile, fixed => no seams, no repaint on scroll */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='900' preserveAspectRatio='none'%3E%3Cfilter id='m' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .25 0 0 0 .2 -.04'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
html.is-locked, html.is-locked body { overflow: hidden; }
::selection { background: var(--vermillion); color: var(--cream); }

main { position: relative; }
section, .band { position: relative; }

/* ---- accessibility ---- */
.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: calc(var(--z-loader) + 1);
  background: var(--ink); color: var(--parchment); padding: .75rem 1.1rem;
  font-size: var(--fs-small); letter-spacing: .08em; text-transform: uppercase;
  transition: top var(--dur-1) var(--ease-out);
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--vermillion); outline-offset: 3px; border-radius: 2px; }
.theme-dark :focus-visible { outline-color: var(--ochre); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- layout ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: calc(var(--gutter) + var(--rail-w)) var(--gutter);
}
.container--wide { max-width: none; }
.section-pad { padding-block: var(--section-y); }

/* ---- type ---- */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  text-wrap: balance;
}
.display--hero { font-size: var(--fs-hero); line-height: var(--lh-display); letter-spacing: -.045em; }
.display--h1 { font-size: var(--fs-h1); line-height: .96; }
.display--h2 { font-size: var(--fs-h2); }
.display--h3 { font-size: var(--fs-h3); letter-spacing: -.02em; line-height: 1.1; }
.display--h4 { font-size: var(--fs-h4); letter-spacing: -.01em; line-height: 1.2; }
.display em, .display i { font-style: italic; font-weight: 400; letter-spacing: -.02em; }
.caps { text-transform: uppercase; }
.text-vermillion { color: var(--vermillion); }
.text-ochre { color: var(--ochre); }
.text-muted { color: var(--ink-60); }

.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-80); max-width: 34em; text-wrap: pretty; }
.body-copy { max-width: 36em; color: var(--ink-80); text-wrap: pretty; }
.body-copy + .body-copy { margin-top: 1em; }

.label {
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  line-height: 1.4;
}
.label--muted { color: var(--ink-60); }
/* stacked label column, e.g. PEOPLE / PLACES / STORIES / TATTOOS */
.label-stack { display: grid; gap: .9em; }

.brush { font-family: var(--font-brush); font-weight: 400; letter-spacing: 0; text-transform: none; line-height: 1; }

/* Japanese vertical text */
.vertical-jp {
  font-family: var(--font-jp);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: .32em;
  line-height: 1;
  font-feature-settings: "vert";
}
/* Oversized background kanji */
.kanji-ghost {
  position: absolute; z-index: 0; pointer-events: none; user-select: none;
  font-family: var(--font-jp); font-size: clamp(16rem, 38vw, 44rem); line-height: .9;
  color: var(--ink); opacity: .045;
}
.theme-dark .kanji-ghost { color: var(--parchment); opacity: .05; }

/* Hanko seal */
.seal {
  display: inline-grid; place-items: center;
  font-family: var(--font-jp); color: var(--cream); background: var(--vermillion);
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 1.05rem; line-height: 1; letter-spacing: .08em;
  padding: .5em .34em; border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px rgba(248, 245, 239, .55);
  /* rough stamped edge */
  filter: url(#fx-rough);
}

/* ---- arrows ---- */
.arrow {
  display: inline-block; width: 1.5em; height: .75em; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath d='M0 6h22M17 1l5 5-5 5' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath d='M0 6h22M17 1l5 5-5 5' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--dur-2) var(--ease-out);
}

/* ---- buttons ---- */
.btn {
  --btn-bg: var(--ochre); --btn-fg: var(--ink); --btn-fill: var(--ink); --btn-fill-fg: var(--parchment);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 1.4em;
  min-height: 3.5rem; padding: 1.05em 1.9em 1.05em 2.1em;
  border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
  will-change: transform;
}
.btn::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--btn-fill);
  transform: translateY(101%); transition: transform var(--dur-2) var(--ease-out);
}
.btn:hover, .btn:focus-visible { color: var(--btn-fill-fg); }
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:hover .arrow, .btn:focus-visible .arrow { transform: translateX(.45em); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--parchment); --btn-fill: var(--ochre); --btn-fill-fg: var(--ink); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: currentColor; --btn-fill: var(--ink); --btn-fill-fg: var(--parchment);
  border: 1px solid var(--line-strong); border-radius: 14px;
}
.theme-dark .btn--ghost { --btn-fill: var(--parchment); --btn-fill-fg: var(--ink); }
.theme-dark .btn { --btn-fill: var(--parchment); --btn-fill-fg: var(--ink); }
.btn--sm { min-height: 2.9rem; padding: .85em 1.4em .85em 1.6em; font-size: .72rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* text link with circled arrow: "EXPLORE ARTWORK (→)" */
.link-arrow {
  display: inline-flex; align-items: center; gap: 1.1em;
  font-size: .78rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; line-height: 1;
  cursor: pointer;
}
.link-arrow__circle {
  position: relative; display: grid; place-items: center; flex: none;
  width: 2.9rem; height: 2.9rem; border-radius: 50%;
  border: 1px solid var(--line-strong); overflow: hidden;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.link-arrow__circle .arrow { width: 1.1rem; }
.link-arrow:hover .link-arrow__circle, .link-arrow:focus-visible .link-arrow__circle { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.theme-dark .link-arrow:hover .link-arrow__circle, .theme-dark .link-arrow:focus-visible .link-arrow__circle { background: var(--ochre); color: var(--ink); border-color: var(--ochre); }
.link-arrow:hover .arrow, .link-arrow:focus-visible .arrow { transform: translateX(.2em); }

/* underlined inline link */
.link-line { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: .15em; transition: background-size var(--dur-2) var(--ease-out); }
.link-line:hover { background-size: 0 1px; background-position: 100% 100%; }

/* ---- form fields (shared by booking + contact) ---- */
.field { position: relative; display: grid; gap: .55rem; }
.field__label { font-size: .8rem; font-weight: 500; letter-spacing: .04em; color: var(--ink-80); }
.field__label .req { color: var(--vermillion); }
.field__control {
  width: 100%; min-height: 3.25rem; padding: .85rem 1rem;
  background: rgba(248, 245, 239, .7); border: 1px solid var(--line-strong); border-radius: var(--r-card);
  font-size: 1rem; line-height: 1.4; color: var(--ink);
  transition: border-color var(--dur-1) ease, background-color var(--dur-1) ease, box-shadow var(--dur-1) ease;
  appearance: none; -webkit-appearance: none;
}
textarea.field__control { min-height: 8.5rem; resize: vertical; }
.field__control::placeholder { color: var(--ink-40); }
.field__control:hover { border-color: var(--ink-60); }
.field__control:focus { outline: none; border-color: var(--ink); background: var(--cream); box-shadow: 0 0 0 3px rgba(241, 178, 67, .35); }
.field__control[aria-invalid="true"] { border-color: var(--vermillion); box-shadow: 0 0 0 3px rgba(166, 52, 40, .14); }
.field__error { font-size: .8rem; color: var(--vermillion); min-height: 1.1em; }
.field__hint { font-size: .8rem; color: var(--ink-60); }
select.field__control {
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23161616' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: .7rem;
}

/* ---- art mounts ---- */
.art { position: relative; display: block; color: var(--ink); line-height: 0; }
.theme-dark .art { color: var(--parchment); }
.art > svg { width: 100%; height: auto; overflow: visible; }
/* fill the (positioned) parent: the mount itself must stretch, otherwise it has no height and the svg collapses */
.art--fill { position: absolute; inset: 0; }
.art--fill > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art--bleed { pointer-events: none; user-select: none; }
/* raster plates (public-domain woodblock art) */
.plate { display: block; pointer-events: none; user-select: none; }
.plate--multiply { mix-blend-mode: multiply; }   /* white-backed plates on paper */
.plate--screen { mix-blend-mode: screen; }       /* black-backed plates on dark */
/* slow spin: whole element rotates => GPU-composited, cheap */
[data-spin] { animation: at-spin var(--spin-dur, 240s) linear infinite; transform-origin: 50% 50%; will-change: transform; }
[data-spin][data-spin-reverse] { animation-direction: reverse; }
@keyframes at-spin { to { transform: rotate(360deg); } }

/* ---- the flock: three cranes share one scale — crossing bird 100%, leader 90%, follower 80% ---- */
:root { --crane-w: 24vw; }
@media (min-width: 600px) { :root { --crane-w: 19vw; } }
@media (min-width: 700px) and (min-aspect-ratio: 5/4) { :root { --crane-w: clamp(5.5rem, min(15vh, 8.6vw), 11rem); } }

/* ---- paper card (flash sheets, panels) ---- */
.paper {
  position: relative; background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 40px -28px rgba(40, 30, 10, .35);
}

/* ---- grain overlay ---- */
.grain {
  position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ---- custom cursor (fine pointers only; enabled by JS) ---- */
.cursor { position: fixed; left: 0; top: 0; z-index: var(--z-cursor); pointer-events: none; opacity: 0; transition: opacity .3s ease; }
html.has-cursor .cursor { opacity: 1; }
.cursor__dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--vermillion); }
.cursor__ring {
  position: absolute; display: grid; place-items: center;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 1px solid rgba(22, 22, 22, .45);
  font-size: .58rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: transparent;
  transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out), background-color .45s var(--ease-out), border-color .45s var(--ease-out), color .3s ease;
}
html[data-cursor-theme="dark"] .cursor__ring { border-color: rgba(242, 238, 231, .5); }
html[data-cursor="link"] .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--vermillion); }
html[data-cursor="label"] .cursor__ring { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--ochre); border-color: var(--ochre); color: var(--ink); }
html[data-cursor="label"] .cursor__dot { opacity: 0; }

/* ---- page loader ---- */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  display: grid; place-items: center; background: var(--ink); color: var(--parchment);
  /* failsafe: if JS never runs, get out of the way */
  animation: at-loader-failsafe .6s ease 7s forwards;
}
.loader.is-done { display: none; }
.loader__inner { display: grid; justify-items: center; gap: 1.6rem; }
.loader__mark { width: clamp(120px, 16vw, 190px); }
.loader__count { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; letter-spacing: .02em; color: var(--paper-60); font-variant-numeric: tabular-nums; }
@keyframes at-loader-failsafe { to { opacity: 0; visibility: hidden; } }

/* ---- scroll progress ---- */
.progress-bar { position: fixed; left: 0; top: 0; z-index: calc(var(--z-nav) + 1); height: 2px; width: 100%; background: var(--vermillion); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
@media (min-width: 1200px) { .progress-bar { display: none; } }

/* left spine rail (desktop): vertical JP text, seal, progress thread with bead */
.rail { display: none; }
@media (min-width: 1200px) {
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: var(--z-rail); width: calc(var(--rail-w) + var(--gutter) * .55);
    display: grid; grid-template-rows: auto auto auto 1fr auto; justify-items: center; gap: 1.4rem;
    padding: calc(var(--nav-h) + 2.2rem) 0 2.2rem; pointer-events: none; color: var(--ink);
    transition: color var(--dur-2) ease;
  }
  html[data-rail="dark"] .rail { color: var(--parchment); }
  .rail__spark { width: 18px; height: 18px; }
  .rail__jp { font-size: 1.15rem; }
  .rail__thread { position: relative; width: 1px; height: 100%; min-height: 80px; background: var(--line-strong); }
  html[data-rail="dark"] .rail__thread { background: var(--line-dark); }
  .rail__thread-fill { position: absolute; inset: 0; background: currentColor; transform: scaleY(0); transform-origin: 50% 0; }
  .rail__bead { position: absolute; left: 50%; top: 0; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--vermillion); box-shadow: 0 0 0 3px var(--parchment); }
  html[data-rail="dark"] .rail__bead { background: var(--ochre); box-shadow: 0 0 0 3px var(--ink); }
  .rail__caption { display: grid; gap: .8em; text-align: center; font-size: .56rem; }
}

/* ---- reveal baseline (JS adds .is-anim to <html> once GSAP is ready) ---- */
html.is-anim [data-reveal] { visibility: hidden; }
.split-line-mask { overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }

/* ---- dialogs / reader (Our story, Journal) ---- */
.reader {
  position: fixed; inset: 0; z-index: var(--z-dialog); width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: hidden;
}
.reader::backdrop { background: rgba(22, 22, 22, .55); }
.reader__panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(760px, 100%);
  background-color: var(--parchment); overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(1.5rem, 5vw, 4.5rem); padding-top: clamp(4.5rem, 7vw, 6rem);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .5);
}
.reader__close { position: absolute; right: clamp(1rem, 3vw, 2.2rem); top: clamp(1rem, 3vw, 2rem); width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; transition: background-color var(--dur-1) ease, color var(--dur-1) ease; }
.reader__close:hover { background: var(--ink); color: var(--parchment); }
.reader__body h2 { margin-bottom: 1.4rem; }
.reader__body h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; letter-spacing: -.01em; margin: 2.2rem 0 .7rem; }
.reader__body p, .reader__body li { color: var(--ink-80); max-width: 38em; }
.reader__body p + p { margin-top: 1em; }
.reader__body ul { padding-left: 1.1em; display: grid; gap: .5em; margin-top: .8em; }

/* ---- mobile sticky booking CTA ---- */
.sticky-cta { display: none; }
@media (max-width: 767px) {
  .sticky-cta {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: var(--z-sticky-cta);
    display: flex; justify-content: space-between; width: auto;
    box-shadow: 0 14px 34px -12px rgba(22, 22, 22, .55);
    transform: translateY(160%); transition: transform .6s var(--ease-out);
  }
  .sticky-cta.is-visible { transform: translateY(0); }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-spin] { animation: none !important; }
  html.is-anim [data-reveal] { visibility: visible; }
}
