/* ==========================================================================
   mvaliolahi.ir — dark executive
   One system, two directions. English pages: forward.
   Persian pages (body.fa): mirrored, Yekan-backed.
   Charcoal surfaces, warm paper text, brass accent. A quiet echo of the
   earlier hand-drawn identity survives in the serif voice and one brass
   full stop. No frameworks, no JS, no external requests.
   ========================================================================== */

@font-face {
  font-family: Yekan;
  src: url("fonts/Yekan.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* surfaces & text (dark) */
  --paper: #141412;
  --paper-deep: #0f0f0d;
  --card: #1c1c18;
  --ink: #ece7dc;
  --ink-soft: #b0a893;
  --ink-faint: #7c7566;
  --line: #2a2925;
  --line-strong: #3b3931;

  /* accents: brass primary, quiet sage secondary */
  --pomegranate: #c9a44f;
  --pomegranate-deep: #b28e3c;
  --pistachio: #8a9a7b;
  --pistachio-deep: #a3b18f;
  --turmeric: #d8b96a;
  --sky: #7e93a8;

  /* washes: faint tinted panels on dark */
  --wash-pom: #221f18;
  --wash-pis: #1e211b;
  --wash-tum: #221f16;

  --font-sans: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --font-fa: Yekan, Tahoma, sans-serif;
  --font-fa-display: Yekan, Tahoma, sans-serif;

  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;

  /* calm radii — the formal turn */
  --b-wobble: 1px;
  --r-hand: 8px;
  --r-hand-soft: 6px;
  --r-hand-tight: 4px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --s16: 64px;
  --s20: 80px;
  --s24: 96px;
  --wrap: 1080px;
  --reading: 62ch;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--s4);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.75 var(--font-sans);
}

[dir="rtl"] body,
body.fa {
  font-family: var(--font-fa);
  font-size: 17px;
  line-height: 2;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

a:hover {
  color: var(--turmeric);
}

a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 2.5px solid var(--pomegranate);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection {
  background: var(--turmeric);
  color: var(--paper-deep);
}

h1,
h2,
h3,
h4,
p,
figure,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
}

body.fa h1,
body.fa h2,
body.fa h3 {
  font-family: var(--font-fa-display);
  line-height: 1.6;
}

p {
  text-wrap: pretty;
}

p + p {
  margin-top: var(--s4);
}

.skip {
  position: absolute;
  inset-block-start: var(--s2);
  inset-inline-start: var(--s2);
  z-index: 50;
  padding: var(--s2) var(--s4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-hand-tight);
  transform: translateY(-250%);
}

.skip:focus {
  transform: none;
}

/* --------------------------------------------------------------------------
   header
   -------------------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s4);
  width: min(var(--wrap), calc(100% - var(--s12)));
  margin-inline: auto;
  padding-block: var(--s4);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
}

body.fa .wordmark {
  font-family: var(--font-fa-display);
  font-size: 20px;
}

.wordmark span {
  color: var(--pomegranate);
  font-size: 34px;
  line-height: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: var(--s1) var(--s3);
  font-size: 14px;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: var(--r-hand-tight);
}

body.fa .site-nav a {
  font-size: 15px;
}

.site-nav a:hover {
  border-color: var(--ink);
}

.site-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.site-nav a[aria-current="page"]:hover {
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   layout helpers
   -------------------------------------------------------------------------- */

.wrap {
  width: min(var(--wrap), calc(100% - var(--s12)));
  margin-inline: auto;
}

.reading {
  max-width: var(--reading);
}

/* --------------------------------------------------------------------------
   sketchy primitives
   -------------------------------------------------------------------------- */

.wobble {
  background: var(--card);
  border: var(--b-wobble) solid var(--line-strong);
  border-radius: var(--r-hand);
}

.wobble-soft {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-soft);
}

.sticker {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 3px 12px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-tight);
  background: var(--card);
}

