/* Shared styles for sub-pages. The root index.html has its own inline styles;
   this file is referenced from pages/*.html. */
:root {
  --ink: hsl(220 100% 55%);
  --ink-deep: hsl(220 95% 38%);
  --ink-soft: hsl(220 85% 72%);
  --paper: hsl(250 6% 96%);
  --paper-warm: hsl(215 14% 92%);  /* cool chalk blue-grey (replaces old linen) */
  --paper-cool: hsl(225 12% 93%);  /* even cooler, lighter */
  --paper-sand: hsl(175 10% 92%);  /* green-grey (replaces old sand) */
  --paper-mint: hsl(165 12% 92%);  /* mint */
  --paper-slate: hsl(220 10% 90%); /* deeper blue-grey */
  --line: rgba(26,26,255,0.18);
  --muted: rgba(26,26,255,0.55);
  /* Accent family — analogous to --ink, same chroma/lightness, varying hue.
     Used for italic <em>, section-kickers, and rare "hot" emphasis. */
  --accent-violet: oklch(58% 0.19 285);
  --accent-teal:   oklch(62% 0.14 210);
  --accent-hot:    oklch(55% 0.15 245);  /* deep blue — used sparingly for emphasis */
  --accent-olive:  oklch(62% 0.10 165);  /* muted green-teal */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--paper); color: var(--ink); font-family: 'Fraunces', Georgia, serif; -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
.mono { font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em; }
a { color: inherit; }

nav.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 40px; pointer-events: none;
}
nav.top > * { pointer-events: auto; }
/* Unified frosted pill: logo + links together */
.navpill {
  display: inline-flex; align-items: center; gap: 36px;
  padding: 4px 28px 4px 14px;
  background: rgba(245, 244, 239, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 16px rgba(26,26,255,0.05);
}
.brand {
  display: inline-flex; align-items: center; text-decoration: none;
  height: 36px; overflow: hidden;
}
.brand img { height: 72px; width: auto; display: block; object-fit: cover; object-position: center; }
.brand em { font-style: italic; font-weight: 300; opacity: 0.65; }
.navlinks { display: flex; gap: 28px; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink); }
.navlinks a { color: inherit; text-decoration: none; position: relative; cursor: pointer; }
.navlinks a::after { content: ''; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0; background: var(--ink); transition: width .35s ease; }
.navlinks a:hover::after, .navlinks a.active::after { width: 100%; }
.corner-mark {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--ink);
  display: none; /* shown only on mobile */
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  min-width: 44px; min-height: 44px;
  background: rgba(245, 244, 239, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0; cursor: pointer; line-height: 1;
  transition: transform 0.22s ease, color 0.2s ease, background 0.2s ease;
  /* Mobile tap fixes: kill 300ms delay and double-tap zoom on the button */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(26,26,255,0.15);
  position: relative; z-index: 60;
}
.corner-mark:active { transform: scale(0.94); background: rgba(26,26,255,0.08); }
body.menu-open { overflow: hidden; }

.page-hero { padding: 28vh 6vw 16vh; position: relative; min-height: 100vh; overflow: hidden; }
.page-hero canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; z-index: 0; pointer-events: auto; }
.page-hero > *:not(canvas) { position: relative; z-index: 2; pointer-events: none; }
.page-hero::after { content:''; position:absolute; inset:0; background: linear-gradient(180deg, transparent 40%, var(--paper) 100%); z-index:1; pointer-events:none; }

.page-hero .hero-copy {
  position: relative; z-index: 3;
  display: block;
  max-width: min(920px, 100%);
  isolation: isolate;
}
.page-hero .hero-copy > * { position: relative; z-index: 2; }
.page-hero .hero-copy::before {
  content: '';
  position: absolute;
  inset: -10vh -10vw;
  z-index: 1;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, hsla(40, 30%, 96%, 0.78) 0%, hsla(40, 30%, 96%, 0.55) 45%, transparent 85%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, black 40%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, black 40%, transparent 85%);
  pointer-events: none;
}

/* Solid, high-contrast text — readable without any blur/mask tricks. */
.page-hero .hero-copy .kicker { color: var(--ink); opacity: 1; }
.page-hero .hero-copy h1 { color: var(--ink); }
.page-hero .hero-copy h1 em { color: var(--ink-soft); opacity: 1; font-style: italic; }
.page-hero .hero-copy .lede { color: var(--ink); opacity: 1; font-weight: 400; }

.page-hero .kicker { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 28px; }
.page-hero h1 { font-family: 'Fraunces', serif; font-weight: 400; font-size: clamp(52px, 8vw, 128px); line-height: 0.98; letter-spacing: -0.025em; font-variation-settings: "opsz" 144; max-width: 14ch; }
.page-hero h1 em { font-style: italic; color: var(--ink-soft); }
.page-hero .lede { margin-top: 28px; max-width: 620px; font-family: 'Fraunces', serif; font-size: 20px; line-height: 1.4; }

