/* ==========================================================================
   SKENE CREATIVE — design system
   Brushstroke on rice paper. Minimal, intelligent, calm, human, warm.
   Mobile-first. No frameworks.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* paper */
  --paper:        #f6f1e7;
  --paper-warm:   #f2ecdf;
  --paper-deep:   #eae2d1;

  /* ink */
  --ink:          #1c1a17;
  --ink-soft:     #45413a;
  --ink-faint:    #837d70;
  --line:         rgba(28, 26, 23, 0.16);
  --line-soft:    rgba(28, 26, 23, 0.09);

  /* vermillion (hanko seal) — used sparingly */
  --vermillion:      #b8371f;
  --vermillion-deep: #97290f;

  /* type */
  --font-display: "Marcellus", "Optima", "Candara", Georgia, serif; /* titles & headings — subtle Optima-like flare */
  --font-serif:   "Fraunces", "Iowan Old Style", Georgia, serif;    /* longform prose & taglines */
  --font-ui:      "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* scale (mobile first) */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1.0625rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  2.625rem;
  --text-hero: clamp(1.9rem, 8.6vw, 6.5rem);

  --measure: 62ch;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;

  --ease-brush: cubic-bezier(0.65, 0, 0.35, 1);
  --header-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

/* ---------- Paper ground ---------- */
body {
  background-color: var(--paper);
  /* layered rice-paper: fine grain + soft fiber wash */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.10 0 0 0 0 0.09 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"),
    radial-gradient(120% 90% at 20% 0%, rgba(255, 252, 244, 0.9), rgba(255, 252, 244, 0) 60%),
    linear-gradient(175deg, var(--paper) 0%, var(--paper-warm) 55%, var(--paper-deep) 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(184, 55, 31, 0.18); }

/* ---------- Type ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

.prose {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-lg);
  font-variation-settings: "SOFT" 40;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: var(--measure);
}
.prose p + p { margin-top: 1.25em; }
.prose strong { color: var(--ink); font-weight: 560; }

.kicker {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--vermillion);
}

a { color: inherit; text-decoration: none; }
.link {
  color: var(--vermillion);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color 0.25s var(--ease-brush);
}
.link:hover { color: var(--vermillion-deep); }

/* brush underline used beneath section headings */
.brush-rule {
  width: 72px;
  height: 6px;
  margin-top: var(--space-2);
  border: none;
  background: var(--vermillion);
  border-radius: 40% 60% 55% 45% / 60% 40% 60% 40%;
  opacity: 0.9;
  transform: rotate(-0.6deg);
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-3);
}
.section { padding-block: var(--space-5); }
.section + .section { border-top: 1px solid var(--line-soft); }
.section-head { margin-bottom: var(--space-4); }
/* eyebrow-to-title gap tuned to match the title-to-brushrule gap (16px) */
.section-head .kicker, .page-head .kicker { display: block; margin-bottom: 16px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  transition: transform 0.35s var(--ease-brush);
}
/* blur lives on a pseudo-element: backdrop-filter on the header itself would
   make it the containing block for the fixed mobile nav sheet */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.brand-mark { width: 30px; height: 38px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.02rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.brand-role {
  display: none;
  font-size: var(--text-xs);
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* mobile menu button — three ink strokes */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 6px;
  z-index: 70;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 40% 60% 50% 50% / 50% 50% 50% 50%;
  transition: transform 0.3s var(--ease-brush), opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* nav: full-screen sheet on mobile */
.site-nav {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: calc(var(--header-h) + var(--space-3)) var(--space-4) var(--space-4);
  overflow-y: auto;
  background: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.10 0 0 0 0 0.09 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2%);
  transition: opacity 0.3s var(--ease-brush), transform 0.3s var(--ease-brush), visibility 0.3s;
}
.site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
.site-nav ul { list-style: none; padding: 0; display: grid; gap: var(--space-1); }
.site-nav a {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  padding-block: 0.3rem;
  display: inline-block;
}
.site-nav a[aria-current="page"] { color: var(--vermillion); }
.site-nav .nav-sub { padding-left: var(--space-3); display: grid; gap: 0.15rem; margin-top: 0.15rem; }
.site-nav .nav-sub a { font-size: 1.05rem; color: var(--ink-soft); }
.nav-lock {
  font-size: 0.7em;
  vertical-align: 0.15em;
  color: var(--vermillion);
  margin-left: 0.35em;
}

/* desktop nav */
@media (min-width: 880px) {
  .brand-role { display: inline; }
  .nav-toggle { display: none; }
  .site-nav {
    position: static;
    inset: auto;
    padding: 0;
    background: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    flex-direction: row;
    overflow: visible; /* mobile sheet scrolls; desktop must not clip the dropdown */
  }
  .site-nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-3);
  }
  .site-nav a {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.04em;
    background-image: linear-gradient(var(--ink), var(--ink));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s var(--ease-brush);
    padding-block: 0.35rem;
  }
  .site-nav a:hover,
  .site-nav a[aria-current="page"] { background-size: 100% 2px; }
  .site-nav a[aria-current="page"] { color: var(--ink); }

  .nav-item-portfolio { position: relative; }
  .nav-sub {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 190px;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px -18px rgba(28, 26, 23, 0.35);
    padding: 0.9rem 1.1rem;
    display: grid;
    gap: 0.55rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s var(--ease-brush), transform 0.22s var(--ease-brush), visibility 0.22s;
  }
  .nav-item-portfolio:hover .nav-sub,
  .nav-item-portfolio:focus-within .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  .site-nav .nav-sub a { font-size: var(--text-sm); color: var(--ink-soft); padding-block: 0.1rem; }
  .site-nav .nav-sub a:hover { color: var(--ink); }
}

