/* ============================================================
   Owen Franzen — personal site
   Palette: navy + warm white. No third hue anywhere.
   Type: Source Serif 4 narrates. IBM Plex Sans records.
   ============================================================ */

:root {
  --ink:        #16283D;
  --ink-soft:   #4A5C70;
  --paper:      #F8F5EF;
  --paper-alt:  #EDE7DC;
  --rule:       #D6CCBC;   /* decorative hairlines */
  --link-rule:  #7C848D;   /* link underline — meets 3:1 non-text contrast */

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 62ch;
  --gutter: 1.5rem;
  --wrap: 1120px;

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);   /* expo-out: fast start, long settle */
  --dur:  900ms;
}

/* ---------- reset ---------- */

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

body, h1, h2, h3, p, ul, figure, figcaption { margin: 0; padding: 0; }

ul { list-style: none; }

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

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

main > section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

main > section.band { background: var(--paper-alt); }

.prose { max-width: var(--measure); }

.prose p + p { margin-top: 1.1em; }

/* ---------- top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.topbar__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  flex-wrap: wrap;
}

.topbar__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

.topbar__links {
  display: flex;
  gap: 1.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}

/* ---------- links ---------- */

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--link-rule);
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 520ms var(--ease);
}

a:hover, a:focus-visible { background-size: 100% 1px; }

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-bottom-color: transparent;
}

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

.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6.5rem); }

.hero__inner {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 5.4vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.021em;
  text-wrap: balance;
  max-width: 17ch;
}

.hero__standfirst {
  margin-top: 1.75rem;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.hero__words {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero__portrait img {
  width: 100%;
  border-radius: 2px;
}

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

main h2 {
  position: relative;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
  padding-bottom: 0.9rem;
  margin-bottom: 2.25rem;
}

main h2::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--rule);
  transform-origin: left center;
}

/* ---------- pull quote ---------- */

.prose__pull {
  position: relative;
  margin-top: 1.9rem;
  padding-left: 1.35rem;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.34;
  letter-spacing: -0.012em;
  max-width: 34ch;
}

.prose__pull::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--ink);
  transform-origin: top center;
}

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

.entry {
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) 2.15fr;
  gap: clamp(1.25rem, 4vw, 3.25rem);
  padding-block: 2.1rem;
  border-top: 1px solid var(--rule);
}

.entry:first-of-type { border-top: 0; padding-top: 0; }

.entry__org {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.32;
}

.entry__role {
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.entry__dates {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  line-height: 1.4;
}

.entry__place {
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.entry__body > ul { margin-top: 0.95rem; }

.entry__body li {
  position: relative;
  padding-left: 1.05rem;
  margin-top: 0.55rem;
}

.entry__body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 1px;
  background: var(--ink-soft);
}

/* ---------- plain list ---------- */

.list-plain li {
  position: relative;
  padding-left: 1.05rem;
  margin-top: 0.75rem;
}

.list-plain li:first-child { margin-top: 0; }

.list-plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 1px;
  background: var(--ink-soft);
}

/* ---------- photo strip ---------- */

.photostrip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.photostrip__slot img { border-radius: 2px; }

.photostrip__pending {
  aspect-ratio: 4 / 5;
  border: 1px dashed var(--rule);
  border-radius: 2px;
}

.photostrip figcaption {
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* ---------- misc ---------- */

cite { font-style: italic; }

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

.footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 2.25rem 2.75rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.footer__name { font-weight: 600; }

.footer__links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

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

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero h1 { max-width: 20ch; }
  .hero__portrait { max-width: 20rem; order: -1; }
  .entry { grid-template-columns: 1fr; gap: 0.9rem; }
}

@media (max-width: 560px) {
  :root { --gutter: 1.15rem; }
  .photostrip { grid-template-columns: 1fr; gap: 1.5rem; }
  .photostrip__slot { max-width: 20rem; }
  .topbar__inner { gap: 0.35rem 1rem; }
}

/* ============================================================
   MOTION
   Nothing here hides content unless <html data-motion="on">, which
   only JS sets, and only when the visitor hasn't asked for reduced
   motion. JS off or motion reduced => everything renders statically.
   ============================================================ */

/* --- hero: the single page-load moment ---
   Driven by a class + transition, not an animation with a backwards fill.
   A transition that never runs still lands on its end state, so the worst
   case is "appears without moving" rather than "never appears". --- */

[data-motion="on"] .hero__text > *,
[data-motion="on"] .hero__portrait img {
  opacity: 0;
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

[data-motion="on"] .hero__text > * { transform: translateY(10px); }

/* the portrait settles rather than slides — scaling is the right verb for a
   photograph arriving; sliding is the right verb for a block of text */
[data-motion="on"] .hero__portrait img {
  transform: scale(1.028);
  transition-duration: 1200ms;
}

[data-motion="on"] .hero__text > h1              { transition-delay:  40ms; }
[data-motion="on"] .hero__text > .hero__standfirst { transition-delay: 130ms; }
[data-motion="on"] .hero__text > .hero__words    { transition-delay: 220ms; }
[data-motion="on"] .hero__portrait img           { transition-delay:  60ms; }

[data-motion="on"] .hero.is-in .hero__text > *,
[data-motion="on"] .hero.is-in .hero__portrait img {
  opacity: 1;
  transform: none;
}

/* --- section hairlines draw in on arrival --- */

[data-motion="on"] main h2::after {
  transform: scaleX(0);
  transition: transform 1100ms var(--ease);
}

[data-motion="on"] main h2.is-in::after { transform: scaleX(1); }

/* --- the one content reveal: the pull quote --- */

[data-motion="on"] .prose__pull::before {
  transform: scaleY(0);
  transition: transform 1000ms var(--ease);
}

[data-motion="on"] .prose__pull.is-in::before { transform: scaleY(1); }

[data-motion="on"] .prose__pull {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 950ms var(--ease) 140ms,
              transform 950ms var(--ease) 140ms;
}

[data-motion="on"] .prose__pull.is-in {
  opacity: 1;
  transform: none;
}

/* --- belt and braces: honour the OS setting even if JS mis-set the flag --- */

@media (prefers-reduced-motion: reduce) {
  [data-motion="on"] .hero__text > *,
  [data-motion="on"] .hero__portrait img {
    opacity: 1; transform: none; transition: none;
  }

  [data-motion="on"] main h2::after,
  [data-motion="on"] .prose__pull::before { transform: none; transition: none; }

  [data-motion="on"] .prose__pull { opacity: 1; transform: none; transition: none; }

  a { transition: none; }
}
