/* ==========================================================================
   Robiul Hasan Nowshad — Portfolio (editorial)
   ========================================================================== */

:root {
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1320px;
  --gutter: clamp(16px, 3.2vw, 44px);
  --header-h: 68px;
  --ease: cubic-bezier(.19, 1, .22, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);

  --paper: #f3f0e8;
  --paper-2: #e9e5da;
  --ink: #151513;
  --ink-2: #4a4842;
  --ink-3: #8b877c;
  --rule: rgba(21, 21, 19, .16);
  --accent: #df4a22;
  --accent-ink: #fff;
  --grain-opacity: .07;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #11110f;
  --paper-2: #1b1a17;
  --ink: #ece8dd;
  --ink-2: #aaa59a;
  --ink-3: #6f6c63;
  --rule: rgba(236, 232, 221, .15);
  --accent: #ff6a3d;
  --accent-ink: #11110f;
  --grain-opacity: .05;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
@supports (overflow: clip) { body { overflow-x: clip; } }
main, .footer { overflow-x: hidden; }
@supports (overflow: clip) { main, .footer { overflow-x: clip; } }

/* paper grain */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 300; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
[data-theme="dark"] body::after { filter: invert(1); }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
em { font-style: italic; }
b, strong { font-weight: 600; color: var(--ink); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.small { font-size: 11px; }
.rule { display: block; height: 1px; background: var(--ink); opacity: .9; transform-origin: left; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 500; padding: 10px 14px;
  background: var(--ink); color: var(--paper); transform: translateY(-200%); transition: transform .3s;
}
.skip-link:focus { transform: none; }

/* ---------- Links & pills ---------- */
.link-u {
  position: relative; display: inline-block; width: fit-content;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .5s var(--ease), color .3s;
  padding-bottom: 1px;
}
.link-u:hover { background-size: 0 1px; background-position: 100% 100%; color: var(--accent); }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .4s var(--ease), border-color .4s;
}
.pill::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  transform: translateY(101%); transition: transform .55s var(--ease);
}
.pill:hover::before { transform: none; }
.pill .arrow { display: inline-block; transition: transform .45s var(--ease); }
.pill:hover .arrow { transform: translate(2px, -2px); }
.pill-ink { background: var(--ink); color: var(--paper); height: 38px; padding: 0 16px; font-size: 14px; }
.pill-ink::before { background: var(--accent); }
.pill-ink:hover { color: var(--accent-ink); }
.pill-accent { background: var(--accent); color: var(--accent-ink); }
.pill-accent::before { background: var(--ink); }
.pill-accent:hover { color: var(--paper); }
.pill-accent:hover .arrow { transform: translateY(3px); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  transition: transform .6s var(--ease), background-color .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--rule);
}
.header.hide { transform: translateY(-100%); }
.header-inner { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-size: 19px; line-height: 1; padding-top: 2px;
  transition: background-color .4s, transform .6s var(--ease);
}
.brand:hover .brand-mark { background: var(--accent); transform: rotate(-12deg); }
.brand-name { font-family: var(--serif); font-size: 24px; letter-spacing: -.01em; line-height: 1; }
.brand-dot { color: var(--accent); }

.header-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); justify-self: center; }
.header-meta .sep { color: var(--ink-3); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2fa84f; box-shadow: 0 0 0 3px color-mix(in srgb, #2fa84f 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #2fa84f 0%, transparent); } }

.header-nav { display: flex; gap: 26px; justify-self: end; font-size: 14.5px; }
.header-nav a { position: relative; overflow: hidden; display: inline-block; height: 1.5em; line-height: 1.5; }
.header-nav a span { display: inline-block; transition: transform .5s var(--ease); }
.header-nav a span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; font-style: italic; font-family: var(--serif); font-size: 1.12em; color: var(--accent); }
.header-nav a:hover span { transform: translateY(-100%); }
.header-nav a::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.header-nav a.active::before { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; gap: 14px; justify-self: end; }
.theme-btn { padding: 6px; border-radius: 999px; }
.theme-btn-track { display: block; width: 38px; height: 22px; border-radius: 999px; border: 1px solid var(--ink); position: relative; transition: background-color .4s; }
.theme-btn-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform .5s var(--ease), background-color .4s; }
[data-theme="dark"] .theme-btn-thumb { transform: translateX(16px); background: var(--accent); }