section.block { padding: 12vh 6vw; border-top: 1px solid var(--line); position: relative; }
section.block.warm { background: var(--paper-warm); }
section.block.cool { background: var(--paper-cool); }
section.block.sand { background: var(--paper-sand); }
section.block.mint { background: var(--paper-mint); }
section.block.slate { background: var(--paper-slate); }

/* Tinted section borders — all in the cool/green family now */
section.block.warm  { --line: rgba(30,80,160,0.14); }
section.block.cool  { --line: rgba(30,80,160,0.14); }
section.block.sand  { --line: rgba(40,110,90,0.14); }
section.block.mint  { --line: rgba(40,110,90,0.14); }
section.block.slate { --line: rgba(30,60,120,0.16); }

/* Editorial accent rules — apply to every sub-page */
.pm-copy h2 em,
.block h2 em,
.page-hero h1 em,
.paper .title em,
.role .title em { color: var(--accent-violet); }

/* Section-coded kickers: cycle through the accent family */
.block:nth-of-type(1) .kicker { color: var(--accent-teal); opacity: 0.95; }
.block:nth-of-type(2) .kicker { color: var(--accent-violet); opacity: 0.95; }
.block:nth-of-type(3) .kicker { color: var(--accent-hot); opacity: 0.95; }
.block:nth-of-type(4) .kicker { color: var(--accent-olive); opacity: 0.95; }


.cta:hover { background: var(--accent-hot); color: var(--paper); border-color: var(--accent-hot); }
.page-side-ornament { color: var(--accent-violet); opacity: 0.55; }

/* Featured numeric values */
.kv-grid .kv.hot .v { color: var(--accent-hot); font-style: italic; }
.block .kicker { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 32px; opacity: 0.7; }
.block h2 { font-family: 'Fraunces', serif; font-weight: 300; font-size: clamp(36px, 4.6vw, 72px); line-height: 1.02; letter-spacing: -0.02em; max-width: 20ch; }
.block h2 em { font-style: italic; color: var(--ink-soft); }
.block .body { margin-top: 40px; font-family: 'Fraunces', serif; font-size: 18px; line-height: 1.55; max-width: 62ch; }
.block .body p + p { margin-top: 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 60px 80px; margin-top: 60px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 60px; margin-top: 60px; }
.cell { border-top: 1px solid var(--line); padding-top: 20px; }
.cell .num { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em; opacity: 0.6; }
.cell h3 { font-family: 'Fraunces', serif; font-weight: 300; font-size: 26px; margin-top: 14px; line-height: 1.1; }
.cell p { margin-top: 12px; font-size: 15px; line-height: 1.55; opacity: 0.78; max-width: 44ch; }

.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-top: 48px; }
.kv { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 20px; }
.kv .k { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.6; margin-bottom: 10px; }
.kv .v { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 300; letter-spacing: -0.01em; }

.cta-row { margin-top: 60px; display: flex; gap: 20px; flex-wrap: wrap; }
.cta { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; border: 1px solid var(--ink); padding: 18px 26px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 16px; transition: background .25s ease, color .25s ease; }
.cta:hover { background: var(--ink); color: var(--paper); }

/* PM section (firm page) */
.pm-grid { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 72px; align-items: start; margin-top: 8px; }
.pm-photo { aspect-ratio: 3/4; max-width: 360px; background: var(--paper-warm); border: 1px solid var(--line); overflow: hidden; position: relative; }
.pm-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; filter: grayscale(0.15) contrast(1.02); }
.pm-copy h2 { font-family: 'Fraunces', serif; font-weight: 300; font-size: clamp(36px, 4.6vw, 72px); line-height: 1.02; letter-spacing: -0.02em; max-width: 20ch; }
.pm-copy h2 em { font-style: italic; color: var(--ink-soft); }
.pm-copy .body { margin-top: 40px; font-family: 'Fraunces', serif; font-size: 18px; line-height: 1.55; max-width: 62ch; }
.pm-copy .body p + p { margin-top: 18px; }
@media (max-width: 1200px) {
  .pm-grid { grid-template-columns: minmax(220px, 300px) 1fr; gap: 48px; }
  .pm-photo { max-width: 300px; }
}
@media (max-width: 900px) {
  .pm-grid { grid-template-columns: 1fr; gap: 40px; }
  .pm-photo { max-width: 320px; }
}

/* Partnership lockup */
.partnership-lockup { margin-top: 8px; margin-bottom: 60px; display: flex; align-items: center; }
.partnership-lockup img { width: min(860px, 100%); height: auto; display: block; }
.cta svg { width: 14px; height: 14px; }
.cta.ghost { border-color: var(--line); }

