/* rezakhosravi.com — one stylesheet, no build step, no third-party requests. */

/* Self-hosted faces: see fonts/README.txt for why they are not loaded from Google. */
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(/fonts/space-grotesk-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(/fonts/space-grotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/archivo-500-latin.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/archivo-600-latin.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/archivo-700-latin.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 300; font-display: swap; src: url(/fonts/newsreader-300-latin.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/newsreader-400-latin.woff2) format("woff2"); }

:root {
  --paper: #f3f6f4;
  --ink: #111a18;
  --ink-soft: #374643;
  --muted: #5f6f6b;
  --rule: #dde5e1;
  --accent: #1a6f62;
  --accent-ink: #10493f;
  --band-bg: #0f1a18;
  --band-fg: #eef3f1;
  --band-soft: #c4cfcb;
  --band-accent: #39b6a4;
  --band-edge: transparent;
  --measure: 42rem;
  --gutter: clamp(1.25rem, 5vw, 3.75rem);
  --display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

/* No automatic dark inversion: this design is the light one, in every browser.
   `color-scheme: light` above keeps form controls and scrollbars from going dark too. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.62 var(--text);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- shared chrome ---------- */

.site-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem 1.5rem; padding: 1.75rem var(--gutter) 0;
}
.site-name { font-family: var(--ui);
  font-size: .8125rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 500;
  color: var(--ink); text-decoration: none;
}
.site-nav { font-family: var(--ui); display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: .9375rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }

.site-foot { font-family: var(--ui);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2.5rem;
  padding: 2rem var(--gutter) 3rem; color: var(--muted); font-size: .8125rem;
  border-top: 1px solid var(--rule); margin-top: 4rem;
}
.site-foot .foot-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot a { color: var(--ink-soft); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot p { margin: 0; max-width: 42em; line-height: 1.6; }

/* ---------- inner pages ---------- */

.wrap { max-width: var(--measure); margin-inline: auto; padding: 3.5rem var(--gutter) 0; }
.wrap .site-head, .wrap .site-foot { font-family: var(--ui); padding-inline: 0; }

h1, h2, h3 { letter-spacing: -.015em; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.25rem, 5.5vw, 3.25rem); line-height: 1.04; letter-spacing: -.03em; margin: 0 0 1rem; }
h2 { font-family: var(--ui); font-size: 1.1875rem; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; margin: 3rem 0 .75rem; }
h3 { font-family: var(--ui); font-size: 1.0625rem; font-weight: 600; margin: 2rem 0 .5rem; }
p, ul, ol { margin: 0 0 1.15rem; }
.lede { font-size: 1.1875rem; }
.muted { color: var(--muted); }
small, .small { font-size: .875rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
code { font: .88em var(--mono); background: rgba(180,73,47,.1); padding: .1em .32em; border-radius: 3px; }
blockquote { margin: 1.5rem 0; padding-left: 1.1rem; border-left: 3px solid var(--accent); color: var(--ink-soft); }
.prose { font-size: 1.1875rem; line-height: 1.72; }
.prose p { margin-bottom: 1.35rem; }

.intro { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; margin-bottom: 2.5rem; }
.intro img { width: 96px; height: 96px; object-fit: cover; flex: none; }
.intro > div { flex: 1 1 18rem; }

.post-meta { font-family: var(--ui); color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }
.disclaimer { font-size: .9rem; color: var(--ink-soft); border: 1px solid var(--rule); padding: 1rem 1.1rem; margin-top: 3rem; }

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

.hero { padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(3rem, 6vw, 4.5rem); }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.75rem, 8vw, 5.75rem); line-height: .94; letter-spacing: -.04em;
  margin: 0 0 clamp(2rem, 4vw, 2.75rem); max-width: 13em; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 21rem); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.hero-intro p + p { margin-top: 1rem; }
.hero-body > div { display: flex; flex-direction: column; gap: 1.75rem; }
.hero-body p { margin: 0; font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }
.hero-body p a { border-bottom: 2px solid rgba(180,73,47,.35); text-decoration: none; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { font-family: var(--ui);
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
  padding: .9rem 1.65rem; font-size: .9375rem; font-weight: 500; text-decoration: none;
  background: var(--band-bg); color: var(--band-fg); border: 1px solid var(--band-bg);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }

/* Portrait is centred on the text column's height. */
.portrait { margin: 0; align-self: center; }
.portrait img { display: block; width: 100%; height: auto; }

.band { background: var(--band-bg); color: var(--band-fg); border-block: 1px solid var(--band-edge); padding: clamp(3rem, 5vw, 4rem) var(--gutter); }
.band-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; padding-bottom: 1.75rem; }
.band-head h2 { font-family: var(--ui); margin: 0; font-size: .8125rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--band-soft); }
.band-head a { font-size: .875rem; color: var(--band-accent); border-bottom: 1px solid rgba(224,113,79,.4); text-decoration: none; }

.cv { list-style: none; margin: 0; padding: 0; }
.cv li {
  display: grid; grid-template-columns: 3rem 9rem minmax(0, 17rem) minmax(0, 1fr); grid-template-rows: auto auto;
  gap: .35rem 2.5rem; align-items: center; padding: 1.6rem 0; border-top: 1px solid rgba(243,237,225,.16);
}
.cv li:last-child { border-bottom: 1px solid rgba(243,237,225,.16); }
/* Every cell hangs on the row's vertical centre: the date sits just above it, the role just below,
   and the mark, name and description each span both rows. */
