/* marckaiohasler.ch
   Built from mockup A2 (image led). Colours: house palette Petrol and Clay.
   Type: Newsreader for reading, Hanken Grotesk for labels. Both self-hosted.
   Motion lives at the end of this file. It only runs when JavaScript has added
   the class "js" to <html> and the reader has not asked for reduced motion.
   Without either, every element is simply visible. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/newsreader-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/hanken-grotesk-normal-latin.woff2") format("woff2");
}

:root {
  --ink: #22303A;
  --ink-light: #33454F;
  --body: #30373E;
  --muted: #67707A;
  --muted-dark: #9DAAB0;
  --border: #DCE1E6;
  --border-strong: #C8D1D6;
  --surface: #F6F8FA;
  --bg: #FFFFFF;
  --petrol: #156E7C;
  --petrol-tint: #EAF3F5;
  --petrol-mid: #C9DEE3;
  --petrol-light: #5DB1BE;
  --indigo: #4A5687;
  --indigo-tint: #F0F1F7;
  --bronze: #8E661F;
  --bronze-tint: #F9F4E8;
  /* sequential ramp on the ink surface: one hue, more activity is lighter */
  --heat-0: #2B3B46;
  --heat-1: #1A6370;
  --heat-2: #1F8494;
  --heat-3: #5DB1BE;
  --heat-4: #C9DEE3;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --page: 74rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(3.5rem, 7.5vw, 6.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--petrol); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4, p, ul, ol, dl, dd, dt, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; }

