/* Shared frame. Palette "Firouzeh": plain near-white greys and one deep Persian turquoise,
   kept for the few marks where a person decides. Chosen October 2026. */

:root {
  --bg: #F7F7F5;
  --surface: #EDEEEB;
  --surface-2: #E2E4E0;
  --ink: #14181A;
  --ink-2: #2A3034;
  --slate: #5D666B;
  --muted: #90979A;
  --rule: #D3D7D4;
  --rule-2: #BCC2BF;
  --rule-3: #A6AEAB;
  --accent: #0B6E70;
  --accent-2: #08514F;
  --accent-soft: rgba(11, 110, 112, 0.14);
  --accent-line: rgba(11, 110, 112, 0.45);

  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4.5vw, 64px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--rule-3) var(--bg);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Folio ---------- */

.folio {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-top: 28px;
}

.brand {
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  color: var(--ink);
}

.nav { display: flex; gap: 28px; }

.nav a {
  font-size: 0.9375rem;
  color: var(--slate);
  text-decoration: none;
  transition: color 140ms var(--ease-out);
}

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

/* ---------- Intro ---------- */

.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  padding-top: clamp(40px, 7vh, 96px);
}

.headline {
  grid-column: 1 / span 8;
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.125rem, 1.1rem + 3.3vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.024em;
  text-wrap: balance;
  font-optical-sizing: auto;
}

.lede {
  grid-column: 1 / span 7;
  margin: clamp(24px, 3.2vh, 32px) 0 0;
  max-width: 36em;
  font-size: clamp(1.0625rem, 0.98rem + 0.32vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Replay (prototype affordance under each signature visual) ---------- */

.replay {
  margin-top: 10px;
  padding: 6px 0;
  font: inherit;
  font-size: 0.875rem;
  color: var(--slate);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule-3);
  text-underline-offset: 0.25em;
  opacity: 0;
  transition: opacity 220ms var(--ease-out), color 140ms var(--ease-out);
}

.replay.is-shown { opacity: 1; }
.replay:hover { color: var(--ink); }

/* ---------- Work ---------- */

.work { padding-top: clamp(48px, 6vh, 80px); }

.work-title {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}

.project { border-bottom: 1px solid var(--rule); }

.project a {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  align-items: baseline;
  padding: 16px 0 17px;
  text-decoration: none;
  transition: background-color 140ms var(--ease-out);
}

.project a:hover { background-color: var(--surface); }

.project-name {
  grid-column: 1 / span 3;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

.project-line {
  grid-column: 4 / span 6;
  color: var(--slate);
  line-height: 1.5;
  text-wrap: pretty;
}

.project-status {
  grid-column: 10 / span 3;
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  white-space: nowrap;
}

/* ---------- Footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: clamp(64px, 10vh, 128px);
  padding: 20px 0 32px;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--slate);
}

.foot-links { display: flex; gap: 24px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* The five names close every page, big enough to be remembered; the page you're on is in turquoise. */
.five {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: clamp(64px, 10vh, 128px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.five a {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 8vw, 8rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink-2);
  text-decoration: none;
}
.five a:hover { color: var(--ink); }
.five a[aria-current] { color: var(--accent); }
.five + .foot { margin-top: 24px; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .nav { gap: 14px; }
  .nav a { font-size: 0.875rem; }

  .intro { display: block; }

  .project a { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; padding: 18px 0 19px; }
  .project-name { grid-column: 1; }
  .project-status { grid-column: 2; }
  .project-line { grid-column: 1 / -1; }
}

/* ---------- Page to page: a project's name travels into its page's title ---------- */

@view-transition { navigation: auto; }

::view-transition-group(*) { animation-duration: 420ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 220ms; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