.menu-btn { display: none; width: 40px; height: 40px; position: relative; border-radius: 50%; border: 1px solid var(--ink); }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--ink); transition: transform .5s var(--ease), top .5s var(--ease); }
.menu-btn span:first-child { top: 15px; }
.menu-btn span:last-child { top: 22px; }
.menu-open .menu-btn span:first-child { top: 18.5px; transform: rotate(45deg); }
.menu-open .menu-btn span:last-child { top: 18.5px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 90; background: var(--paper);
  padding-top: calc(var(--header-h) + 24px);
  clip-path: inset(0 0 100% 0); transition: clip-path .8s var(--ease-io);
}
.menu[hidden] { display: none; }
.menu-open .menu { clip-path: inset(0 0 0 0); }
.menu-inner { display: grid; }
.menu-inner > a {
  display: flex; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule);
  font-family: var(--serif); font-size: clamp(44px, 12vw, 72px); line-height: 1; letter-spacing: -.02em;
}
.menu-inner > a .mono { color: var(--accent); }
.menu-inner > a, .menu-foot { opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i) * 60ms + 200ms); }
.menu-open .menu-inner > a, .menu-open .menu-foot { opacity: 1; transform: none; }
.menu-foot { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-top: 28px; font-size: 15px; color: var(--ink-2); }

/* ---------- Intro animations ---------- */
.js [data-intro] { opacity: 0; transform: translateY(18px); }
.js.is-loaded [data-intro] { opacity: 1; transform: none; transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--d) * 90ms + 100ms); }
.js [data-rule-intro], .js [data-rule] { transform: scaleX(0); }
.js.is-loaded [data-rule-intro] { transform: scaleX(1); transition: transform 1.6s var(--ease-io) .15s; }
.js [data-rule].in { transform: scaleX(1); transition: transform 1.4s var(--ease-io); }

/* split words */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; padding-right: .04em; margin-right: -.04em; }
.split .w > span { display: inline-block; }
.js .split .w > span { transform: translateY(105%); }
.js .split.in .w > span { transform: none; transition: transform 1.2s var(--ease); transition-delay: calc(var(--i) * 45ms); }

/* scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { padding-top: calc(var(--header-h) + clamp(28px, 5vw, 64px)); }
.hero-topline { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; color: var(--ink-2); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 27vw, 380px); gap: clamp(28px, 5vw, 80px); padding-top: clamp(28px, 4.5vw, 64px); align-items: end; }
.hero-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(50px, 7.6vw, 126px); line-height: .92; letter-spacing: -.035em;
  max-width: 14ch;
}
.hero-title em, .sec-title em, .contact-title em { color: var(--accent); }
.hero-sub { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; margin-top: clamp(32px, 4vw, 56px); align-items: end; }
.hero-lead { font-size: clamp(16px, 1.3vw, 18.5px); color: var(--ink-2); max-width: 46ch; }
.hero-ctas { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.hero-ctas .link-u { font-size: 15px; color: var(--ink-2); }

.hero-figure { position: relative; }
.photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); }
.photo img {
  position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; object-position: 50% 30%;
  filter: grayscale(1) contrast(1.06);
  transition: filter 1s var(--ease), transform .2s linear;
}
.hero-figure:hover .photo img { filter: grayscale(0) contrast(1); }
.photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.hero-figure figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--ink-3); font-size: 11px; }
.js [data-intro-photo] .photo { clip-path: inset(100% 0 0 0); }
.js [data-intro-photo] .photo img { scale: 1.25; }
.js [data-intro-photo] figcaption { opacity: 0; }
.js.is-loaded [data-intro-photo] .photo { clip-path: inset(0 0 0 0); transition: clip-path 1.5s var(--ease-io) .25s; }
.js.is-loaded [data-intro-photo] .photo img { scale: 1; transition: scale 2s var(--ease) .25s, filter 1s var(--ease); }
.js.is-loaded [data-intro-photo] figcaption { opacity: 1; transition: opacity 1s 1.3s; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(56px, 7vw, 100px); border-top: 1px solid var(--rule); }
.stat { padding: 20px 20px 4px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--rule); }
.stat dt { color: var(--ink-3); font-size: 11px; }
.stat dd { margin-top: 10px; font-family: var(--serif); font-size: clamp(42px, 5.2vw, 78px); line-height: 1; letter-spacing: -.03em; }
.stat dd small { font-size: .38em; letter-spacing: 0; color: var(--ink-2); }

/* ---------- Marquee ---------- */
.marquee { margin-top: clamp(56px, 8vw, 110px); border-block: 1px solid var(--rule); padding: clamp(14px, 2vw, 22px) 0; overflow: hidden; }
.marquee-track { display: flex; align-items: center; gap: clamp(20px, 3vw, 44px); width: max-content; will-change: transform; }
.marquee-track span { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 64px); line-height: 1.1; letter-spacing: -.02em; white-space: nowrap; }
.marquee-track em { color: var(--ink-2); }
.marquee-track i { font-style: normal; color: var(--accent); font-size: clamp(18px, 2.2vw, 30px); }

/* ---------- Sections ---------- */
.section { padding-top: clamp(88px, 11vw, 160px); }
.sec-head { margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 24px; align-items: start; padding-top: 18px; }
.sec-num { color: var(--accent); padding-top: .6em; }
.sec-title { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 7vw, 112px); line-height: .92; letter-spacing: -.035em; }
.sec-meta { text-align: right; color: var(--ink-3); line-height: 1.7; padding-top: .6em; font-size: 11px; }

/* ---------- Work list ---------- */
.work-list { border-top: 1px solid var(--rule); }
.work-item { border-bottom: 1px solid var(--rule); position: relative; }
.work-row {
  width: 100%; display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 300px) 64px 28px; align-items: center; gap: 24px;
  padding: clamp(18px, 2.4vw, 30px) 0; position: relative;
}
.work-row::before { content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); background: var(--ink); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); z-index: -1; }
.work-no { color: var(--ink-3); transition: color .4s; }
.work-title { font-family: var(--serif); font-size: clamp(30px, 4vw, 58px); line-height: 1; letter-spacing: -.025em; transition: transform .6s var(--ease), color .4s; }
.work-stack, .work-year { color: var(--ink-2); font-size: 11.5px; transition: color .4s; }
.work-year { text-align: right; }
.plus { position: relative; width: 16px; height: 16px; justify-self: end; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px; background: currentColor; transition: transform .5s var(--ease); }
.plus::after { transform: rotate(90deg); }
[aria-expanded="true"] .plus::after { transform: rotate(0); }

@media (hover: hover) and (pointer: fine) {
  .work-list { isolation: isolate; }
  .work-row:hover::before { transform: scaleY(1); }
  .work-row:hover { color: var(--paper); }
  .work-row:hover .work-no, .work-row:hover .work-stack, .work-row:hover .work-year { color: color-mix(in srgb, var(--paper) 70%, transparent); }
  .work-row:hover .work-title { transform: translateX(18px); font-style: italic; }
}

