/* ============================================================
   Panel system — bone / orange editorial direction.

   Loaded on its own, NOT alongside style.css. The two stylesheets
   both bind bare `nav` / `footer` element selectors, so a page
   picks one or the other. Pages still on the dark livery keep
   style.css until they're ported.
   ============================================================ */

:root {
  /* Palette */
  --orange: #fa6614;
  --ink: #141210;
  --bone: #f0e8dc;
  --panel: #e6dccc;
  --rust: #8a3a12;

  /* Tint of --bone / --ink for overlays, so opacity stays out of
     the markup. Keep these in sync if the palette moves. */
  --ink-veil: rgba(20, 18, 16, .14);
  --bone-veil: rgba(240, 232, 220, .13);
  --bone-veil-soft: rgba(240, 232, 220, .1);
  --bone-rule: rgba(240, 232, 220, .18);

  /* Type */
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Rhythm */
  --gutter: 11px;
  --pad: clamp(22px, 3.2vw, 46px);
  --r: clamp(20px, 2.4vw, 34px);
  --ease: cubic-bezier(.32, .72, .28, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font);
  font-variation-settings: "wdth" 100, "wght" 400;
  font-size: clamp(15px, 1.02vw, 17px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

/* ── Type ─────────────────────────────────────────────────── */

.display {
  font-variation-settings: "wdth" 122, "wght" 780;
  line-height: 1.04;
  letter-spacing: -.026em;
  margin: 0;
  text-align: left;
}
.h-xl { font-size: clamp(2.5rem, 5.6vw, 4.6rem); line-height: 1; }
.h-lg { font-size: clamp(1.9rem, 3.5vw, 2.9rem); }
.h-md { font-size: clamp(1.3rem, 1.9vw, 1.8rem); line-height: 1.1; }
.h-sm { font-size: clamp(1.1rem, 1.5vw, 1.35rem); line-height: 1.2; }

.lede {
  font-size: clamp(1.04rem, 1.3vw, 1.24rem);
  line-height: 1.42;
  max-width: 38ch;
  font-variation-settings: "wdth" 100, "wght" 420;
}

p { margin: 0 0 1em; max-width: 60ch; text-align: left; }
p:last-child { margin-bottom: 0; }

.meta {
  font-size: .82rem;
  font-variation-settings: "wdth" 92, "wght" 500;
  opacity: .7;
}
.meta--solid { opacity: 1; }
.meta--sub { opacity: .8; margin-top: 8px; }

/* ── Sheet + panels ───────────────────────────────────────── */

.sheet {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  padding: 0 var(--gutter) var(--gutter);
}

.panel {
  position: relative;
  overflow: hidden;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
}

.p-ink   { background: var(--ink);   color: var(--bone); }
.p-orange{ background: var(--orange);color: var(--ink); }
.p-panel { background: var(--panel); color: var(--ink); }

/* Lift real content above the decorative shapes. */
.panel > *:not(.shape):not(img) { position: relative; }

.shape { position: absolute; pointer-events: none; }
.sh-ink    { background: var(--ink); }
.sh-bone   { background: var(--panel); }
.sh-orange { background: var(--orange); }
.circle { border-radius: 50%; }
.arch   { border-radius: 0 0 999px 999px; }

/* ── Nav ──────────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: var(--gutter);
  z-index: 40;
  margin: var(--gutter);
  background: var(--ink);
  color: var(--bone);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px 10px 24px;
}
.bar b {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-variation-settings: "wdth" 116, "wght" 700;
  font-size: 1rem;
  letter-spacing: -.01em;
}
.bar b img { width: 32px; height: 32px; border-radius: 9px; }
.bar nav {
  display: flex;
  gap: 4px;
  font-size: .86rem;
  font-variation-settings: "wdth" 96, "wght" 500;
}
.bar nav a {
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 999px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.bar nav a:hover { background: var(--orange); color: var(--ink); }
.bar nav a[aria-current] { background: var(--bone-veil); }
.bar nav .nav-icon { display: none; }

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 999px;
  font-variation-settings: "wdth" 104, "wght" 600;
  font-size: .95rem;
  background: var(--orange);
  color: var(--ink);
  border: 2px solid var(--orange);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: transparent; color: var(--orange); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn-quiet { background: transparent; border-color: currentColor; color: inherit; }
.btn-quiet:hover { background: var(--bone); color: var(--ink); border-color: var(--bone); }

/* ── Hero ─────────────────────────────────────────────────── */

.hero-main {
  grid-column: span 8;
  min-height: clamp(330px, 38vw, 470px);
  justify-content: center;
  gap: 22px;
}
.hero-main .lede { opacity: .84; }

.hero-portrait {
  grid-column: span 4;
  grid-row: span 2;
  padding: 0;
  min-height: 260px;
}
.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
}

.role {
  grid-column: span 4;
  text-decoration: none;
  justify-content: flex-end;
  min-height: clamp(160px, 15vw, 190px);
  transition: background .22s var(--ease), color .22s var(--ease);
}
.role--a { margin-top: clamp(10px, 1.6vw, 26px); }
.role .meta:first-child { margin-bottom: auto; }
.role h2 { margin: 10px 0 0; }
.role:hover { background: var(--ink); color: var(--bone); }
.role--b:hover { background: var(--orange); color: var(--ink); }

/* ── Proof ────────────────────────────────────────────────── */

.proof-text {
  grid-column: span 7;
  gap: 20px;
  justify-content: center;
  min-height: clamp(300px, 30vw, 400px);
}
.proof-visual {
  grid-column: span 5;
  min-height: clamp(220px, 26vw, 400px);
  justify-content: flex-end;
  text-decoration: none;
}

.proof-text--full { grid-column: 1 / -1; }

.what {
  gap: 14px;
  min-height: clamp(240px, 22vw, 320px);
}
.what h3 { margin: 0; margin-top: auto; }
.what p { margin: 0; max-width: 34ch; opacity: .85; }

.beat {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--bone-rule);
}
.beat:first-of-type { border-top: 0; }
.beat span {
  font-size: .8rem;
  opacity: .6;
  font-variation-settings: "wdth" 90, "wght" 600;
}
.beat p { margin: 0; max-width: 52ch; }