/* lock body scroll when mobile nav open */
body.nav-open { overflow: hidden; }

/* ---------- Hero / splash ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + var(--space-4)) var(--space-3) var(--space-5);
  position: relative;
}
.hero-logo {
  width: clamp(180px, 42vw, 280px);
  margin-bottom: 0.75rem; /* tight coupling to the title, per splash layout */
  /* per Brian's measured layout: mark bbox center sits at ~54.2% of viewport
     width (left:right margins 1146:926), i.e. +4.2vw right of center */
  transform: translateX(4.2vw);
}
.hero-title {
  font-size: var(--text-hero);
  font-weight: 400;
  letter-spacing: 0.06em;
}
.hero-tagline {
  margin-top: var(--space-2);
  font-family: var(--font-serif);
  /* sized so the line spans the same width as SKENE CREATIVE above it;
     opsz pinned so glyph widths scale linearly with font-size */
  font-size: calc(var(--text-hero) * 0.364);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 40;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--ink-soft);
}
.hero-title, .hero-tagline, .hero-scroll {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s var(--ease-brush) forwards;
  animation-delay: var(--d, 1.49s);
}
.hero-tagline { --d: 1.63s; }
.hero-scroll { --d: 1.83s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.hero-scroll {
  position: absolute;
  bottom: max(var(--space-3), env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  color: var(--ink-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.hero-scroll::after {
  content: "";
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--ink-faint), transparent);
  animation: drip 2.2s var(--ease-brush) infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: top; }
  56% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Portfolio grid ---------- */
.folio-grid {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .folio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .folio-grid { grid-template-columns: repeat(3, 1fr); } }

.folio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 168px;
  padding: var(--space-3);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 55%, #fffdf6 45%);
  transition: transform 0.35s var(--ease-brush), box-shadow 0.35s var(--ease-brush), border-color 0.35s;
  overflow: hidden;
}
.folio-card::before {
  /* faint ink wash that sweeps in on hover */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(28,26,23,0.05), rgba(28,26,23,0) 55%);
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease-brush);
}
.folio-card:hover, .folio-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: 0 24px 44px -26px rgba(28, 26, 23, 0.4);
}
.folio-card:hover::before { transform: translateX(0); }
.folio-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  margin-top: var(--space-3);
}
.folio-desc { color: var(--ink-faint); font-size: var(--text-sm); margin-top: 0.3rem; }
.folio-lock {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  color: var(--vermillion);
}
.folio-note { margin-top: var(--space-3); color: var(--ink-faint); font-size: var(--text-sm); max-width: var(--measure); }
.folio-note strong { color: var(--ink-soft); }