footer.site { padding: 10vh 6vw 4vh; border-top: 1px solid var(--line); margin-top: 12vh; }
footer.site .foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 60px; align-items: start; }
footer.site .foot-brand { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
footer.site .foot-brand img { width: auto; height: 140px; object-fit: contain; display: block; }
footer.site .foot-brand .mark-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.62; max-width: 28ch; line-height: 1.65; }
footer.site .foot-col .ctitle { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.5; margin-bottom: 18px; }
footer.site .foot-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
footer.site .foot-col a { color: var(--ink); text-decoration: none; font-family: 'Fraunces', serif; font-size: 16px; letter-spacing: -0.005em; border-bottom: 1px solid transparent; transition: border-color .2s ease; }
footer.site .foot-col a:hover { border-bottom-color: var(--ink); }
footer.site .socials { display: flex; gap: 14px; }
footer.site .socials a { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); transition: background .2s ease, color .2s ease, border-color .2s ease; }
footer.site .socials a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
footer.site .socials a svg { width: 16px; height: 16px; display: block; }
footer.site .meta { margin-top: 8vh; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.65; }
@media (max-width: 1200px) {
  footer.site .foot-grid { grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; }
  footer.site .foot-brand { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 32px; flex-wrap: wrap; }
  footer.site .foot-brand img { height: 96px; }
}
@media (max-width: 900px) {
  footer.site .foot-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  footer.site .foot-brand { flex-direction: column; align-items: flex-start; }
  footer.site .foot-brand img { height: 110px; }
}

.page-side-ornament {
  position: fixed; right: 24px; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--ink); opacity: 0.45; z-index: 5;
}

@media (max-width: 1200px) {
  .kv-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 820px) {
  nav.top { padding: 14px 16px; }
  .navlinks { display: none; }
  .navpill { gap: 12px; padding: 4px 14px 4px 8px; max-width: calc(100vw - 80px); }
  .brand { height: 28px; }
  .brand img { height: 56px; }

  .page-hero, section.block { padding-left: 20px; padding-right: 20px; }
  .page-hero { min-height: 70vh; padding-top: 18vh; padding-bottom: 10vh; }
  .page-hero canvas { opacity: 1; }
  .page-hero h1 { font-weight: 500; }
  .page-hero .lede { font-weight: 500; }

  /* Center the hero copy block on mobile */
  .page-hero .hero-copy { padding: 0; max-width: 100%; text-align: center; margin: 0 auto; }
  .page-hero h1, .page-hero .lede { margin-left: auto; margin-right: auto; }
  .page-hero h1 { max-width: 16ch; }
  .page-hero .lede { max-width: 40ch; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 30px; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .kv { padding: 18px 14px; min-width: 0; }
  .kv .v { font-size: 18px; overflow-wrap: anywhere; }
  .page-side-ornament { display: none; }

  /* Break long URLs/emails without showing hyphens. Short phrases stay intact. */
  footer.site .foot-col a, footer.site .foot-brand .mark-tag, .kv .v {
    overflow-wrap: anywhere; hyphens: none; word-break: normal;
  }
  /* Allow long body text to soft-wrap without hyphenating. */
  .block .body, .cell p, .pm-copy .body, .block h2, .pm-copy h2,
  .page-hero h1, .page-hero .lede {
    overflow-wrap: break-word; hyphens: none;
  }

  .cell h3 { font-size: 22px; }
  .block .body { font-size: 16px; }
  .cell p { font-size: 14px; }

  /* Footer: single column on narrow, keep headings above links */
  footer.site .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  footer.site .foot-brand img { height: 80px; }
  footer.site .meta { margin-top: 6vh; flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .brand { height: 24px; }
  .brand img { height: 48px; }
  .navpill { padding: 4px 10px 4px 6px; gap: 8px; }

  .kv-grid { grid-template-columns: 1fr; }
  .page-hero { min-height: 58vh; padding: 14vh 20px 8vh; }
  .page-hero .hero-copy { padding: 0; }
  .page-hero h1 { font-size: clamp(40px, 11vw, 64px); }
  .block h2, .pm-copy h2 { font-size: clamp(32px, 8vw, 48px); }
  .page-hero .lede { font-size: 17px; }
  .kv .v { font-size: 16px; }
}

/* ---------- Mobile hamburger + menu ---------- */
@media (max-width: 1024px) {
  .corner-mark { display: inline-flex !important; }
}
@media (min-width: 1025px) {
  .mobile-menu { display: none !important; }
  .corner-mark { display: none !important; }
}

.mobile-menu {
  position: fixed; inset: 0; z-index: 100;
  background: var(--paper);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0 8vw; gap: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
body.menu-open .mobile-menu { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(36px, 10vw, 56px); line-height: 1.1;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
  padding: 8px 0;
}
  .mobile-menu-close {
    position: absolute; top: 24px; right: 24px;
    background: none; border: none; cursor: pointer;
    font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 400;
    color: var(--ink); line-height: 1;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.7; transition: opacity 0.2s ease;
  }
  .mobile-menu-close:hover { opacity: 1; }
