/* Shared styles for every page */
:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --muted: #8a8a8a;
  --line: #ececec;
  --accent: #d9677a; /* rosy pink */
  --accent-2: #3567b0; /* blue, for the work dropdowns */
  --accent-2-soft: #dce7f7; /* pale blue hover fill */
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 0 32px; }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
}
nav .wrap {
  display: flex; justify-content: space-between; align-items: center;
  height: 64px;
}
.mark { font-family: var(--serif); font-size: 22px; }
nav ul { display: flex; gap: 32px; list-style: none; font-size: 13px; }
nav ul a { color: var(--ink); transition: color .2s; }
nav ul a:hover { color: var(--accent); }

/* Hero */
.hero { min-height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: space-between; padding-top: 12vh; padding-bottom: 48px; }
/* svh = the screen height with the browser's toolbars showing, so the intro stays above the fold on iPhone Safari */
@supports (height: 100svh) {
  .hero { min-height: calc(100svh - 64px); padding-top: 12svh; }
}
.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 11vw, 150px);
  line-height: 1;
  letter-spacing: -0.02em;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 0.18em;
  max-width: 1052px; margin: 0 auto; /* keeps the name at its original width, so it stacks on large screens */
}
.photo {
  width: 1.5em; height: 0.85em;
  border-radius: 4px;
  background: linear-gradient(135deg, #f6d9df, #fbe9b7 55%, #cfe0f3);
  display: inline-block;
  overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; filter: grayscale(1); }
.intro {
  max-width: 700px;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Sections */
section.block { padding: 96px 0; border-top: 1px solid var(--line); }
.label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 40px;
}
h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -0.02em;
  margin-bottom: 48px;
}

/* Lists (work + writing) */
.list { list-style: none; border-top: 1px solid var(--line); }
.list > li { border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: baseline;
  padding: 20px 0;
}
.row .title { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.row .meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.row .desc, .job .desc { grid-column: 1 / -1; color: var(--muted); max-width: 620px; }
.wins { grid-column: 1 / -1; list-style: none; margin-top: 16px; max-width: 680px; }
.wins li { position: relative; padding-left: 18px; margin-top: 6px; }
.wins li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
/* Work dropdowns */
.job summary, a.row.fill {
  list-style: none; cursor: pointer;
  padding-left: 12px; padding-right: 12px;
  background: linear-gradient(var(--accent-2-soft), var(--accent-2-soft)) no-repeat left / 0% 100%;
  transition: background-size .35s cubic-bezier(.2, .8, .2, 1);
}
.job summary:hover, .job[open] summary, a.row.fill:hover, a.row.fill:focus-visible { background-size: 100% 100%; }
.job summary .meta, a.row.fill .meta { transition: color .2s; }
.job summary:hover .meta, .job[open] summary .meta, a.row.fill:hover .meta { color: var(--ink); }
a.row.fill:focus-visible { outline: none; }
a.row.fill .meta { display: inline-flex; align-items: center; gap: 12px; }
.ext { font-size: 15px; line-height: 1; transition: transform .2s ease; }
a.row.fill:hover .ext { transform: translate(2px, -2px); }
.job summary::-webkit-details-marker { display: none; }
.job summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }
.job .meta { display: inline-flex; align-items: center; gap: 14px; }
.chev {
  width: 9px; height: 9px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform .25s ease, color .2s;
}
.job[open] .chev { transform: translateY(2px) rotate(-135deg); }
.job .work-body { padding: 20px 12px 32px; }
/* Lists with hover rows extend 12px each side, so divider lines match the hover fill exactly while text stays aligned */
.list.fillable { margin-left: -12px; margin-right: -12px; }
.job .wins li::before { background: var(--accent-2); }
.job[open] .work-body { animation: job-open .35s ease-out; }
@keyframes job-open { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .job[open] .work-body { animation: none; } .chev { transition: none; } }
.work-body { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.work-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; display: block; margin-top: 4px; }
.essay-body { display: grid; grid-template-columns: 1fr 240px; gap: 40px; align-items: start; }
.essay-text { max-width: 640px; }
.essay-text p + p { margin-top: 14px; }
.essay-text .desc { margin-bottom: 18px; }
.essay-img { width: 100%; display: block; border-radius: 4px; }
figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