/* ── Writing ──────────────────────────────────────────────── */

.strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: clamp(34px, 4.4vw, 60px) var(--pad) clamp(12px, 1.4vw, 18px);
}
.strip a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.strip a:hover { color: var(--rust); }

.posts { grid-column: 1 / -1; padding: 0; }

.post {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(18px, 2vw, 26px) var(--pad);
  text-decoration: none;
  border-top: 1px solid var(--ink-veil);
  transition: background .22s var(--ease), color .22s var(--ease), padding-left .28s var(--ease);
}
.post:first-child { border-top: 0; }
.post:hover {
  background: var(--ink);
  color: var(--bone);
  padding-left: calc(var(--pad) + 14px);
}
.post h3 { margin: 0; max-width: 46ch; }
.post .meta { white-space: nowrap; }

.post-main { display: flex; flex-direction: column; gap: 10px; }
.post-main p { margin: 0; opacity: .7; font-size: .92rem; max-width: 56ch; }

/* ── Band + note ──────────────────────────────────────────── */

.band {
  grid-column: span 5;
  min-height: clamp(240px, 28vw, 360px);
  padding: 0;
}
.band img { width: 100%; height: 100%; object-fit: cover; }

.band-note { grid-column: span 7; justify-content: center; gap: 14px; }

/* ── Contact ──────────────────────────────────────────────── */

.contact {
  grid-column: 1 / -1;
  min-height: clamp(300px, 32vw, 420px);
  justify-content: center;
}
.contact h2 { max-width: 18ch; }
.contact .lede { margin-top: 16px; opacity: .85; }

.contact-dot {
  width: min(60vw, 470px);
  padding-bottom: min(60vw, 470px);
  right: -7%;
  top: 50%;
  transform: translateY(-50%);
}

.mail {
  display: inline-block;
  text-decoration: none;
  margin-top: 20px;
  border-bottom: 5px solid var(--orange);
  padding-bottom: 5px;
  font-variation-settings: "wdth" 116, "wght" 740;
  font-size: clamp(1.25rem, 3.1vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  word-break: break-word;
}
.mail:hover { color: var(--orange); border-bottom-color: var(--bone); }

.elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  font-size: .9rem;
}
.elsewhere a {
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--bone-veil-soft);
}
.elsewhere a:hover { background: var(--orange); color: var(--ink); }

footer.site-foot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 22px var(--pad) 6px;
}

/* ── Column utilities ─────────────────────────────────────────
   For layouts outside the bespoke hero/proof/writing grids above. */

.c-4  { grid-column: span 4; }
.c-5  { grid-column: span 5; }
.c-6  { grid-column: span 6; }
.c-7  { grid-column: span 7; }
.c-8  { grid-column: span 8; }
.c-12 { grid-column: span 12; }

/* ── Card link (generic clickable panel, for cases outside the
   homepage's bespoke .role cards) ─────────────────────────── */

.card-link {
  text-decoration: none;
  justify-content: flex-end;
  min-height: clamp(160px, 15vw, 190px);
  transition: background .22s var(--ease), color .22s var(--ease);
}
.card-link .meta:first-child { margin-bottom: auto; }
.card-link h2, .card-link h3 { margin: 10px 0 0; }
.card-link:hover { background: var(--ink); color: var(--bone); }