/* ---------- One-time gallery unlock (portfolio section) ---------- */
.folio-unlock { max-width: var(--measure); }
.unlock-form {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.unlock-input {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.25rem 0.1rem;
  width: 11ch;
  transition: border-color 0.25s var(--ease-brush);
}
.unlock-input:focus { outline: none; border-bottom-color: var(--vermillion); }
.unlock-input::placeholder { color: var(--ink-faint); }
.unlock-btn {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vermillion);
  background: none;
  border: none;
  padding: 0.25rem 0;
  cursor: pointer;
  transition: color 0.25s var(--ease-brush);
}
.unlock-btn:hover { color: var(--vermillion-deep); }
.unlock-msg { font-size: var(--text-sm); color: var(--ink-faint); }
.unlock-msg.is-ok { color: var(--vermillion); }
.folio-unlock.is-unlocked .unlock-form { display: none; }
.folio-lock { overflow: visible; transition: opacity 0.5s var(--ease-brush) 0.35s; }
.folio-lock .lock-shackle {
  transform-origin: 11px 7.5px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* springy swing */
}
body.galleries-unlocked .folio-lock { opacity: 0.45; }
body.galleries-unlocked .folio-lock .lock-shackle { transform: rotate(30deg); }
/* the four protected tiles pop open in quick succession */
body.galleries-unlocked .folio-card:nth-child(2) .lock-shackle { transition-delay: 0.09s; }
body.galleries-unlocked .folio-card:nth-child(3) .lock-shackle { transition-delay: 0.18s; }
body.galleries-unlocked .folio-card:nth-child(4) .lock-shackle { transition-delay: 0.27s; }
@media (prefers-reduced-motion: reduce) {
  .folio-lock .lock-shackle { transition: none; }
}


/* ---------- Gallery pages ---------- */
.page-head {
  padding-top: calc(var(--header-h) + var(--space-5));
  padding-bottom: var(--space-4);
}


.gallery {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  padding-bottom: var(--space-6);
}
@media (min-width: 700px)  { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

.mod {
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--paper) 60%, #fffdf6 40%);
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  transition: transform 0.35s var(--ease-brush), box-shadow 0.35s var(--ease-brush);
}
.mod:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -26px rgba(28,26,23,0.38); }
.mod-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--paper-deep); }
.mod-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-brush); }
.mod:hover .mod-media img { transform: scale(1.025); }
.mod-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mod-media.is-video { aspect-ratio: 16/9; }
.mod-body { padding: var(--space-2) var(--space-2) var(--space-3); }
.mod-title { font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); }
.mod-tag {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vermillion);
  margin-bottom: 0.35rem;
}
.mod-caption { color: var(--ink-soft); font-size: var(--text-sm); margin-top: 0.4rem; line-height: 1.6; }
.mod--case .mod-body { padding: var(--space-3); }
.mod--case .prose { font-size: var(--text-base); }
.mod-zoom { cursor: zoom-in; }

.gallery-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  padding: var(--space-4);
  text-align: center;
  color: var(--ink-faint);
}

/* sample badge for placeholder modules */
.mod[data-sample]::after {
  content: "sample layout";
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 3px 8px;
  color: var(--ink-faint);
}
.mod { position: relative; }
.mod--case[data-sample] .mod-body { padding-top: calc(var(--space-3) + 26px); }

/* ---------- Case-study narrative gallery (Concepting) ----------
   Editorial "chapter" layout: numbered case studies, prose at measure
   width, artwork mounted like prints on washi. Uses the shared lightbox
   (js/gallery.js binds [data-lightbox]) and .reveal (js/main.js). */
.cs-lede { margin-top: var(--space-3); }

.cs-index { margin-top: var(--space-3); display: grid; gap: 0.4rem; justify-items: start; }
.cs-index a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  transition: color 0.25s var(--ease-brush);
}
.cs-index a:hover { color: var(--vermillion-deep); }
.cs-index .n {
  font-family: var(--font-display);
  color: var(--vermillion);
  letter-spacing: 0.08em;
  flex: none;
}

.cs {
  position: relative;
  padding-block: var(--space-5);
  border-top: 1px solid var(--line-soft);
}
.cs-head { position: relative; margin-bottom: var(--space-4); }
.cs-head h2 {
  font-size: clamp(1.7rem, 4.6vw, var(--text-3xl));
  max-width: 26ch;
  position: relative;
}
.cs-ghost {
  position: absolute;
  top: -0.32em;
  right: -0.04em;
  font-family: var(--font-display);
  font-size: clamp(5.5rem, 17vw, 12rem);
  line-height: 1;
  color: rgba(28, 26, 23, 0.055);
  pointer-events: none;
  user-select: none;
}

.cs-quote {
  margin-block: var(--space-4);
  padding-left: var(--space-3);
  border-left: 4px solid var(--vermillion);
  border-radius: 2px;
  max-width: 44ch;
}
.cs-quote p {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  font-weight: 380;
  line-height: 1.5;
  color: var(--ink-soft);
}
.cs-quote em { color: var(--vermillion-deep); }
.cs-quote--wide { max-width: none; } /* let short quotes run on one line */