body.fa .sticker {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.sticker--pom {
  background: var(--wash-pom);
}

.sticker--pis {
  background: var(--wash-pis);
}

.sticker--tum {
  background: var(--wash-tum);
}

.sticker--ink {
  background: var(--ink);
  color: var(--paper);
}

.doodle {
  color: var(--pomegranate);
}


/* --------------------------------------------------------------------------
   buttons & links
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  padding: var(--s2) var(--s6);
  background: var(--pomegranate);
  border: 1px solid var(--pomegranate-deep);
  border-radius: var(--r-hand);
  color: var(--paper-deep);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease;
}

body.fa .button {
  font-size: 16px;
}

.button:hover {
  background: var(--turmeric);
  color: var(--paper-deep);
}

.button:active {
  background: var(--pomegranate-deep);
}

.button--leaf {
  background: var(--pistachio);
  color: var(--paper-deep);
}

.button--leaf:hover {
  background: var(--pistachio-deep);
}

.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button--ghost:hover {
  background: var(--wash-tum);
  color: var(--ink);
  border-color: var(--ink);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
}

.text-link::before {
  content: "→";
  transition: transform 0.12s ease;
}

[dir="rtl"] .text-link::before {
  content: "←";
}

.text-link:hover::before {
  transform: translateX(3px);
}

[dir="rtl"] .text-link:hover::before {
  transform: translateX(-3px);
}

/* --------------------------------------------------------------------------
   eyebrow / section labels
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

body.fa .eyebrow {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--pomegranate);
}

/* --------------------------------------------------------------------------
   home hero
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--s12);
  align-items: center;
  width: min(var(--wrap), calc(100% - var(--s12)));
  margin-inline: auto;
  padding-block: var(--s16) var(--s20);
}

.hero-copy .sticker-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s6);
}

.hero h1 {
  font-size: clamp(44px, 6.4vw, 78px);
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin-bottom: var(--s6);
}

body.fa .hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.5;
  letter-spacing: 0;
}

.hero .lead {
  font-size: 20px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: var(--s6);
}

body.fa .hero .lead {
  font-size: 18px;
  line-height: 2;
}

.hero .lead strong {
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  align-items: center;
}

.hero-figure {
  position: relative;
}

.hero-figure svg {
  width: 100%;
  height: auto;
}

.hero-hint {
  position: absolute;
  bottom: -6px;
  inset-inline-end: 4%;
  max-width: 210px;
  padding: var(--s2) var(--s3);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-faint);
}

body.fa .hero-hint {
  font-family: var(--font-fa);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   home sections
   -------------------------------------------------------------------------- */

.stripe {
  padding-block: var(--s20);
  border-top: 1px solid var(--line);
}

.stripe--deep {
  background: var(--paper-deep);
}

.stripe-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s4);
  margin-bottom: var(--s12);
}

.stripe-head h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  letter-spacing: -0.02em;
}

body.fa .stripe-head h2 {
  font-size: clamp(26px, 3.2vw, 36px);
}

.stripe-head .eyebrow {
  display: flex;
}

/* index rows */
.work-index {
  list-style: none;
  margin: 0;
  padding: 0;
}

.work-index a {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--s4);
  padding: var(--s4) var(--s4);
  text-decoration: none;
  border-radius: var(--r-hand-soft);
}

.work-index .when {
  padding-top: 5px;
}

.work-index li + li {
  border-top: 1px solid var(--line);
}

.work-index a:hover {
  background: var(--wash-tum);
}

.work-index h3 {
  font-size: 22px;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
}

body.fa .work-index h3 {
  font-size: 20px;
}

.work-index .what {
  color: var(--ink-soft);
  font-size: 14px;
}

.work-index .when {
  font-size: 13px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* portrait frame (former polaroid, formalised) */
.polaroid {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand);
  padding: 10px;
}

.polaroid img {
  width: 100%;
  border-radius: var(--r-hand-soft);
}

.polaroid figcaption {
  padding-top: var(--s2);
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

/* book teaser on home */
.book-teaser {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--s12);
  align-items: center;
  padding: var(--s8);
}

