/* ============================================================
   Steven Grieshaber — Portfolio
   Calm / Wabi-sabi · “Sumi & Fuji” twilight palette
   Quiet mincho type · fog neutrals · wisteria purple accent
   ============================================================ */

/* ---- Tokens (font + accent are overridden live by Tweaks) ---- */
:root {
  /* Brand — murasaki (quiet purple) on light, fuji (wisteria) on dark */
  --purple:      #5C5170;   /* murasaki */
  --purple-deep: #46405A;
  --purple-soft: #E4E0EA;
  --purple-on-dark: #A795C0; /* fuji — wisteria for dark grounds (AA) */
  --accent:      #5B6A66;   /* rikyu green-gray — tweakable (AA on paper) */
  --accent-soft: #E3E8E5;

  /* Ink + paper — cool fog drawn from the twilight hero */
  --ink:       #2E323A;
  --ink-2:     #545B66;
  --ink-3:     #5A616C;
  --paper:     #E9EBEF;
  --paper-2:   #DFE3E9;
  --line:      #D2D6DE;
  --line-2:    #C2C7D1;

  /* Dusk — dark grounds (hero, footer) */
  --sumi:   #262B33;
  --sumi-2: #1F242B;
  --fog:    #A8AEB8;

  /* Type (tweakable) — default pairing = Shippori Mincho */
  --font-head: "Shippori Mincho", "Times New Roman", serif;
  --font-body: "EB Garamond", Georgia, serif;
  --tracking-head: 0.01em;

  /* Tone palette for case placeholders / accents — same neighborhood */
  --tone-violet: #5C5170;
  --tone-deep:   #46405A;
  --tone-blue:   #4D5B7C;
  --tone-plum:   #6B5364;
  --tone-slate:  #677672;

  /* Layout */
  --maxw: 1320px;
  --gut: clamp(20px, 5vw, 72px);
  --nav-h: 76px;
}

* { box-sizing: border-box; }

/* Keyboard focus — visible for all interactive elements (a11y) */
:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

/* Skip to content — appears on keyboard focus */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 300;
  background: var(--ink); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  padding: 12px 18px;
  transform: translateY(-160%);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.66;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---- Headings ---- */
h1, h2, h3, h4, h5, .head {
  font-family: var(--font-head);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: var(--tracking-head);
  line-height: 1.14;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1.1em; text-wrap: pretty; }
/* Page titles + case study titles carry the brand purple (light grounds;
   dark-ground titles keep their own light overrides) */
h1 { color: var(--purple); }
a { color: inherit; text-decoration: none; }

img, svg, video { display: block; max-width: 100%; }

/* ---- Layout helpers ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding-inline: var(--gut); }
.section { padding-block: clamp(56px, 9vw, 130px); }
.section-tight { padding-block: clamp(40px, 6vw, 80px); }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
}
.eyebrow::before {
  content: "";
  width: 44px; height: 1px;
  background: var(--purple);
}
.eyebrow.accent { color: var(--accent); }
.eyebrow.accent::before { background: var(--accent); }

.lede { font-size: clamp(20px, 2.4vw, 27px); line-height: 1.5; color: var(--ink-2); }

/* Display scale */
.display {
  font-size: clamp(44px, 8.5vw, 110px);
  line-height: 1.06;
  letter-spacing: 0.01em;
  font-weight: 500;
}
.h-xl { font-size: clamp(34px, 5vw, 58px); letter-spacing: 0.005em; }
.h-lg { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: 0.005em; }
.h-md { font-size: clamp(22px, 2.6vw, 30px); }

