/* Clarisse Legendre — portfolio
   White paper, black ink, one brick red taken from the boards. The drawings carry the colour. */

:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.955 0.004 230);
  --line: oklch(0.88 0.006 230);
  --ink: oklch(0.17 0.012 230);
  --muted: oklch(0.44 0.018 230);
  --accent: oklch(0.50 0.10 42); /* brick red sampled from the boards' numerals */
  --accent-soft: oklch(0.95 0.02 42);
  --night: #0a0806; /* exact ground of the cover drawing, so it bleeds */
  --night-ink: oklch(0.97 0 0);
  --night-muted: oklch(0.72 0.01 230);

  --serif: 'EB Garamond', Garamond, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;

  --step--1: clamp(0.875rem, 0.85rem + 0.15vw, 0.95rem);
  --step-0: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  --step-1: clamp(1.35rem, 1.2rem + 0.7vw, 1.75rem);
  --step-2: clamp(1.8rem, 1.5rem + 1.4vw, 2.6rem);
  --step-3: clamp(2.6rem, 1.9rem + 3.2vw, 5rem);

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 62ch;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --z-sticky: 10;
  --z-overlay: 20;

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.5;
  font-feature-settings: 'liga', 'kern';
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.on-night :focus-visible, .hero :focus-visible { outline-color: var(--night-ink); }

h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; line-height: 1.1; }
p { margin: 0; text-wrap: pretty; }

.sans {
  font-family: var(--sans);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  font-family: var(--sans);
  font-size: var(--step--1);
}
.topbar a { text-decoration: none; }
.topbar .name { font-family: var(--serif); font-size: var(--step-0); white-space: nowrap; }
.topbar nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.topbar nav a:hover { text-decoration: underline; }
.topbar.on-night { color: var(--night-ink); background: var(--night); }
.topbar.on-night a:hover { color: var(--night-ink); }

/* ---------- Hero ---------- */
.hero {
  background: var(--night);
  color: var(--night-ink);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: min(78vh, 820px);
}
.hero-text {
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.5rem;
}
.hero h1 {
  font-size: var(--step-3);
  letter-spacing: -0.01em;
  line-height: 1;
}
.hero h1 span { display: block; }
.hero .lede {
  font-size: var(--step-0);
  font-family: var(--sans);
  color: var(--night-muted);
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.hero-actions { display: flex; gap: 1rem 1.75rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }
.hero-actions .secondary { color: var(--night-muted); }
.hero-actions .secondary:hover { color: var(--night-ink); }

.hero-image { position: relative; min-height: 46vh; overflow: hidden; display: block; }
.hero-image img {
  position: absolute; inset: -2px; /* hide the 1px page edge of the render */
  width: calc(100% + 4px); height: calc(100% + 4px);
  object-fit: cover;
  object-position: 50% 90%;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.8rem 1.25rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.button:hover { background: var(--night-ink); color: var(--night); }
.button.on-paper { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.button.on-paper:hover { background: var(--accent); border-color: var(--accent); }
.button svg { width: 1em; height: 1em; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 9vw, 8rem) var(--gutter); }
.section + .section { border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.section-head h2 { font-size: var(--step-2); }
.section-head .note { color: var(--muted); font-family: var(--sans); font-size: var(--step--1); }

/* ---------- Projects ---------- */
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); }
.project {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 1.25rem var(--gutter);
  align-items: start;
}
.project:nth-child(even) { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.project:nth-child(even) .project-text { order: 2; }
.project-text { display: grid; gap: 0.6rem; align-content: start; }
.project-index { font-family: var(--sans); font-size: var(--step--1); color: var(--accent); }
.project h3 { font-size: var(--step-1); }
.project h3 a { text-decoration: none; }
.project h3 a:hover { text-decoration: underline; }
.project .theme { font-style: italic; color: var(--muted); font-size: var(--step-0); }
.project .desc { max-width: 42ch; margin-top: 0.25rem; }
.project .meta { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); margin-top: 0.4rem; }
.project .meta span + span::before { content: ' · '; }
.project-image { margin: 0; }
.project-image a { display: block; border: 1px solid var(--line); }
.project-image img { width: 100%; height: auto; }
.project-image a:hover img { opacity: 0.92; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(2.5rem, 6vw, 7rem); align-items: start; }
.about .bio { max-width: var(--measure); display: grid; gap: 1.1rem; }
.about .bio p:first-child { font-size: var(--step-1); line-height: 1.35; }

.facts { display: grid; }
.facts-group {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--ink);
}
.facts-group:first-child { padding-top: 0; border-top: 0; }
.facts-group h3 { font-family: var(--serif); font-style: italic; font-size: var(--step-0); line-height: 1.5; }
.facts dl { margin: 0; display: grid; gap: 0.85rem; }
.facts dl > div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.25rem 1rem; align-items: baseline; }
.facts dt { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.facts dd { margin: 0; font-size: var(--step-0); line-height: 1.4; }
.facts dd b { font-weight: 500; }

/* ---------- Contact / footer ---------- */
.contact { display: grid; gap: 1rem; }
.contact .big { font-size: var(--step-2); line-height: 1.1; }
.contact .big a { text-decoration-color: var(--line); }
.contact .big a:hover { text-decoration-color: currentColor; }
.contact .where { color: var(--muted); }
.footer { padding: 2rem var(--gutter) 3rem; color: var(--muted); font-family: var(--sans); font-size: var(--step--1); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Motion ---------- */
.reveal { animation: rise 0.9s var(--ease-out) both; }
.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-text { order: 1; justify-content: flex-start; }
  .hero-image { order: 2; min-height: 0; aspect-ratio: 4 / 5; }
  .hero-image img { object-position: 50% 92%; }
  .project, .project:nth-child(even) { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-text { order: 0; }
  .about { grid-template-columns: 1fr; }
  .facts-group { grid-template-columns: 1fr; gap: 0.5rem; }
  .facts dl > div { grid-template-columns: 1fr; gap: 0.1rem; }
}
@media (max-width: 480px) {
  .topbar nav { gap: 1rem; }
}