/* About */
.about p:not(.label) {
  font-size: clamp(20px, 2.4vw, 28px); line-height: 1.35; letter-spacing: -0.01em;
  max-width: 760px;
}
.about p:not(.label) + p { margin-top: 1em; }
.about-grid { display: grid; grid-template-columns: 1fr 280px; gap: 48px; align-items: start; }
.about-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; display: block; }
.label.sub { margin: 80px 0 24px; }

/* Contact */

/* Contact blocks: same pale-blue sweep as the work/writing rows */
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-left: -12px; margin-right: -12px;
}
.contact-block {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-content: space-between;
  min-height: 200px; padding: 16px 12px 20px;
  background: linear-gradient(var(--accent-2-soft), var(--accent-2-soft)) no-repeat left / 0% 100%;
  transition: background-size .35s cubic-bezier(.2, .8, .2, 1);
}
.contact-block + .contact-block { border-left: 1px solid var(--line); }
.contact-block:hover, .contact-block:focus-visible { background-size: 100% 100%; outline: none; }
.cb-handle { font-size: 13px; color: var(--muted); transition: color .2s; }
.contact-block:hover .cb-handle { color: var(--ink); }
.contact-block .ext { justify-self: end; }
.contact-block:hover .ext { transform: translate(2px, -2px); }
.cb-name { grid-column: 1 / -1; font-family: var(--serif); font-size: clamp(36px, 4.5vw, 56px); line-height: 1; }

