/* ==========================================================================
   NIXOLOGY - base layer
   Design tokens, reset, typography, and the components shared by all four
   variants (buttons, form, carousel, map, FAQ, footer, ornament).
   Variant-specific layout lives in v1.css … v4.css.
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  /* Fallbacks first, for browsers without OKLCH (pre-2023). */
  --bg:        #0a0506;
  --fg:        #f1e5e4;
  --primary:   #b3001f;
  --accent:    #a8001a;
  --neon:      #d81030;
  --bone:      #f0e7dc;

  --font-black:  'UnifrakturMaguntia', 'UnifrakturCook', serif;
  --font-script: 'Cinzel', 'Cormorant Garamond', serif;
  --font-display:'Cormorant Garamond', Georgia, serif;
  --font-body:   'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Fluid type scale */
  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.2vw,  1.05rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.5vw,  1.4rem);
  --step-2:  clamp(1.5rem,  1.3rem + 1vw,     2.1rem);
  --step-3:  clamp(2rem,    1.6rem + 2vw,     3.2rem);
  --step-4:  clamp(2.6rem,  1.8rem + 4vw,     5rem);
  --step-5:  clamp(3.2rem,  1.8rem + 7vw,     8rem);

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section-y: clamp(4.5rem, 10vw, 10rem);

  --radius-arch: 50% 50% 0 0 / 28% 28% 0 0;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.6s;
}

@supports (color: oklch(0.5 0.1 20)) {
  :root {
    --bg:      oklch(0.06 0.02 20);
    --fg:      oklch(0.90 0.02 20);
    --primary: oklch(0.45 0.28 20);
    --accent:  oklch(0.40 0.30 25);
    --neon:    oklch(0.55 0.28 20);
    --bone:    oklch(0.90 0.02 60);
  }
}

/* Derived surfaces - kept separate so the six brand tokens above stay pure. */
:root {
  --surface:     color-mix(in oklab, var(--bg) 88%, var(--bone));
  --surface-2:   color-mix(in oklab, var(--bg) 94%, var(--bone));
  --fg-muted:    color-mix(in oklab, var(--fg) 62%, var(--bg));
  --fg-faint:    color-mix(in oklab, var(--fg) 38%, var(--bg));
  --rule:        color-mix(in oklab, var(--fg) 16%, var(--bg));
  --rule-strong: color-mix(in oklab, var(--fg) 30%, var(--bg));
  --blood-dim:   color-mix(in oklab, var(--primary) 55%, var(--bg));
  --blood-wash:  color-mix(in oklab, var(--primary) 14%, var(--bg));
  --glow: 0 0 2.5rem color-mix(in oklab, var(--neon) 34%, transparent);
}

/* ------------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--blood-dim) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  text-underline-offset: 0.22em;
}

img, svg, picture, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.08; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; }

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

/* Screen-reader-only, used for the real <h1> where the logo is an image. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; top: 0; left: 50%; translate: -50% -110%;
  z-index: 200; padding: 0.7em 1.4em;
  background: var(--primary); color: var(--bone);
  font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; transition: translate 0.2s var(--ease);
}
.skip-link:focus { translate: -50% 0; }

/* -------------------------------------------------------------- typography */
.blackletter { font-family: var(--font-black); font-weight: 400; line-height: 1; }

.display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.display em { font-style: italic; color: var(--bone); }