.book-teaser .cover {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-soft);
}

.book-teaser h3 {
  font-size: clamp(24px, 2.6vw, 32px);
  margin-bottom: var(--s3);
}

.book-teaser .meta {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: var(--s4);
}

/* --------------------------------------------------------------------------
   page intro (subpages)
   -------------------------------------------------------------------------- */

.page-head {
  width: min(var(--wrap), calc(100% - var(--s12)));
  margin-inline: auto;
  padding-block: var(--s12) var(--s8);
}

.page-head h1 {
  font-size: clamp(38px, 5vw, 58px);
  letter-spacing: -0.025em;
  margin-block: var(--s4) var(--s4);
}



body.fa .page-head h1 {
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: 0;
}

.page-head .intro {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 56ch;
}

body.fa .page-head .intro {
  font-size: 17px;
}

/* --------------------------------------------------------------------------
   experience
   -------------------------------------------------------------------------- */

.chapter {
  padding: var(--s8);
  margin-bottom: var(--s8);
}

.chapter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2) var(--s6);
}

.chapter-head h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.02em;
}

body.fa .chapter-head h2 {
  font-size: 26px;
}

.chapter-head .role {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--pomegranate);
}

.chapter .dates {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: var(--s1);
  font-variant-numeric: tabular-nums;
}

.chapter .scope {
  margin-top: var(--s4);
  max-width: 62ch;
  color: var(--ink-soft);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s6);
}

.wins {
  margin-top: var(--s6);
  padding-inline-start: 0;
  list-style: none;
}

.wins li {
  position: relative;
  padding-inline-start: 30px;
  margin-top: var(--s3);
  color: var(--ink-soft);
  max-width: 68ch;
}

.wins li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--paper-deep);
  background: var(--pistachio);
  border-radius: var(--r-hand-tight);
}

/* earlier chapters strip */
.earlier {
  margin-top: var(--s16);
}

.earlier ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.earlier li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s4);
  align-items: baseline;
  padding-block: var(--s3);
  border-bottom: 1px solid var(--line);
}

.earlier .dates {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.earlier strong {
  font-size: 16px;
}

.earlier .role {
  color: var(--ink-soft);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   perspective principles
   -------------------------------------------------------------------------- */

.principle {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--s6);
  align-items: start;
  padding: var(--s8) 0;
}

.principle + .principle {
  border-top: 1px solid var(--line);
}

.principle .number {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--pomegranate);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand);
  background: var(--card);
  transform: none;
}

.principle:nth-child(even) .number {
  transform: none;
}

.principle h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  margin-bottom: var(--s3);
}

.principle p {
  color: var(--ink-soft);
  max-width: 64ch;
}

.principle .more {
  margin-top: var(--s3);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   fa pages: library & book
   -------------------------------------------------------------------------- */

.lib-head {
  padding-block: var(--s12) var(--s8);
}

.lib-head h1 {
  font-size: clamp(30px, 4vw, 44px);
  margin-block: var(--s3) var(--s2);
}

.lib-head .lead {
  font-size: 18px;
  color: var(--ink-soft);
}

.book-feature {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: var(--s8);
  align-items: center;
  padding: var(--s8);
}

.book-feature .cover {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-soft);
}

.book-feature h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: var(--s3);
}

.book-feature .meta {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: var(--s4);
}

/* section grid with side label (RTL-mirrored automatically) */
.section-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--s8);
  padding-block: var(--s12);
}

.section-grid > .eyebrow {
  padding-top: 6px;
}

.section-grid h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: var(--s4);
}

.author {
  display: flex;
  align-items: center;
  gap: var(--s4);
  margin-bottom: var(--s4);
}

.author img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  object-fit: cover;
}

.author h2 {
  font-size: 22px;
  margin: 0;
}

.author p {
  color: var(--ink-soft);
  font-size: 14px;
}

.topics {
  margin-block: var(--s4) 0;
  padding-inline-start: 0;
  list-style: none;
}