.cs-step { margin: var(--space-5) 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.cs-step::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 160px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* mounted artwork */
.cs-figure { margin: 0; min-width: 0; }
.cs-mount {
  position: relative;
  background: #fffdf6;
  border: 1px solid var(--line);
  padding: clamp(8px, 1.3vw, 14px);
  box-shadow: 0 20px 40px -30px rgba(28, 26, 23, 0.5);
  transition: transform 0.35s var(--ease-brush), box-shadow 0.35s var(--ease-brush);
}
.cs-figure:hover .cs-mount,
.cs-figure:focus-within .cs-mount {
  transform: translateY(-4px);
  box-shadow: 0 30px 52px -30px rgba(28, 26, 23, 0.55);
}
.cs-mount img { width: 100%; height: auto; }
.cs-caption {
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  color: var(--ink-faint);
  line-height: 1.55;
  max-width: 52ch;
}
.cs-caption .tag {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vermillion);
  margin-bottom: 0.25rem;
}
.cs-caption--wide { max-width: none; } /* let short captions sit on one line */

/* text-only deliverable entries (result items without artwork yet) */
.cs-facts {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
}
@media (min-width: 700px) {
  .cs-facts { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
.cs-credit {
  margin-top: 0.5rem;
  font-size: var(--text-xs);
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* layout rhythms */
.cs-grid { display: grid; gap: var(--space-3); }
.cs-grid + .prose, .cs-figure + .prose { margin-top: var(--space-4); } /* air between captions and prose */
.prose + .cs-figure, .prose + .cs-grid, .prose + .cs-stack { margin-top: var(--space-4); } /* and the reverse */
@media (min-width: 700px) {
  .cs-grid--trio { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .cs-grid--trio > :nth-child(2) { margin-top: var(--space-4); }
  .cs-grid--trio > :nth-child(3) { margin-top: var(--space-5); }
  .cs-grid--duo { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .cs-grid--duo-38 { grid-template-columns: 2fr 3fr; }
  .cs-grid--duo.is-offset > :nth-child(2) { margin-top: var(--space-5); }
}

.cs-feature { max-width: 780px; margin-inline: auto; }
.cs-feature--wide { max-width: 980px; }
.cs-feature--sm { max-width: 680px; } /* ~30% narrower than --wide */

/* full-width photographic band (e.g., the Hubble spiral) */
.cs-band { margin-block: var(--space-2) var(--space-4); }
.cs-band .cs-mount { padding: 0; }
.cs-band img { aspect-ratio: 16 / 5; object-fit: cover; }

/* parallax: ghost numerals + quotes drift via JS transforms */
.cs-ghost, .cs-quote { will-change: transform; }

/* page entrance — the head settles in layers, echoing the parallax depth.
   body.page-entered is added by js/gallery.js (on gate unlock, or at boot
   on open galleries); without it the page simply renders static. */
body.page-entered .page-head > * {
  animation: settle 0.85s var(--ease-brush) both;
  animation-delay: var(--d, 0s);
}
body.page-entered .page-head .kicker     { --rise: 12px; --d: 0.05s; }
body.page-entered .page-head h1          { --rise: 16px; --d: 0.14s; }
body.page-entered .page-head .brush-rule { --rise: 14px; --d: 0.24s; }
body.page-entered .page-head .cs-lede,
body.page-entered .page-head .folio-note,
body.page-entered .page-head .page-sub   { --rise: 22px; --d: 0.34s; }
body.page-entered .page-head .cs-index   { --rise: 28px; --d: 0.46s; }
@keyframes settle {
  from { opacity: 0; transform: translateY(var(--rise, 16px)); }
  to   { opacity: 1; transform: none; }
}

/* gate fades out over the settling page */
.gate { transition: opacity 0.5s var(--ease-brush); }
.gate.is-closing { opacity: 0; pointer-events: none; }

/* parallax pan band: image taller than its clipped frame; JS pans it.
   Without JS (or with reduced motion) it falls back to the static crop. */
.cs-band--pan .cs-mount { aspect-ratio: 16 / 5; overflow: hidden; }
.cs-band--pan img {
  position: absolute;
  top: 0; left: 0;
  height: 142%;
  aspect-ratio: auto;
  object-fit: cover;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .cs-band--pan .cs-mount { aspect-ratio: auto; overflow: visible; }
  .cs-band--pan img { position: static; height: auto; aspect-ratio: 16 / 5; }
}

/* end-of-gallery link back to the portfolio menu */
.cs-endnav {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-5);
  padding-bottom: var(--space-2);
}
.cs-endlink {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15em;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--ink);
  transition: color 0.3s var(--ease-brush);
}
.cs-endlink .arrow {
  display: inline-block;
  color: var(--vermillion);
  transition: transform 0.35s var(--ease-brush);
}
.cs-endlink:hover, .cs-endlink:focus-visible { color: var(--vermillion-deep); }
.cs-endlink:hover .arrow, .cs-endlink:focus-visible .arrow { transform: translateX(10px); }

/* alternating editorial stack (campaign ads) */
.cs-stack { display: grid; gap: var(--space-4); }
@media (min-width: 880px) {
  .cs-stack > .cs-figure { width: min(76%, 760px); }
  .cs-stack > .cs-figure:nth-child(odd) { margin-right: auto; }
  .cs-stack > .cs-figure:nth-child(even) { margin-left: auto; }
}

/* ---------- Video figures in the narrative layout ----------
   A framed 16:9 embed mounted on washi like the print figures. The
   placeholder is shown until a real YouTube/Vimeo link is dropped in. */
.cs-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper-deep);
}
.cs-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.cs-video-frame.is-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(120% 120% at 50% 40%, #fffdf6 0%, var(--paper-deep) 82%);
  border: 1px dashed var(--line);
}
.cs-video-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 3px 8px;
}
.cs-video-play {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1.5px solid var(--vermillion);
  position: relative;
  margin-bottom: var(--space-2);
  transition: transform 0.35s var(--ease-brush), background 0.35s var(--ease-brush);
}
.cs-video-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--vermillion);
}
.cs-figure:hover .cs-video-play,
.cs-figure:focus-within .cs-video-play {
  transform: scale(1.06);
  background: rgba(184, 55, 31, 0.06);
}
.cs-video-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink-soft);
  max-width: 24ch;
  line-height: 1.25;
  padding: 0 var(--space-3);
}
/* two stacked features (e.g. flagship film + a second) get breathing room */
.cs-feature + .cs-feature { margin-top: var(--space-5); }
/* an odd trailing tile in a duo grid: center it at single-column width */
@media (min-width: 700px) {
  .cs-grid--duo > .is-wide-solo { grid-column: 1 / -1; width: min(100%, 48%); margin-inline: auto; }
}