.script {
  font-family: var(--font-script);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Small caps label used above section headings. */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.eyebrow--blood { color: var(--neon); }

.lead {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  line-height: 1.5;
  color: color-mix(in oklab, var(--fg) 86%, var(--bg));
  max-width: 46ch;
}

.prose { max-width: var(--measure); }
.prose p { color: var(--fg-muted); }
.prose strong { color: var(--fg); font-weight: 500; }

/* Ornamental drop cap for the first paragraph of a body block. */
.dropcap::first-letter {
  float: left;
  font-family: var(--font-black);
  font-size: 3.6em;
  line-height: 0.76;
  margin: 0.08em 0.12em 0 0;
  color: var(--primary);
}

/* A single saturated red passage - the one loud note in the palette. */
.blood { color: var(--neon); }
.bone  { color: var(--bone); }

/* ------------------------------------------------------------------- logo
   The source PDFs were black line art. They are converted to SVG and used as
   CSS masks rather than <img>, so the ink takes `currentColor` - which lets
   the same file render bone white here and blood red on hover.            */
.mark {
  display: block;
  background-color: currentColor;
  -webkit-mask: var(--mark-src) no-repeat center / contain;
  mask: var(--mark-src) no-repeat center / contain;
}
.mark--word {
  --mark-src: url('../logo/nixology.svg');
  aspect-ratio: 1.3971;
  width: 100%;
}
.mark--eye {
  --mark-src: url('../logo/oko.svg');
  aspect-ratio: 1.0908;
  width: 100%;
}

/* --------------------------------------------------------------- ornament */
/* Hairline rule with a centred lozenge. */
.rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--rule-strong);
}
.rule::before, .rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}
.rule__mark { color: var(--primary); font-size: 0.7rem; line-height: 1; }

/* Pointed arch frame - the cathedral motif, reused for photos and cards. */
.arch { border-radius: var(--radius-arch); overflow: hidden; }

/* Engraving cross-hatch, for filling large empty areas without noise. */
.hatch {
  background-image:
    repeating-linear-gradient(45deg,  var(--rule) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, var(--rule) 0 1px, transparent 1px 7px);
}

/* Film grain + vignette laid over the whole page. */
/* No mix-blend-mode. A fixed, full-viewport blended layer has to be
   recomposited against everything beneath it on every frame, which was the
   largest single cause of scroll stutter. Plain low-opacity noise looks
   near-identical over a near-black page and costs nothing to scroll. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: 89;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 80% at 50% 40%, transparent 40%, var(--bg) 100%);
  opacity: 0.85;
}

/* ------------------------------------------------------------------ layout */
.wrap {
  width: min(100% - var(--gutter) * 2, 78rem);
  margin-inline: auto;
}
.wrap--narrow { width: min(100% - var(--gutter) * 2, 52rem); }
.wrap--wide   { width: min(100% - var(--gutter) * 2, 92rem); }

.section { padding-block: var(--section-y); position: relative; }
.section__head { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.section__title {
  font-family: var(--font-script);
  font-size: var(--step-3);
  letter-spacing: 0.04em;
  margin-top: 0.5rem;
}

/* Reveal-on-scroll, applied by site.js only when JS is available. */
.js .reveal { opacity: 0; translate: 0 1.75rem; }
.js .reveal.is-in {
  opacity: 1;
  translate: none;
  transition: opacity 0.9s var(--ease), translate 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}

/* ----------------------------------------------------------------- buttons */
.btn {
  --btn-fg: var(--bone);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  padding: 1.05em 2.2em;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--btn-fg);
  border: 1px solid currentColor;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
/* Blood wipes upward on hover. */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--primary);
  transform-origin: bottom;
  scale: 1 0;
  transition: scale 0.45s var(--ease);
}
.btn:hover, .btn:focus-visible { color: var(--bone); border-color: var(--primary); }
.btn:hover::before, .btn:focus-visible::before { scale: 1 1; }

.btn--solid { background: var(--primary); border-color: var(--primary); }
.btn--solid::before { background: var(--neon); }
.btn--ghost { color: var(--fg-muted); border-color: var(--rule-strong); }
.btn--block { width: 100%; }

/* Understated text link with a rule that grows in. */
.link {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 0.15em;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.link:hover { color: var(--neon); border-color: var(--neon); }

/* --------------------------------------------------------------- site nav */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
              padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--rule);
  padding-block: 0.7rem;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--bone);
}
.nav__brand .mark { width: 1.9rem; }
.nav__brand:hover .mark { color: var(--neon); transition: color 0.3s var(--ease); }
.nav__brand span {
  font-family: var(--font-script);
  font-size: var(--step--1);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2.2rem); }