.work-detail, .xp-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s var(--ease); }
.work-item.open .work-detail, .xp-item.open .xp-detail { grid-template-rows: 1fr; }
.work-detail-inner, .xp-detail-inner { overflow: hidden; min-height: 0; }
.work-detail-inner { padding-left: 144px; }
.work-detail-inner > * { max-width: 760px; }
.work-detail-inner > p:first-child { padding-top: 4px; font-size: clamp(16px, 1.3vw, 18px); color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; border-top: 1px solid var(--rule); }
.facts div { padding: 14px 16px 0 0; }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.facts dt { color: var(--ink-3); font-size: 10.5px; }
.facts dd { margin-top: 6px; font-family: var(--serif); font-size: clamp(28px, 3vw, 42px); line-height: 1; letter-spacing: -.02em; }
.tags { margin-top: 22px; padding-bottom: 32px; color: var(--ink-3); font-size: 11px; }

/* hover preview */
.preview {
  position: fixed; top: 0; left: 0; z-index: 80; pointer-events: none;
  width: 300px; height: 210px; margin: -105px 0 0 -150px;
  opacity: 0; scale: .7; transition: opacity .35s var(--ease), scale .5s var(--ease);
  display: none;
}
@media (hover: hover) and (pointer: fine) { .preview { display: block; } }
.preview.show { opacity: 1; scale: 1; }
.preview-card {
  position: absolute; inset: 0; display: none; flex-direction: column; justify-content: space-between;
  padding: 16px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink);
  box-shadow: 10px 10px 0 var(--accent);
}
.preview-card.active { display: flex; }
.preview-card > .mono { font-size: 10.5px; color: var(--ink-2); }
.preview-card svg { width: 100%; height: 140px; }
.pv-links path { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 5; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.pv-dot { fill: var(--accent); }
.pv-node rect { fill: var(--paper); stroke: var(--ink); }
.pv-node text, .pv-core text { font-family: var(--mono); font-size: 10px; text-anchor: middle; text-transform: uppercase; fill: var(--ink); }
.pv-core rect { fill: var(--accent); }
.pv-core text { fill: var(--accent-ink); }
.pv-flow { flex: 1; display: flex; align-items: center; gap: 4px; }
.pv-flow b { font-family: var(--mono); font-weight: 400; font-size: 10px; text-transform: uppercase; padding: 6px 7px; border: 1px solid var(--ink); white-space: nowrap; }
.pv-flow b.hl { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pv-flow i { flex: 1; height: 1px; background: var(--ink); position: relative; overflow: hidden; }
.pv-flow i::after { content: ""; position: absolute; inset: -1px auto -1px 0; width: 40%; background: var(--accent); animation: flow 1.4s linear infinite; }
@keyframes flow { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.pv-bars { flex: 1; display: flex; align-items: flex-end; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.pv-bars i { flex: 1; height: var(--h); background: var(--ink); transform-origin: bottom; animation: grow 1s var(--ease) both; }
.pv-bars i.hl { background: var(--accent); }
.pv-bars i:nth-child(2) { animation-delay: .05s; } .pv-bars i:nth-child(3) { animation-delay: .1s; } .pv-bars i:nth-child(4) { animation-delay: .15s; }
.pv-bars i:nth-child(5) { animation-delay: .2s; } .pv-bars i:nth-child(6) { animation-delay: .25s; } .pv-bars i:nth-child(7) { animation-delay: .3s; } .pv-bars i:nth-child(8) { animation-delay: .35s; }
@keyframes grow { from { transform: scaleY(0); } }
.pv-radar { flex: 1; position: relative; overflow: hidden; }
.pv-radar span { position: absolute; left: 50%; top: 50%; border: 1px solid var(--rule); border-radius: 50%; transform: translate(-50%, -50%); }
.pv-radar span:nth-child(1) { width: 50px; height: 50px; } .pv-radar span:nth-child(2) { width: 110px; height: 110px; } .pv-radar span:nth-child(3) { width: 170px; height: 170px; }
.pv-radar b { position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; margin: -90px; border-radius: 50%; background: conic-gradient(color-mix(in srgb, var(--accent) 40%, transparent), transparent 25%); animation: spin 3.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pv-radar i { position: absolute; left: var(--x); top: var(--y); width: 6px; height: 6px; margin: -3px; background: var(--ink); border-radius: 50%; }
.pv-spark path { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 400; animation: draw 1.6s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 400; } }

/* ---------- Experience ---------- */
.xp-list { border-top: 1px solid var(--rule); }
.xp-item { border-bottom: 1px solid var(--rule); }
.xp-row { width: 100%; display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) 28px; gap: 24px; align-items: baseline; padding: clamp(20px, 2.4vw, 30px) 0; }
.xp-date { color: var(--ink-3); font-size: 11px; }
.xp-company { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 48px); line-height: 1; letter-spacing: -.02em; transition: color .3s, font-style .3s; }
.xp-row:hover .xp-company { color: var(--accent); font-style: italic; }
.xp-role { color: var(--ink-2); font-size: 16px; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.now { font-size: 10px; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.xp-row .plus { align-self: center; }
.xp-detail-inner ul { margin-left: 144px; max-width: 780px; padding-bottom: 30px; display: grid; gap: 12px; counter-reset: x; }
.xp-detail-inner li { position: relative; padding-left: 44px; color: var(--ink-2); font-size: 16px; counter-increment: x; }
.xp-detail-inner li::before { content: "0" counter(x); position: absolute; left: 0; top: .3em; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(40px, 6vw, 72px); padding-left: 144px; }
.about-statement { font-family: var(--serif); font-size: clamp(28px, 3.3vw, 48px); line-height: 1.12; letter-spacing: -.015em; text-indent: 2.2em; max-width: 26ch; max-width: 900px; }
.about-statement em { color: var(--accent); }
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.principles li { padding: 20px 24px 0 0; }
.principles li + li { padding-left: 24px; border-left: 1px solid var(--rule); }
.principles .mono { color: var(--accent); }
.principles h3 { margin-top: 26px; font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.05; letter-spacing: -.015em; }
.principles p { margin-top: 10px; color: var(--ink-2); font-size: 15.5px; }

.caps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(64px, 8vw, 120px); border-top: 1px solid var(--ink); }
.cap { padding: 20px 20px 36px 0; border-bottom: 1px solid var(--rule); }
.cap:not(:nth-child(4n + 1)) { padding-left: 20px; border-left: 1px solid var(--rule); }
.cap h3 { color: var(--ink-3); font-weight: 400; font-size: 11px; margin-bottom: 16px; }
.cap li { font-size: 15.5px; padding: 3px 0; transition: transform .4s var(--ease), color .3s; width: fit-content; }
.cap li:hover { transform: translateX(6px); color: var(--accent); }

/* ---------- Contact ---------- */
.contact { padding: clamp(100px, 13vw, 190px) 0 clamp(40px, 6vw, 80px); }
.contact-top { display: flex; justify-content: space-between; gap: 20px; padding-top: 18px; }
.contact-kicker { color: var(--ink-2); text-align: right; font-size: 11px; }
.contact-title { margin-top: clamp(28px, 4vw, 56px); font-family: var(--serif); font-weight: 400; font-size: clamp(54px, 10vw, 168px); line-height: .9; letter-spacing: -.04em; max-width: 12ch; }
.contact-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: clamp(36px, 5vw, 64px); }
.mail-link {
  font-family: var(--serif); font-size: clamp(28px, 4.4vw, 64px); line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat, linear-gradient(var(--rule), var(--rule)) 0 100% / 100% 2px no-repeat;
  transition: background-size .8s var(--ease), color .4s;
  padding-bottom: 4px;
}
.mail-link:hover { background-size: 100% 2px, 100% 2px; color: var(--accent); }
.mail-link .arrow { display: inline-block; margin-left: .2em; font-family: var(--sans); font-size: .6em; vertical-align: .25em; transition: transform .5s var(--ease); }
.mail-link:hover .arrow { transform: translate(6px, -6px); }
.copy-btn { height: 34px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 999px; font-size: 11px; transition: background-color .3s, color .3s; }
.copy-btn:hover, .copy-btn.copied { background: var(--ink); color: var(--paper); }
.contact-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(56px, 8vw, 110px); border-top: 1px solid var(--rule); }
.contact-cols > div { padding: 20px 20px 0 0; display: grid; gap: 6px; align-content: start; font-size: 16px; }
.contact-cols > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.contact-cols h3 { color: var(--ink-3); font-weight: 400; font-size: 11px; margin-bottom: 8px; }
.contact-cols .small { color: var(--ink-3); }

/* ---------- Footer ---------- */
.footer { padding-bottom: 28px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid var(--ink); color: var(--ink-2); font-size: 11px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200; padding: 12px 18px;
  background: var(--ink); color: var(--paper); font-size: 11px;
  transform: translate(-50%, calc(100% + 40px)); visibility: hidden; pointer-events: none;
  transition: transform .6s var(--ease), visibility 0s linear .6s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .6s var(--ease); }

/* theme switch transition */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .work-row { grid-template-columns: 60px minmax(0, 1fr) 64px 28px; }
  .work-stack { display: none; }
  .work-detail-inner, .about-grid { padding-left: 84px; }
  .xp-row { grid-template-columns: 60px minmax(0, 1fr) 28px; grid-template-areas: "d c p" ". r ."; row-gap: 6px; }
  .xp-date { grid-area: d; }
  .xp-company { grid-area: c; }
  .xp-role { grid-area: r; }
  .xp-row .plus { grid-area: p; }
  .xp-detail-inner ul { margin-left: 84px; }
  .xp-date { font-size: 10px; line-height: 1.4; }
  .sec-head-row { grid-template-columns: 60px minmax(0, 1fr) auto; }
  .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cap:not(:nth-child(4n + 1)) { padding-left: 0; border-left: 0; }
  .cap:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--rule); }
}