.topics li {
  position: relative;
  padding-inline-start: 26px;
  margin-top: var(--s2);
  color: var(--ink-soft);
}

.topics li::before {
  content: "❧";
  position: absolute;
  inset-inline-start: 0;
  color: var(--pomegranate);
}

/* faq */
details {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-soft);
  background: var(--card);
  padding: 0;
  margin-top: var(--s3);
  overflow: hidden;
}

details summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s4);
  font-weight: 700;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 18px;
  color: var(--pomegranate);
}

details[open] summary::after {
  content: "−";
}

details p {
  padding: 0 var(--s4) var(--s4);
  color: var(--ink-soft);
}

details p a {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   purchase & status pages
   -------------------------------------------------------------------------- */

.status-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.status-page main {
  flex: 1;
  width: 100%;
}

.purchase {
  max-width: 660px;
  margin-inline: auto;
  padding: var(--s8);
  margin-block: var(--s12);
}

.purchase .eyebrow {
  margin-bottom: var(--s3);
}

.purchase h1 {
  font-size: clamp(28px, 3.4vw, 38px);
  margin-bottom: var(--s3);
}

.price {
  font-family: var(--font-display);
  font-size: 34px;
  margin-block: var(--s4);
  font-variant-numeric: tabular-nums;
}

body.fa .price {
  font-family: var(--font-fa);
}

.price small {
  font-size: 17px;
  color: var(--ink-soft);
}

.price del {
  font-size: 17px;
  color: var(--ink-faint);
  margin-inline-start: var(--s2);
}

.payment-block {
  border-top: 1px solid var(--line);
  padding-top: var(--s6);
  margin-top: var(--s6);
}

.payment-block h2 {
  font-size: 22px;
  margin-bottom: var(--s2);
}

.account {
  display: block;
  direction: ltr;
  text-align: center;
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0.06em;
  padding: var(--s3);
  margin-top: var(--s3);
  background: var(--wash-tum);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-tight);
  font-variant-numeric: tabular-nums;
}

.qr {
  width: 190px;
  margin: var(--s4) auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-soft);
  padding: 6px;
  background: var(--card);
}

.purchase .actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s6);
}

.note {
  font-size: 13.5px;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   writing & case studies
   -------------------------------------------------------------------------- */

/* breadcrumb trail */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
  padding-block: var(--s4) 0;
  font-size: 13px;
  color: var(--ink-faint);
}

.breadcrumb a {
  color: inherit;
}

.breadcrumb a:hover {
  color: var(--turmeric);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--s2);
  list-style: none;
}

.breadcrumb ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s2);
  margin: 0;
  padding: 0;
}

.breadcrumb [aria-current] {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--turmeric);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* essay index rows (writing index + "selected writing" on home) */
.essay-index {
  list-style: none;
  margin: 0;
  padding: 0;
}

.essay-index a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s2) var(--s4);
  align-items: baseline;
  padding: var(--s4) var(--s3);
  text-decoration: none;
  border-radius: var(--r-hand-soft);
}

.essay-index a:hover {
  background: var(--wash-tum);
}

.essay-index li + li a {
  border-top: 1px solid var(--line);
}

.essay-index h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

body.fa .essay-index h3 {
  font-size: 18px;
}

.essay-index .cat {
  font-size: 12.5px;
  color: var(--pistachio-deep);
  white-space: nowrap;
  justify-self: end;
}

.essay-index p {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 14.5px;
  max-width: 60ch;
}

.essay-index .rule {
  color: var(--ink-faint);
  font-style: italic;
  font-family: var(--font-display);
}

/* essay/case-study reading layout */
.essay {
  max-width: 740px;
  margin-inline: auto;
  padding-block: var(--s6) var(--s12);
}

.essay h1 {
  font-size: clamp(34px, 4.4vw, 52px);
  letter-spacing: -0.025em;
  margin-block: var(--s4);
}

body.fa .essay h1 {
  font-size: clamp(28px, 3.6vw, 40px);
}