.nav__links a {
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-muted);
  transition: color 0.3s var(--ease);
}
.nav__links a:hover { color: var(--neon); }
.nav__cta { flex-shrink: 0; }
.nav__toggle { display: none; }

/* ------------------------------------------------------------ language switch
   Shows the language you would switch TO, which is the convention people
   actually read correctly. */
.lang {
  flex-shrink: 0;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5em 0.75em;
  border: 1px solid var(--rule-strong);
  color: var(--fg-muted);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.16em;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
              background 0.3s var(--ease);
}
.lang:hover { color: var(--bone); border-color: var(--primary); background: var(--primary); }

@media (max-width: 60rem) {
  .nav__toggle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--rule-strong);
  }
  .nav__toggle span {
    display: block;
    width: 1.1rem;
    height: 1px;
    background: var(--fg);
    position: relative;
  }
  .nav__toggle span::before, .nav__toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--fg);
    transition: translate 0.3s var(--ease), rotate 0.3s var(--ease);
  }
  .nav__toggle span::before { translate: 0 -0.34rem; }
  .nav__toggle span::after  { translate: 0 0.34rem; }
  .nav[data-open='true'] .nav__toggle span { background: transparent; }
  .nav[data-open='true'] .nav__toggle span::before { translate: 0; rotate: 45deg; }
  .nav[data-open='true'] .nav__toggle span::after  { translate: 0; rotate: -45deg; }

  .nav__links {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    background: color-mix(in oklab, var(--bg) 96%, transparent);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
  }
  .nav__links a { font-size: var(--step-1); letter-spacing: 0.2em; }
  .nav[data-open='true'] .nav__links { opacity: 1; visibility: visible; }
  .nav__cta { display: none; }
}

/* ------------------------------------------------------------------ cards */
.card {
  padding: clamp(1.6rem, 3vw, 2.6rem);
  border: 1px solid var(--rule);
  background:
    linear-gradient(160deg,
      color-mix(in oklab, var(--bone) 4%, transparent),
      transparent 60%);
  position: relative;
  transition: border-color 0.5s var(--ease), background 0.5s var(--ease),
              translate 0.5s var(--ease);
}
.card:hover {
  border-color: var(--blood-dim);
  translate: 0 -4px;
  background:
    linear-gradient(160deg, var(--blood-wash), transparent 65%);
}
.card__num {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  color: var(--primary);
}
.card__title {
  font-family: var(--font-script);
  font-size: var(--step-1);
  letter-spacing: 0.06em;
  margin: 0.6rem 0 0.8rem;
}
.card__title small {
  display: block;
  font-family: var(--font-body);
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-top: 0.5rem;
}
.card p { color: var(--fg-muted); margin: 0; font-size: var(--step-0); }

/* Corner ticks - a devotional-engraving flourish on hover. */
.card--ticked::before, .card--ticked::after {
  content: '';
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid var(--primary);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.card--ticked::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.card--ticked::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.card--ticked:hover::before, .card--ticked:hover::after { opacity: 1; }

/* -------------------------------------------------------------- checklists */
.checklist { display: grid; gap: 0.9rem; }
.checklist li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.9rem;
  color: var(--fg-muted);
  font-size: var(--step-0);
  line-height: 1.6;
}
.checklist li::before {
  content: '✝';
  color: var(--primary);
  font-size: 0.85em;
  line-height: 1.9;
}
.checklist--don li::before { content: '✕'; color: var(--fg-faint); }