/* click-to-play poster facade: shows the real thumbnail, swaps in the player
   on click (js/gallery.js). No iframe loads until asked — no black frames. */
.cs-video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  cursor: pointer;
  overflow: hidden;
  background: var(--paper-deep);
}
.cs-video-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-brush);
}
.cs-video-facade:hover .cs-video-poster { transform: scale(1.03); }
.cs-video-facade .cs-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: rgba(255, 253, 246, 0.86);
  box-shadow: 0 6px 20px -8px rgba(28, 26, 23, 0.5);
}
.cs-video-facade:hover .cs-video-play,
.cs-video-facade:focus-visible .cs-video-play {
  transform: translate(-50%, -50%) scale(1.06);
  background: var(--paper);
}
.cs-video-facade:focus-visible { outline: 2px solid var(--vermillion); outline-offset: 3px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: rgba(28, 26, 23, 0.9);
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: min(1200px, 94vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 18px;
  color: var(--paper);
  font-size: 2rem;
  line-height: 1;
  padding: 8px;
}
.lightbox-caption {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  color: var(--paper);
  font-size: var(--text-sm);
  opacity: 0.85;
  text-align: center;
  max-width: 80ch;
  padding-inline: var(--space-2);
}

/* ---------- Password gate ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.10 0 0 0 0 0.09 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}
.gate[hidden] { display: none; }
.gate-card { width: 100%; max-width: 380px; text-align: center; }
.gate-mark { width: 56px; margin-inline: auto; margin-bottom: var(--space-3); }
.gate-title { font-size: var(--text-xl); font-weight: 400; }
.gate-hint { color: var(--ink-faint); font-size: var(--text-sm); margin-top: var(--space-1); }
.gate-form { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.gate-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  padding: 0.6rem 0.2rem;
  text-align: center;
  font-size: var(--text-lg);
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.2s;
}
.gate-input:focus { border-color: var(--vermillion); }
.gate-error { color: var(--vermillion); font-size: var(--text-sm); min-height: 1.4em; }
.gate-card.is-error { animation: shake 0.4s var(--ease-brush); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}
body.gated-locked { overflow: hidden; }
body.gated-locked .site-header { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: background 0.3s var(--ease-brush), color 0.3s, border-color 0.3s, transform 0.2s;
}
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn--seal {
  border-color: var(--vermillion);
  color: var(--vermillion);
}
.btn--seal:hover { background: var(--vermillion); border-color: var(--vermillion); color: #fffaf2; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--space-3); max-width: 520px; }
.field { display: grid; gap: 0.35rem; }
.field label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.field input, .field textarea {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  padding: 0.55rem 0.1rem;
  transition: border-color 0.25s;
  border-radius: 0;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field textarea { min-height: 120px; resize: vertical; }
.form-status { font-size: var(--text-sm); color: var(--vermillion-deep); min-height: 1.5em; }

/* ---------- Resume ---------- */
.resume-block { max-width: var(--measure); }
.resume-block + .resume-block { margin-top: var(--space-4); }
.resume-item { padding-block: var(--space-3); border-top: 1px solid var(--line-soft); }
.resume-item:first-of-type { border-top: none; }
.resume-role { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; }
.resume-org { color: var(--ink-soft); }
.resume-dates { color: var(--ink-faint); font-size: var(--text-sm); letter-spacing: 0.06em; }
.resume-item ul { padding-left: 1.1rem; margin-top: var(--space-1); color: var(--ink-soft); }
.resume-item li { margin-top: 0.4rem; }
.resume-quote {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  font-weight: 380;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-block: var(--space-4) var(--space-5);
}
.page-sub {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--ink-soft);
  margin-top: 0.5rem;
}
.resume-quote cite { display: block; font-style: normal; font-size: var(--text-sm); color: var(--ink-faint); margin-top: var(--space-1); }
.resume-contact { display: grid; gap: 0.3rem; color: var(--ink-soft); margin-top: var(--space-2); justify-items: start; }

