/* thoughtsabout — styles taken from the Figma prototype */
:root {
  --ground: #e9eef6;
  --ink: #1b1c20;
  --ink-soft: #3d4250;
  --muted: #6b7486;
  --tab: #5f6f86;
  --line: rgba(27, 28, 32, 0.08);
  --card: rgba(246, 248, 252, 0.72);
  --card-border: rgba(255, 255, 255, 0.85);
  --shadow: 0 1px 2px rgba(31, 45, 80, 0.04), 0 8px 24px rgba(31, 45, 80, 0.07);

  --yellow: #f4c84a;
  --coral: #ef6461;
  --navy: #22408f;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 4px;
  --col: 420px; /* content column; the heading lines up with it */
}

/* selected text in the red dot's colour */
::selection { background: var(--coral); color: #fff; }
.page-work { --col: 560px; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* soft colour washes + paper grain, fixed behind everything */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    radial-gradient(40vw 40vw at 8% 38%, rgba(160, 205, 235, 0.45), transparent 70%),
    radial-gradient(45vw 45vw at 92% 90%, rgba(196, 180, 240, 0.4), transparent 70%),
    radial-gradient(30vw 30vw at 85% 10%, rgba(232, 240, 214, 0.5), transparent 70%);
}
body::after {
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.62 0 0 0 0 0.68 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

/* ---------- nav ---------- */
/* nav shares the content column: dots on its left edge, links on its right */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: calc(var(--col) + 32px);
  margin: 0 auto;
  padding: 18px 16px;
}
/* the name, in the page titles' face */
.logo {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links { display: flex; gap: 28px; }
/* same face as the page titles, just smaller */
.nav-links a {
  position: relative;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tab);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[href="/work"] { --mark: var(--yellow); }
.nav-links a[href="/"] { --mark: var(--coral); }
/* current page: its own dot from the logo, under the link */
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--mark);
}

/* ---------- masthead ---------- */
/* heading and content share one centred column, so their left edges line up */
.masthead, .feed, .section {
  max-width: calc(var(--col) + 32px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}
.masthead { padding-top: 72px; padding-bottom: 56px; }
.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}
.dots { display: inline-flex; gap: 5px; margin-left: 5px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: var(--yellow); }
.dots i:nth-child(2) { background: var(--coral); }
.dots i:nth-child(3) { background: var(--navy); }
.lede { margin-top: 0; margin-bottom: 0; font-size: 15px; line-height: 1.75; color: var(--ink-soft); }

/* ---------- cards ---------- */
.feed {
  display: grid;
  gap: 16px;
  margin-bottom: 80px;
}
.card {
  display: block;
  width: 100%;
  padding: 20px 22px 18px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(31, 45, 80, 0.05), 0 14px 32px rgba(31, 45, 80, 0.1); }
.card:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.card h2 {
  margin: 0 0 2px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.25;
}

