/* ==========================================================================
   Daniel Florea — personal site

   Typographic system, after the structure of jakob-thumm.com:
     Newsreader (serif)     — display, headings, body prose
     Manrope (sans)         — metadata, UI, secondary text
     Space Grotesk (sans)   — small uppercase labels, tags

   Colour is a green analogue of an M3-style tonal palette, built around the
   lab green #7ab51d. The pure brand green carries rules, fills and brackets;
   text uses darkened tones so everything clears WCAG AA.
   ========================================================================== */

:root {
  /* Brand — swap this single hex/color value to re-theme the entire site */
  --brand: #7ab51d;

  /* Light theme */
  --surface: color-mix(in srgb, var(--brand) 4%, #ffffff);
  --card: #ffffff;
  --surface-low: color-mix(in srgb, var(--brand) 7%, #f4f4f4);

  --ink: color-mix(in srgb, var(--brand) 5%, #141414);
  --muted: color-mix(in srgb, var(--brand) 20%, #444444);
  --outline: color-mix(in srgb, var(--brand) 25%, #606060);
  --outline-variant: color-mix(in srgb, var(--brand) 20%, #e2e2e2);

  --accent: color-mix(in srgb, var(--brand) 60%, #000000);
  --accent-strong: color-mix(in srgb, var(--brand) 42%, #000000);
  --on-accent: #ffffff;
  --accent-wash: color-mix(in srgb, var(--brand) 12%, #ffffff);

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  --font-label: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
                Roboto, "Helvetica Neue", Arial, "Liberation Sans", sans-serif;

  --page: 78rem;
  --gutter: 2rem;
  --measure: 74ch;

  --radius: 12px;
  --radius-card: 12px;
  --section-gap: 8rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: color-mix(in srgb, var(--brand) 6%, #101010);
    --card: color-mix(in srgb, var(--brand) 9%, #141414);
    --surface-low: color-mix(in srgb, var(--brand) 7%, #121212);

    --ink: color-mix(in srgb, var(--brand) 10%, #e0e0e0);
    --muted: color-mix(in srgb, var(--brand) 20%, #909090);
    --outline: color-mix(in srgb, var(--brand) 25%, #666666);
    --outline-variant: color-mix(in srgb, var(--brand) 18%, #1a1a1a);

    --accent: color-mix(in srgb, var(--brand) 80%, #ffffff);
    --accent-strong: color-mix(in srgb, var(--brand) 95%, #ffffff);
    --on-accent: color-mix(in srgb, var(--brand) 6%, #101010);
    --accent-wash: color-mix(in srgb, var(--brand) 15%, #141414);
  }
}

/* --------------------------------------------------------------- base ---- */

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

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

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

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

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

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

::selection { background: var(--accent-wash); color: var(--accent-strong); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: .6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--outline-variant) 70%, transparent);
}

.nav {
  max-width: var(--page);
  margin-inline: auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

/* Brand: serif, italic, bold, in the accent — as on the reference site. */
.nav-brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
}
.nav-brand:hover { color: var(--accent-strong); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  color: var(--muted);
  text-decoration: none;
  padding-block: .2rem;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Filled accent CTA closing the nav, as on the reference site. */
.nav-links .nav-cta {
  font-family: var(--font-label);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius);
  padding: .6rem 1.1rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links .nav-cta:hover { background: var(--accent-strong); color: var(--on-accent); }

.icon { display: block; }

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

main { padding-bottom: 6rem; }

.hero {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 3rem;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: var(--section-gap);
}
/* When the hero is the whole page, it does not need the full section tail. */
.hero:last-child { padding-bottom: 3rem; }

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.25rem, 5.5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 1.75rem;
  color: var(--ink);
}


/* The biography sits directly under the name — there is no separate section. */
.hero-bio {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  line-height: 1.7;
  color: var(--ink);
  max-width: 56ch;
}
.hero-bio p { margin: 0; }


/* Portrait, with the offset accent bracket behind its lower-left corner. */
.portraits {
  position: relative;
  display: flex;
  gap: .75rem;
  justify-self: end;
}
.portraits::before {
  content: "";
  position: absolute;
  left: -1rem;
  bottom: -1rem;
  width: 45%;
  height: 45%;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  pointer-events: none;
}

.portrait {
  position: relative;
  width: 340px;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-low);
  box-shadow: 0 0 0 1px var(--outline-variant);
  /* Greyscale at rest, colour on hover — the reference site swaps two photos;
     with one image a filter gets the same effect. */
  /* filter: grayscale(1) contrast(1.03); */
  transition: filter .7s ease;
}
.portrait:hover { filter: none; }
.portraits--pair .portrait { width: 240px; }
.portrait--mono { filter: grayscale(1) contrast(1.03); }

/* ------------------------------------------------------ page headings ---- */

.page-head { padding-top: 5rem; padding-bottom: 4rem; }

/* Subpage titles are LIGHT-weight serif (the display face carries the size),
   with one word set italic in the accent. */
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}
.h1-accent { font-style: italic; color: var(--accent); }

/* Intros are set in the UI sans, not the display serif — it separates the
   standfirst from the body copy below it. */
.page-head p {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
  max-width: 42rem;
}

/* -------------------------------------------------- section scaffolding -- */

.section { padding-bottom: var(--section-gap); }
.section:last-child { padding-bottom: 0; }


/* Tiny uppercase accent label + hairline: the reference site's section marker. */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--outline-variant);
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-family: var(--font-label);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--accent);
  margin: 0;
}

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: clamp(1.75rem, 4vw, 3.5rem);
  box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -24px rgb(0 0 0 / .35);
}

/* ------------------------------------------------------ research topics -- */

.topics { padding-bottom: var(--section-gap); }

.topic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  padding-block: 3.5rem;
  border-top: 1px solid var(--outline-variant);
}
.topic:first-child { border-top: 0; padding-top: 0; }
.topic:last-child { padding-bottom: 0; }

.topic h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .625rem;
}

/* The italic accent question under each heading. */
.topic-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1875rem;
  line-height: 1.45;
  color: var(--accent);
  margin: 0;
}

.topic-body p {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 0 1rem;
}
.topic-body p:last-child { margin-bottom: 0; }
.topic-body a { color: var(--accent); }

/* ------------------------------------------------ project / entry rows ---- */

.entry-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2.5rem;
  align-items: start;
  padding-block: 1.75rem;
  border-top: 1px solid var(--outline-variant);
}
.entry-row:first-child { border-top: 0; padding-top: 0; }
.entry-row:last-child { padding-bottom: 0; }

.entry-row h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 .25rem;
}

.entry-year {
  font-family: var(--font-label);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--outline);
}

.entry-desc {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0;
}
.entry-desc a { color: var(--accent); }

/* ------------------------------------------------------------- content --- */
/* .card and .prose are not used by the three current pages — the biography now
   sits in the hero. They are kept as the body-copy pattern for any longer page
   you add later (a blog post, a teaching page): wrap content in
   <div class="card"><div class="prose">…</div></div>. */

/* Cards keep a comfortable measure. (Letting prose fill the card suited a
   200-word biography; at 55 words it gave ~1000px lines.) */
.card .prose { max-width: 68ch; }

.prose {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  line-height: 1.75;
  color: var(--ink);
  max-width: var(--measure);
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose p { margin: 0 0 1.5rem; }

.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.875rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2.75rem 0 .75rem;
}

.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.3;
  margin: 2.25rem 0 .625rem;
}

.prose ul, .prose ol { margin: 0 0 1.5rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--brand); }

.prose strong { font-weight: 700; }
.prose em { font-style: italic; color: var(--muted); }

.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--brand);
  font-style: italic;
  color: var(--muted);
}

.prose code {
  font-family: var(--font-label);
  font-size: .875em;
  background: var(--surface-low);
  border-radius: var(--radius);
  padding: .1em .35em;
}

.entry-year {
  font-family: var(--font-label);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--outline);
  letter-spacing: .04em;
}

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

