:root {
  --paper: #f3f6f7;
  --paper-strong: #e4eaec;
  --ink: #0b1217;
  --muted: #5d6a70;
  --line: #c4cdd0;
  --accent: #00bfae;
  --accent-dark: #007f75;
  --signal: #d8f35a;
  --warm: #ff7657;
  --white: #fbfdfd;
  --max: 1240px;
  --header-height: 78px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  background-image: linear-gradient(rgba(11, 18, 23, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 18, 23, .025) 1px, transparent 1px);
  background-size: 40px 40px;
}
body.dialog-open { overflow: hidden; }
.top-anchor { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }
svg { width: 19px; height: 19px; stroke-width: 1.8; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: white; padding: 12px 16px; }
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 91%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav-shell { height: var(--header-height); max-width: var(--max); margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 13px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; background: var(--ink); color: var(--signal); font-size: 11px; letter-spacing: 0; box-shadow: inset 0 0 0 1px #26343b; }
.brand-name { font-size: 16px; }
.desktop-nav { display: flex; align-items: center; gap: 34px; font-size: 14px; color: #46443f; }
.desktop-nav a { position: relative; padding: 29px 0; }
.desktop-nav a::after { content: ""; position: absolute; left: 0; bottom: 21px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .25s ease; }
.desktop-nav a:hover::after, .desktop-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.nav-actions { display: flex; gap: 8px; }
.icon-button { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 2px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.icon-button:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.menu-button { display: none; }
.mobile-nav { padding: 12px 24px 22px; border-top: 1px solid var(--line); }
.mobile-nav a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); }

.hero { position: relative; min-height: calc(100svh - var(--header-height)); padding: clamp(58px, 7vw, 104px) 32px 0; display: flex; flex-direction: column; overflow: hidden; }
.hero::before { content: ""; position: absolute; right: 0; top: 0; width: 34%; height: 100%; background: linear-gradient(135deg, transparent 49.7%, rgba(0,191,174,.08) 50%, transparent 50.3%); background-size: 28px 28px; pointer-events: none; }
.hero-inner { width: 100%; max-width: var(--max); margin: auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .65fr); gap: clamp(48px, 9vw, 140px); align-items: center; }
.eyebrow, .section-index { margin: 0 0 24px; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent-dark); }
.eyebrow span { width: 32px; height: 1px; background: var(--accent); }
.hero h1 { margin: 0; max-width: 780px; font-size: clamp(54px, 6.2vw, 94px); line-height: 1.03; font-weight: 800; letter-spacing: 0; }
.hero-lead { max-width: 675px; margin: 35px 0 0; font-size: clamp(17px, 1.55vw, 21px); line-height: 1.85; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.button { min-height: 50px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 36px; border: 1px solid var(--ink); font-size: 14px; font-weight: 600; transition: transform .2s, background .2s, color .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--ink); color: var(--white); }
.button-primary:hover { background: var(--accent); border-color: var(--accent); }
.button-secondary:hover { background: var(--white); }
.hero-portrait { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.portrait-frame { position: relative; aspect-ratio: 4 / 5; min-height: 430px; overflow: hidden; background: #13242c; box-shadow: 18px 18px 0 rgba(0,191,174,.12); }
.portrait-frame::before { content: ""; position: absolute; inset: 18px; z-index: 2; border: 1px solid rgba(255,255,255,.4); pointer-events: none; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 44% center; filter: saturate(.88) contrast(1.02); }
.portrait-label { position: absolute; z-index: 3; right: 0; bottom: 0; min-width: 154px; padding: 15px 18px; background: var(--paper); }
.portrait-label span, .portrait-label strong { display: block; }
.portrait-label span { margin-bottom: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.portrait-label strong { font-size: 14px; }
.availability { margin-top: 15px; display: flex; align-items: center; gap: 9px; font-size: 10px; font-weight: 700; color: var(--muted); }
.availability span { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgba(216,243,90,.18); }
.hero-stats { width: 100%; max-width: var(--max); margin: clamp(55px, 6vw, 90px) auto 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.hero-stats div { padding: 27px 24px 32px 0; border-right: 1px solid var(--line); }
.hero-stats div:not(:first-child) { padding-left: 28px; }
.hero-stats div:last-child { border-right: 0; }
.hero-stats strong { display: block; font-size: 42px; line-height: 1; }
.hero-stats strong span { color: var(--accent); font-size: 22px; }
.hero-stats p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.metric-code { display: block; margin-bottom: 13px; color: var(--accent-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }

.section { padding: clamp(90px, 11vw, 160px) 32px; }
.section-heading { max-width: var(--max); margin: 0 auto; }
.section-index { color: var(--accent-dark); }
.section-heading h2, .contact h2 { margin: 0; font-size: clamp(39px, 5vw, 68px); line-height: 1.12; letter-spacing: 0; }
.about-grid { max-width: var(--max); margin: 80px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(70px, 10vw, 150px); }
.about-copy { color: var(--muted); font-size: 16px; line-height: 1.9; }
.about-copy p { margin: 0 0 24px; }
.about-copy .large-copy { color: var(--ink); font-size: clamp(23px, 2.4vw, 34px); line-height: 1.55; font-weight: 500; }
.capabilities { border-top: 1px solid var(--line); }
.capabilities article { display: grid; grid-template-columns: 55px 1fr; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.capabilities article > span { padding-top: 4px; color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.capabilities h3 { margin: 0 0 8px; font-size: 18px; }
.capabilities p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.case-study { padding: clamp(90px, 10vw, 145px) 32px; background: #dfe7e9; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-shell { max-width: var(--max); margin: auto; }
.case-heading { display: flex; justify-content: space-between; align-items: end; gap: 50px; }
.case-heading h2 { margin: 0; font-size: clamp(38px, 4.5vw, 63px); line-height: 1.14; }
.live-status { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #aab9bd; background: rgba(251,253,253,.55); color: #3d4b51; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.live-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(0,191,174,.12); }
.case-dashboard { margin-top: 64px; display: grid; grid-template-columns: .85fr 1.15fr; border: 1px solid #9fadb1; background: var(--ink); color: var(--white); box-shadow: 14px 14px 0 rgba(0,127,117,.13); }
.case-summary { padding: clamp(34px, 5vw, 66px); border-right: 1px solid #344149; background-image: radial-gradient(#324149 1px, transparent 1px); background-size: 18px 18px; }
.terminal-label { margin: 0 0 34px; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.case-summary h3 { margin: 0 0 18px; font-size: clamp(34px, 4vw, 56px); }
.case-summary > p:not(.terminal-label) { margin: 0; color: #b9c4c8; line-height: 1.9; }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.case-tags span { padding: 6px 9px; border: 1px solid #3c4a51; color: #dce3e5; font-size: 11px; }
.case-metrics { display: grid; grid-template-columns: 1fr 1fr; }
.case-metrics div { min-height: 190px; padding: 30px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid #344149; border-bottom: 1px solid #344149; }
.case-metrics div:nth-child(2n) { border-right: 0; }
.case-metrics div:nth-child(n+3) { border-bottom: 0; }
.case-metrics span { color: #839198; font-size: 12px; }
.case-metrics strong { color: var(--signal); font-size: clamp(37px, 4vw, 58px); line-height: 1; }
.case-metrics small { color: #b9c4c8; font-size: 11px; }
.portfolio-proof { margin: 28px 0 0; padding-left: 18px; border-left: 2px solid var(--accent); color: #46555b; }

.experience { background-color: var(--ink); background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 48px 48px; color: var(--white); }
.section-heading.light .section-index { color: var(--accent); }
.timeline { max-width: var(--max); margin: 85px auto 0; border-top: 1px solid #344149; }
.timeline-item { display: grid; grid-template-columns: 175px minmax(230px, .8fr) minmax(320px, 1.3fr); gap: 40px; padding: 36px 0 42px; border-bottom: 1px solid #344149; }
.timeline time { color: #aaa9a2; font-size: 13px; }
.timeline-role h3 { margin: 0 0 8px; font-size: 21px; }
.timeline-role p { margin: 0; color: #aaa9a2; font-size: 14px; }
.timeline-detail { color: #cbc9c1; font-size: 14px; line-height: 1.8; }
.timeline-detail p { margin: 0; }
.timeline-detail ul { margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.timeline-detail li { padding: 5px 9px; border: 1px solid #3a4b52; color: #d9f8f4; font-size: 12px; }

.work { background: var(--white); }
.work-header { max-width: var(--max); margin: auto; display: grid; grid-template-columns: 1.5fr .5fr; gap: 80px; align-items: end; }
.work-header .section-heading { margin: 0; }
.work-header > p { margin: 0 0 9px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.filter-bar { max-width: var(--max); margin: 55px auto 0; flex-wrap: wrap; gap: 8px; }
.filter-button { flex: 0 0 auto; padding: 9px 15px; border: 1px solid var(--line); background: transparent; color: var(--muted); white-space: nowrap; cursor: pointer; }
.filter-button.active, .filter-button:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
.project-grid { max-width: var(--max); margin: 32px auto 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project-card { min-width: 0; text-align: left; padding: 0; border: 0; background: transparent; cursor: pointer; }
.project-image { position: relative; aspect-ratio: 1 / 1; padding: 24px; display: grid; place-items: center; background: #eef2f3; overflow: hidden; border: 1px solid #d7dfe1; }
.project-image img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform .45s ease; }
.project-card:hover .project-image img { transform: scale(1.025); }
.project-view { position: absolute; right: 14px; bottom: 14px; padding: 9px 11px; display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--white); font-size: 11px; }
.project-view svg { width: 14px; height: 14px; }
.project-meta { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0 8px; border-bottom: 1px solid var(--line); }
.project-meta h3 { margin: 0; font-size: 20px; }
.project-meta span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.project-meta > span { flex: 0 0 auto; color: var(--accent-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.project-note { max-width: var(--max); margin: 34px auto 0; padding-top: 18px; border-top: 1px solid var(--line); color: #738086; font-size: 11px; line-height: 1.7; }
.education-band { max-width: var(--max); margin: 0 auto; padding: 80px 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.education-band > div { padding: 10px 34px; border-left: 1px solid var(--line); }
.education-band > div:first-child { padding-left: 0; border-left: 0; }
.education-band p { margin: 0 0 18px; color: var(--accent-dark); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.education-band strong, .education-band span { display: block; }
.education-band strong { margin-bottom: 9px; font-size: 18px; }
.education-band span { color: var(--muted); font-size: 13px; line-height: 1.6; }

.contact { padding: clamp(100px, 13vw, 190px) 32px; background-color: var(--accent); background-image: linear-gradient(rgba(11,18,23,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(11,18,23,.09) 1px, transparent 1px); background-size: 32px 32px; color: #07100f; }
.contact-inner { max-width: var(--max); margin: auto; }
.contact .section-index { color: #064c47; }
.contact-email { max-width: 930px; margin-top: 60px; padding: 18px 0; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid rgba(27,23,20,.55); font-size: clamp(22px, 4.4vw, 57px); font-weight: 500; overflow-wrap: anywhere; }
.contact-email svg { width: 38px; height: 38px; flex: 0 0 auto; }
.contact-note { margin: 22px 0 0; font-size: 13px; }
footer { min-height: 110px; padding: 30px max(32px, calc((100vw - var(--max)) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 30px; background: var(--ink); color: #aaa9a2; font-size: 12px; }
footer a { display: inline-flex; align-items: center; gap: 8px; color: var(--white); }
footer svg { width: 15px; height: 15px; }

.project-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100svh - 40px); padding: 0; border: 0; background: var(--white); color: var(--ink); }
.project-dialog::backdrop { background: rgba(10,10,9,.76); backdrop-filter: blur(5px); }
.dialog-close { position: sticky; z-index: 2; float: right; top: 18px; right: 18px; margin: 18px; background: var(--white); }
.dialog-body { padding: 20px 54px 60px; clear: both; }
.dialog-body img { width: 100%; aspect-ratio: 1 / 1; padding: 24px; object-fit: contain; margin-bottom: 35px; background: #eef2f3; }
.dialog-body h2 { font-size: 38px; margin: 0 0 12px; }
.dialog-body .dialog-tags { color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.dialog-body p { color: var(--muted); line-height: 1.85; }
.dialog-summary { color: var(--ink) !important; font-size: 18px; font-weight: 600; }
.dialog-highlights { margin: 22px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-highlights span { padding: 7px 10px; background: #e5f5f2; border: 1px solid #afd9d3; color: #006b63; font-size: 11px; }
.sku-panel { margin: 28px 0; padding: 18px; border: 1px solid var(--line); background: var(--paper); }
.sku-panel > span { color: var(--accent-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.sku-panel p { margin: 9px 0 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.dialog-actions { display: flex; margin-top: 26px; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  :root { --header-height: 70px; }
  .desktop-nav { display: none; }
  .menu-button { display: inline-grid; }
  .hero { min-height: auto; }
  .hero-inner { grid-template-columns: 1fr .6fr; gap: 42px; }
  .hero h1 { font-size: clamp(50px, 8vw, 72px); }
  .portrait-frame { min-height: 380px; }
  .timeline-item { grid-template-columns: 150px 1fr; }
  .timeline-detail { grid-column: 2; }
  .case-heading { align-items: start; flex-direction: column; gap: 28px; }
  .case-dashboard { grid-template-columns: 1fr; }
  .case-summary { border-right: 0; border-bottom: 1px solid #344149; }
  .work-header { grid-template-columns: 1fr; gap: 26px; }
  .education-band { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 48px; }
  .education-band > div, .education-band > div:first-child { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .education-band > div:last-child { border-bottom: 0; }
}

@media (max-width: 680px) {
  .nav-shell, .hero, .section, .contact { padding-left: 20px; padding-right: 20px; }
  .brand-name { display: none; }
  .hero { padding-top: 50px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(45px, 14vw, 64px); }
  .hero-lead { margin-top: 26px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .button { gap: 16px; padding: 0 15px; }
  .hero-portrait { margin-top: 10px; }
  .portrait-frame { width: 100%; min-height: 0; aspect-ratio: 4 / 4.5; }
  .portrait-frame img { object-position: 44% center; }
  .hero-stats { grid-template-columns: 1fr 1fr; margin-top: 48px; }
  .hero-stats div { padding: 22px 12px 25px 0; border-bottom: 1px solid var(--line); }
  .hero-stats div:not(:first-child) { padding-left: 18px; }
  .hero-stats div:nth-child(2) { border-right: 0; }
  .hero-stats div:nth-child(3) { padding-left: 0; }
  .hero-stats strong { font-size: 34px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; margin-top: 48px; }
  .case-study { padding-left: 20px; padding-right: 20px; }
  .case-dashboard { margin-top: 44px; box-shadow: 8px 8px 0 rgba(0,127,117,.13); }
  .case-summary { padding: 34px 24px; }
  .case-metrics div { min-height: 155px; padding: 22px 18px; }
  .case-metrics strong { font-size: clamp(30px, 10vw, 43px); }
  .case-metrics small { line-height: 1.5; }
  .timeline { margin-top: 55px; }
  .timeline-item { grid-template-columns: 1fr; gap: 19px; }
  .timeline-detail { grid-column: auto; }
  .timeline-role h3 { font-size: 19px; }
  .project-grid { grid-template-columns: 1fr; }
  .filter-bar { margin-top: 34px; }
  .filter-button { padding: 8px 11px; font-size: 13px; }
  .project-image { padding: 18px; }
  .project-meta { align-items: start; }
  .project-meta h3 { font-size: 18px; line-height: 1.45; }
  .education-band { padding-left: 20px; padding-right: 20px; }
  .contact-email { margin-top: 38px; gap: 15px; font-size: clamp(19px, 6.5vw, 30px); }
  .contact-email svg { width: 26px; height: 26px; }
  footer { padding: 28px 20px; flex-wrap: wrap; }
  footer p:nth-child(2) { display: none; }
  .project-dialog { width: calc(100% - 16px); max-height: calc(100svh - 16px); }
  .dialog-close { top: 10px; right: 10px; margin: 10px; background: var(--ink); color: var(--white); }
  .dialog-body { padding: 6px 18px 34px; }
  .dialog-body img { padding: 14px; margin-bottom: 25px; }
  .dialog-body h2 { font-size: 29px; }
  .dialog-summary { font-size: 16px; }
  .dialog-actions .button { width: 100%; }
}