/* -------------------------------------------------------------------- FAQ */
.faq { border-top: 1px solid var(--rule); }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  padding: 1.5rem 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--fg);
  transition: color 0.3s var(--ease);
}
.faq__q:hover { color: var(--neon); }
.faq__sign {
  flex-shrink: 0;
  position: relative;
  width: 0.9rem;
  height: 0.9rem;
  color: var(--primary);
}
.faq__sign::before, .faq__sign::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: currentColor;
  transition: rotate 0.4s var(--ease), opacity 0.4s var(--ease);
}
.faq__sign::after { rotate: 90deg; }
.faq__item[data-open='true'] .faq__sign::after { rotate: 0deg; opacity: 0; }
.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}
.faq__item[data-open='true'] .faq__a { grid-template-rows: 1fr; }
.faq__a > div { overflow: hidden; }
.faq__a p {
  max-width: var(--measure);
  color: var(--fg-muted);
  padding-bottom: 1.6rem;
  margin: 0;
}

/* --------------------------------------------------------------- carousel */
.carousel { position: relative; }
.carousel__track {
  display: flex;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
  cursor: grab;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.carousel__track.is-dragging * { pointer-events: none; }

.carousel__item {
  flex: 0 0 clamp(15rem, 30vw, 22rem);
  scroll-snap-align: center;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--rule);
  text-decoration: none;
  display: block;
  background: var(--surface);
}
.carousel__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  transition: scale 0.9s var(--ease), filter 0.6s var(--ease);
}
.carousel__item:hover img { scale: 1.05; filter: saturate(1.05) contrast(1.1); }
.carousel__item figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 2.5rem 1.2rem 1.1rem;
  background: linear-gradient(transparent, color-mix(in oklab, var(--bg) 92%, transparent));
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
}

.carousel__nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.carousel__btn {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  color: var(--fg-muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
              background 0.3s var(--ease);
}
.carousel__btn:hover:not(:disabled) {
  color: var(--bone);
  border-color: var(--primary);
  background: var(--primary);
}
.carousel__btn:disabled { opacity: 0.3; cursor: default; }
.carousel__btn svg { width: 1rem; height: 1rem; }
.carousel__count {
  margin-left: auto;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- lightbox */
/* `display` must be scoped to [open] - setting it unconditionally would beat
   the UA's `display: none` and leave the closed dialog on the page. */
.lightbox { display: none; }
.lightbox[open] {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  border: 0;
}
.lightbox::backdrop { background: transparent; }
.lightbox__stage {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 1rem;
  max-width: min(100%, 62rem);
}
.lightbox img {
  max-width: 100%;
  max-height: 78svh;
  width: auto;
  border: 1px solid var(--rule-strong);
  animation: nx-lb-in 0.5s var(--ease);
}
@keyframes nx-lb-in {
  from { opacity: 0; scale: 0.97; }
  to   { opacity: 1; scale: 1; }
}
.lightbox figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem 1.25rem;
}
.lightbox__index {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* Prev/next sit against the viewport edges on desktop and drop to the bottom
   corners on a phone, where edge-anchored arrows collide with the photo. */
.lightbox__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  color: var(--fg-muted);
  border: 1px solid var(--rule-strong);
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
              background 0.3s var(--ease);
}
.lightbox__nav:hover { color: var(--bone); border-color: var(--primary); background: var(--primary); }
.lightbox__nav svg { width: 1.15rem; height: 1.15rem; }
.lightbox__nav--prev { left: var(--gutter); }
.lightbox__nav--next { right: var(--gutter); }
/* `display: grid` above would otherwise beat the UA's rule for [hidden]. */
.lightbox__nav[hidden] { display: none; }

@media (max-width: 48rem) {
  .lightbox__nav {
    top: auto;
    bottom: 1rem;
    translate: none;
    width: 3.5rem;
    height: 3.5rem;
  }
  .lightbox__nav--prev { left: 1rem; }
  .lightbox__nav--next { right: 1rem; }
  .lightbox img { max-height: 60svh; }
}
.lightbox__close {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--rule-strong);
  color: var(--fg);
  font-size: 1.2rem;
}
.lightbox__close:hover { border-color: var(--primary); background: var(--primary); color: var(--bone); }
.lightbox__cap {
  text-align: center;
  color: var(--fg-faint);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  max-width: 46ch;
}