@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .header-meta, .header-nav { display: none; }
  .menu-btn { display: block; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-figure { order: -1; width: min(62%, 300px); }
  .hero-sub { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .principles li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); margin-top: 20px; }
  .principles h3 { margin-top: 12px; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .header-cv { display: none; }
  .hide-sm { display: none; }
  .hero-figure { width: min(70%, 260px); }
  .hero-title { max-width: none; }
  .sec-head-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sec-num { padding-top: 0; }
  .sec-meta { display: none; }
  .work-row { grid-template-columns: 36px minmax(0, 1fr) 20px; gap: 12px; }
  .work-year { display: none; }
  .work-detail-inner, .about-grid { padding-left: 0; }
  .xp-row { grid-template-columns: minmax(0, 1fr) 20px; grid-template-areas: "d p" "c c" "r r"; }
  .xp-detail-inner ul { margin-left: 0; }
  .xp-detail-inner li { padding-left: 32px; font-size: 15px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); margin-top: 14px; }
  .facts div { padding-top: 12px; }
  .about-statement { text-indent: 0; }
  .caps { grid-template-columns: minmax(0, 1fr); }
  .cap:nth-child(even) { padding-left: 0; border-left: 0; }
  .contact-top { flex-direction: column; gap: 6px; }
  .contact-kicker { text-align: left; }
  .contact-cols { grid-template-columns: minmax(0, 1fr); }
  .contact-cols > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); margin-top: 20px; }
  .footer-inner { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
  .js [data-intro], .js [data-reveal] { opacity: 1; transform: none; }
  .js [data-rule-intro], .js [data-rule] { transform: none; }
  .js .split .w > span { transform: none; }
  .js [data-intro-photo] .photo { clip-path: none; }
  .js [data-intro-photo] .photo img { scale: 1; }
  .js [data-intro-photo] figcaption { opacity: 1; }
  body::after { animation: none; }
}