.essay .standfirst {
  font-size: 19px;
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: var(--s8);
}

.essay .byline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  align-items: baseline;
  font-size: 13.5px;
  color: var(--ink-faint);
  margin-bottom: var(--s6);
}

.essay .byline .sticker {
  font-size: 12.5px;
  padding: 3px 10px;
  max-width: none;
}

.essay h2 {
  font-size: clamp(24px, 2.8vw, 32px);
  letter-spacing: -0.02em;
  margin-block: var(--s12) var(--s4);
}

.essay h3 {
  font-size: 20px;
  margin-block: var(--s8) var(--s2);
}

.essay p,
.essay ul,
.essay ol {
  max-width: 66ch;
}

.essay ul,
.essay ol {
  padding-inline-start: 1.4em;
}

.essay li {
  margin-block: var(--s2);
}

.essay li::marker {
  color: var(--pomegranate);
  font-weight: 700;
}

/* compact reference list */
.refs {
  font-size: 14px;
  color: color-mix(in srgb, var(--ink) 72%, var(--paper));
}
.refs li {
  margin-block: var(--s1);
}

/* decision card — a judgement call, framed */
.decision,
.pull-quote,
.lesson-box {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-soft);
  padding: var(--s6);
  margin-block: var(--s8);
}

.pull-quote,
.lesson-box {
  background: var(--wash-tum);
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.55;
  font-style: italic;
}

body.fa .pull-quote,
body.fa .lesson-box {
  font-family: var(--font-fa-display);
  font-style: normal;
  font-size: 19px;
  line-height: 1.9;
}

.pull-quote::before {
  content: "“";
  position: absolute;
  inset-block-start: -26px;
  inset-inline-start: 18px;
  font-family: var(--font-display);
  font-size: 64px;
  color: var(--turmeric);
  line-height: 1;
}

.lesson-box {
  background: var(--wash-pis);
  border-radius: var(--r-hand);
}

.lesson-box::before {
  content: "the lesson";
  position: absolute;
  inset-block-start: -14px;
  inset-inline-start: 22px;
  padding: 2px 12px;
  background: var(--pistachio);
  color: var(--paper-deep);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: var(--r-hand-tight);
}

.decision {
  background: var(--wash-pom);
}

.decision::before {
  content: "the decision";
  position: absolute;
  inset-block-start: -14px;
  inset-inline-start: 22px;
  padding: 2px 12px;
  background: var(--pomegranate);
  color: var(--paper-deep);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: var(--r-hand-tight);
}

.decision .what {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.5;
  margin-bottom: var(--s3);
}

.decision .why {
  font-size: 15.5px;
  color: var(--ink-soft);
}

.decision .why strong {
  color: var(--ink);
}

/* before/after panel */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  margin-block: var(--s8);
}

.compare .before,
.compare .after {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-hand-soft);
  padding: var(--s6);
}

.compare .before {
  background: var(--wash-pom);
}

.compare .after {
  background: var(--wash-pis);
}

.compare h3 {
  font-size: 18px;
  font-family: var(--font-sans);
  font-weight: 700;
  margin-bottom: var(--s3);
}

.compare .after h3 {
  color: var(--pistachio-deep);
  font-weight: 700;
}

.compare .before h3 {
  color: var(--ink-soft);
  font-weight: 700;
}

.compare ul {
  padding-inline-start: 1.2em;
  font-size: 15.5px;
  margin: 0;
}

.compare li {
  margin-block: var(--s2);
}

/* key facts strip on the case study */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
  margin-block: var(--s8);
}

.facts div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-hand-soft);
  padding: var(--s3) var(--s4);
}

.facts dt {
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-bottom: 2px;
}

.facts dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
}

/* section label used inside essays */
.essay .kicker {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pistachio-deep);
  margin-bottom: var(--s2);
}

.essay .more {
  margin-top: var(--s4);
}

.essay .note {
  max-width: 66ch;
}

