/* Field Notebook · Greenhouse paper. One light look by design.
   Breakpoints: phone < 640 (Spine + bottom tabs), tablet 640–1000 (horizontal Line, header nav), desktop > 1000. */
:root {
  color-scheme: light;
  --ground: #E6F2EA; --paper: #F6F8F1; --ink: #0E3B2C; --link: #1A6B43;
  --graphite: #59625D; --sun: #F4C430; --coral: #EE6A4D; --grid: #D3E6DA;
  --ey: #CBE3D3; --mid: #72B38D; --leaf: #1F7A4D;
  --f-display: "Instrument Serif", "Serif Fallback", Georgia, serif;
  --f-body: "IBM Plex Sans", "Sans Fallback", Arial, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", "Mono Fallback", ui-monospace, Menlo, monospace;
  --name-col: 140px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.55 var(--f-body);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
a { color: var(--link); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--paper); border: 1.5px solid var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }
.mono { font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.small { font-size: 14px; color: var(--graphite); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }

/* Header */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; align-items: center; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.brand { color: var(--ink); text-decoration: none; }
.brand .short { display: none; }
.mark { display: inline-grid; place-content: center; width: 44px; height: 44px; border-radius: 8px; background: var(--ink); color: var(--paper); font: 400 24px/1 var(--f-display); text-decoration: none; }
.mark:hover { background: var(--leaf); }
.top-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.top-nav a { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.top-nav a span { color: var(--graphite); margin-right: 4px; }
.top-nav a:hover, .top-nav a[aria-current="true"] { color: var(--link); text-decoration: underline; text-underline-offset: 4px; }

/* Hero */
.hero { display: grid; gap: 14px; padding-block: 28px 24px; }
h1 { margin: 0; font: 400 clamp(56px, 10vw, 128px)/.88 var(--f-display); letter-spacing: -.02em; }
.sub { margin: 0; max-width: 44ch; font: 400 clamp(17px, 1.6vw, 20px)/1.5 var(--f-body); }
@media (min-width: 1100px) { .hero { grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 40px; } .sub { padding-bottom: 10px; } }

h2 { margin: 0; font: 400 clamp(34px, 5vw, 48px)/1 var(--f-display); }
h3 { margin: 0; font: 400 28px/1.05 var(--f-display); }

/* I. Experience */
.line { background: var(--paper); border: 1.5px solid var(--ink); border-top-width: 2px; padding: 18px clamp(14px, 3vw, 28px) 20px; display: grid; gap: 14px; }

/* No-JS list (and the source of truth for the timeline) */
.roles { margin: 0; padding: 0; list-style: none; display: grid; gap: 22px; }
.roles .role { display: grid; gap: 4px; border-top: 1px solid var(--grid); padding-top: 12px; }
.roles .dates { margin: 0; color: var(--graphite); }
.roles .role-title { margin: 0; }
.roles ul { margin: 4px 0 0; padding-left: 20px; }
.js .roles { display: none; }

.timeline { display: grid; grid-template-columns: var(--name-col) minmax(0, 1fr); gap: 0 12px; }
.ticks { grid-column: 2; position: relative; height: 22px; border-top: 1px solid var(--ink); }
.ticks span { position: absolute; top: 4px; transform: translateX(-50%); font: 500 12px var(--f-mono); color: var(--graphite); }
.lane-name { font: 400 22px/1 var(--f-display); padding-block: 8px; display: flex; flex-direction: column; justify-content: center; min-height: 44px; }
.lane-name small { font: 500 12px var(--f-mono); color: var(--graphite); margin-top: 4px; }
.track { position: relative; min-height: 48px; border-bottom: 1px dashed var(--grid); }
.bar {
  appearance: none; margin: 0; position: absolute; top: 8px; bottom: 8px; border: 1.5px solid var(--ink);
  font: 500 13px/1 var(--f-mono); padding: 0 8px; text-align: left; overflow: hidden; white-space: nowrap;
  transform-origin: left; outline: 3px solid transparent; outline-offset: 2px;
  transition: transform .7s cubic-bezier(.2,.7,.2,1), outline-color .12s linear;
}
.bar.dark { background: var(--leaf); color: #fff; }
.bar.mid { background: var(--mid); }
.bar.ey { background: var(--ey); }
.bar .seg { pointer-events: none; }
.bar.split { border-left: 0; }
.bar.split::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: repeating-linear-gradient(to bottom, var(--ink) 0 4px, transparent 4px 7px); transform: scaleY(0); transform-origin: top; transition: transform .35s ease-out 1.1s; }
.bar.before-split { border-right: 0; }
.timeline.in .bar.split::before { transform: scaleY(1); }
.timeline:not(.in) .bar { transform: scaleX(0); }
.bar[aria-pressed="true"] { outline-color: var(--ink); z-index: 1; }
.bar:focus-visible { outline: 3px solid var(--ink); }

.detail { border-top: 4px double var(--ink); padding-top: 12px; display: grid; gap: 6px; align-content: start; }
.detail .hd { display: grid; gap: 6px; align-content: start; }
.detail h3 { font-size: 32px; line-height: 1; }
.detail ul { margin: 0; padding-left: 20px; }
@media (min-width: 1001px) { .detail { grid-template-columns: 280px 1fr; column-gap: 40px; } }
.cv-line { margin: 0; }
.cv-line a, .cv { min-height: 44px; display: inline-flex; align-items: center; }

/* The Spine (phones). Built by site.js only below 640px. */
.spine { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; }
.spine .yrs { position: relative; }
.spine .yrs span { position: absolute; left: 0; font: 500 11px var(--f-mono); color: var(--graphite); transform: translateY(-50%); }
.spine .col { position: relative; border-left: 1px solid var(--ink); }
.vseg {
  position: absolute; left: 8px; right: 0; border: 1.5px solid var(--ink); text-align: left; padding: 4px 8px;
  display: flex; flex-direction: column; justify-content: center; overflow: hidden; transform-origin: top;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), outline-color .12s; outline: 3px solid transparent; outline-offset: 2px;
}
.vseg b { font: 400 18px/1 var(--f-display); }
.vseg small { font: 500 11px var(--f-mono); }
.vseg.short { padding: 0 8px; }
.vseg.short b { font-size: 16px; white-space: nowrap; }
.vseg.short small { display: none; }
.vseg.dark { background: var(--leaf); color: #fff; }
.vseg.mid { background: var(--mid); }
.vseg.ey { background: var(--ey); }
.vseg[aria-pressed="true"] { outline-color: var(--ink); z-index: 1; }

/* Bottom sheet */
.scrim { position: fixed; inset: 0; background: rgba(14,59,44,.35); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--paper); border-top: 2px solid var(--ink);
  border-radius: 18px 18px 0 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); max-height: 75vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.sheet.open { transform: none; }
.sheet:focus { outline: none; }
.grab { touch-action: none; cursor: grab; height: 28px; position: relative; }
.grab::after { content: ""; position: absolute; left: 50%; top: 10px; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: var(--graphite); }
.sheet h3 { margin: 4px 0; }
.sheet ul { padding-left: 18px; margin: 8px 0; font-size: 15px; }
.sheet .more { background: none; border: 0; padding: 0; min-height: 44px; color: var(--link); text-decoration: underline; font-size: 14px; }
.sheet-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.pill { border: 1.5px solid var(--ink); background: var(--ground); border-radius: 999px; min-height: 44px; padding: 0 14px; }
.pill:disabled { opacity: .45; cursor: default; }

/* Sections after Experience */
.block { display: grid; gap: 18px; border-top: 4px double var(--ink); margin-top: 48px; padding-top: 22px; }
.lede { margin: 0; max-width: 62ch; }
.sub-h { margin-top: 10px; }

/* II. Projects: numbered plates */
.plates { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plate { position: relative; background: var(--paper); border: 1.5px solid var(--ink); display: grid; grid-template-rows: auto 150px 1fr; transition: transform .15s, box-shadow .15s; }
.plate:hover, .plate:focus-within { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--mid); }
.plate-head { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--ink); }
.fig { margin: 0; border-bottom: 1px solid var(--ink); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 12px 12px; }
.fig svg { width: 100%; height: 100%; display: block; }
.fig .flow { stroke-dasharray: 4 4; }
.plate:hover .fig .flow, .plate:focus-within .fig .flow { animation: flow .8s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -16; } }
.plate-body { padding: 12px 14px 14px; display: grid; gap: 8px; align-content: start; }
.plate-body p { margin: 0; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips span { font: 500 12px var(--f-mono); border: 1px solid var(--ink); padding: 1px 6px; background: var(--ground); }
.links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; }
.links a { min-height: 44px; display: inline-flex; align-items: center; }
.fig-toggle { display: none; }