/* ---------- Seal (hanko) signature ---------- */
.seal {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--vermillion);
  color: #fdf6ea;
  border-radius: 6px 8px 7px 6px / 7px 6px 8px 7px;
  box-shadow: inset 0 0 6px rgba(151, 41, 15, 0.55);
  transform: rotate(-2deg);
}
.seal svg { width: 62%; height: auto; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-5) var(--space-4);
  margin-top: var(--space-5);
}
.footer-grid { display: grid; gap: var(--space-4); }
@media (min-width: 880px) {
  .footer-grid { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
.footer-title { font-size: var(--text-2xl); font-weight: 400; }
.footer-email { margin-top: var(--space-2); display: inline-block; }
.footer-meta {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  color: var(--ink-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

/* ---------- Logo brush-on animation ----------
   Reveal strokes are painted WITH the traced artwork (pattern paint), so the
   brush literally paints the ink on. No <mask> — avoids Safari ghosting.
   .ink-full fades in at the end to guarantee a pixel-perfect final state. */
.logo-anim .stroke {
  stroke-dasharray: 101;
  stroke-dashoffset: 101;
}
/* constant ink-speed: durations proportional to each stroke's path length,
   linear easing, no dead time between strokes */
.logo-anim .stroke-1a { animation: brushOn 0.612s linear 0.233s forwards; }
.logo-anim .stroke-1b { animation: brushOn 0.21s linear 0.845s forwards; }
.logo-anim .stroke-2 { animation: slashOn 0.51s linear 1.055s forwards; }
.logo-anim .ink-full { opacity: 0; animation: inkFull 0.263s ease 1.565s forwards; }
@keyframes brushOn { to { stroke-dashoffset: 0; } }
/* slashOn: piecewise-linear remap for a CONSTANT leading-edge speed on every
   visible stretch of the slash; the four occluded stretches (under the S tail,
   the bottom curve, the loop crossing, and the sparse tip feather) are swept
   in milliseconds so the emerging edge never appears to stall. */
@keyframes slashOn {
  0% { stroke-dashoffset: 101; }
  8% { stroke-dashoffset: 58.8; }
  99.3% { stroke-dashoffset: 6; }
  100% { stroke-dashoffset: 0; }
}
@keyframes inkFull { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .logo-anim .stroke { stroke-dashoffset: 0; }
  .logo-anim .ink-full { opacity: 1; }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease-brush), transform 0.8s var(--ease-brush);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Motion & a11y ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-2);
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  transition: top 0.2s;
}
.skip-link:focus { top: var(--space-1); }

:focus-visible { outline: 2px solid var(--vermillion); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .hero-title, .hero-tagline, .hero-scroll { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer form, .hero-scroll, .nav-toggle { display: none; }
  body { background: #fff; }
}
