/* ---------- Tokens (warm beige, editorial) ---------- */
:root {
  --bg: #f5f0e6;
  --panel: #ebe3d3;
  --card: #fbf8f2;
  --border: #ddd4c2;
  --text: #1c1917;
  --body: #44403c;
  --muted: #78716c;
  --accent: #1d4ed8;
  --accent-bg: #e6eaf3;
  --accent-border: #b9c6e4;
  --green: #16a34a;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased;
}
::selection { background: var(--text); color: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; color: var(--text); font-weight: 400; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
em { font-style: italic; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: 40px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-size: 15px; font-weight: 600; border: 1px solid var(--text);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.btn:hover { transform: translateY(-1px); background: #3a3532; }
.btn-ghost { background: transparent; color: var(--text); border-color: #bfb4a0; }
.btn-ghost:hover { background: var(--card); }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 240, 230, .86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { font-family: var(--serif); font-size: 24px; color: var(--text); letter-spacing: -.01em; white-space: nowrap; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-size: 15px; font-weight: 500; color: var(--body); position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--text); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* ---------- Hero (illustrated dusk over the Charles River) ---------- */
.hero {
  position: relative; overflow: hidden;

  background: linear-gradient(180deg, #f5f0e6 0%, #f6e9da 38%, #f4d9c6 62%, #efd2c4 72%);
}
.hero-scene { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; }
.hero-scene svg { width: 100%; height: auto; min-height: 150px; display: block; }
.boat { animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-18px); } to { transform: translateX(26px); } }

.hero-inner {
  position: relative; z-index: 1; width: 100%;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
  padding-top: 26px; padding-bottom: 100px;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #d9ead3; }
.hero-name {
  margin-top: 18px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 6.6vw, 98px); line-height: .88; letter-spacing: -.03em;
}
.hero-name span, .hero-name em { display: block; }
.hero-name em { color: var(--accent); }
.hero-tag { margin-top: 22px; max-width: 26em; font-family: var(--serif); font-size: clamp(19px, 1.7vw, 22px); line-height: 1.3; color: var(--text); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.contact h2 em { color: var(--accent); }

.code-card {
  margin: 0; justify-self: end; align-self: center; width: 100%; max-width: 470px;
  background: #1f1b18; color: #e7e2dc; border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 4px rgba(28, 25, 23, .1), 0 28px 60px rgba(28, 25, 23, .28);
  transform: rotate(1.2deg);
}
.code-card figcaption {
  display: flex; align-items: center; gap: 14px; padding: 11px 16px;
  font: 500 12.5px/1 ui-monospace, "JetBrains Mono", Consolas, monospace; color: #a8a29e;
  background: #2a2521; border-bottom: 1px solid #3a332e;
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ef6a5e; }
.dots i:nth-child(2) { background: #f4bf4f; }
.dots i:nth-child(3) { background: #61c454; }
.code-card pre { margin: 0; padding: 14px 18px 16px; overflow: hidden; }
.code-card code { font: 13px/1.55 ui-monospace, "JetBrains Mono", Consolas, monospace; white-space: pre; }
.ln { display: inline-block; width: 1.6em; margin-right: 14px; text-align: right; color: #5f5650; user-select: none; }
.kw { color: #f0a868; } .cls { color: #8fd6b4; } .st { color: #e9d8a6; } .cm { color: #8a817c; font-style: italic; }
.caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 4px; vertical-align: -2px; background: #f0a868; animation: blink 1.1s steps(1) infinite; }
/* Solid caret while typing; it only blinks once the card is idle. */
.typing .caret { animation: none; }
@keyframes blink { 50% { opacity: 0; } }

.facts-band { margin-top: -1px; }
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 0 22px;
}
.facts > div { padding: 18px 24px 0 0; }
.facts > div + div { padding-left: 24px; border-left: 1px solid var(--border); }
.facts dt { font-size: 32px; font-weight: 700; line-height: 1.05; letter-spacing: -.035em; color: var(--text); font-variant-numeric: tabular-nums; }
.facts dt::before { content: ""; display: block; width: 26px; height: 3px; margin-bottom: 14px; border-radius: 2px; background: var(--accent); }
.facts dd { margin-top: 6px; font-size: 15px; color: var(--muted); line-height: 1.5; max-width: 16em; }

/* Focus / Now band */
.focus-band {
  margin-top: -1px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
}
.focus-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
}
.focus-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(224, 90, 43, .7);
  animation: pulse-ring 2s infinite cubic-bezier(.45, 0, .55, 1);
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(224, 90, 43, .7); }
  70% { box-shadow: 0 0 0 7px rgba(224, 90, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 90, 43, 0); }
}
.focus-icons {
  font-size: 17px;
  letter-spacing: 2px;
}
.focus-text {
  color: var(--text);
  font-weight: 500;
}

/* Numbered section headings */
.sec-num {
  display: inline-block; margin-right: 14px; vertical-align: .55em;
  font: 600 13px/1 var(--sans); letter-spacing: .08em; color: var(--accent);
}

/* ---------- Work ---------- */
.work { padding-top: 72px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--text); margin-bottom: 40px;
}
.section-head h2, .split > h2 { font-family: var(--serif); font-size: clamp(34px, 3.6vw, 48px); line-height: 1; letter-spacing: -.02em; }
.count { font-family: var(--serif); font-size: 28px; color: var(--muted); }

.project {
  display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: center;
  margin-bottom: 64px;
}
.project.flip { grid-template-columns: 5fr 7fr; }
.project.flip .project-media { order: 2; }
/* Every project image sits in an identical frame: same panel padding, same 16:9 image box. */
.project-media {
  display: block;
  background: var(--panel); border-radius: 18px; padding: 28px; overflow: hidden;
}
.project-media img { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.project:hover .project-media img { transform: scale(1.02); }
.shot {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: cover; object-position: top center;
  border-radius: 10px; border: 1px solid rgba(28, 25, 23, .08);
  box-shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 18px 40px rgba(28, 25, 23, .12);
  background: #fff;
}
.shot[src*="secondopinion"] { object-position: left top; }

.project-meta { display: flex; gap: 14px; align-items: baseline; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.project-meta span { font-family: var(--serif); font-size: 22px; letter-spacing: 0; color: var(--text); }
.project h3 { margin-top: 8px; font-family: var(--serif); font-size: clamp(32px, 3.2vw, 42px); line-height: 1; letter-spacing: -.02em; }
.award {
  display: inline-block; margin-top: 10px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  padding: 4px 12px; border-radius: 999px; line-height: 1.5;
}
.project-body > p:not(.project-meta):not(.award):not(.stack):not(.links) { margin-top: 12px; font-size: 15.5px; line-height: 1.65; }
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 16px 24px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.stats:has(> div:nth-child(4)) { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.stats dt { font-family: var(--serif); font-size: 26px; line-height: 1.05; color: var(--text); }
.stats dd { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stack { margin-top: 12px; font-size: 15px; color: var(--muted); }
.links { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 14px; }
.links a { font-size: 15px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--text); padding-bottom: 2px; }
.links a span { display: inline-block; transition: transform .2s ease; }
.links a:hover { color: var(--accent); border-color: var(--accent); }
.links a:hover span { transform: translateX(3px); }

.more { text-align: center; margin-top: -24px; }
.more a { font-size: 15px; font-weight: 600; color: var(--body); border-bottom: 1px solid #bfb4a0; padding-bottom: 2px; }
.more a:hover { color: var(--text); border-color: var(--text); }

/* ---------- About / Experience (split) ---------- */
.split {
  display: grid; grid-template-columns: 4fr 8fr; gap: 48px;
  padding-top: 48px; padding-bottom: 8px;
  border-top: 1px solid var(--border); margin-top: 56px;
}
.focus-band + .split {
  margin-top: 18px;
}
.split + .split { margin-top: 48px; }
.prose p { font-size: 16.5px; line-height: 1.7; }
.prose p + p { margin-top: 12px; }

.timeline li, .plain li {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 20px;
  padding: 16px 0; border-top: 1px solid var(--border);
}
.timeline li:last-child, .plain li:last-child { border-bottom: 1px solid var(--border); }
.when { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.timeline h3 { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.where { margin-top: 4px; font-size: 15.5px; font-weight: 500; color: var(--muted); }
.timeline p:not(.where) { margin-top: 6px; font-size: 16.5px; }
.edu-coursework { margin-top: 6px; font-size: 14.5px !important; color: var(--muted); line-height: 1.5; }
.sub { margin: 36px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.plain li { padding: 11px 0; font-size: 16.5px; color: var(--body); }
.plain .when { padding-top: 2px; }
.more-link { display: inline-block; margin-top: 22px; font-size: 15px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--text); padding-bottom: 2px; }
.more-link:hover { color: var(--accent); border-color: var(--accent); }

/* Experience told as a story */
.role { padding: 28px 0 32px; border-top: 1px solid var(--border); }
.role:first-child { padding-top: 0; border-top: 0; }
.role-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.role-head h3 { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.role-head .when { padding-top: 0; white-space: nowrap; }
.co-logo {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: #fffdf8; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(28, 25, 23, .06);
  align-self: center; text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
a.co-logo:hover {
  transform: translateY(-2px);
  border-color: #cdbfa8;
  box-shadow: 0 4px 12px rgba(28, 25, 23, .1);
}
.co-logo img { width: 38px; height: 38px; object-fit: contain; border-radius: 6px; }
.role-title { flex: 1 1 auto; min-width: 0; }
.role-story { margin-top: 14px; font-size: 17.5px; line-height: 1.75; max-width: 44em; }
.role-story strong { color: var(--text); font-weight: 600; }
.squiggly-link {
  color: inherit;
  text-decoration: underline wavy var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.squiggly-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.role .stack { margin-top: 14px; }

/* Achievements & certificates */
.achieve { padding-top: 56px; margin-top: 56px; border-top: 1px solid var(--border); }
.achieve .section-head { margin-bottom: 32px; }
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cert { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.cert-img { display: block; background: var(--panel); padding: 22px; }
.cert-img img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 12px 28px rgba(28, 25, 23, .12);
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
.cert-img:hover img { transform: scale(1.02); }
.cert figcaption { padding: 20px 22px 24px; }
.cert-kind { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cert h3, .mini-grid h3 { margin-top: 6px; font-family: var(--serif); font-size: 26px; line-height: 1.15; }
.cert figcaption p:not(.cert-kind) { margin-top: 8px; font-size: 16px; }
.cert a:not(.cert-img), .mini-grid a { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--accent-border); }
.cert a:not(.cert-img):hover { color: var(--accent); border-color: var(--accent); }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; margin-top: 28px; }
.mini-grid li { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.mini-grid li.wide { grid-column: auto; }
.cert code { font: 600 13px/1 ui-monospace, Consolas, monospace; background: var(--panel); padding: 3px 6px; border-radius: 4px; color: var(--text); }
.mini-grid h3 { font-size: 21px; }
.mini-grid p:not(.cert-kind) { margin-top: 6px; font-size: 15px; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { padding-top: 64px; padding-bottom: 64px; margin-top: 56px; border-top: 1px solid var(--border); }
.contact-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.contact h2 { max-width: 15ch; font-family: var(--serif); font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -.025em; }
.bubble {
  position: relative; margin-bottom: 10px; padding: 12px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px 16px 16px 4px;
  font-family: var(--serif); font-size: 20px; color: var(--text);
  box-shadow: 0 8px 20px rgba(28, 25, 23, .08); transform: rotate(-1.5deg);
}
.copy-status { min-height: 1.4em; margin-top: 10px; font-size: 13px; color: var(--green); font-weight: 500; text-align: center; }

/* Contact as an air-mail envelope */
.envelope {
  max-width: 820px; margin: 40px auto 0; padding: 10px; border-radius: 10px;
  background: repeating-linear-gradient(135deg, #c8553d 0 18px, #fbf6ec 18px 30px, #2f5fc4 30px 48px, #fbf6ec 48px 60px);
  box-shadow: 0 2px 4px rgba(28, 25, 23, .08), 0 24px 50px rgba(28, 25, 23, .16);
  transform: rotate(-.6deg); transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.envelope:hover { transform: rotate(0) translateY(-4px); }
.env-paper { position: relative; overflow: hidden; background: #fbf6ec; border-radius: 4px; padding: 108px 44px 30px; }
.env-flap { position: absolute; top: 0; left: 0; width: 100%; height: 110px; }
.stamp {
  position: absolute; top: 18px; right: 22px; width: 108px; padding: 8px 8px 6px; background: #fffdf8; text-align: center;
  border: 2px dashed #d8c7ab; outline: 4px solid #fffdf8; transform: rotate(4deg);
  box-shadow: 0 2px 6px rgba(28, 25, 23, .15);
}
.stamp svg { width: 100%; height: auto; display: block; background: #f6e7d6; }
.stamp span { display: block; margin-top: 4px; font: 700 8.5px/1 var(--sans); letter-spacing: .08em; color: #8a5a3c; }
.postmark {
  position: absolute; top: 24px; right: 110px; width: 74px; height: 74px; border-radius: 50%;
  border: 2px solid rgba(47, 95, 196, .45); display: grid; place-items: center; transform: rotate(-14deg);
}
.postmark span { font: 700 9px/1 var(--sans); letter-spacing: .1em; color: rgba(47, 95, 196, .65); }
.postmark i { position: absolute; left: 70px; width: 70px; height: 2px; background: rgba(47, 95, 196, .4); border-radius: 2px; }
.postmark i:nth-of-type(1) { top: 26px; } .postmark i:nth-of-type(2) { top: 36px; } .postmark i:nth-of-type(3) { top: 46px; }
.env-to { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 40px); color: var(--text); line-height: 1.1; }
.env-to span { font-style: italic; color: var(--muted); font-size: .6em; margin-right: 8px; }
.env-addr { margin-top: 4px; font-size: 15px; color: var(--muted); }
.env-lines { margin-top: 22px; }
.env-lines li {
  display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 16px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #e6dac4;
}
.env-k { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.env-v { font-family: var(--serif); font-size: 22px; color: var(--text); word-break: break-word; }
a.env-v { grid-column: 2 / 4; transition: color .15s ease; }
a.env-v:hover { color: var(--accent); }
#email-address { user-select: all; }
.env-a { display: flex; gap: 8px; }
.env-a .btn { cursor: pointer; font-family: inherit; }

/* ---------- Footer ---------- */
.footer { display: flex; justify-content: space-between; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Selected work: prints pinned to a light table ---------- */
.light-table {
  display: grid; grid-template-columns: 1fr; gap: 56px;
  padding: 56px 48px; border-radius: 24px;
  background-color: var(--panel);
  background-image: linear-gradient(rgba(28, 25, 23, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(28, 25, 23, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  box-shadow: inset 0 2px 10px rgba(28, 25, 23, .06);
}
.print {
  position: relative; background: #fffdf8; border-radius: 8px; padding: 16px;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: center;
  box-shadow: 0 1px 2px rgba(28, 25, 23, .08), 0 14px 30px rgba(28, 25, 23, .14);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
}
.tilt-l { transform: rotate(-.9deg); }
.tilt-r { transform: rotate(.8deg); }
.tilt-l2 { transform: rotate(-.6deg); }
.print:nth-child(even) { grid-template-columns: 1fr 1.25fr; }
.print:nth-child(even) .print-img { order: 2; }
.print:hover { transform: rotate(0) translateY(-6px); box-shadow: 0 2px 4px rgba(28, 25, 23, .08), 0 26px 50px rgba(28, 25, 23, .2); z-index: 2; }
.tape {
  position: absolute; top: -14px; left: 50%; width: 120px; height: 28px; z-index: 2; transform: translateX(-50%) rotate(-3deg);
  background: rgba(240, 222, 186, .78); box-shadow: 0 1px 2px rgba(28, 25, 23, .1);
}
.tilt-r .tape { transform: translateX(-50%) rotate(4deg); }
.rosette {
  position: absolute; top: -22px; right: -18px; z-index: 3; width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-content: center; text-align: center; line-height: 1;
  background: radial-gradient(circle, #f7d78a 0 54%, #e5b14a 55% 100%); color: #5b3b07;
  box-shadow: 0 0 0 4px #fffdf8, 0 6px 14px rgba(28, 25, 23, .25);
  font: 600 10px/1.1 var(--sans); letter-spacing: .06em; text-transform: uppercase; transform: rotate(10deg);
}
.rosette b { display: block; font: 400 30px/1 var(--serif); letter-spacing: 0; text-transform: none; }
.print-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 3px; background: #f1ece2; }
.print-img img { width: 100%; height: 100%; object-fit: cover; object-position: left top; transition: transform .5s ease; }
.print:hover .print-img img { transform: scale(1.04); }
.print-img img[src*="kitchen"] { object-fit: contain; object-position: center; padding: 3%; background: #f1ece2; }

/* Carousel */
.print-carousel {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: #f1ece2;
}
.print:nth-child(even) .print-carousel { order: 2; }
.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease;
  display: block;
  text-decoration: none;
}
.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform .5s ease;
}
.carousel-slide[href*="FinMLOps"] img {
  object-fit: cover;
  object-position: center top;
}
.carousel-slide[href*="certificate"] img {
  object-fit: contain;
  object-position: center;
  padding: 6px;
  background: #fbf9f4;
}
.print:hover .carousel-slide.active img {
  transform: scale(1.02);
}
.carousel-caption {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 27, 24, .75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  z-index: 2;
  pointer-events: none;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(31, 27, 24, .65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  display: grid;
  place-content: center;
  transition: background .2s ease, transform .2s ease;
}
.carousel-btn:hover {
  background: rgba(31, 27, 24, .9);
  transform: translateY(-50%) scale(1.08);
}
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  padding: 0;
  transition: background .2s ease, transform .2s ease, width .2s ease;
}
.carousel-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: 4px;
}
.print-body { padding: 8px 12px 8px 0; }
.print:nth-child(even) .print-body { padding: 8px 0 8px 12px; }
.print-meta { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.print-meta span { font-family: var(--serif); font-size: 22px; letter-spacing: 0; color: var(--text); }
.print h3 { margin-top: 6px; font-family: var(--serif); font-size: clamp(32px, 3.4vw, 46px); line-height: 1.05; letter-spacing: -.015em; }
.print-award { margin-top: 10px; font-size: 14.5px; font-weight: 600; color: var(--accent); }
.print-desc { margin-top: 12px; font-size: 17.5px; line-height: 1.65; color: var(--body); }
.print-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.print-stats li { font-size: 14px; color: var(--body); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
.print-stats b { font-family: var(--serif); font-weight: 400; font-size: 18px; color: var(--text); margin-right: 2px; }
.print-stack { margin-top: 14px; font-size: 14.5px; color: var(--muted); }
.print-links { display: flex; gap: 20px; margin-top: 16px; }
.print-links a { font-size: 15px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--text); padding-bottom: 1px; }
.print-links a:hover { color: var(--accent); border-color: var(--accent); }
.work .more { margin-top: 26px; }

/* ---------- Tools: compact chips ---------- */
.tools-sec { padding-top: 48px; margin-top: 56px; border-top: 1px solid var(--border); }
.tools-sec .section-head { margin-bottom: 20px; }
.tool-row { display: grid; grid-template-columns: 10rem 1fr; gap: 16px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.tool-row:last-child { border-bottom: 1px solid var(--border); }
.tool-row h3 { padding-top: 7px; font: 600 12px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 7px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--body); line-height: 1;
  transition: transform .15s ease, border-color .15s ease;
}
.chips li:hover { transform: translateY(-2px); border-color: #cdbfa8; }
.chips img { width: 18px; height: 18px; object-fit: contain; }
.mono-chip { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; background: #0194e2; color: #fff; font: 700 8.5px/1 var(--sans); }

/* ---------- Code card: run button and output ---------- */
.run-btn {
  margin-left: auto; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  font: 600 11.5px/1 ui-monospace, "JetBrains Mono", Consolas, monospace; color: #61c454;
  background: rgba(97, 196, 84, .1); border: 1px solid rgba(97, 196, 84, .35);
}
.run-btn:hover { background: rgba(97, 196, 84, .2); }
.pr { color: #8a817c; }
.out { display: block; margin-top: 4px; padding-left: calc(1.6em + 14px); color: #f3efe8; font-style: italic; white-space: pre-wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 14px; }
}

@media (max-width: 960px) {
  .project, .project.flip { grid-template-columns: 1fr; gap: 20px; margin-bottom: 56px; }
  .project.flip .project-media { order: 0; }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .mini-grid { grid-template-columns: 1fr 1fr; }
  .mini-grid li.wide { grid-column: 1 / -1; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(n+3) { margin-top: 16px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; padding-bottom: 120px; }
  .code-card { justify-self: start; align-self: auto; margin-top: 0; transform: none; }
  .light-table { padding: 40px 24px; gap: 44px; }
  .print, .print:nth-child(even) { grid-template-columns: 1fr; gap: 16px; }
  .print:nth-child(even) .print-img,
  .print:nth-child(even) .print-carousel { order: 0; }
  .print-body, .print:nth-child(even) .print-body { padding: 4px 6px 6px; }
}

@media (max-width: 720px) {
  .wrap { padding-inline: 20px; }
  .nav-links { display: none; }
  .hero { min-height: 0; }
  .hero-inner { padding-top: 28px; padding-bottom: 110px; }
  .code-card code { font-size: 11.6px; }
  .code-card pre { padding: 16px 14px 18px; }
  .ln { margin-right: 10px; }
  .light-table { gap: 34px; padding: 30px 14px; }
  .tool-row { grid-template-columns: 1fr; gap: 8px; }
  .rosette { right: -6px; }
  .facts dt { font-size: 27px; }
  .project-media { padding: 16px; border-radius: 14px; }
  .section-head { margin-bottom: 28px; }
  .more { margin-top: -16px; }
  .timeline li, .plain li { grid-template-columns: 1fr; gap: 8px; }
  .cert-grid { grid-template-columns: 1fr; gap: 20px; }
  .mini-grid { grid-template-columns: 1fr; }
  .role-head h3 { font-size: 26px; }
  .achieve { padding-top: 36px; margin-top: 40px; }
  .split { padding-top: 36px; margin-top: 40px; }
  .contact { padding-top: 48px; padding-bottom: 48px; margin-top: 40px; }
  .env-paper { padding: 120px 18px 22px; }
  .postmark { right: 96px; top: 20px; width: 64px; height: 64px; }
  .stamp { width: 92px; }
  .env-lines li { grid-template-columns: 1fr; gap: 6px; }
  a.env-v { grid-column: auto; }
  .env-v { font-size: 19px; }
  .footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .boat, .caret { animation: none; }
}