/* -------------------------------------------------------------------- form */
.form { display: grid; gap: 1.5rem; }
.form__row { display: grid; gap: 1.5rem; }
@media (min-width: 40rem) { .form__row--2 { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 0.5rem; }
.field > label {
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* Guidance under a label. Sentence case and not uppercase, because it is a
   sentence to read rather than a field name to scan. */
.field__hint {
  margin-top: -0.15rem;
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--fg-faint);
  text-transform: none;
  letter-spacing: 0;
  max-width: 56ch;
}
.field :is(input, textarea, select) {
  width: 100%;
  padding: 0.95em 1.1em;
  font: inherit;
  font-size: var(--step-0);
  color: var(--fg);
  background: color-mix(in oklab, var(--bg) 70%, var(--surface));
  border: 1px solid var(--rule);
  border-radius: 0;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
  appearance: none;
}
.field textarea { resize: vertical; min-height: 8rem; line-height: 1.65; }
.field :is(input, textarea, select):hover { border-color: var(--rule-strong); }
.field :is(input, textarea, select):focus {
  outline: none;
  border-color: var(--primary);
  background: color-mix(in oklab, var(--bg) 60%, var(--surface));
}
.field :is(input, textarea)::placeholder { color: var(--fg-faint); opacity: 0.7; }
.field select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: right 1.4rem center, right 1.1rem center;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}
.field option { background: var(--bg); color: var(--fg); }
.field--invalid :is(input, textarea, select) { border-color: var(--neon); }
.field__error {
  font-size: var(--step--1);
  color: var(--neon);
  min-height: 1.2em;
}
.field--invalid .field__error::before { content: '✝ '; }

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  font-size: var(--step--1);
  color: var(--fg-muted);
  line-height: 1.6;
}
.consent input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.28em;
  accent-color: var(--primary);
}

.form__note {
  font-size: var(--step--1);
  color: var(--fg-faint);
  border-left: 1px solid var(--primary);
  padding-left: 1rem;
  line-height: 1.65;
}
.form__status {
  font-size: var(--step-0);
  color: var(--neon);
  min-height: 1.5em;
}
.form__status[data-ok='true'] { color: var(--bone); }

/* --------------------------------------------------------------------- map
   The Google iframe is light-themed and cannot be styled from outside, so it
   is inverted and hue-rotated back to sit inside the dark palette. The frame
   only loads after a click - no third-party request on first paint.        */
.map {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--surface);
}
@media (max-width: 45rem) { .map { aspect-ratio: 4 / 5; } }

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: invert(0.92) hue-rotate(175deg) saturate(0.75) contrast(0.92) brightness(0.95);
}
.map__consent {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.1rem;
  padding: var(--gutter);
  text-align: center;
  background:
    linear-gradient(color-mix(in oklab, var(--bg) 78%, transparent),
                    color-mix(in oklab, var(--bg) 92%, transparent)),
    var(--surface);
}
.map__consent p {
  max-width: 34ch;
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--step--1);
}
.map__pin { color: var(--primary); }
.map__pin svg { width: 2rem; height: 2rem; }

.address {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: normal;
  line-height: 1.5;
  color: var(--fg);
}
.address a { text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.address a:hover { color: var(--neon); border-color: var(--neon); }

/* ------------------------------------------------------------------ footer */
.footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
  position: relative;
}
.footer__grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer__mark { width: clamp(9rem, 18vw, 13rem); color: var(--bone); opacity: 0.9; }
.footer h3 {
  font-size: var(--step--1);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-family: var(--font-body);
  margin-bottom: 1.1rem;
}
.footer li { margin-bottom: 0.6rem; }
.footer a { text-decoration: none; color: var(--fg-muted); transition: color 0.3s var(--ease); }
.footer a:hover { color: var(--neon); }
.footer__legal {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--fg-faint);
}

/* ==========================================================================
   MOTION
   Style-relevant animation only: ink soaking into a page, an ember guttering,
   blood creeping along a rule. Nothing bounces. Every effect below is disabled
   wholesale by the prefers-reduced-motion block near the top of this file,
   which zeroes both transitions and keyframe animations.
   ========================================================================== */