/* Cards that open another site get a corner arrow. */
a.panel[target="_blank"]::after {
  content: "\2197";
  position: absolute;
  top: clamp(16px, 2vw, 26px);
  right: clamp(16px, 2vw, 26px);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  transition: transform .22s var(--ease), background .22s var(--ease), color .22s var(--ease);
}
a.panel[target="_blank"]:hover::after {
  transform: translate(2px, -2px);
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

/* ── Tags (Work) ──────────────────────────────────────────── */

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  display: inline-block;
  font-size: .78rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: .75;
  font-variation-settings: "wdth" 92, "wght" 500;
}

/* ── About: intro ─────────────────────────────────────────── */

.about-photo {
  padding: 0;
  min-height: clamp(280px, 30vw, 420px);
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
}
.about-copy { justify-content: center; gap: 20px; }
.lede--wide { max-width: 56ch; }

.badge-ay {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-variation-settings: "wdth" 118, "wght" 780;
  font-size: .95rem;
  letter-spacing: -.02em;
}

/* ── About: timeline ──────────────────────────────────────── */

.tl-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: clamp(16px, 2vw, 22px) 0;
  border-top: 1px solid var(--ink-veil);
}
.tl-row:first-child { border-top: 0; }
.tl-row .num {
  font-variation-settings: "wdth" 110, "wght" 700;
  opacity: .5;
  font-size: 1rem;
}
.tl-row p { margin-top: 4px; opacity: .85; }
.tl-row .period { white-space: nowrap; }

/* ── About: now ───────────────────────────────────────────── */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  margin-right: 8px;
  vertical-align: middle;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(250, 102, 20, .45); }
  70%  { box-shadow: 0 0 0 10px rgba(250, 102, 20, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 102, 20, 0); }
}
.now-list { list-style: none; margin: 20px 0 0; padding: 0; }
.now-list li {
  padding: 12px 0;
  border-top: 1px solid var(--bone-rule);
  font-variation-settings: "wdth" 100, "wght" 500;
}
.now-list li:first-child { border-top: 0; }

/* ── Post header ──────────────────────────────────────────── */

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.post-hero-meta .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: var(--bone-veil-soft);
  font-variation-settings: "wdth" 96, "wght" 600;
  font-size: .85rem;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.post-hero-meta ~ .lede { margin-top: clamp(16px, 2.4vw, 24px); }
.post-hero-meta .back:hover { background: var(--orange); color: var(--ink); }
.post-hero-meta .back-icon { display: none; }

.post-thumb {
  padding: 0;
  min-height: clamp(220px, 34vw, 420px);
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Post body ────────────────────────────────────────────── */

.post-content { max-width: 68ch; margin: 0 auto; }
.post-content > *:first-child { margin-top: 0; }

.post-content h1 {
  font-variation-settings: "wdth" 110, "wght" 750;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 2.2em 0 .6em;
}
.post-content h2 {
  font-variation-settings: "wdth" 108, "wght" 700;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: 2.2em 0 .6em;
}
.post-content h3 {
  font-variation-settings: "wdth" 104, "wght" 700;
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.3;
  margin: 1.8em 0 .5em;
}

.post-content p { font-size: 1rem; line-height: 1.75; max-width: none; margin-bottom: 1.2em; opacity: .9; }
.post-content strong { font-variation-settings: "wght" 700; }
.post-content a { color: var(--rust); text-decoration: underline; text-underline-offset: 2px; }
.post-content a:hover { color: var(--orange); }

.post-content ul, .post-content ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.post-content li { line-height: 1.75; margin-bottom: .4em; opacity: .9; }

.post-content blockquote {
  border-left: 3px solid var(--orange);
  margin: 0 0 1.2em;
  padding: 4px 0 4px 20px;
  font-style: italic;
  opacity: .85;
}

.post-content hr { border: none; border-top: 1px solid var(--ink-veil); margin: 2.4em 0; }

.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .85em;
  background: var(--bone-veil-soft);
  border: 1px solid var(--ink-veil);
  border-radius: 3px;
  padding: 2px 6px;
}
.post-content pre {
  background: var(--ink);
  color: var(--bone);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 1.2em;
}
.post-content pre code { background: none; border: none; padding: 0; color: inherit; }

.post-content table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 1.2em; }
.post-content th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-veil);
  font-variation-settings: "wght" 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .65;
}
.post-content td { padding: 10px 14px; border-bottom: 1px solid var(--ink-veil); vertical-align: top; }
.post-content tr:last-child td { border-bottom: none; }