.site-footer {
  background: var(--surface-low);
  border-top: 1px solid var(--outline-variant);
  padding-block: 3rem;
}

.footer-inner {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--accent);
  margin: 0 0 .25rem;
}

.footer-copy {
  font-family: var(--font-body);
  font-size: .8125rem;
  color: var(--outline);
  margin: 0;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-social a { color: var(--outline); display: inline-flex; text-decoration: none; }
.footer-social a:hover { color: var(--accent); }

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

@media (max-width: 60rem) {
  :root { --section-gap: 5rem; --gutter: 1.5rem; }

  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 3rem;
    align-items: start;
  }
  .portraits { justify-self: start; order: -1; }
  .portrait { width: 200px; }
  .portraits::before { left: -.75rem; bottom: -.75rem; }

  .page-head { padding-top: 3rem; padding-bottom: 2.5rem; }
  .prose { font-size: 1.0625rem; }

  .topic, .entry-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-block: 2.25rem;
  }
}

@media (max-width: 40rem) {
  .nav { padding-block: .75rem; gap: 1rem; }
  .nav-links { gap: 1.25rem; }
  .nav-links a { font-size: 1rem; }
  .portrait { width: 150px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .pub-title { font-size: 1.1875rem; }
}

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

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; padding: 0; }
  a { color: #000; }
}