/* --------------------------------------------------- headings: ink rising
   The heading is revealed bottom-up through a clip, slightly out of focus at
   first, as if the ink were soaking upward into the paper. A blood rule draws
   itself underneath once the text has landed. */
.js [data-ink] {
  position: relative;
  clip-path: inset(100% 0 0 0);
  filter: blur(7px);
  opacity: 0;
}
.js [data-ink].is-in {
  clip-path: inset(0 0 0 0);
  filter: blur(0);
  opacity: 1;
  transition:
    clip-path 1.15s var(--ease),
    filter 1.15s var(--ease),
    opacity 0.75s var(--ease);
}
.js [data-ink]::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.55em;
  translate: -50% 0;
  width: min(7rem, 40%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  scale: 0 1;
  transition: scale 0.9s var(--ease) 0.5s;
}
.js [data-ink].is-in::after { scale: 1 1; }
/* Left-aligned headings get the rule under their first character instead. */
.js .v1-liturgy__title::after { left: 0; translate: none; }

/* -------------------------------------------------- paragraphs: word bleed
   site.js wraps each word in a span and sets --i; words fade up in sequence,
   so the sentence arrives at reading speed rather than all at once. */
.js [data-words] .word {
  display: inline-block;
  opacity: 0;
  translate: 0 0.5em;
  filter: blur(5px);
}
.js [data-words].is-in .word {
  opacity: 1;
  translate: none;
  filter: blur(0);
  transition: opacity 0.7s var(--ease), translate 0.7s var(--ease), filter 0.7s var(--ease);
  transition-delay: calc(var(--i) * 34ms);
}

/* ----------------------------------------------------- hero: slow ken burns
   The portrait behind the wordmark drifts and swells over 48s, so the hero is
   never quite still without ever visibly moving. */
@keyframes nx-kenburns {
  from { scale: 1;    translate: 0 0; }
  to   { scale: 1.11; translate: 1.5% -1.8%; }
}
.v1-hero__bloom img {
  animation: nx-kenburns 48s var(--ease) infinite alternate;
  will-change: transform;
}

/* Elements the parallax handler moves. Promoting them keeps the drift on the
   compositor instead of repainting the section each frame. */
[data-parallax] { will-change: transform; }

/* The progress bar and the grain sit above everything and never reflow, so
   isolating them stops scroll from invalidating the layers underneath. */
.progress, .grain, .vignette { contain: strict; }

/* --------------------------------------------------------- hero: ember glow
   The red behind the wordmark gutters like a candle - irregular steps, not a
   sine wave, or it reads as a pulse. */
@keyframes nx-ember {
  0%, 100% { opacity: 0.55; }
  18%      { opacity: 0.9; }
  32%      { opacity: 0.42; }
  51%      { opacity: 1; }
  63%      { opacity: 0.6; }
  79%      { opacity: 0.85; }
}
.v1-hero::before { animation: nx-ember 9s ease-in-out infinite; }

/* -------------------------------------------------- photographs: settle in
   Images land from very slightly over-scaled, which reads as focus pulling. */
.js .v1-relic img,
.js .v1-studio__photo img,
.js .v1-liturgy__photo img { scale: 1.07; }
.js .reveal.is-in .v1-relic img,
.js .v1-relic.is-in img,
.js .v1-studio__photo.is-in img,
.js .v1-liturgy__photo.is-in img {
  scale: 1;
  transition: scale 1.6s var(--ease);
}

/* ------------------------------------------------------------ scroll progress
   A blood rule filling along the top of the viewport. */
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 110;
  height: 2px;
  background: transparent;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left;
  scale: var(--p, 0) 1;
  background: linear-gradient(90deg, var(--accent), var(--neon));
  box-shadow: 0 0 0.75rem color-mix(in oklab, var(--neon) 60%, transparent);
}