.wrap { max-width: var(--page); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.sans { font-family: var(--sans); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 50; font-family: var(--sans); }
.skip:focus { left: 0; }

/* ------------------------------------------------------------ top bar */
.bar { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.bar.is-stuck { border-bottom-color: var(--border); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-top: 0.875rem; padding-bottom: 0.875rem; }
.bar-name { font-size: 1.1875rem; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; }
.bar-nav { display: none; gap: 1.75rem; font-family: var(--sans); font-size: 0.9375rem; }
.bar-nav a { color: var(--body); text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.bar-nav a:hover { color: var(--petrol); }
.bar-nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--petrol); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--petrol); transform: scaleX(0); transform-origin: left; display: none; }
.js .progress { display: block; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none; padding: 0.8125rem 1.25rem; border-radius: 4px; border: 1.5px solid var(--petrol); background: var(--petrol); color: #fff; transition: background 0.15s, color 0.15s, transform 0.15s; }
.btn:hover { background: #0F5662; border-color: #0F5662; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--petrol); }
.btn.ghost:hover { background: var(--petrol-tint); border-color: var(--petrol); }
.btn.small { font-size: 0.9375rem; padding: 0.5rem 0.875rem; }
.btn svg { width: 1.125rem; height: 1.125rem; flex: none; }

/* ------------------------------------------------------------ hero */
.hero { padding-top: clamp(2rem, 6vw, 5rem); padding-bottom: var(--section); display: grid; gap: 2rem 3.5rem; }
.hero h1 { font-weight: 300; font-size: clamp(2.125rem, 4.9vw, 4.375rem); line-height: 1.07; letter-spacing: -0.022em; color: var(--ink); text-wrap: balance; }
.hero h1 .w { display: inline-block; }
.hero-meta { display: grid; gap: 1.75rem; }
.available { color: var(--ink); font-size: 1.3125rem; line-height: 1.45; max-width: 33em; }
.contact-block { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-proof { font-family: var(--sans); font-size: 0.9375rem; line-height: 1.45; color: var(--muted); max-width: 34em; }
.hero-proof b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Portrait: a designed monogram tile until a real photo is supplied */
/* On a phone the availability and the contact buttons come before the tile. */
.portrait { max-width: 12rem; order: 3; }
.monogram { position: relative; aspect-ratio: 4 / 5; background: var(--petrol); color: #fff; border-radius: 6px; overflow: hidden; display: grid; place-items: center; }
.monogram::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px), linear-gradient(to right, rgba(255, 255, 255, 0.09) 1px, transparent 1px); background-size: 12.5% 10%; }
.monogram b { position: relative; font-weight: 300; font-size: clamp(4.5rem, 11vw, 7.5rem); line-height: 1; letter-spacing: -0.04em; }
.monogram span { position: absolute; left: 1rem; bottom: 0.875rem; font-family: var(--sans); font-size: 0.8125rem; line-height: 1.3; }
.portrait img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; width: 100%; }

/* ------------------------------------------------------------ chapters */
.chapter { padding-top: var(--section); padding-bottom: var(--section); }
.chapter + .chapter { border-top: 1px solid var(--border); }
.ch-head { display: flex; align-items: baseline; gap: 1rem 1.5rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); position: relative; padding-bottom: 1.25rem; }
.ch-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform-origin: left; }
.ch-num { font-weight: 300; font-size: clamp(2.5rem, 5vw, 4rem); line-height: 0.9; color: var(--petrol); font-variant-numeric: lining-nums; min-width: 0.7em; }
.ch-head h2 { font-weight: 400; font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.1; letter-spacing: -0.018em; color: var(--ink); }
.big { font-weight: 300; font-size: clamp(1.5rem, 2.8vw, 2.25rem); line-height: 1.28; letter-spacing: -0.012em; color: var(--ink); max-width: 26em; text-wrap: pretty; }
.text { max-width: 34em; }
.text + .text { margin-top: 1rem; }
.label { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--petrol); }
figcaption, .caption { font-family: var(--sans); font-size: 0.875rem; line-height: 1.45; color: var(--muted); margin-top: 0.75rem; max-width: 46em; }
.tag { display: inline-block; font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; line-height: 1; padding: 0.3125rem 0.5rem; border-radius: 2px; white-space: nowrap; }
.tag.live { background: var(--petrol); color: #fff; }
.tag.note { background: var(--bronze-tint); color: var(--bronze); box-shadow: inset 0 0 0 1px #E6D8B0; }
.tag.plain { background: var(--surface); color: var(--body); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* 1 Why commodities */
.why-quote { position: relative; }
.why-quote .big { max-width: 24em; }
.why-source { margin-top: 1rem; font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }
.scenes { margin-top: clamp(2.5rem, 5vw, 4rem); display: grid; gap: 2rem; }
.scene { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.scene p { font-size: 1.3125rem; line-height: 1.35; color: var(--ink); }
.ill { width: 100%; height: auto; color: var(--ink); overflow: visible; }
.ill .d { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ill .a { stroke: var(--petrol); }
.ill .fa { fill: var(--petrol-mid); stroke: var(--petrol); stroke-width: 1.6; }
.ill .dash { stroke-dasharray: 4 4; }
.ill .dot { fill: var(--petrol); stroke: none; }
.ill .mute { stroke: var(--border-strong); }
.why-close { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* 2 Zurich and Singapore */
.arc { display: none; color: var(--ink); margin-bottom: 0.25rem; }
.arc .base { fill: none; stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 3 6; }
.arc .go { fill: none; stroke: var(--petrol); stroke-width: 2; stroke-linecap: round; }
.arc circle { fill: var(--bg); stroke: var(--petrol); stroke-width: 2; }
.places { display: grid; gap: 2.5rem 4rem; }
.place h3 { font-weight: 400; font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.1; letter-spacing: -0.015em; color: var(--ink); }
.place .org { margin: 1.25rem 0 1rem; }
.place .text { font-size: 1.1875rem; }
.courses { margin-top: 1.25rem; display: grid; gap: 0.5rem; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.35; }
.courses li { padding: 0.625rem 0.875rem; background: var(--surface); border-left: 0; border-radius: 3px; color: var(--ink); }

/* Logos and typographic badges share one slot size */
.org { display: flex; align-items: center; height: 3.5rem; }
.org img { max-height: 2.75rem; max-width: 9.5rem; width: auto; object-fit: contain; }
.org img.roomy { max-height: 3.5rem; max-width: 11rem; margin-left: -0.375rem; }
.badge { display: inline-flex; align-items: center; gap: 0.625rem; height: 3rem; padding: 0 0.875rem 0 0.25rem; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--bg); font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; line-height: 1.15; color: var(--ink); }
.badge i { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 3px; background: var(--ink); color: #fff; font-family: var(--serif); font-style: normal; font-weight: 400; font-size: 1.0625rem; letter-spacing: -0.02em; }

/* ------------------------------------------------------------ 3 How I work with AI: the centrepiece, on ink */
.ai { background: var(--ink); color: #DCE1E6; border-top: 0; }
.chapter.ai + .chapter { border-top: 0; }
.ai .ch-head::after { background: #5E737D; }
.ai .ch-num { color: var(--petrol-light); }
.ai .ch-head h2, .ai .big, .ai h3 { color: #fff; }
.ai a { color: #fff; text-decoration-color: var(--petrol-light); }
.ai a:focus-visible, .ai button:focus-visible { outline-color: #fff; }
.ai .label { color: var(--petrol-light); }
.ai .caption { color: var(--muted-dark); }

.tokens { margin-top: clamp(3rem, 6vw, 5rem); display: grid; gap: 2.5rem 4rem; }
.counter { font-weight: 300; font-size: clamp(2.5rem, 8.6vw, 6.75rem); line-height: 0.95; letter-spacing: -0.035em; color: #fff; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.counter-label { margin-top: 0.875rem; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.4; color: #fff; max-width: 30em; }
.counter-sub { margin-top: 0.375rem; font-family: var(--sans); font-size: 0.875rem; line-height: 1.45; color: var(--muted-dark); max-width: 34em; }

.split { margin-top: 2.5rem; }
.split-bar { position: relative; height: 2.75rem; background: var(--ink-light); border-radius: 3px; overflow: hidden; }
.split-read { position: absolute; inset: 0; background: var(--heat-2); transform-origin: left; }
.split-written { position: absolute; top: 0; bottom: 0; right: 0; width: max(2px, 0.118%); background: #fff; }
.split-legend { margin-top: 1rem; display: grid; gap: 1rem 2.5rem; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.4; }
.split-legend div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 0.625rem; align-items: start; }
.split-legend i { width: 0.875rem; height: 0.875rem; border-radius: 2px; margin-top: 0.25rem; background: var(--heat-2); }
.split-legend .written i { background: #fff; }
.split-legend b { display: block; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.split-legend span { color: var(--muted-dark); }
.split-note { margin-top: 1.5rem; font-size: 1.3125rem; line-height: 1.4; color: #fff; max-width: 28em; }

.heat h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.hm { margin-top: 0.875rem; display: grid; grid-template-columns: auto repeat(var(--weeks), minmax(0, 1fr)); gap: 3px; max-width: 26rem; font-family: var(--sans); font-size: 0.6875rem; line-height: 1; color: var(--muted-dark); }
.hm .mo { grid-row: 1; width: 0; white-space: nowrap; padding-bottom: 0.25rem; }
.hm .wd { grid-column: 1; padding-right: 0.5rem; align-self: center; line-height: 0; }
.hm .c { aspect-ratio: 1; background: var(--heat-0); border-radius: 2px; }
.hm .c:hover { outline: 1.5px solid #fff; outline-offset: 1px; }
.hm .l1 { background: var(--heat-1); }
.hm .l2 { background: var(--heat-2); }
.hm .l3 { background: var(--heat-3); }
.hm .l4 { background: var(--heat-4); }
.legend { display: flex; align-items: center; gap: 0.3125rem; margin-top: 0.75rem; font-family: var(--sans); font-size: 0.75rem; color: var(--muted-dark); }
.legend i { width: 0.75rem; height: 0.75rem; border-radius: 2px; background: var(--heat-0); }
.legend i:nth-of-type(2) { background: var(--heat-1); }
.legend i:nth-of-type(3) { background: var(--heat-2); }
.legend i:nth-of-type(4) { background: var(--heat-3); }
.legend i:nth-of-type(5) { background: var(--heat-4); }
.tip { position: fixed; z-index: 40; pointer-events: none; background: #fff; color: var(--ink); font-family: var(--sans); font-size: 0.8125rem; line-height: 1.4; padding: 0.4375rem 0.625rem; border-radius: 3px; max-width: 16rem; opacity: 0; transition: opacity 0.1s; box-shadow: 0 4px 16px rgba(34, 48, 58, 0.25); }
.tip.on { opacity: 1; }
.tip b { display: block; font-weight: 600; }

/* The method diagram: one column per mind, one row per step */
.method { margin-top: clamp(4rem, 8vw, 7rem); }
.method-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 2rem; }
.method-head h3 { font-weight: 400; font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.12; letter-spacing: -0.015em; }
.replay { display: none; font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: #fff; background: transparent; border: 1.5px solid #5E737D; border-radius: 4px; padding: 0.4375rem 0.75rem; cursor: pointer; }
.replay:hover { border-color: #fff; }
.method-intro { margin-top: 1rem; max-width: 34em; }
.flow { --lanes: 5; margin-top: 2.25rem; }
.lanes, .lane-heads { display: grid; grid-template-columns: repeat(var(--lanes), minmax(0, 1fr)); }
.lane-heads { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; line-height: 1.15; color: #fff; text-align: center; padding-bottom: 0.625rem; border-bottom: 1px solid #5E737D; }
.lane-heads span { padding: 0 0.125rem; }
.step { display: grid; gap: 0.25rem 2rem; padding: 0; }
.lanes { position: relative; min-height: 3.5rem; }
.lanes i { position: relative; display: grid; place-items: center; }
.lanes i::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #42555F; }
.lanes i.on::after { content: ""; position: relative; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--petrol-light); box-shadow: 0 0 0 4px var(--ink); }
.lanes i.lead::after { width: 1.5rem; height: 1.5rem; background: #fff; box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--petrol-light); }
.lanes i.check::after { border-radius: 3px; background: #fff; }
/* a bar joins the minds that work on the same step */
.lanes .join { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--petrol-light); left: calc((var(--from) - 0.5) * 100% / var(--lanes)); width: calc((var(--to) - var(--from)) * 100% / var(--lanes)); transform-origin: left; }
.step-text { padding: 0 0 1.75rem; }
.step-text h4 { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; line-height: 1.3; color: #fff; }
.step-text h4 span { color: var(--petrol-light); font-variant-numeric: tabular-nums; margin-right: 0.375rem; }
.step-text p { font-size: 1.0625rem; line-height: 1.5; margin-top: 0.25rem; max-width: 30em; }

.checkable { margin-top: clamp(3rem, 6vw, 5rem); display: grid; gap: 2rem 4rem; }
.checkable h3 { font-weight: 400; font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.12; letter-spacing: -0.015em; }
.checkable .text { margin-top: 1rem; }
.checks { display: grid; gap: 0.75rem; }
.checks li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.875rem; align-items: start; background: var(--ink-light); padding: 1rem 1.125rem; border-radius: 4px; font-size: 1.0625rem; line-height: 1.45; color: #fff; }
.checks svg { width: 1.75rem; height: 1.75rem; color: var(--petrol-light); margin-top: 0.0625rem; }
.checks svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ai-close { margin-top: clamp(3rem, 6vw, 5rem); padding-top: 1.75rem; border-top: 1px solid #5E737D; }

/* ------------------------------------------------------------ 4 What I built */
.project + .project { margin-top: clamp(4.5rem, 9vw, 8rem); }
.project-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 1.75rem; }
.project-head h3 { font-weight: 400; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); margin-right: 0.25rem; }
.project-head a { font-family: var(--sans); font-size: 1rem; }

.frame { border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--bg); box-shadow: 0 1px 2px rgba(34, 48, 58, 0.06), 0 14px 36px -14px rgba(34, 48, 58, 0.2); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.frame-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5625rem 0.875rem; background: var(--surface); border-bottom: 1px solid var(--border); font-family: var(--sans); font-size: 0.8125rem; line-height: 1; color: var(--muted); }
.frame-dots { display: flex; gap: 0.3125rem; }
.frame-dots i { width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--border-strong); }
.frame-url { flex: 1; max-width: 22rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 0.3125rem 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame img { width: 100%; }
a.frame-link { display: block; text-decoration: none; color: inherit; }
a.frame-link:hover .frame, .frame.lift:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(34, 48, 58, 0.06), 0 24px 48px -16px rgba(34, 48, 58, 0.28); }
.combo { position: relative; padding-bottom: 7%; padding-right: 0; }
.phone { position: absolute; right: 4%; bottom: 0; width: 27%; max-width: 15rem; border: 0.375rem solid var(--ink); border-radius: 1.5rem; overflow: hidden; background: var(--ink); box-shadow: 0 18px 40px -14px rgba(34, 48, 58, 0.45); }
.phone img { width: 100%; border-radius: 1.125rem; }

.story { margin-top: 2.5rem; display: grid; gap: 2rem 3rem; counter-reset: none; }
.story div { border-top: 2px solid var(--ink); padding-top: 1rem; }
.story h4 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--petrol); margin-bottom: 0.5rem; }
.story p { font-size: 1.1875rem; line-height: 1.5; }
.story p + p { margin-top: 0.75rem; }
.project-cta { margin-top: 2.25rem; }

/* thesis */
.thesis-title { max-width: 30em; }
.metals { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.metal { position: relative; aspect-ratio: 1; background: var(--petrol-tint); border: 1px solid var(--petrol-mid); border-radius: 6px; padding: 0.875rem 1rem; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.25s var(--ease), background 0.2s, color 0.2s; color: var(--ink); max-height: 13rem; }
.metal:hover { transform: translateY(-4px); background: var(--petrol); color: #fff; }
.metal b { font-weight: 300; font-size: clamp(3rem, 7vw, 5rem); line-height: 0.9; letter-spacing: -0.03em; }
.metal span { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; }
.metals-note { margin-top: 1rem; }

.pipe { margin-top: 1.5rem; --line: var(--border-strong); }
.pipe-row { display: grid; gap: 0.75rem; }
.pipe-box, .pipe-wide { background: var(--bg); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0.875rem 1rem; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.4; }
.pipe-box b, .pipe-wide b { display: block; font-weight: 600; color: var(--ink); margin-bottom: 0.125rem; }
.pipe-src .pipe-box { background: var(--surface); }
.pipe-wide { text-align: left; }
.pipe-out { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.pipe-out b { color: #fff; }
.pipe-link { height: 1.5rem; position: relative; }
.pipe-link::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; margin-left: -0.75px; background: var(--line); transform-origin: top; }
.pipe-link.three { display: none; }
.charts { margin-top: 3rem; display: grid; gap: 2.5rem; }
.paper { border: 1px solid var(--border-strong); background: var(--bg); padding: 0.625rem; box-shadow: 0 1px 2px rgba(34, 48, 58, 0.06), 0 14px 36px -14px rgba(34, 48, 58, 0.2); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.paper:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(34, 48, 58, 0.06), 0 24px 48px -16px rgba(34, 48, 58, 0.28); }
.thesis-grid { display: grid; gap: 3rem 4rem; }
.sub { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 0.25rem; }

/* smaller projects, with designed empty frames */
.pair { display: grid; gap: clamp(3.5rem, 7vw, 5rem) 3rem; }
.pair h3 { font-weight: 400; font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.12; letter-spacing: -0.015em; color: var(--ink); margin-top: 1.5rem; }
.pair .text { margin-top: 0.75rem; }
.pair .tag { margin-top: 0.625rem; }
.empty { position: relative; aspect-ratio: 16 / 10; background-color: var(--petrol-tint); background-image: linear-gradient(var(--petrol-mid) 1px, transparent 1px), linear-gradient(to right, var(--petrol-mid) 1px, transparent 1px); background-size: 2rem 2rem; background-position: -1px -1px; display: grid; place-items: center; }
.empty span { background: var(--bg); border: 1px solid var(--petrol-mid); border-radius: 999px; padding: 0.4375rem 0.875rem; font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; color: var(--petrol); }
.empty.alt { background-color: var(--indigo-tint); background-image: linear-gradient(#D5D9EA 1px, transparent 1px), linear-gradient(to right, #D5D9EA 1px, transparent 1px); }
.empty.alt span { border-color: #D5D9EA; color: var(--indigo); }

/* ------------------------------------------------------------ 5 The path so far: timeline */
.tl { position: relative; margin-top: 1rem; }
.tl-line { position: absolute; left: 0.5rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--border); }
.tl-line i { position: absolute; inset: 0; background: var(--petrol); transform-origin: top; }
.tl-sides { display: none; }
.st { position: relative; padding: 0 0 2.5rem 2.25rem; }
.st:last-child { padding-bottom: 0; }
.st::before { content: ""; position: absolute; left: 0; top: 0.3125rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--bg); border: 2px solid var(--petrol); z-index: 1; }
.st.now::before { background: var(--petrol); box-shadow: 0 0 0 5px var(--petrol-tint); }
.st-when { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--petrol); font-variant-numeric: tabular-nums; }
.st-kind { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin-left: 0.5rem; }
.st .org { margin-top: 0.625rem; }
.st h3 { margin-top: 0.625rem; font-weight: 500; font-size: 1.3125rem; line-height: 1.25; color: var(--ink); }
.st p { font-size: 1.0625rem; line-height: 1.5; margin-top: 0.25rem; max-width: 26em; }
.st p.more { color: var(--muted); }
.st.now h3 { font-weight: 400; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.012em; }
.langs { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 1.5rem; border-top: 1px solid var(--border); display: grid; gap: 1rem 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.langs dt { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--ink); }
.langs dd { font-family: var(--sans); font-size: 0.9375rem; color: var(--muted); }

/* ------------------------------------------------------------ away from the desk */
.away { padding-top: 0; padding-bottom: var(--section); }
.gallery { border: 1px solid var(--border); border-radius: 6px; }
.gallery summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; padding: 1rem 1.25rem; }
.gallery summary::-webkit-details-marker { display: none; }
.thumbs { display: flex; gap: 0.375rem; }
.thumbs i { width: 2.75rem; height: 2.75rem; border-radius: 3px; background: var(--petrol-tint); border: 1px solid var(--petrol-mid); position: relative; }
.thumbs i:nth-child(2) { background: var(--indigo-tint); border-color: #D5D9EA; }
.thumbs i:nth-child(3) { background: var(--bronze-tint); border-color: #E6D8B0; }
.gallery-title { font-size: 1.3125rem; line-height: 1.3; color: var(--ink); flex: 1; min-width: 12rem; }
.gallery-open { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--petrol); display: inline-flex; align-items: center; gap: 0.5rem; }
.gallery-open::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
.gallery[open] .gallery-open::after { transform: rotate(-135deg) translateY(-2px); }
.gallery .when-open { display: none; }
.gallery[open] .when-open { display: inline; }
.gallery[open] .when-closed { display: none; }
.photo-grid { padding: 0.25rem 1.25rem 1.25rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.photo-frame { position: relative; aspect-ratio: 4 / 5; background: var(--petrol-tint); border-radius: 4px; display: grid; place-items: end start; padding: 0.75rem; font-family: var(--sans); font-size: 0.8125rem; color: var(--petrol); }
.photo-frame:nth-child(3n+2) { background: var(--indigo-tint); color: var(--indigo); }
.photo-frame:nth-child(3n) { background: var(--bronze-tint); color: var(--bronze); }
/* viewfinder corners */
.photo-frame::before, .photo-frame::after { content: ""; position: absolute; width: 1.25rem; height: 1.25rem; border: 1.5px solid currentColor; opacity: 0.55; }
.photo-frame::before { left: 0.75rem; top: 0.75rem; border-right: 0; border-bottom: 0; }
.photo-frame::after { right: 0.75rem; top: 0.75rem; border-left: 0; border-bottom: 0; }
.photo-frame.wide { aspect-ratio: 3 / 2; grid-column: span 2; }

/* ------------------------------------------------------------ 6 What I am looking for: the closing contact block */
.closing { background: var(--petrol); color: #fff; border-top: 0; }
.closing .ch-head::after { background: rgba(255, 255, 255, 0.5); }
.closing .ch-num, .closing .ch-head h2, .closing .big { color: #fff; }
.closing .big { max-width: 22em; font-size: clamp(1.75rem, 3.6vw, 3rem); line-height: 1.16; }
.closing .text { margin-top: 1.5rem; color: #fff; }
.closing .contact-block { margin-top: 2.5rem; }
.closing .btn { background: #fff; border-color: #fff; color: var(--petrol); font-size: 1.0625rem; padding: 1rem 1.5rem; }
.closing .btn:hover { background: var(--petrol-tint); border-color: var(--petrol-tint); }
.closing .btn.ghost { background: transparent; color: #fff; }
.closing .btn.ghost:hover { background: rgba(255, 255, 255, 0.14); border-color: #fff; }
.closing a:focus-visible { outline-color: #fff; }

.foot { background: var(--ink); color: var(--muted-dark); font-family: var(--sans); font-size: 0.875rem; line-height: 1.5; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 1.5rem; padding-bottom: 2rem; }
.foot a { color: #fff; }

/* ------------------------------------------------------------ wider screens */
@media (min-width: 40rem) {
  .scenes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
  .scene { grid-template-columns: 1fr; align-items: start; gap: 1rem; }
  .scene .ill { max-width: 13rem; }
  .split-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pipe-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipe-link.one { display: none; }
  .pipe-link.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
  .pipe-link.three::before { display: none; }
  .pipe-link.three i { position: relative; }
  .pipe-link.three i::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; margin-left: -0.75px; background: var(--line); transform-origin: top; }
  /* three lines gather into one */
  .pipe-link.gather { height: 2.25rem; }
  .pipe-link.gather::before { top: 50%; }
  .pipe-link.gather i::before { bottom: 50%; }
  .pipe-link.gather::after { content: ""; position: absolute; top: 50%; left: calc(100% / 6); right: calc(100% / 6); height: 1.5px; margin-top: -0.75px; background: var(--line); }
  .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .langs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 56rem) {
  .bar-nav { display: flex; }
  .hero { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: start; }
  .portrait { max-width: none; order: 0; grid-row: span 2; padding-top: 0.5rem; }
  .hero-meta { grid-column: 1; }
  .places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arc { display: block; }
  .tokens { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: end; }
  .step { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
  .lanes { min-height: 5.25rem; height: 100%; }
  .step-text { padding: 1rem 0; }
  .lane-heads { width: calc(5 / 12 * (100% - 2rem)); font-size: 0.8125rem; }
  .checkable { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .thesis-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .thesis-grid .metals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone { right: 5%; width: 21%; }
  .combo { padding-bottom: 5%; }

  /* timeline: one axis in the middle, education on the left, experience on the right */
  .tl-sides { display: grid; grid-template-columns: 1fr 1fr; font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--ink); margin-bottom: 2rem; }
  .tl-sides span:first-child { text-align: right; padding-right: 3rem; }
  .tl-sides span:last-child { padding-left: 3rem; }
  .tl-line { left: 50%; margin-left: -1px; }
  .st { width: 50%; padding: 0 3rem 3rem 0; text-align: right; }
  .st::before { left: auto; right: -0.5625rem; }
  .st .org { justify-content: flex-end; }
  .st p { margin-left: auto; }
  .st.exp { margin-left: 50%; padding: 0 0 3rem 3rem; text-align: left; }
  .st.exp::before { right: auto; left: -0.5625rem; }
  .st.exp .org { justify-content: flex-start; }
  .st.exp p { margin-left: 0; }
  /* the open end of the path: its text sits on the axis, the node below it starts the line */
  .st.now { width: 100%; margin: 0 0 3rem; padding: 0.5rem 0 0; text-align: center; display: flex; flex-direction: column; align-items: center; background: var(--bg); z-index: 1; }
  .st.now::before { position: relative; order: 9; left: auto; right: auto; top: 0; margin: 1.25rem auto 0; }
  .st.now p { margin-left: auto; margin-right: auto; }
  .st.edu .org img.roomy { margin-left: 0; margin-right: -0.375rem; }
  .st-kind { display: none; }
}

/* ------------------------------------------------------------ motion
   Everything below is an enhancement. Start states only exist under .js and
   only when the reader allows motion. */
@media (prefers-reduced-motion: no-preference) {
  /* 1. Opening sentence: words arrive one after another */
  .js .hero h1 .w { opacity: 0; transform: translateY(0.35em); animation: word 0.7s var(--ease) forwards; animation-delay: calc(var(--i) * 42ms + 120ms); }
  .js .hero .after-h1 { opacity: 0; animation: rise 0.8s var(--ease) forwards; animation-delay: 1.15s; }
  .js .hero .portrait { opacity: 0; animation: rise 0.9s var(--ease) forwards; animation-delay: 0.5s; }

  /* 2. Scroll reveals */
  .js [data-reveal] { opacity: 0; transform: translateY(1.25rem); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  /* The wipe sits on the children: an element that clips itself away completely is never reported as "in view". */
  .js [data-reveal="wipe"] { opacity: 1; transform: none; }
  .js [data-reveal="wipe"] > * { clip-path: inset(0 0 100% 0); transition: clip-path 1.1s var(--ease); }
  .js [data-reveal="wipe"] > .phone { transition-delay: 0.35s; }
  .js [data-reveal="wipe"].is-in > * { clip-path: inset(-10% -10% -20% -10%); }
  .js [data-reveal="side"] { transform: translateX(var(--from, 1.5rem)); }
  .js .st.edu { --from: -1.5rem; }
  .js .st.now { --from: 0rem; }
  .js [data-reveal="side"].is-in { transform: none; }
  .js .st::before { transform: scale(0); transition: transform 0.45s var(--ease) 0.15s; }
  .js .st.is-in::before { transform: scale(1); }

  /* chapter rule draws in */
  .js .ch-head::after { transform: scaleX(0); transition: transform 1s var(--ease) 0.15s; }
  .js .ch-head.is-in::after { transform: scaleX(1); }

  /* line drawings draw themselves */
  .js .draw .d[pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease); transition-delay: calc(var(--d, 0) * 90ms + var(--k, 0) * 120ms); }
  .js .draw.is-in .d[pathLength] { stroke-dashoffset: 0; }
  .js .draw .f { opacity: 0; transition: opacity 0.6s ease 1s; }
  .js .draw.is-in .f { opacity: 1; }

  /* 3. Tokens: the bar fills, then the output line appears */
  .js .split .split-read { transform: scaleX(0); transition: transform 1.6s var(--ease) 0.2s; }
  .js .split.is-in .split-read { transform: scaleX(1); }
  .js .split .split-written { opacity: 0; transition: opacity 0.3s ease 1.7s; }
  .js .split.is-in .split-written { opacity: 1; animation: blink 0.5s ease 2s 3 alternate; }
  .js .hm .c { opacity: 0; transform: scale(0.5); transition: opacity 0.4s ease, transform 0.4s var(--ease); transition-delay: calc(var(--w) * 40ms); }
  .js .hm.is-in .c { opacity: 1; transform: none; }

  /* 4. Method diagram: one step at a time */
  .js .flow .step .lanes i.on::after { transform: scale(0); transition: transform 0.45s var(--ease); }
  .js .flow .step .join { transform: scaleX(0); transition: transform 0.5s var(--ease) 0.15s; }
  .js .flow .step .step-text { opacity: 0.25; transition: opacity 0.5s ease; }
  .js .flow .step .lanes i::before { background: #33454F; transition: background 0.5s ease; }
  .js .flow .step.is-on .lanes i.on::after { transform: scale(1); }
  .js .flow .step.is-on .join { transform: scaleX(1); }
  .js .flow .step.is-on .step-text { opacity: 1; }
  .js .flow .step.is-on .lanes i::before { background: #5E737D; }
  .js .replay { display: inline-block; }

  /* 5. Thesis pipeline: connectors grow downwards */
  .js .pipe .pipe-link::before, .js .pipe .pipe-link i::before { transform: scaleY(0); transition: transform 0.5s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
  .js .pipe .pipe-link.is-in::before, .js .pipe .pipe-link.is-in i::before { transform: scaleY(1); }
  .js .pipe .pipe-link.gather::after { transform: scaleX(0); transition: transform 0.5s var(--ease) 0.3s; }
  .js .pipe .pipe-link.gather.is-in::after { transform: scaleX(1); }

  /* 6. Timeline: the axis fills as you scroll */
  .js .tl-line i { transform: scaleY(var(--p, 0)); }

  .js .gallery[open] .photo-frame { animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@keyframes word { to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }
@keyframes blink { from { opacity: 1; } to { opacity: 0.25; } }

@media print {
  .bar, .progress, .replay { display: none !important; }
  .ai, .closing, .foot { background: #fff !important; color: #000 !important; }
}