.pages { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page { position: relative; transition: transform .15s, box-shadow .15s; background: var(--paper); border: 1.5px solid var(--ink); padding: 14px 16px; display: grid; gap: 4px; background-image: repeating-linear-gradient(transparent 0 27px, var(--grid) 27px 28px); transform: rotate(-.6deg); }
.page + .page { transform: rotate(.5deg); }
.page a { font: 400 24px/1.1 var(--f-display); text-decoration: none; }
.page:hover, .page:focus-within { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--mid); }
.page:hover a { text-decoration: underline; }
/* Whole card is clickable: the primary link's ::after covers the card; other controls sit above it. */
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.plate .links a:not(.stretch), .fig-toggle { position: relative; z-index: 2; }
.plate:hover .stretch { text-decoration-thickness: 2px; }

/* III. Lab */
.lab { background: var(--paper); border: 1.5px solid var(--ink); padding: 16px; display: grid; gap: 10px; max-width: 640px; }
.demo { border: 1.5px solid var(--ink); background: var(--ground); padding: 12px; display: grid; gap: 10px; }
.demo p { margin: 0; font-size: 15px; }
.still { display: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1.5px solid var(--ink); background: var(--leaf); color: #fff; min-height: 44px; padding: 0 16px; border-radius: 999px; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.play { display: none; }
pre.out { margin: 0; max-height: 360px; overflow: auto; font: 400 12px/1.5 var(--f-mono); background: var(--paper); border: 1px solid var(--ink); padding: 8px; white-space: pre-wrap; }
.code summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--link); font-size: 14px; }
html:not(.js) .demo { display: none; }