.cv-when { grid-column: 2; grid-row: 1; align-self: end; font-family: var(--ui); font-size: .9375rem; color: var(--band-soft); font-variant-numeric: tabular-nums; }
.cv-role { grid-column: 2; grid-row: 2; align-self: start; font-family: var(--ui); font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--band-accent); }
.cv-what { grid-column: 3; grid-row: 1 / span 2; font-family: var(--ui); font-weight: 600; font-size: 1.5rem; line-height: 1.15; letter-spacing: -.02em; }
.cv-what a { color: inherit; text-decoration: none; border-bottom: 2px solid var(--band-accent); }
/* Company mark: a white square tile, LinkedIn-style, so any logo reads on the dark band. */
.cv-logo { grid-column: 1; grid-row: 1 / span 2; width: 3rem; height: 3rem; border-radius: .375rem; background: #fff; object-fit: contain; padding: .3rem; box-sizing: border-box; }
.cv-logo-full { padding: 0; background: none; }
.cv-mono { display: grid; place-items: center; background: var(--band-accent); color: var(--band-bg); font: 700 1.0625rem/1 var(--ui); letter-spacing: -.02em; }
.cv p { grid-column: 4; grid-row: 1 / span 2; align-self: center; margin: 0; font-size: 1rem; line-height: 1.55; color: var(--band-soft); max-width: 34em; }
.band a:hover { color: var(--band-accent); border-bottom-color: var(--band-accent); }

.home-section { padding: clamp(3rem, 5vw, 4rem) var(--gutter) 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; padding-bottom: 1.25rem; }
.section-head h2 { font-family: var(--ui); margin: 0; font-size: .8125rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--muted); }
.section-head a { font-size: .875rem; text-decoration: none; border-bottom: 1px solid var(--rule); }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { border-top: 1px solid var(--rule); }
.entries li:last-child { border-bottom: 1px solid var(--rule); }
.entries a, .entries .upcoming {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: .35rem 2rem; padding: 1.5rem 0; text-decoration: none; color: var(--ink);
}
.entries .title { font-family: var(--display); font-weight: 600; letter-spacing: -.025em; font-size: clamp(1.375rem, 2.8vw, 2rem); line-height: 1.15; }
.entries a:hover .title { color: var(--accent); }
.entries time { font-family: var(--ui); font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.entries .upcoming { opacity: .4; }

/* the old homepage list class, kept for /writing/ */
.posts { list-style: none; padding: 0; margin: 0; }
.posts li { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.posts time { font-family: var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 6.5rem; font-size: .875rem; }
.posts a { flex: 1 1 16rem; text-decoration: none; color: var(--ink); }
.posts a:hover { color: var(--accent); }

/* ---------- reveal on load ---------- */

.rise { animation: rise 850ms cubic-bezier(.2,.7,.2,1) both; }
.rise-2 { animation-delay: 120ms; }
.rise-3 { animation-delay: 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- narrow screens ---------- */

@media (max-width: 62rem) {
  .cv li { grid-template-columns: 3rem 8rem minmax(0, 1fr); align-items: start; }
  .cv-when, .cv-role { align-self: auto; }
  .cv-what { grid-row: 1; }
  .cv p { grid-column: 3; grid-row: 2; margin-top: .25rem; }
}
@media (max-width: 44rem) {
  .hero-body { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: none; }
  .portrait { max-width: 20rem; }
  .cv li { grid-template-columns: 3rem minmax(0, 1fr); grid-template-rows: auto auto auto auto; gap: .3rem 1rem; }
  .cv-when { grid-row: 1; } .cv-what { grid-row: 2; } .cv-role { grid-row: 3; } .cv p { grid-row: 4; }
  .cv-when, .cv-what, .cv-role, .cv p { grid-column: 2; }
  .cv p { margin-top: .35rem; }
  .entries a, .entries .upcoming { padding: 1.15rem 0; }
}

/* inner pages still use a flat footer (links + one span) — keep it tidy */
.site-foot > a { color: var(--ink-soft); text-decoration: none; }
.site-foot > a:hover { color: var(--accent); }
.site-foot > span { flex: 1 1 100%; max-width: 42em; line-height: 1.6; }

/* Inner pages: breathing room between the header and the page title. */
.wrap main { padding-top: 2.5rem; }

/* Essay images sit in their original article positions, centred, never wider than the column. */
.essay-figure { margin: 2rem 0; }
.essay-figure img { display: block; margin-inline: auto; max-width: 100%; height: auto; }
.essay-figure figcaption { margin-top: .6rem; text-align: center; font-family: var(--ui); font-size: .875rem; color: var(--muted); }

/* Series: reading number and previous/next */
.series-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-family: var(--ui); font-size: .9375rem; }
.series-nav a { text-decoration: none; color: var(--ink); max-width: 48%; }
.series-nav a:hover { color: var(--accent); }
.series-nav .next { margin-left: auto; text-align: right; }
.series-nav small { display: block; color: var(--muted); font-size: .8125rem; margin-bottom: .2rem; }
.posts .n { font-family: var(--ui); color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2.25rem; font-size: .875rem; }