/* related reading grid at page end */
.related {
  border-top: 1px solid var(--line);
  margin-top: var(--s16);
  padding-top: var(--s8);
}

.related h2 {
  font-size: 24px;
  margin-bottom: var(--s4);
}

.related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related li + li {
  margin-top: var(--s3);
}

.related a {
  display: grid;
  gap: 2px;
  text-decoration: none;
}

.related .r-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16.5px;
}

.related a:hover .r-title {
  color: var(--turmeric);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.related .r-desc {
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 58ch;
}

.related .r-tag {
  font-size: 12px;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   footer
   -------------------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  width: min(var(--wrap), calc(100% - var(--s12)));
  margin-inline: auto;
  padding-block: var(--s8) var(--s12);
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}

.site-footer a {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--s8);
    padding-block: var(--s8) var(--s12);
  }
  .hero-figure {
    max-width: 380px;
    margin-inline: auto;
  }
  .stripe {
    padding-block: var(--s16);
  }
  .section-grid {
    grid-template-columns: 1fr;
    gap: var(--s3);
  }
  .book-feature,
  .book-teaser {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: var(--s6);
    padding: var(--s6);
  }
  .principle {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: var(--s4);
  }
  .principle .number {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
}

@media (max-width: 600px) {
  .wrap,
  .site-header,
  .site-footer {
    width: calc(100% - var(--s8));
  }

  /* header: stack wordmark above a touch-friendly nav */
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s2);
    padding-block: var(--s3);
  }
  .wordmark {
    font-size: 20px;
  }
  body.fa .wordmark {
    font-size: 18px;
  }
  .wordmark span {
    font-size: 27px;
  }
  .site-nav {
    gap: var(--s1) var(--s2);
  }
  .site-nav a {
    padding: 7px 14px;
    font-size: 14px;
  }
  body.fa .site-nav a {
    font-size: 14.5px;
  }

  /* hero: tighter scale, annotation below the drawing */
  .hero {
    padding-block: var(--s6) var(--s8);
  }
  .hero h1 {
    font-size: clamp(34px, 11vw, 44px);
  }
  body.fa .hero h1 {
    font-size: clamp(27px, 8.6vw, 36px);
  }
  .hero .lead {
    font-size: 17.5px;
  }
  body.fa .hero .lead {
    font-size: 16px;
  }
  .sticker {
    font-size: 12.5px;
    padding: 2px 11px;
  }
  body.fa .sticker {
    font-size: 13px;
  }
  .hero-figure {
    max-width: 320px;
  }
  .hero-hint {
    position: static;
    margin-top: var(--s3);
    max-width: none;
    text-align: center;
  }

  /* sections */
  .stripe {
    padding-block: var(--s12);
  }
  .stripe-head h2 {
    font-size: 25px;
  }
  body.fa .stripe-head h2 {
    font-size: 23px;
  }
  .page-head {
    padding-block: var(--s8) var(--s6);
  }
  .page-head h1 {
    font-size: clamp(29px, 9vw, 38px);
  }
  body.fa .page-head h1 {
    font-size: clamp(25px, 7.6vw, 32px);
  }
  .page-head .intro {
    font-size: 16.5px;
  }

  /* work index */
  .work-index a {
    grid-template-columns: 1fr auto;
    padding: var(--s3) var(--s1);
  }
  .work-index h3 {
    font-size: 19px;
  }
  .work-index .when {
    font-size: 12px;
    justify-self: end;
  }

  /* experience chapters */
  .chapter {
    padding: var(--s6) var(--s4);
    margin-bottom: var(--s4);
  }
  .chapter-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .chapter-head h2 {
    font-size: 24px;
  }
  body.fa .chapter-head h2 {
    font-size: 22px;
  }
  .chapter-head .role {
    font-size: 17px;
  }
  .chapter .dates {
    font-size: 12px;
  }
  .wins li {
    font-size: 15.5px;
    padding-inline-start: 27px;
  }
  .polaroid {
    max-width: 260px !important;
    margin-top: var(--s8) !important;
  }
  .earlier {
    margin-top: var(--s8);
  }

  /* principles */
  .principle {
    grid-template-columns: 46px minmax(0, 1fr);
    padding-block: var(--s6);
  }
  .principle .number {
    width: 44px;
    height: 44px;
    font-size: 19px;
  }

  /* books */
  .book-feature,
  .book-teaser {
    grid-template-columns: 1fr;
    padding: var(--s4);
  }
  .book-feature .cover,
  .book-teaser .cover {
    max-width: 160px;
  }
  .book-feature h2 {
    font-size: 23px;
  }

  /* purchase & status */
  .purchase {
    padding: var(--s6) var(--s4);
    margin-block: var(--s8);
  }
  .purchase h1 {
    font-size: clamp(23px, 6.4vw, 28px);
  }
  .price {
    font-size: 28px;
  }
  .price small,
  .price del {
    font-size: 15px;
  }
  .payment-block h2 {
    font-size: 19px;
  }
  .account {
    font-size: 16px;
    letter-spacing: 0.04em;
    padding: var(--s3) var(--s2);
  }
  .qr {
    width: 160px;
  }
  .purchase .actions .button,
  .hero-actions .button {
    flex: 1 1 auto;
  }

  /* footer */
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s2);
    padding-block: var(--s6) var(--s12);
  }
}