/* IV. Contact: the postcard */
.postcard { background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 6px 6px 0 var(--mid); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.msg { padding: 28px; border-right: 1.5px dashed var(--graphite); display: grid; gap: 14px; align-content: start; }
.msg p { margin: 0; }
.msg .big { font: italic 400 clamp(26px, 3vw, 36px)/1.15 var(--f-display); max-width: 22ch; }
.addr { padding: 28px; display: grid; align-content: start; }
.stamp { justify-self: end; width: 86px; height: 98px; border: 2px dashed var(--ink); background: var(--ground); display: grid; place-content: center; justify-items: center; gap: 4px; user-select: none; text-align: center; font: 500 11px/1.3 var(--f-mono); text-transform: uppercase; margin-bottom: 18px; transform: rotate(3deg); }
.stamp img { display: block; width: 66px; height: 76px; object-fit: cover; border: 1px solid var(--ink); pointer-events: none; }
.aline { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--ink); min-height: 56px; flex-wrap: wrap; }
.aline.last { border-bottom: 0; }
.aline .k { font: 500 12px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--graphite); width: 76px; }
.aline .v { flex: 1; min-width: 0; font: 400 22px/1.2 var(--f-display); overflow-wrap: anywhere; }
.aline .v a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.aline .v a:hover { text-decoration: underline; }
.copy { border: 1.5px solid var(--ink); background: var(--leaf); color: #fff; border-radius: 999px; min-height: 44px; padding: 0 16px; font-size: 14px; }
.copy.done { background: var(--sun); color: var(--ink); }
html:not(.js) .copy { display: none; }

.colo { font-size: 14px; color: var(--graphite); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--ink); padding: 10px 0 40px; margin-top: 48px; }

.tabs { display: none; }

/* Tablet 640–1000 */
@media (max-width: 1000px) {
  :root { --name-col: 110px; }
  .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plates .plate:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .postcard { grid-template-columns: minmax(0, 1fr); }
  .msg { border-right: 0; border-bottom: 1.5px dashed var(--graphite); }
}

