:root {
  --bg: #090d0f;
  --surface: #101619;
  --surface-2: #151d20;
  --text: #f3f7f7;
  --muted: #9bacb0;
  --line: #293437;
  --accent: #8cf7c4;
  --accent-2: #81d8ff;
  --danger: #ff8d85;
  --shadow: 0 18px 60px rgba(0,0,0,.26);
  --radius: 18px;
  --max: 1180px;
}
html[data-theme="light"] {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #edf2f1;
  --text: #111718;
  --muted: #59686b;
  --line: #ccd7d5;
  --accent: #087f5b;
  --accent-2: #006d96;
  --shadow: 0 18px 50px rgba(20,42,45,.10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; transition: background .2s ease, color .2s ease; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; padding: 10px 14px; background: var(--accent); color: #06100d; font-weight: 800; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.system-bar { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 20px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.system-bar a { margin-left: auto; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.site-header { position: sticky; top: 0; z-index: 100; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px; min-height: 72px; padding: 10px max(20px, calc((100vw - var(--max)) / 2)); border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 10px; color: var(--accent); font-weight: 900; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; line-height: 1.2; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
nav { justify-self: center; display: flex; gap: 4px; }
.header-actions { display: inline-flex; align-items: center; gap: 10px; }
.lang-control { display: inline-flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 12px; }
.lang-control span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.lang-control select { min-width: 122px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.lang-control select option { background: var(--surface); color: var(--text); }
nav a { padding: 9px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
nav a:hover, nav a.active { color: var(--text); background: var(--surface-2); }
.theme-toggle, .menu-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; cursor: pointer; }
.theme-toggle { width: 40px; height: 40px; font-size: 18px; }
.menu-toggle { display: none; padding: 9px 12px; }
.section-shell { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.hero { min-height: calc(100vh - 110px); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 48px; align-items: center; padding-block: 76px 40px; }
.hero-copy { max-width: 780px; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.eyebrow span, .section-heading > span, .card > span, .project-top, .flow article > span, .capability-list span, .contact-copy > span { color: var(--accent); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.kicker { color: var(--muted); font-weight: 700; letter-spacing: .04em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: clamp(48px, 7vw, 92px); line-height: .98; letter-spacing: -.065em; }
h1 em { color: var(--accent); font-style: normal; }
.hero-lede { max-width: 720px; margin-bottom: 30px; color: var(--muted); font-size: clamp(17px, 2vw, 21px); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 0 18px; border-radius: 11px; font-weight: 800; text-decoration: none; }
.button.primary { background: var(--accent); color: #07110e; }
.button.secondary { border: 1px solid var(--line); background: var(--surface); }
.text-link { padding: 8px; color: var(--muted); font-weight: 700; text-decoration: none; }
.hero-panel { position: relative; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(150deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow); }
.portrait-wrap { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-2); }
.portrait-wrap img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) contrast(1.04); }
.scan-line { position: absolute; inset-inline: 0; top: 15%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .65; animation: scan 5s linear infinite; }
@keyframes scan { to { top: 90%; } }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; }
.identity-grid div { padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 82%, transparent); }
.identity-grid dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.identity-grid dd { margin: 3px 0 0; font-size: 13px; font-weight: 800; }
.metric-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric-strip div { padding: 18px 20px; border-right: 1px solid var(--line); background: var(--surface); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip strong, .metric-strip span { display: block; }
.metric-strip strong { color: var(--accent); font: 800 25px/1 ui-monospace, monospace; }
.metric-strip span { margin-top: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.section-block { padding-block: 96px; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(130px, .35fr) minmax(0, 1fr); gap: 28px; margin-bottom: 40px; }
.section-heading h2 { max-width: 820px; margin-bottom: 0; font-size: clamp(35px, 5vw, 60px); line-height: 1.04; letter-spacing: -.045em; }
.section-heading p { grid-column: 2; color: var(--muted); max-width: 680px; }
.about-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 38px; }
.lead { color: var(--muted); font-size: 19px; }
.core-grid, .project-grid, .education-grid { display: grid; gap: 14px; }
.core-grid { grid-template-columns: 1fr 1fr; }
.card, .project-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card { padding: 24px; }
.card h3, .project-card h3 { margin: 12px 0 10px; font-size: 21px; line-height: 1.2; }
.card p, .project-card p, .card small { color: var(--muted); }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 14px; }
.flow article { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.flow h3 { margin: 12px 0 8px; }
.flow p { color: var(--muted); margin-bottom: 0; }
.flow-arrow { display: grid; place-items: center; color: var(--accent); font-size: 28px; }
.project-grid { grid-template-columns: 1fr 1fr; }
.project-card { display: flex; flex-direction: column; min-height: 390px; padding: 26px; }
.project-top { display: flex; justify-content: space-between; }
.status { padding: 5px 8px; border: 1px solid currentColor; border-radius: 999px; }
.status.active { color: var(--accent); }
.status.field { color: var(--accent-2); }
.status.prototype { color: #ffd18a; }
.status.build { color: #d9b0ff; }
.project-card p { font-size: 16px; }
.project-card ul { padding-left: 18px; color: var(--muted); }
.project-card a { margin-top: auto; color: var(--accent); font-weight: 800; text-decoration: none; }
.capability-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.capability-list > div { display: grid; grid-template-columns: 160px 1fr 1.3fr; gap: 24px; align-items: baseline; padding: 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.capability-list > div:last-child { border-bottom: 0; }
.capability-list h3, .capability-list p { margin-bottom: 0; }
.capability-list p { color: var(--muted); }
.timeline { border-top: 1px solid var(--line); }
.timeline-item { display: grid; grid-template-columns: .35fr 1fr; gap: 36px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.timeline-meta span, .timeline-meta strong { display: block; }
.timeline-meta span { color: var(--accent); font: 700 12px ui-monospace, monospace; }
.timeline-meta strong { margin-top: 6px; color: var(--muted); font-size: 13px; }
.timeline h3 { margin-bottom: 4px; font-size: 27px; }
.timeline h4 { color: var(--accent-2); font-size: 15px; }
.timeline p { max-width: 760px; color: var(--muted); }
.education-grid { grid-template-columns: repeat(3, 1fr); }
.language-line { display: grid; grid-template-columns: 160px 1fr; gap: 24px; margin-top: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.language-line span { color: var(--accent); font: 700 12px ui-monospace, monospace; text-transform: uppercase; }
.language-line p { margin: 0; color: var(--muted); }
.contact { display: grid; grid-template-columns: 1fr .8fr; gap: 46px; }
.contact-copy h2 { margin: 15px 0 18px; font-size: clamp(36px, 5vw, 60px); line-height: 1.05; letter-spacing: -.04em; }
.contact-copy p { max-width: 700px; color: var(--muted); }
.contact-links { display: grid; gap: 10px; }
.contact-links a { display: block; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; }
.contact-links span, .contact-links strong { display: block; }
.contact-links span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.contact-links strong { margin-top: 5px; font-size: 14px; overflow-wrap: anywhere; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px max(20px, calc((100vw - var(--max)) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto auto; }
  .header-actions { justify-self: end; }
  .lang-control span { display: none; }
  .lang-control { padding-inline: 8px; }
  .lang-control select { min-width: 96px; }
  .menu-toggle { display: block; }
  nav { position: absolute; top: calc(100% + 1px); inset-inline: 0; display: none; flex-direction: column; padding: 12px 20px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
  nav.open { display: flex; }
  nav a { padding: 12px; }
  .hero { grid-template-columns: 1fr; }
  .hero-panel { max-width: 520px; }
  .about-layout, .contact { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); }
  .education-grid { grid-template-columns: 1fr; }
  .capability-list > div { grid-template-columns: 130px 1fr; }
  .capability-list p { grid-column: 2; }
}
@media (max-width: 660px) {
  .system-bar { justify-content: flex-start; overflow: hidden; white-space: nowrap; }
  .system-bar a { display: none; }
  .brand small { display: none; }
  .header-actions { gap: 8px; }
  .lang-control { padding: 6px 8px; }
  .lang-control select { min-width: 82px; max-width: 82px; }
  .section-shell { width: min(100% - 26px, var(--max)); }
  .hero { padding-top: 48px; }
  h1 { font-size: clamp(46px, 15vw, 68px); }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip div:nth-child(2) { border-right: 0; }
  .metric-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .section-block { padding-block: 70px; }
  .section-heading { grid-template-columns: 1fr; gap: 14px; }
  .section-heading p { grid-column: 1; }
  .core-grid, .project-grid { grid-template-columns: 1fr; }
  .capability-list > div, .timeline-item, .language-line { grid-template-columns: 1fr; gap: 10px; }
  .capability-list p { grid-column: 1; }
  .project-card { min-height: 0; }
  .site-footer { flex-direction: column; }
}
@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; }
}

/* Header language switch adjustments */
.site-header { grid-template-columns: auto 1fr auto; }
nav { justify-self: center; }
.header-actions { display: flex; align-items: center; gap: 12px; justify-self: end; }
.lang-switch { display: grid; gap: 4px; min-width: 168px; }
.lang-switch span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.lang-switch select {
  appearance: none;
  min-height: 42px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.lang-switch select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto auto; align-items: start; }
  .header-actions { align-items: flex-start; }
  .lang-switch { min-width: 142px; }
}

@media (max-width: 660px) {
  .site-header { grid-template-columns: 1fr auto; gap: 10px; }
  .menu-toggle { order: 2; }
  .header-actions { grid-column: 1 / -1; justify-content: space-between; }
  .lang-switch { flex: 1; min-width: 0; }
  .lang-switch select { width: 100%; }
}