.measure { max-width: 64ch; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-head {
  position: sticky; top: 0; z-index: 80;
  background: rgba(233,235,239,0.9);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding-inline: var(--gut);
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
/* Logo */
.logo { display: inline-flex; align-items: center; gap: 13px; }
.logo__mark {
  width: 40px; height: 40px;
  background: var(--sumi);
  border: 1px solid var(--sumi);
  color: #E7EAEF;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-weight: 600; font-size: 16px; letter-spacing: 0.04em;
}
.logo__txt { display: flex; flex-direction: column; line-height: 1.05; }
.logo__name { font-family: var(--font-head); font-weight: 600; font-size: 16px; letter-spacing: 0.02em; color: var(--ink); }
.logo__role { font-family: var(--font-body); font-weight: 500; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); }
.nav a {
  font-family: var(--font-body);
  font-weight: 500; font-size: 13.5px; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 0;
  position: relative;
  transition: color .18s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 1px; background: var(--purple);
  transition: right .22s ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { right: 0; }
.nav a.active { color: var(--purple); }
.nav a.active::after { right: 0; }

.nav__cta {
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  background: var(--ink); color: #fff !important;
  padding: 11px 20px !important;
}
.nav__cta::after { display: none; }
.nav__cta:hover { background: var(--purple); }

/* Hamburger (mobile only) */
.burger {
  display: none;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  padding: 0; align-items: center; justify-content: center;
}
.burger span, .burger span::before, .burger span::after {
  content: ""; display: block; width: 26px; height: 2.5px; background: var(--ink);
  transition: transform .26s ease, opacity .2s;
}
.burger span { position: relative; }
.burger span::before { position: absolute; top: -8px; left: 0; }
.burger span::after  { position: absolute; top: 8px;  left: 0; }
body.menu-open .burger span { background: transparent; }
body.menu-open .burger span::before { transform: translateY(8px) rotate(45deg); }
body.menu-open .burger span::after  { transform: translateY(-8px) rotate(-45deg); }

/* Mobile menu panel */
.mobile-nav {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 70;
  background: var(--paper);
  transform: translateY(-12px);
  opacity: 0; pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
  padding: 28px var(--gut) 60px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
body.menu-open .mobile-nav { opacity: 1; transform: none; pointer-events: auto; }
.mobile-nav a {
  font-family: var(--font-head); font-weight: 500;
  font-size: 28px; letter-spacing: 0.01em;
  color: var(--ink);
  padding: 14px 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.mobile-nav a .idx { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.1em; }
.mobile-nav a.active { color: var(--purple); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  letter-spacing: 0.06em;
  padding: 14px 26px;
  border: 1px solid var(--purple); background: var(--purple); color: #fff;
  cursor: pointer; transition: background .18s, border-color .18s, color .18s, transform .12s;
}
.btn:hover { background: var(--purple-deep); border-color: var(--purple-deep); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--purple); border-color: var(--purple); }
.btn--ghost:hover { background: var(--purple); color: #fff; border-color: var(--purple); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--purple); border-color: var(--purple); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ============================================================
   IMAGE SLOTS — Swiss placeholder styling
   ============================================================ */
image-slot {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.018) 0 14px, transparent 14px 28px),
    var(--paper-2);
  border: 1px solid var(--line);
}
image-slot::part(placeholder) { font-family: var(--font-head); }

/* ============================================================
   CASE CARDS
   ============================================================ */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 44px); }
.case-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: border-color .2s, transform .2s, box-shadow .25s;
}
.case-card:hover { border-color: var(--ink-2); transform: translateY(-3px); box-shadow: 0 24px 50px -32px rgba(38,43,51,0.4); }
.case-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.case-card__img { width: 100%; height: 100%; }
.case-card__tone {
  position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: multiply; opacity: 0;
}
.case-card__num { display: none; }
.case-card__disc { display: none; }
.case-card__body { padding: clamp(22px, 2.4vw, 34px); display: flex; flex-direction: column; flex: 1; gap: 14px; }
.case-card__client { font-family: var(--font-body); font-weight: 500; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2); }
.case-card__title { font-family: var(--font-head); font-weight: 500; font-size: clamp(21px, 2.1vw, 27px); line-height: 1.4; letter-spacing: 0.005em; color: var(--purple); }
.case-card__desc { color: var(--ink-2); font-size: 16px; line-height: 1.55; margin: 0; }
.case-card__foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.case-card__tags { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tag {
  font-family: var(--font-head); font-weight: 600; font-size: 13px;
  letter-spacing: 0.01em; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0; border: 0; background: none;
}
.tag::before {
  content: ""; flex: none;
  width: 7px; height: 7px; background: var(--purple);
}
.case-card__go { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--ink); display: inline-flex; gap: 8px; align-items: center; }
.case-card:hover .case-card__go { color: var(--purple); }
.case-card:hover .case-card__go .arrow { transform: translateX(4px); }
.case-card__go .arrow { transition: transform .2s; }

/* ============================================================
   STAT / METRIC BLOCKS
   ============================================================ */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); }