.post-content img {
  display: block;
  width: 100%;
  max-width: 600px;
  background: #fff;
  border: 1px solid var(--ink-veil);
  border-radius: 14px;
  padding: 24px;
  margin: 8px auto 24px;
  box-sizing: border-box;
}
.post-content img.screenshot { max-width: 100%; background: none; border: none; padding: 0; }

.post-content video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 480px;
  aspect-ratio: 576 / 1280;
  background: var(--ink);
  border-radius: 14px;
  margin: 8px auto 24px;
  box-sizing: border-box;
}

.post-content .img-caption {
  font-size: .82rem;
  opacity: .6;
  text-align: center;
  max-width: 70ch;
  margin: -14px auto 28px;
}

@media (max-width: 620px) {
  .post-content video { max-height: 420px; }
}

/* ── Stats (Research) ─────────────────────────────────────── */

.stats { flex-direction: row; flex-wrap: wrap; gap: clamp(20px, 4vw, 48px); }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat b {
  font-variation-settings: "wdth" 118, "wght" 780;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1;
  color: var(--orange);
}
.stat span { font-size: .82rem; opacity: .7; font-variation-settings: "wdth" 92, "wght" 500; }

/* ── Motion + focus ───────────────────────────────────────── */

.settle { animation: settle .8s var(--ease) both; }
.settle:nth-child(2) { animation-delay: .06s; }
.settle:nth-child(3) { animation-delay: .12s; }
.settle:nth-child(4) { animation-delay: .18s; }

@keyframes settle {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.994); }
  to   { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}
.p-orange :focus-visible { outline-color: var(--ink); }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .role, .proof-text, .proof-visual, .band, .band-note,
  .c-4, .c-5, .c-6, .c-7, .c-8 { grid-column: span 12; }

  /* Hero collapses to one unit: portrait fills it, text sits over
     the lower half. */
  .hero-main, .hero-portrait { grid-column: 1 / -1; grid-row: 1; }
  .hero-portrait {
    z-index: 0;
    align-self: start;
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 0;
  }
  .hero-portrait img { height: 100%; object-position: 50% 8%; }
  .hero-main {
    z-index: 1;
    margin-top: min(72vw, 470px);
    background: var(--ink);
    min-height: 0;
    justify-content: flex-end;
  }
  .role--a { margin-top: 0; }
  .band { aspect-ratio: 16 / 10; }

  /* Stacked cards: drop the desktop height so the text sits under the number. */
  .what { min-height: 0; }
  .what h3 { margin-top: 12px; }
}

@media (max-width: 620px) {
  .hero-main { margin-top: 74vw; }
  .hero-main .h-xl { font-size: clamp(2.05rem, 8.4vw, 2.9rem); }
  .hero-main .lede { font-size: 1rem; }
  .band { aspect-ratio: 1 / 1; }
  .bar { padding-left: 18px; }

  /* Right-side icon strip, detached from the top bar so it stays put
     (and thumb-reachable) while the page scrolls. One compact capsule
     rather than four separate pills, so it barely covers any content
     underneath. Anchored to the bottom corner, clear of hero text. */
  .bar nav {
    position: fixed;
    bottom: var(--gutter);
    right: var(--gutter);
    flex-direction: column;
    gap: 1px;
    background: var(--ink);
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    z-index: 60;
  }
  .bar nav a {
    background: none;
    color: var(--bone);
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }
  .bar nav a[aria-current] { background: var(--orange); color: var(--ink); }
  .bar nav .nav-icon { display: block; width: 18px; height: 18px; }
  .bar nav .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* Back button: fixed, vertically centered on the left edge — the
     left-side counterpart to the icon strip on the right. */
  .post-hero-meta .back {
    position: fixed;
    top: 50%;
    left: var(--gutter);
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bone);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    z-index: 60;
    opacity: 1;
    transition: opacity .25s var(--ease);
  }
  .post-hero-meta .back.is-hidden { opacity: 0; pointer-events: none; }
  .post-hero-meta .back-icon { display: block; width: 18px; height: 18px; }
  .post-hero-meta .back-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .beat { grid-template-columns: 1fr; gap: 4px; }
  .post { flex-direction: column; gap: 6px; }
  .tl-row { grid-template-columns: 1fr; gap: 4px; }
  .tl-row .num { order: -1; }
  .contact { padding-bottom: calc(var(--pad) + 34vw); }
  .contact-dot {
    width: 62vw;
    padding-bottom: 62vw;
    right: -13%;
    top: auto;
    bottom: -15vw;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .settle, .dot { animation: none; }
  * { transition-duration: .001ms !important; }
}