/* Phone < 640: the Spine, bottom tabs */
@media (max-width: 639px) {
  body { font-size: 16px; background-size: 20px 20px; }
  .wrap { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .top-nav { display: none; }
  .top { font-size: 11px; }
  .brand:not(.mark) { display: flex; justify-content: space-between; width: 100%; }
  .brand .long { display: none; } .brand .short { display: inline; }
  h1 { font-size: 54px; line-height: .86; }
  .hero { padding-block: 16px 8px; }
  .sub { font-size: 17px; }
  h2 { font-size: 34px; }
  .line { background: transparent; border: 0; padding: 18px 0 0; }
  .block { margin-top: 32px; }
  .plates, .pages { grid-template-columns: minmax(0, 1fr); }
  .plates .plate:nth-child(3) { grid-column: auto; }
  .plate { grid-template-rows: auto; }
  .js .plate .fig { display: none; height: 150px; }
  .js .plate.show-fig .fig { display: block; }
  .js .fig-toggle { display: inline-flex; align-items: center; min-height: 44px; justify-self: start; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font-size: 14px; }
  .plate:hover .fig .flow, .plate:focus-within .fig .flow { animation: none; }
  .plate:hover, .plate:focus-within { transform: none; box-shadow: none; }
  .page, .page + .page, .page:hover, .page:focus-within { transform: none; box-shadow: none; }
  .still { display: grid; place-content: center; height: 90px; border: 1px solid var(--ink); background: repeating-linear-gradient(-45deg, var(--ground) 0 8px, var(--paper) 8px 16px); }
  .demo.played .still { display: none; }
  .play { display: inline; }
  .stamp { display: none; }
  .msg, .addr { padding: 14px; }
  .msg .big { font-size: 22px; }
  .aline { padding: 6px 0; gap: 2px 10px; min-height: 50px; }
  .aline .k { width: auto; }
  .aline .v { flex-basis: 100%; order: 3; font-size: 19px; }
  .copy { min-height: 40px; padding: 0 12px; }
  .colo { margin-top: 32px; }
  .tabs {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 15;
    left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom));
    background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; overflow: hidden;
  }
  .tabs a { min-height: 52px; display: grid; place-content: center; text-align: center; color: var(--ink); text-decoration: none; font: 500 11px var(--f-mono); letter-spacing: .04em; text-transform: uppercase; }
  .tabs a i { font: italic 400 18px/1 var(--f-display); text-transform: none; }
  .tabs a[aria-current="true"] { background: var(--ink); color: var(--paper); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar, .bar.split::before, .vseg, .sheet, .plate { transition: none; }
  .timeline:not(.in) .bar { transform: none; }
  .bar.split::before { transform: none; }
  .plate:hover .fig .flow, .plate:focus-within .fig .flow { animation: none; }
}

/* 404 */
.lost { min-height: 60vh; display: grid; align-content: center; gap: 12px; position: relative; padding-block: 48px; }
.lost .n { font: 400 clamp(72px, 14vw, 160px)/.85 var(--f-display); letter-spacing: -.03em; margin: 0; }
.lost p { margin: 0; max-width: 32ch; font-size: 18px; }
.torn { position: absolute; right: 0; top: 24px; width: clamp(90px, 14vw, 160px); aspect-ratio: 7/11; background: var(--paper); border: 1px solid var(--ink); transform: rotate(8deg); clip-path: polygon(0 0,100% 0,100% 100%,0 100%,6% 90%,0 80%,6% 70%,0 60%,6% 50%,0 40%,6% 30%,0 20%,6% 10%); z-index: -1; }

/* Hero: stack line and quiet link row */
.hero-text { display: grid; gap: 12px; }
.stack { margin: 0; max-width: 60ch; font-size: 13px; line-height: 1.5; opacity: .8; }
.hero-links { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
@media (min-width: 1100px) { .hero-text .sub { padding-bottom: 0; } .hero-text { padding-bottom: 10px; } }

/* Writing heading label and essay blurbs */
.sub-h .mono { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.page p.small { margin: 2px 0 0; }