/* ----------------------------------------------------------------- back to top */
.totop {
  position: fixed;
  inset: auto 1.1rem 1.1rem auto;
  z-index: 115;
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  color: var(--fg-muted);
  border: 1px solid var(--rule-strong);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  translate: 0 0.75rem;
  transition: opacity 0.4s var(--ease), translate 0.4s var(--ease),
              visibility 0.4s, color 0.3s var(--ease),
              border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.totop.is-on { opacity: 1; visibility: visible; translate: none; }
.totop:hover {
  color: var(--bone);
  border-color: var(--primary);
  background: var(--primary);
}
.totop svg { width: 1.1rem; height: 1.1rem; }

/* --------------------------------------------------------------- nav: active */
.nav__links a { position: relative; }
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45em;
  height: 1px;
  background: var(--neon);
  scale: 0 1;
  transform-origin: left;
  transition: scale 0.45s var(--ease);
}
.nav__links a:hover::after,
.nav__links a.is-active::after { scale: 1 1; }
.nav__links a.is-active { color: var(--bone); }

/* ------------------------------------------------- form: counter + spam trap */
.field__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.field__count {
  flex-shrink: 0;
  font-size: var(--step--1);
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}
.field__count.is-near { color: var(--neon); }

/* ------------------------------------------------------------- uploader
   Reference photos. The real <input type=file> is visually hidden but stays
   in the accessibility tree and keeps its native keyboard behaviour; the
   drop zone is its <label>, so clicking or pressing Enter both work. */
.uploader__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.uploader__drop {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem) 1.25rem;
  text-align: center;
  cursor: pointer;
  border: 1px dashed var(--rule-strong);
  background: color-mix(in oklab, var(--bg) 70%, var(--surface));
  color: var(--fg-muted);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease),
              color 0.3s var(--ease);
}
.uploader__drop svg { width: 1.6rem; height: 1.6rem; color: var(--primary); }
.uploader__drop:hover,
.uploader__input:focus-visible + .uploader__drop,
.uploader.is-over .uploader__drop {
  border-color: var(--primary);
  background: var(--blood-wash);
  color: var(--bone);
}
.uploader__hint { font-size: var(--step-0); }
.uploader__limit {
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.uploader__list { display: grid; gap: 0.6rem; margin-top: 0.9rem; }
.uploader__list:empty { margin-top: 0; }
.uploader__file {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem;
  border: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 60%, var(--surface));
}
.uploader__thumb {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border: 1px solid var(--rule);
}
.uploader__meta { min-width: 0; }
.uploader__name {
  display: block;
  font-size: var(--step--1);
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uploader__size { font-size: var(--step--1); color: var(--fg-faint); }
.uploader__drop-file {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  color: var(--fg-faint);
  border: 1px solid transparent;
  font-size: 1rem;
}
.uploader__drop-file:hover { color: var(--neon); border-color: var(--rule-strong); }

/* Upload progress, shown while the enquiry is in flight. */
.form__bar {
  height: 2px;
  background: var(--rule);
  overflow: hidden;
}
.form__bar[hidden] { display: none; }
.form__bar span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left;
  scale: var(--p, 0) 1;
  background: linear-gradient(90deg, var(--accent), var(--neon));
  transition: scale 0.25s linear;
}

/* Off-canvas rather than display:none - some bots skip hidden inputs. */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ============================================================ print
   Clients print the aftercare section and stick it on the fridge. Everything
   that is not instructions or contact detail comes off the page.          */
