:root {
  --bg: #1a1a1a;
  --bg-soft: #202120;
  --panel: #252625;
  --panel-2: #2d2f2d;
  --text: #f1eee7;
  --muted: #b7b1a7;
  --red: #a34c43;
  --red-bright: #b55449;
  --green: #658963;
  --green-dark: #3c4d3b;
  --slate: #99a1af;
  --orange: #e0a15e;
  --line: #3d403d;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
  --radius: 18px;
  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
::selection { background: var(--red); color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 18px; top: 14px; z-index: 999;
  transform: translateY(-150%); padding: 10px 14px; background: var(--orange); color: #181818;
  border-radius: 8px; font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }
.shell { width: var(--shell); margin-inline: auto; }
.section { position: relative; padding: 110px 0; }
.section--muted {
  background: linear-gradient(180deg, rgba(255,255,255,.012), rgba(255,255,255,.025));
  border-block: 1px solid rgba(255,255,255,.04);
}
.section--work { background: #191a19; }
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Ambient interface */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(153,161,175,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(153,161,175,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 76%);
}
.ambient__noise {
  position: absolute; inset: 0; opacity: .18;
  background-image: radial-gradient(circle at 30% 20%, rgba(181,84,73,.11), transparent 28%), radial-gradient(circle at 74% 14%, rgba(101,137,99,.1), transparent 30%);
}
.ambient__line { position: absolute; height: 1px; background: linear-gradient(90deg, transparent, var(--red), transparent); opacity: .28; }
.ambient__line--a { top: 34%; left: -10%; width: 58%; transform: rotate(-8deg); }
.ambient__line--b { top: 70%; right: -10%; width: 50%; transform: rotate(5deg); background: linear-gradient(90deg, transparent, var(--green), transparent); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100; height: 76px;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}
.site-header.is-scrolled { background: rgba(26,26,26,.92); border-color: rgba(255,255,255,.08); backdrop-filter: blur(14px); }
.header__inner { height: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .055em; white-space: nowrap; }
.brand__mark { color: var(--orange); font-size: 18px; }
.brand__text { font-size: 17px; }
.brand__status {
  font-family: Consolas, monospace; color: var(--green); font-size: 9px; border: 1px solid var(--green-dark);
  padding: 3px 5px; border-radius: 4px; letter-spacing: .08em;
}
.main-nav { justify-self: center; display: flex; gap: 25px; }
.main-nav a { color: #d7d2c9; font-size: 14px; position: relative; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -9px; height: 2px; background: var(--red); transition: right .2s ease; }
.main-nav a:hover::after { right: 0; }
.header-links { display: flex; gap: 8px; }
.header-links a { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; font: 700 11px Consolas, monospace; background: #202120; }
.menu-toggle { display: none; width: 42px; height: 42px; background: transparent; border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.menu-toggle span:not(.sr-only) { display: block; height: 1px; background: var(--text); margin: 5px 0; }

/* Hero */
.hero { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 44px; padding-top: 70px; padding-bottom: 95px; }
.hero::before { content: ""; position: absolute; left: 47%; top: 10%; width: 1px; height: 70%; background: linear-gradient(var(--red), transparent); opacity: .28; }
.hero__copy { position: relative; z-index: 2; }
.eyebrow, .kicker { font: 700 11px/1.2 Consolas, monospace; letter-spacing: .15em; text-transform: uppercase; color: var(--orange); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #4a3c32; background: #221f1c; border-radius: 5px; padding: 8px 10px; }
.eyebrow__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(101,137,99,.12); }
.hero__hello { margin: 24px 0 0; color: var(--muted); font-size: clamp(19px, 2vw, 26px); }
.hero h1 { margin: 0; font-size: clamp(62px, 8vw, 112px); line-height: .88; letter-spacing: -.055em; font-weight: 900; }
.accent { color: var(--red-bright); }
.hero__role { margin: 15px 0 18px; font-size: clamp(26px, 4vw, 48px); line-height: 1.05; font-weight: 800; letter-spacing: -.035em; color: #dfddd7; }
.cursor { display: inline-block; width: .5em; height: 1em; margin-left: 6px; vertical-align: -.09em; background: var(--orange); }
.hero__intro { max-width: 650px; color: var(--muted); font-size: 17px; }
.hero__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.hero__tags span, .project-card__tags span {
  border: 1px solid #444743; background: #222322; color: #d9d4cb; border-radius: 6px; padding: 7px 10px; font: 700 11px Consolas, monospace;
}
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 48px;
  padding: 0 18px; border: 1px solid var(--line); border-radius: 8px; font-weight: 800; font-size: 14px;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.btn--primary:hover { background: var(--red-bright); }
.btn--ghost { background: #202120; }
.hero__socials { display: flex; gap: 12px; margin-top: 22px; color: #a9a39b; font: 700 12px Consolas, monospace; }
.hero__socials a:hover { color: var(--orange); }

.hero__visual { position: relative; min-height: 620px; transform: translate(var(--parallax-x, 0), var(--parallax-y, 0)); transition: transform .2s ease-out; }
.robot-frame {
  position: absolute; inset: 3% 4% 2% 10%; border: 1px solid #4b4e4a; border-radius: 26px 26px 80px 26px;
  background:
    linear-gradient(135deg, rgba(101,137,99,.14), transparent 40%),
    radial-gradient(circle at 68% 35%, rgba(163,76,67,.16), transparent 30%),
    #1f201f;
  overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.45);
}
.robot-frame::before { content: ""; position: absolute; inset: 18px; border: 1px dashed rgba(224,161,94,.25); border-radius: 18px 18px 70px 18px; }
.robot-frame::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(transparent, rgba(26,26,26,.95)); }
.robot { position: absolute; width: 78%; max-height: 96%; object-fit: contain; object-position: bottom; bottom: -2%; left: 3%; filter: drop-shadow(20px 20px 22px rgba(0,0,0,.45)); z-index: 2; }
.robot-frame__label { position: absolute; right: 24px; bottom: 20px; z-index: 5; font: 700 10px Consolas, monospace; letter-spacing: .14em; color: var(--orange); }
.robot-frame__scan { position: absolute; z-index: 4; left: 0; right: 0; top: 12%; height: 1px; background: linear-gradient(90deg, transparent, rgba(224,161,94,.75), transparent); box-shadow: 0 0 16px rgba(224,161,94,.3); }
.robot-frame__cross { position: absolute; z-index: 5; width: 22px; height: 22px; }
.robot-frame__cross::before, .robot-frame__cross::after { content: ""; position: absolute; background: var(--red); }
.robot-frame__cross::before { width: 22px; height: 1px; top: 10px; }
.robot-frame__cross::after { width: 1px; height: 22px; left: 10px; }
.robot-frame__cross--tl { top: 30px; left: 28px; }
.robot-frame__cross--br { right: 28px; bottom: 32px; }
.terminal-chip { position: absolute; z-index: 6; width: 124px; background: rgba(26,26,26,.94); border: 1px solid #4a4d49; border-left: 3px solid var(--green); padding: 10px; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.terminal-chip small, .terminal-chip span { display: block; font: 700 8px Consolas, monospace; letter-spacing: .1em; color: #8e928c; }
.terminal-chip strong { display: block; font: 900 22px Consolas, monospace; color: var(--orange); margin: 2px 0; }
.terminal-chip--left { left: 0; top: 19%; }
.terminal-chip--right { right: 0; bottom: 19%; border-left-color: var(--red); }
.orbit { position: absolute; border: 1px solid rgba(153,161,175,.22); border-radius: 50%; pointer-events: none; }
.orbit i { position: absolute; width: 7px; height: 7px; background: var(--orange); border-radius: 50%; }
.orbit--1 { width: 140px; height: 50px; right: -1%; top: 17%; transform: rotate(-22deg); }
.orbit--1 i { right: 22px; top: -3px; }
.orbit--2 { width: 95px; height: 34px; left: 0; bottom: 12%; transform: rotate(18deg); }
.orbit--2 i { left: 18px; bottom: -3px; background: var(--green); }
.hero__rail { position: absolute; left: 0; right: 0; bottom: 28px; display: flex; gap: 14px; align-items: center; font: 700 9px Consolas, monospace; letter-spacing: .14em; color: #777a76; }
.hero__rail b { width: 70px; height: 1px; background: var(--red); }

/* Section heading */
.section-heading { display: grid; grid-template-columns: 62px auto 1fr; gap: 16px; align-items: end; margin-bottom: 46px; }
.section-index { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--red); color: var(--red-bright); font: 800 12px Consolas, monospace; border-radius: 50%; }
.section-heading h2 { margin: 4px 0 0; font-size: clamp(36px, 5vw, 64px); line-height: 1; letter-spacing: -.045em; }
.section-note { max-width: 390px; justify-self: end; color: var(--muted); margin: 0; font-size: 14px; }

/* About */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 42px; align-items: center; }
.about-art { position: relative; min-height: 500px; overflow: hidden; background: #202120; }
.about-art::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,.025) 32px), repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,.025) 32px); }
.about-art img { position: absolute; bottom: -4%; left: 4%; width: 88%; z-index: 2; filter: drop-shadow(20px 26px 28px rgba(0,0,0,.45)); }
.about-art__hud { position: absolute; top: 18px; left: 18px; right: 18px; display: flex; justify-content: space-between; gap: 8px; z-index: 4; color: var(--green); font: 700 8px Consolas, monospace; letter-spacing: .08em; }
.about-art__caption { position: absolute; z-index: 5; right: 16px; bottom: 14px; color: var(--orange); font: 700 9px Consolas, monospace; letter-spacing: .08em; }
.about-copy { max-width: 690px; }
.about-copy .lead { font-size: clamp(23px, 3vw, 35px); line-height: 1.3; color: #e7e3dc; letter-spacing: -.02em; }
.about-copy > p:not(.lead) { color: var(--muted); font-size: 16px; }
.capability-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.capability-list span { padding: 9px 11px; background: rgba(101,137,99,.13); border: 1px solid #435442; color: #bfcbbb; border-radius: 6px; font-size: 12px; font-weight: 700; }

/* Stack */
.stack-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.stack-card { grid-column: span 3; min-height: 250px; position: relative; padding: 24px; border: 1px solid #40423f; background: #202120; border-radius: 12px; overflow: hidden; }
.stack-card--small { grid-column: span 12; min-height: auto; }
.stack-card::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 100px; height: 100px; border: 1px solid rgba(181,84,73,.18); border-radius: 50%; }
.stack-card__code { position: absolute; top: 15px; right: 16px; color: #737873; font: 800 10px Consolas, monospace; }
.stack-card h3 { margin: 25px 0 16px; color: var(--orange); font-size: 22px; }
.stack-card ul { list-style: none; padding: 0; margin: 0; }
.stack-card li { padding: 7px 0; border-bottom: 1px solid #333532; color: #c7c2ba; font-family: Consolas, monospace; font-size: 12px; }
.stack-card li:last-child { border-bottom: 0; }
.stack-card:hover { border-color: var(--green); transform: translateY(-3px); }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid #3d403d; border-left: 1px solid #3d403d; }
.service-card { min-height: 260px; padding: 24px 20px; border-right: 1px solid #3d403d; border-bottom: 1px solid #3d403d; background: #1e1f1e; position: relative; }
.service-card > span { color: #6e726d; font: 800 10px Consolas, monospace; }
.service-card h3 { margin-top: 54px; font-size: 20px; line-height: 1.15; }
.service-card p { color: var(--muted); font-size: 13px; }
.service-card::after { content: "+"; position: absolute; right: 14px; top: 12px; color: var(--red); font: 700 16px Consolas, monospace; }
.service-card:hover { background: #232523; }
.service-card:hover h3 { color: var(--orange); }

/* Projects */
.projects-layout { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.project-card { grid-column: span 4; border: 1px solid #40423f; border-radius: 14px; overflow: hidden; background: #202120; }
.project-card--featured { grid-column: span 8; display: grid; grid-template-columns: 1.15fr .85fr; }
.project-card__media { position: relative; min-height: 230px; background: #161716; overflow: hidden; }
.project-card--featured .project-card__media { min-height: 100%; }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(1.02); transition: transform .4s ease, filter .4s ease; }
.project-card:hover .project-card__media img { transform: scale(1.025); filter: saturate(1); }
.project-card__status { position: absolute; left: 12px; top: 12px; padding: 5px 7px; background: rgba(26,26,26,.9); border: 1px solid #464944; border-radius: 5px; color: var(--green); text-transform: uppercase; font: 700 8px Consolas, monospace; letter-spacing: .08em; }
.project-card__placeholder { height: 100%; min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, #1b1c1b 0 10px, #1f201f 10px 20px); color: #5c605b; }
.project-card__placeholder strong { font: 800 48px Consolas, monospace; color: var(--red); margin: 6px 0; }
.project-card__placeholder span, .project-card__placeholder small { font: 700 9px Consolas, monospace; letter-spacing: .1em; }
.project-card__body { padding: 20px; }
.project-card__meta { display: flex; justify-content: space-between; gap: 12px; color: var(--orange); font: 700 9px Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
.project-card h3 { margin: 12px 0 8px; font-size: 28px; letter-spacing: -.025em; }
.project-card p { color: var(--muted); font-size: 13px; }
.project-card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.project-card__tags span { padding: 5px 7px; font-size: 9px; }
.project-card__actions { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.project-link { font: 800 11px Consolas, monospace; color: #bdb7af; }
.project-link--primary { color: var(--orange); }

/* Labs */
.labs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lab-card { min-height: 280px; padding: 22px; border: 1px solid #3f413e; border-radius: 16px; background: #212221; position: relative; overflow: hidden; }
.lab-card::after { content: ""; position: absolute; width: 160px; height: 160px; right: -70px; bottom: -70px; border: 1px solid #4b4e49; transform: rotate(45deg); }
.lab-card--orange { border-top: 3px solid var(--orange); }
.lab-card--green { border-top: 3px solid var(--green); }
.lab-card--wide { grid-column: span 3; min-height: 240px; display: grid; grid-template-columns: 280px 1fr; align-items: center; gap: 28px; background: #a34c43; border-color: #a34c43; }
.lab-card--wide img { width: 250px; max-height: 250px; object-fit: contain; margin-top: -35px; filter: drop-shadow(14px 14px 18px rgba(0,0,0,.3)); }
.lab-card__meta { display: flex; justify-content: space-between; color: var(--orange); font: 700 9px Consolas, monospace; letter-spacing: .08em; }
.lab-card--wide .lab-card__meta, .lab-card--wide p { color: #f0ddd6; }
.lab-card h3 { margin: 42px 0 12px; font-size: 29px; }
.lab-card--wide h3 { margin: 10px 0; font-size: 38px; }
.lab-card p { color: var(--muted); font-size: 14px; max-width: 600px; }
.lab-card__footer { position: absolute; left: 22px; bottom: 20px; color: #737772; font: 700 9px Consolas, monospace; }

/* Github */
.github-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 50px; align-items: center; }
.github-profile h2 { margin: 10px 0 12px; font-size: clamp(50px, 7vw, 90px); letter-spacing: -.06em; }
.github-profile > p:not(.kicker) { color: var(--muted); max-width: 500px; }
.github-stats { display: flex; gap: 36px; margin-top: 28px; }
.github-stats div { display: flex; flex-direction: column; }
.github-stats strong { font-size: 29px; color: var(--orange); }
.github-stats span { color: #8d918b; font: 700 9px Consolas, monospace; text-transform: uppercase; }
.github-console { padding: 20px; background: #1d1e1d; }
.console-head { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid #383a37; color: #7d817b; font: 700 9px Consolas, monospace; }
.contrib-grid { display: grid; grid-template-columns: repeat(15, 1fr); gap: 5px; margin: 20px 0; }
.contrib-grid i { aspect-ratio: 1; display: block; background: #2d302d; border-radius: 2px; }
.contrib-grid i[data-level="1"] { background: #3d4f3c; }
.contrib-grid i[data-level="2"] { background: #537052; }
.contrib-grid i[data-level="3"] { background: #658963; }
.contrib-grid i[data-level="4"] { background: #e0a15e; }
.repo-list { display: grid; gap: 8px; }
.repo-list a { display: flex; justify-content: space-between; padding: 12px; border: 1px solid #373936; border-radius: 7px; }
.repo-list strong { font-size: 13px; }
.repo-list span { color: #777b75; font: 700 9px Consolas, monospace; }

/* Timeline */
.timeline { position: relative; margin-top: 10px; }
.timeline::before { content: ""; position: absolute; left: 188px; top: 0; bottom: 0; width: 1px; background: linear-gradient(var(--red), #424541 85%, transparent); }
.timeline-item { display: grid; grid-template-columns: 160px 30px 1fr; gap: 14px; padding: 12px 0 48px; }
.timeline-date { color: var(--orange); font: 700 10px Consolas, monospace; letter-spacing: .08em; padding-top: 8px; }
.timeline-dot { width: 12px; height: 12px; border: 2px solid var(--red); background: var(--bg); border-radius: 50%; margin: 8px 0 0 8px; z-index: 2; box-shadow: 0 0 0 5px rgba(163,76,67,.08); }
.timeline-item h3 { margin: 0; font-size: 26px; }
.timeline-company { color: var(--green); font-weight: 800; margin: 3px 0 12px; }
.timeline-item > div:last-child > p:not(.timeline-company), .timeline-item li { color: var(--muted); font-size: 13px; }
.timeline-item ul { padding-left: 18px; }
.resume-btn { margin-left: 204px; }

/* Beyond */
.interest-marquee { display: flex; flex-wrap: wrap; gap: 9px; }
.interest-marquee span { flex: 1 1 220px; min-height: 95px; display: flex; align-items: center; justify-content: center; border: 1px solid #3d403d; background: #202120; border-radius: 10px; color: #c7c1b9; font: 800 11px Consolas, monospace; text-align: center; }
.interest-marquee span:nth-child(2n) { border-color: #4a3c32; color: var(--orange); }

/* Contact */
.contact { padding-top: 70px; padding-bottom: 120px; }
.contact-panel { position: relative; padding: clamp(34px, 7vw, 80px); background: var(--green); border-radius: 30px 30px 90px 30px; color: #111711; overflow: hidden; }
.contact-panel::before { content: ""; position: absolute; width: 280px; height: 280px; right: -80px; top: -100px; border: 1px solid rgba(0,0,0,.22); border-radius: 50%; box-shadow: 0 0 0 30px rgba(0,0,0,.04), 0 0 0 60px rgba(0,0,0,.03); }
.contact-panel .kicker { color: #283d27; }
.contact-panel h2 { max-width: 760px; margin: 10px 0 14px; font-size: clamp(46px, 7vw, 86px); line-height: .95; letter-spacing: -.055em; }
.contact-panel p { max-width: 590px; font-weight: 700; color: #233223; }
.contact-panel .btn--primary { margin-top: 18px; background: #1c1d1c; border-color: #1c1d1c; }
.contact-panel__code { position: absolute; right: 30px; bottom: 24px; font: 700 9px Consolas, monospace; letter-spacing: .12em; color: rgba(0,0,0,.45); }
.contact-links { display: flex; gap: 16px; margin-top: 24px; font: 800 11px Consolas, monospace; }
.contact-links a { border-bottom: 1px solid rgba(0,0,0,.35); }

/* Footer */
.site-footer { border-top: 1px solid #383a37; padding: 34px 0 48px; }
.footer-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 50px; align-items: end; }
.footer-grid strong { font-size: 17px; letter-spacing: .06em; }
.footer-grid p, .footer-meta { color: #7e817c; font: 700 9px Consolas, monospace; }
.footer-links { display: flex; gap: 16px; font-size: 12px; }
.footer-meta { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.footer-meta span:last-child { color: var(--green); }

@media (max-width: 1050px) {
  .main-nav { gap: 16px; }
  .hero { grid-template-columns: 1fr 1fr; }
  .hero__visual { min-height: 520px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card:last-child { grid-column: span 2; }
  .stack-card { grid-column: span 6; }
  .project-card { grid-column: span 6; }
  .project-card--featured { grid-column: span 12; }
}

@media (max-width: 820px) {
  :root { --shell: min(100% - 28px, 1180px); }
  .section { padding: 82px 0; }
  .header__inner { grid-template-columns: 1fr auto; }
  .header-links { display: none; }
  .menu-toggle { display: block; }
  .main-nav {
    position: fixed; inset: 76px 14px auto; display: grid; gap: 0; justify-self: stretch; padding: 12px;
    background: rgba(29,30,29,.98); border: 1px solid #424541; border-radius: 12px; transform: translateY(-16px); opacity: 0; pointer-events: none;
    transition: .2s ease;
  }
  .main-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 14px; border-bottom: 1px solid #363835; }
  .main-nav a:last-child { border-bottom: 0; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 55px; }
  .hero::before { display: none; }
  .hero__visual { min-height: 520px; margin-top: 10px; }
  .hero__rail { display: none; }
  .section-heading { grid-template-columns: 48px 1fr; }
  .section-note { grid-column: 2; justify-self: start; }
  .about-grid, .github-grid { grid-template-columns: 1fr; }
  .about-art { min-height: 440px; order: 2; }
  .services-grid { grid-template-columns: 1fr; }
  .service-card:last-child { grid-column: auto; }
  .project-card, .project-card--featured { grid-column: span 12; }
  .project-card--featured { display: block; }
  .labs-grid { grid-template-columns: 1fr; }
  .lab-card--wide { grid-column: auto; grid-template-columns: 180px 1fr; }
  .timeline::before { left: 14px; }
  .timeline-item { grid-template-columns: 30px 1fr; }
  .timeline-date { grid-column: 2; grid-row: 1; }
  .timeline-dot { grid-column: 1; grid-row: 1 / span 2; margin-left: 8px; }
  .timeline-item > div:last-child { grid-column: 2; }
  .resume-btn { margin-left: 44px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; align-items: start; }
  .footer-meta { text-align: left; }
}

@media (max-width: 560px) {
  .brand__status { display: none; }
  .hero h1 { font-size: 58px; }
  .hero__role { font-size: 31px; }
  .hero__visual { min-height: 430px; }
  .robot-frame { inset: 5% 0 0 4%; }
  .robot { width: 92%; left: -2%; }
  .terminal-chip { transform: scale(.82); transform-origin: center; }
  .terminal-chip--left { left: -14px; }
  .terminal-chip--right { right: -12px; }
  .section-heading h2 { font-size: 40px; }
  .stack-card { grid-column: span 12; min-height: 210px; }
  .lab-card--wide { grid-template-columns: 1fr; text-align: left; }
  .lab-card--wide img { width: 170px; margin: -25px auto -20px; }
  .github-stats { gap: 18px; }
  .contrib-grid { gap: 3px; }
  .contact-panel { border-radius: 20px 20px 55px 20px; }
  .contact-panel__code { display: none; }
  .footer-links { flex-wrap: wrap; }
}

/* Brand logo + language control */
.header-actions { display: flex; align-items: center; justify-self: end; gap: 8px; }
.brand__logo-shell {
  width: 38px; height: 34px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--red); border: 1px solid #c06a5f; border-radius: 10px 4px 10px 4px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
}
.brand__logo-shell img { width: 23px; height: 23px; object-fit: contain; }
.language-toggle {
  height: 34px; min-width: 58px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--text); background: #202120; border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.language-toggle:hover { border-color: var(--green); background: #252725; transform: translateY(-1px); }
.language-toggle__icon { color: var(--green); font-size: 14px; line-height: 1; }
.language-toggle strong { color: var(--orange); font: 800 10px Consolas, monospace; letter-spacing: .08em; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px 3px 9px 3px; background: var(--red); }
.footer-logo img { width: 21px; height: 21px; }

@media (max-width: 820px) {
  .header__inner { grid-template-columns: 1fr auto; }
  .header-actions { gap: 7px; }
  .header-links { display: none; }
  .menu-toggle { display: block; }
}

@media (max-width: 560px) {
  .brand__text { font-size: 14px; }
  .brand__logo-shell { width: 34px; height: 31px; }
  .brand__logo-shell img { width: 20px; height: 20px; }
  .language-toggle { min-width: 50px; padding-inline: 7px; }
}