@media (max-width: 640px) {
  nav ul { gap: 13px; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row .title { font-size: 24px; }
  .row .meta { white-space: normal; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .work-body { grid-template-columns: 1fr; gap: 48px; } /* room for an annotation between highlights and photo */
  .work-img { max-width: 360px; }
  .contact-grid { grid-template-columns: 1fr; }
  .essay-body { grid-template-columns: 1fr; gap: 24px; }
  .essay-body figure { max-width: 240px; }
  .contact-block { min-height: 130px; }
  .contact-block + .contact-block { border-left: 0; border-top: 1px solid var(--line); }
  .about-img { max-width: 280px; }
  section.block { padding: 64px 0; }
  .wrap { padding-left: 16px; padding-right: 16px; }
}

/* "All writing" link under the Writing list on the home page */
.more-link {
  display: inline-block; margin-top: 28px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink); border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.more-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Writing page ---------- */
nav ul a[aria-current="page"] { color: var(--accent); }
section.writing-page { border-top: 0; padding-top: 48px; }
.back { font-size: 13px; color: var(--muted); transition: color .2s; }
.back:hover { color: var(--accent); }
.page-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 9vw, 120px); line-height: 1; letter-spacing: -0.02em;
  margin: 32px 0 20px;
}
.page-intro { font-size: clamp(18px, 2vw, 22px); line-height: 1.4; max-width: 620px; margin: 0 0 48px auto; text-align: right; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filters button {
  font: inherit; font-size: 13px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.filters button:hover { border-color: var(--accent-2); }
.filters button[aria-pressed="true"] { background: var(--accent-2-soft); border-color: var(--accent-2-soft); }

.post-head, .post {
  display: grid; grid-template-columns: 80px 1fr 180px 24px; gap: 24px; align-items: baseline;
}
.post-head {
  padding: 0 12px 12px; margin: 0 -12px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.post {
  padding: 22px 12px;
  background: linear-gradient(var(--accent-2-soft), var(--accent-2-soft)) no-repeat left / 0% 100%;
  transition: background-size .35s cubic-bezier(.2, .8, .2, 1);
}
.post.fill:hover, .post.fill:focus-visible { background-size: 100% 100%; outline: none; }
.post.fill:hover .ext { transform: translate(2px, -2px); }
.post-year, .post-type { font-size: 13px; color: var(--muted); }
.post.fill:hover .post-year, .post.fill:hover .post-type, .post.fill:hover .post-about { color: var(--ink); }
.post-main { display: flex; flex-direction: column; gap: 6px; }
.post-main .title { font-family: var(--serif); font-size: 28px; line-height: 1.15; }
.post-about { font-size: 14px; color: var(--muted); transition: color .2s; }
.empty { padding: 32px 0; color: var(--muted); }

@media (max-width: 640px) {
  .post-head { display: none; }
  .post { grid-template-columns: 1fr auto; gap: 6px 16px; }
  .post-year { grid-row: 1; grid-column: 1; }
  .post-main { grid-column: 1 / -1; }
  .post-type { grid-column: 1; }
  .post .ext { grid-row: 1; grid-column: 2; }
  .post-main .title { font-size: 24px; }
}

/* Project rows: description darkens with the hover fill, like the other row text */
a.row.fill .desc { margin-top: 4px; transition: color .2s; }
a.row.fill:hover .desc { color: var(--ink); }

/* Links that stay on the page (e.g. Founder narratives → Contact): arrow nudges right, not up */
a.row.fill[href^="#"]:hover .ext { transform: translateX(3px); }

/* Writing page intro: right-aligned on wider screens, normal on phones where it fills the width */
@media (max-width: 640px) {
  .page-intro { text-align: left; margin-left: 0; }
}

/* ---------- Gallery: one row you click or swipe through ---------- */
.g-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 48px; }
.g-head h2 { margin-bottom: 0; }
.g-nav { display: flex; gap: 8px; }
.g-nav button {
  width: 40px; height: 40px; display: grid; place-items: center;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer; transition: border-color .2s, background-color .2s, opacity .2s;
}
.g-nav button:hover:not(:disabled) { background: var(--accent-2-soft); border-color: var(--accent-2-soft); }
.g-nav button:disabled { opacity: .35; cursor: default; }

.gallery {
  display: flex; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; outline: none;
}
.gallery::-webkit-scrollbar { display: none; }
.g-item {
  position: relative; margin: 0; flex: 0 0 calc((100% - 48px) / 4);
  scroll-snap-align: start; border-radius: 4px; overflow: hidden; cursor: pointer; outline: none;
}
.g-item img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: opacity .35s ease; }
.g-item figcaption {
  position: absolute; left: 18px; right: 18px; bottom: 18px;
  font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink);
  opacity: 0; transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
.g-item { touch-action: manipulation; -webkit-tap-highlight-color: transparent; } /* no tap delay or grey flash on phones */
.g-item:focus-visible img, .g-item.show img { opacity: .18; }
.g-item:focus-visible figcaption, .g-item.show figcaption { opacity: 1; transform: none; }
/* Hover only on devices with a real mouse/trackpad; phones use a tap (the .show class) so it fades in straight away */
@media (hover: hover) and (pointer: fine) {
  .g-item:hover img { opacity: .18; }
  .g-item:hover figcaption { opacity: 1; transform: none; }
}
.g-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-2); }
@media (max-width: 900px) { .g-item { flex-basis: calc((100% - 32px) / 3); } }
@media (max-width: 640px) {
  .g-head { margin-bottom: 32px; }
  .gallery { gap: 10px; }
  .g-item { flex-basis: 72%; } /* a peek of the next photo shows there's more */
  .g-item figcaption { left: 14px; right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .gallery { scroll-behavior: auto; } .g-item img, .g-item figcaption { transition: none; } }

/* Phones: bigger tap areas for small links, without changing how they look */
@media (max-width: 640px) {
  nav ul a { display: inline-block; padding: 14px 0; }
  .mark { display: inline-block; padding: 12px 8px 12px 0; }
  .more-link { padding: 12px 0; margin-top: 16px; }
  .filters button { padding: 11px 16px; }
}

/* ---------- Phone hero: big two-line name, photo fills the space below, intro at the bottom ---------- */
@media (max-width: 640px) {
  .hero { padding-top: 20px; padding-bottom: 28px; }
  @supports (height: 100svh) { .hero { padding-top: 20px; } }
  .name {
    flex: 1 1 auto;
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
    gap: 0; max-width: none; margin: 0;
    font-size: 22vw; line-height: 0.95;
  }
  .name > span:first-child { order: 1; }
  .name > span:last-child { order: 2; }
  .photo {
    order: 3; position: relative;
    flex: 1 1 0; align-self: stretch; /* grows into whatever space is left, no more */
    width: 100%; height: auto; min-height: 110px;
    margin-top: 20px; border-radius: 4px;
  }
  .photo img { position: absolute; inset: 0; object-position: 50% 28%; }
  .intro { margin-top: 20px; }
}