@media print {
  :root { --bg: #fff; --fg: #111; }
  body { background: #fff; color: #111; }
  .nav, .progress, .totop, .grain, .vignette, .lightbox,
  .v1-hero, .v1-manifesto, .v1-rites, .v1-reliquary, .v1-insta,
  .v1-divider, .map, .form, .variant-bar, .carousel { display: none !important; }
  .section { padding-block: 0.5cm; }
  .v1-care__grid { display: block; }
  .v1-care__col { break-inside: avoid; border: 0; padding: 0; margin-bottom: 0.6cm; }
  .v1-care__col + .v1-care__col { border-left: 0; padding-left: 0; }
  .card__title, .section__title { color: #111; }
  .checklist li { color: #222; }
  .checklist li::before { color: #900; }
  a { color: #111; text-decoration: underline; }
  .footer { border-top: 1px solid #ccc; }
  .footer__grid { display: none; }
  /* Reveal animations must never leave printed content invisible. */
  .reveal, [data-ink], [data-words] { opacity: 1 !important; clip-path: none !important;
    filter: none !important; translate: none !important; }
  [data-words] .word { opacity: 1 !important; filter: none !important; translate: none !important; }
}

/* Variant switcher - a review aid. Delete this block before launch. */
.variant-bar {
  position: fixed;
  inset: auto auto 1rem 50%;
  translate: -50% 0;
  z-index: 120;
  max-width: calc(100vw - 1.5rem);
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--rule-strong);
  font-size: var(--step--1);
  overflow-x: auto;
  scrollbar-width: none;
}
.variant-bar::-webkit-scrollbar { display: none; }
.variant-bar span {
  padding-inline: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
  white-space: nowrap;
}
.variant-bar a {
  padding: 0.6rem 0.85rem;
  text-decoration: none;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.variant-bar a:hover { color: var(--bone); background: var(--blood-dim); }
.variant-bar a[aria-current='page'] { color: var(--bone); background: var(--primary); }
@media (max-width: 40rem) {
  .variant-bar span { display: none; }
  .variant-bar { gap: 0; font-size: 0.72rem; }
  .variant-bar a { padding: 0.55rem 0.6rem; }
}

/* ==========================================================================
   MOBILE HARDENING
   The site is phone-first in practice - most tattoo enquiries arrive from an
   Instagram bio link. These rules are deliberately last so they win.
   ========================================================================== */

/* Kill the grey flash on tap, and stop iOS rubber-banding the whole page
   sideways when a carousel reaches its end. */
* { -webkit-tap-highlight-color: color-mix(in oklab, var(--primary) 30%, transparent); }
body { overscroll-behavior-y: none; }
.carousel__track { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }

@media (max-width: 48rem) {
  /* iOS Safari zooms the viewport whenever a focused control is under 16px.
     Forcing 16px on every text control is the only reliable prevention. */
  .field :is(input, textarea, select) {
    font-size: 16px;
    padding: 0.85em 1em;
    min-height: 3rem;
  }

  /* WCAG 2.5.8 - give standalone controls a 44px target. Inline prose links
     are exempt and stay as they are. */
  .nav__links a { padding: 0.55em 1em; }
  .footer li a,
  .v1-summon__links a,
  .v2-contact__links a,
  .v3-contact__links a,
  .v4-contact__links a { display: inline-block; padding-block: 0.5em; }
  .carousel__btn { width: 3.25rem; height: 3.25rem; }
  .consent input { width: 1.4rem; height: 1.4rem; }

  /* A full-screen blended noise layer is the single most expensive thing on
     the page to repaint while scrolling. Phones get the cheap vignette only. */
  .grain { display: none; }
  .vignette { opacity: 0.7; }

  /* Nav is transparent at rest; once the menu is open it needs a solid base
     so the brand and toggle never sit on top of body copy. */
  .nav[data-open='true'] {
    background: color-mix(in oklab, var(--bg) 92%, transparent);
    border-bottom-color: var(--rule);
  }

  .btn { padding: 1em 1.6em; }
  .btn--block + .form__status { margin-top: 0.5rem; }

  /* Long unbroken strings (emails, handles) must never widen the page. */
  .address, .footer, .prose, .lead { overflow-wrap: break-word; }
}

/* Landscape phones: a 100svh hero would leave no room for the type. */
@media (max-height: 30rem) and (orientation: landscape) {
  .v1-hero, .v2-hero, .v3-hero, .v4-hero { min-height: auto; padding-block: 6rem 3rem; }
}