/* every title on the site: lowercase, set tight */
.card h2, .modal h1, .section-title, .role h3, .cv-heading {
  text-transform: lowercase;
  letter-spacing: -0.035em;
}
.card h2 .hl-red { color: var(--coral); }
.card h2 .hl-blue { color: var(--navy); }
.card h2 .hl-yellow { color: var(--yellow); }
.date { font-size: 9.5px; color: var(--muted); letter-spacing: 0.02em; }
.card p { margin: 10px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-soft); }
.empty { text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- article modal ---------- */
.modal {
  width: min(680px, 100vw - 32px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: #f5f7fb;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(31, 45, 80, 0.25);
}
.modal::backdrop { background: rgba(214, 222, 236, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[open] { animation: rise 0.25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.modal-inner { padding: 40px 48px 56px; outline: none; }
.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(27, 28, 32, 0.06);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: rgba(27, 28, 32, 0.12); }
.modal h1 { margin: 0 0 4px; font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1.1; }
.modal .date { font-size: 12px; }
.prose { margin-top: 28px; font-size: 16px; line-height: 1.75; color: var(--ink-soft); }
.prose h2, .prose h3 { font-family: var(--serif); color: var(--ink); line-height: 1.25; margin: 2em 0 0.5em; }
.prose img { display: block; width: 100%; height: auto; border-radius: var(--radius); margin: 1.6em 0 0; }
.prose figure { margin: 1.6em 0; }
.prose figure img { margin: 0; }
.prose figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.prose a { color: inherit; text-underline-offset: 3px; text-decoration-color: rgba(34, 64, 143, 0.35); }
.prose .source { margin-top: 2.4em; font-size: 13px; color: var(--muted); }
.prose blockquote { margin: 1.6em 0; padding-left: 18px; border-left: 3px solid var(--yellow); font-family: var(--serif); font-size: 19px; color: var(--ink); }
body.modal-open { overflow: hidden; }

/* ---------- work page ---------- */
/* title on the left, a loose cluster of round photos on the right */
.masthead-work { display: flex; align-items: center; gap: 24px; padding-bottom: 32px; }
.masthead-work .wordmark { flex: none; }
/* sizes below are in cqw (1% of the cluster's width), so everything scales together */
.photos { position: relative; flex: 1; max-width: 400px; margin-left: auto; aspect-ratio: 795 / 520; container-type: inline-size; }
/* photo inside a frosted glass ring; --w is its size, --x/--y its centre */
.bubble {
  position: absolute;
  width: calc(var(--w) * 1cqw);
  left: calc((var(--x) - var(--w) / 2) * 1cqw);
  top: calc((var(--y) - var(--w) / 2) * 1cqw);
  aspect-ratio: 1;
  padding: max(3px, calc(var(--w) * 0.03cqw));
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 32px rgba(31, 45, 80, 0.14);
  animation: drift var(--t, 14s) ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), left 0.6s cubic-bezier(0.22, 1, 0.36, 1), top 0.6s cubic-bezier(0.22, 1, 0.36, 1), padding 0.6s ease;
}
.bubble img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* resting sizes and spots; --hx/--hy is where a small one grows to so it stays inside the cluster */
.p1 { --w: 60; --x: 30; --y: 30; --t: 16s; --d: -3s; }
.p2 { --w: 12; --x: 69; --y: 13; --hx: 66; --hy: 30; --t: 11s; --d: -7s; }
.p3 { --w: 17; --x: 91.5; --y: 29; --hx: 70; --hy: 32; --t: 13s; --d: -2s; }
.p4 { --w: 27; --x: 66.5; --y: 50; --hx: 66.5; --hy: 35; --t: 15s; --d: -9s; z-index: 1; }
.p2, .p3 { animation-name: drift-alt; }
/* hovering a small photo: it takes the big size, the big one shrinks into the corner */
.bubble:not(.p1):hover { --w: 60; --x: var(--hx); --y: var(--hy); z-index: 3; }
.photos:has(.bubble:not(.p1):hover) .p1 { --w: 22; --x: 13; --y: 20; }

/* a few pixels of slow drift, each circle on its own clock */
@keyframes drift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(4px, -6px); }
  66% { transform: translate(-3px, -2px); }
  100% { transform: translate(2px, 5px); }
}
@keyframes drift-alt {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-5px, 4px); }
  66% { transform: translate(3px, 7px); }
  100% { transform: translate(-2px, -4px); }
}

.story { margin-top: 24px; }
.story p { margin: 0 0 1.1em; font-size: 17px; line-height: 1.75; color: var(--ink-soft); }
.story a {
  color: var(--ink);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: rgba(34, 64, 143, 0.3);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}