.metric { padding: 26px 0 4px; border-bottom: 0; }
.metric__v { font-family: var(--font-head); font-weight: 500; font-size: clamp(40px, 5.5vw, 64px); line-height: 1.05; letter-spacing: 0; color: var(--ink); }
.metric__l { font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 10px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-foot { background: linear-gradient(180deg, #2A2D36 0%, var(--sumi-2) 100%); color: #E7EAEF; padding-block: clamp(50px, 7vw, 92px); margin-top: 40px; }
.site-foot a { color: #E7EAEF; }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot-cta { font-family: var(--font-head); font-weight: 500; font-size: clamp(28px, 4vw, 46px); line-height: 1.1; letter-spacing: 0.01em; }
.foot-cta a { border-bottom: 1px solid var(--purple-on-dark); }
.foot-cta a:hover { color: var(--purple-on-dark); }
.foot-col h4 { font-family: var(--font-body); font-weight: 500; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: #8E96A3; margin-bottom: 16px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.foot-col a { font-family: var(--font-body); font-weight: 500; font-size: 16.5px; color: #C9CEDA; }
.foot-col a:hover { color: #fff; }
.foot-bottom { margin-top: clamp(40px, 6vw, 70px); padding-top: 26px; border-top: 1px solid rgba(231,234,239,0.16); display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; font-family: var(--font-body); font-size: 14px; color: #8E96A3; letter-spacing: 0.04em; }

/* ============================================================
   TWEAKS PANEL (vanilla)
   ============================================================ */
#tweaks {
  position: fixed; top: 92px; right: 20px; z-index: 200;
  width: 286px; background: #F4F5F8;
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 70px -24px rgba(38,43,51,0.45);
  font-family: var(--font-head);
  display: none;
}
#tweaks.show { display: block; }
.tw__head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--line); cursor: grab; }
.tw__title { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.tw__x { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink-3); padding: 4px; }
.tw__x:hover { color: var(--ink); }
.tw__body { padding: 6px 16px 18px; max-height: 70vh; overflow-y: auto; }
.tw__sec { font-weight: 700; font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 10px; }
.tw__seg { display: flex; flex-direction: column; gap: 6px; }
.tw__opt {
  text-align: left; cursor: pointer;
  border: 1px solid var(--line-2); background: #F4F5F8; color: var(--ink);
  padding: 10px 12px; font-family: var(--font-head); font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: border-color .15s, background .15s;
}
.tw__opt small { display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.tw__opt:hover { border-color: var(--ink-3); }
.tw__opt.on { border-color: var(--purple); background: var(--purple-soft); }
.tw__opt.on .tw__check { opacity: 1; }
.tw__check { color: var(--purple); opacity: 0; font-weight: 800; }
.tw__row { display: flex; gap: 8px; }
.tw__sw { flex: 1; height: 40px; border: 1px solid var(--line-2); cursor: pointer; position: relative; }
.tw__sw.on { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--ink); }
.tw__count { display: flex; gap: 8px; }
.tw__count .tw__opt { justify-content: center; flex: 1; font-size: 17px; font-weight: 800; }
.tw__range { display: flex; align-items: center; gap: 12px; }
.tw__range input[type="range"] { flex: 1; accent-color: var(--purple); height: 4px; cursor: pointer; }
.tw__rval { font-family: var(--font-head); font-weight: 800; font-size: 13px; color: var(--ink); min-width: 38px; text-align: right; }

/* ============================================================
   VARIANT PREVIEW BADGE
   ============================================================ */
.variant-badge {
  position: fixed; left: 18px; bottom: 18px; z-index: 150;
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: 13px;
  padding: 10px 14px; box-shadow: 0 16px 40px -18px rgba(0,0,0,0.5);
}
.variant-badge b { font-weight: 800; color: var(--purple-on-dark); }
.variant-badge__dot { width: 8px; height: 8px; background: #57d39a; border-radius: 50%; }
.variant-badge a { color: #fff; border-bottom: 1px solid rgba(255,255,255,0.4); padding-bottom: 1px; margin-left: 4px; }
.variant-badge a:hover { color: var(--purple-on-dark); border-color: var(--purple-on-dark); }
@media print { .variant-badge { display: none !important; } }

/* ============================================================
   MISC PAGE PIECES
   ============================================================ */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule-top { border-top: 2px solid var(--ink); }
.kicker-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }

/* Two-column prose */
.prose p { font-size: 19px; line-height: 1.7; color: var(--ink); }
.prose .lede { color: var(--ink-2); }

/* List with markers */
.list-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.list-check li { position: relative; padding-left: 30px; color: var(--ink); line-height: 1.5; }
.list-check li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 13px; height: 13px; background: var(--purple);
}
.list-check.accent li::before { background: var(--accent); }

/* Tag row */
.tagrow { display: flex; flex-wrap: wrap; gap: 10px 20px; }

/* Inline text links carry an underline so they're not distinguished by color
   alone (colorblind-safe). Nav, buttons, and cards are excluded. */
.prose a:not(.btn), .ab-prose a:not(.btn), .body a, .ct-detail dd a,
.rs-contact a, .cs-tagline a, .lede a, .pillar__d a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; transition: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
  .case-grid { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: 1fr; gap: 34px; }
  body { font-size: 17px; }
}
@media (max-width: 560px) {
  .logo__txt { display: none; }
  .metric__v { font-size: 46px; }
}