/* ==========================================================================
   motion layer — CSS only, progressively enhanced
   Time-based entrance effects run everywhere; scroll-driven effects live
   inside @supports (animation-timeline: view()) so browsers without them
   render a fully static site. Reduced-motion users get everything off.
   ========================================================================== */

/* hero entrance: one orchestrated fade-and-rise on load */
.hero-copy > * {
  animation: hero-rise 0.7s ease-out backwards;
}
.hero-copy > *:nth-child(2) { animation-delay: 80ms; }
.hero-copy > *:nth-child(3) { animation-delay: 160ms; }
.hero-copy > *:nth-child(4) { animation-delay: 240ms; }
.hero-copy > *:nth-child(5) { animation-delay: 320ms; }
.hero-copy > *:nth-child(6) { animation-delay: 400ms; }

.hero-figure {
  animation: hero-rise 0.9s ease-out 0.15s backwards;
}

/* svg draw-on: strokes trace themselves once, leaves settle in after */
.hero-figure svg [data-draw] {
  stroke-dasharray: 400;
  animation: draw-stroke 1.6s ease-out 0.4s backwards;
}

.hero-figure svg .leaf {
  transform-box: fill-box;
  transform-origin: center;
  animation: leaf-in 0.8s ease-out 1.7s backwards;
}

/* micro-interactions */
.button,
.work-index a,
.essay-index a {
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease;
}
.button:hover {
  transform: translateY(-1px);
}
.button:active {
  transform: translateY(0);
}

@supports (animation-timeline: view()) {
  /* reading progress: brass hairline along the top of essay pages */
  .essay::before {
    content: "";
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pomegranate), var(--turmeric));
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: progress-grow linear both;
    animation-timeline: view();
    z-index: 60;
    pointer-events: none;
  }

  [dir="rtl"] .essay::before {
    transform-origin: 100% 50%;
  }

  /* scroll reveals: content rises in as each unit enters the viewport;
     section backgrounds stay still, so nothing large ever fades wholesale */
  .page-head,
  .stripe-head,
  .chapter,
  .principle,
  .work-index li,
  .essay-index li,
  .book-feature,
  .decision,
  .pull-quote,
  .lesson-box,
  .compare > div {
    animation: reveal-rise both;
    animation-timeline: view();
    animation-range: entry 0% entry 50%;
  }
}

@keyframes progress-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes reveal-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes draw-stroke {
  from { stroke-dashoffset: 400; }
  to { stroke-dashoffset: 0; }
}

@keyframes leaf-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
  .essay::before {
    display: none;
  }
}

@media print {
  .site-nav,
  .hero-actions {
    display: none;
  }
}