.story a:hover { text-decoration-color: var(--navy); }
.story ul { list-style: none; margin: 0 0 1.4em; padding: 0; }
/* favourites: the bullets are the three dots, in turn */
.story li { position: relative; margin: 0 0 0.8em; padding-left: 22px; font-size: 17px; line-height: 1.75; color: var(--ink-soft); }
.story li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.story ul li:nth-child(3n+2)::before { background: var(--coral); }
.story ul li:nth-child(3n)::before { background: var(--navy); }

/* closing call to action */
.talk { margin-top: 64px; }
.talk p { margin: 0; font-size: 17px; line-height: 1.75; color: var(--ink-soft); }
.talk-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.talk-link svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.talk-link:hover svg { transform: translateX(3px); }

.section-title {
  margin: 56px 0 20px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgba(34, 64, 143, 0.18);
}
.role { position: relative; padding: 0 0 28px 32px; }
.role::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ground);
  border: 2px solid var(--dot, var(--navy));
}
.role:nth-child(3n + 1) { --dot: var(--navy); }
.role:nth-child(3n + 2) { --dot: var(--coral); }
.role:nth-child(3n + 3) { --dot: var(--yellow); }
.role .when { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.role h3 { margin: 2px 0 0; font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.3; }
.role .where { font-size: 14px; color: var(--ink-soft); }
.role p { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); }
.role ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-soft); }
.role li + li { margin-top: 4px; }

.lock { margin-top: 4px; }
.unlock { position: relative; }
.unlock input {
  width: 100%;
  height: 56px;
  padding: 0 60px 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 32px rgba(31, 45, 80, 0.1);
  font: inherit;
  font-size: 16px; /* no zoom on iOS */
  color: var(--ink);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.unlock input::placeholder { color: var(--muted); }
.unlock input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 32px rgba(31, 45, 80, 0.12), 0 0 0 4px rgba(34, 64, 143, 0.1);
}
.unlock-go {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.unlock-go:hover { background: rgba(27, 28, 32, 0.06); transform: translateX(2px); }
.unlock-go:disabled { opacity: 0.4; cursor: default; }
.unlock-go svg { width: 20px; height: 20px; }
.lock .error { margin: 10px 0 0 24px; font-size: 13px; color: #c2413e; min-height: 1em; }
.cv-block + .cv-block { margin-top: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--card-border); font-size: 13px; color: var(--ink-soft); }
.lock-again { margin-top: 24px; background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; }

footer { padding: 48px 16px 40px; text-align: center; font-size: 12px; color: var(--muted); }

@media (max-width: 600px) {
  .nav-links { gap: 24px; }
  .masthead { padding-top: 48px; padding-bottom: 40px; }
  .wordmark { font-size: 44px; }
  .masthead-work { flex-direction: column; align-items: stretch; gap: 32px; }
  .photos { max-width: none; width: 100%; margin: 0; }
  .story p, .story li { font-size: 16px; }
  .modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .modal-inner { padding: 24px 20px 48px; }
  .modal h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .modal[open], .bubble { transition: none; animation: none; }
}

/* detailed CV, rendered by work.js */
.cv-text { margin: 0 0 24px; font-size: 15px; color: var(--ink-soft); }
.cv-heading { margin: 32px 0 16px; font-family: var(--serif); font-size: 18px; font-weight: 700; }
.cv-heading:first-child { margin-top: 0; }
.cv-contact { margin-top: 28px; }
.cv-meta { margin: 0 0 16px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.cv-meta a, .cv-also a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: rgba(34, 64, 143, 0.3); }
/* an engagement or area inside a role */
.cv-sub { margin-top: 20px; padding-left: 14px; border-left: 2px solid rgba(255, 255, 255, 0.9); }
.cv-sub h4, .cv-skill h4 { margin: 0; font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); letter-spacing: -0.015em; }
.cv-sub .when { margin-top: 2px; }
.cv-also ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-soft); }
.cv-also li + li { margin-top: 6px; }
.cv-skill + .cv-skill { margin-top: 16px; }
.cv-skill h4 { margin-bottom: 8px; }
