:root {
  --void: #09090b;
  --panel: #111114;
  --panel-raised: #17171b;
  --border: #33282b;
  --border-bright: #503138;
  --text: #f5ece6;
  --muted: #cbb7ae;
  --faint: #9c8580;
  --accent-deep: #6f0a0d;
  --accent: #740c20;
  --accent-light: #d57279;
  --accent-soft: #b64d59;
  --accent-ink: #fff3ed;
  --online: #55d98b;
  --display: "Manrope", "Segoe UI Variable", "Segoe UI", sans-serif;
  --body: "DM Sans", "Segoe UI Variable", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  --shell: 1160px;
  --radius-small: 7px;
  --radius: 13px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 94px;
  color-scheme: dark;
  overflow-x: clip;
}

body {
  min-width: 300px;
  margin: 0;
  overflow-x: hidden;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(245, 236, 230, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 236, 230, 0.018) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
  content: "";
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(181, 56, 75, 0.45);
  color: var(--accent-ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
}

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  transform: translateY(-160%);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-small);
  background: var(--panel-raised);
  color: var(--text);
  font: 600 12px/1 var(--mono);
  transition: transform 160ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  top: 6vh;
  right: -22vw;
  z-index: -1;
  width: 65vw;
  height: 65vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(116, 12, 32, 0.24), rgba(111, 10, 13, 0.08) 36%, transparent 69%);
  filter: blur(14px);
  pointer-events: none;
  transition: transform 600ms var(--ease), opacity 600ms var(--ease);
}

body[data-site-mode="work"] .ambient {
  transform: translate(-5vw, 14vh) scale(1.08);
  opacity: 0.85;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(80, 49, 56, 0.65);
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(20px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  min-height: 76px;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand b,
.footer-signature span {
  color: var(--accent-light);
}

.brand-mark {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(182, 77, 89, 0.72);
  border-radius: 9px;
  background: var(--void);
  box-shadow: 0 0 30px rgba(116, 12, 32, 0.28);
  color: var(--accent);
  font: 800 15px/1 var(--display);
}

.brand-symbol {
  display: block;
  width: 24px;
  height: 20px;
  overflow: visible;
}

.desktop-nav,
.nav-set {
  display: flex;
  align-items: center;
  gap: 23px;
}

.desktop-nav a {
  color: var(--faint);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.desktop-nav a:hover {
  color: var(--text);
}

.mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-width: 190px;
  padding: 4px;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  background: var(--panel);
  isolation: isolate;
}

.mode-switch-track {
  position: absolute;
  inset: 4px auto 4px 4px;
  z-index: -1;
  width: calc(50% - 4px);
  border: 1px solid #9e3544;
  border-radius: 6px;
  background: var(--accent);
  box-shadow: 0 7px 22px rgba(116, 12, 32, 0.34);
  transition: transform 280ms var(--ease), background 280ms ease;
}

body[data-site-mode="work"] .mode-switch-track {
  transform: translateX(100%);
  background: var(--accent-deep);
}

.mode-switch button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease;
}

.mode-switch button[aria-pressed="true"] {
  color: var(--accent-ink);
}

.hero {
  display: grid;
  grid-template-columns: 42px minmax(0, 1.22fr) minmax(310px, 0.78fr);
  gap: clamp(24px, 4vw, 58px);
  align-items: center;
  min-height: min(760px, calc(100vh - 76px));
  padding-block: clamp(82px, 12vh, 138px);
}

.identity-rail {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 450px;
  padding-top: 7px;
}

.rail-node {
  width: 12px;
  height: 12px;
  border: 3px solid var(--void);
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 22px rgba(213, 114, 121, 0.45);
}

.rail-line {
  width: 1px;
  flex: 1;
  margin-block: 12px;
  background: linear-gradient(var(--accent-soft), var(--accent-deep), transparent);
}

.rail-mode {
  color: var(--accent-light);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.17em;
  writing-mode: vertical-rl;
}

.hero-stage {
  min-width: 0;
}

.hero-copy {
  max-width: 690px;
}

.eyebrow,
.section-label,
.project-category,
.resume-meta,
.link-card-label {
  color: var(--accent-light);
  font: 600 11px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 25px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 0 6px rgba(116, 12, 32, 0.22);
}

h1,
h2,
h3 {
  font-family: var(--display);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(54px, 7vw, 92px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.062em;
}

.hero-alias {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
}

.hero-alias strong {
  color: var(--text);
  font-weight: 700;
}

.hero-lede {
  max-width: 650px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font: 700 12px/1 var(--mono);
  transition: transform 180ms var(--ease), border-color 180ms ease, background 180ms ease;
}

.button:hover,
.text-link:hover {
  transform: translateY(-2px);
}

.button-primary {
  border-color: #9e3544;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 36px rgba(116, 12, 32, 0.27);
}

.button-primary:hover {
  background: #86142b;
}

.button-quiet,
.text-link {
  border-color: var(--border-bright);
  background: rgba(17, 17, 20, 0.72);
  color: var(--text);
}

.button-quiet:hover,
.text-link:hover {
  border-color: var(--accent-soft);
}

.hero-console {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 17, 20, 0.88);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), inset 4px 0 0 var(--accent-deep);
}

.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 17px;
  border-bottom: 1px solid var(--border);
  color: var(--faint);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.04em;
}

.console-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.console-state i,
.project-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 12px rgba(85, 217, 139, 0.55);
}

.console-body {
  min-height: 290px;
  padding: 24px 22px 30px;
  font: 13px/1.65 var(--mono);
}

.console-body p {
  margin: 0 0 5px;
}

.prompt {
  color: var(--accent-light);
}

.console-response {
  margin: 0 0 19px !important;
  padding-left: 18px;
  color: var(--muted);
}

.console-ready {
  color: var(--online);
}

.console-caret {
  display: block;
  width: 8px;
  height: 15px;
  margin: -25px 0 24px 40px;
  background: var(--accent-light);
  animation: blink 1.15s steps(1) infinite;
}

.section {
  padding-block: clamp(78px, 10vw, 125px);
  border-top: 1px solid var(--border);
}

.section-heading {
  margin-bottom: clamp(36px, 6vw, 58px);
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 34px;
}

.section-label {
  margin: 0 0 13px;
}

.section h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.052em;
}

.section-note {
  max-width: 340px;
  margin: 0 0 7px;
  color: var(--faint);
  text-align: right;
  font-size: 14px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(42px, 8vw, 110px);
}

.about-copy {
  color: var(--muted);
  font-size: clamp(19px, 2.4vw, 27px);
  line-height: 1.55;
  letter-spacing: -0.022em;
}

.about-copy p {
  margin: 0;
}

.about-copy p + p {
  margin-top: 25px;
}

.fact-ledger {
  margin: 0;
  border-top: 1px solid var(--border-bright);
}

.fact-ledger div {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.fact-ledger dt {
  color: var(--faint);
  font: 500 10px/1.5 var(--mono);
  text-transform: uppercase;
}

.fact-ledger dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.capability-grid article,
.interest-grid article {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 17, 20, 0.78);
  transition: transform 220ms var(--ease), border-color 220ms ease, background 220ms ease;
}

.capability-grid article:hover,
.interest-grid article:hover {
  transform: translateY(-4px);
  border-color: var(--border-bright);
  background: var(--panel-raised);
}

.capability-code {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 40px;
  place-items: center;
  border: 1px solid #8f3040;
  border-radius: 7px;
  background: rgba(116, 12, 32, 0.42);
  color: var(--accent-light);
  font: 600 11px/1 var(--mono);
}

.capability-grid h3,
.interest-grid h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.capability-grid p,
.interest-grid p {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 14px;
  line-height: 1.65;
}

.project-inspector {
  display: grid;
  grid-template-columns: minmax(300px, 0.74fr) minmax(0, 1.26fr);
  min-height: 545px;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.34);
}

.project-tabs {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-right: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.48);
}

.project-tabs::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  background: linear-gradient(var(--accent-light), var(--accent), transparent 82%);
  content: "";
}

.project-tab {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  align-items: center;
  gap: 12px;
  min-height: 103px;
  padding: 16px 22px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--faint);
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.project-tab:last-child {
  border-bottom: 0;
}

.project-tab::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  background: var(--accent-light);
  opacity: 0;
  content: "";
  transition: opacity 180ms ease;
}

.project-tab:hover {
  background: rgba(116, 12, 32, 0.12);
  color: var(--muted);
}

.project-tab[aria-selected="true"] {
  background: rgba(116, 12, 32, 0.2);
  color: var(--text);
}

.project-tab[aria-selected="true"]::before {
  opacity: 1;
}

.project-tab-index {
  color: var(--accent-light);
  font: 500 10px/1 var(--mono);
}

.project-tab-copy {
  min-width: 0;
}

.project-tab-name,
.project-tab-category {
  display: block;
}

.project-tab-name {
  color: inherit;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
}

.project-tab-category {
  margin-top: 5px;
  overflow: hidden;
  color: var(--faint);
  font: 10px/1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tab-arrow {
  color: var(--accent-light);
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 180ms ease, transform 180ms var(--ease);
}

.project-tab[aria-selected="true"] .project-tab-arrow {
  opacity: 1;
  transform: translateX(0);
}

.project-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: clamp(28px, 5vw, 54px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(116, 12, 32, 0.18), transparent 40%),
    var(--panel-raised);
}

.project-panel::after {
  position: absolute;
  right: -120px;
  bottom: -180px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(213, 114, 121, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 45px rgba(116, 12, 32, 0.035), 0 0 0 90px rgba(116, 12, 32, 0.025);
  content: "";
  pointer-events: none;
}

.project-panel-topline,
.project-panel-content,
.project-link {
  position: relative;
  z-index: 1;
}

.project-panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-monogram {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #9e3544;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 13px/1 var(--mono);
  box-shadow: 0 16px 40px rgba(116, 12, 32, 0.28);
}

.project-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  text-transform: uppercase;
}

.project-panel-content {
  align-self: center;
  max-width: 650px;
  padding-block: 42px;
}

.project-category {
  margin: 0 0 12px;
}

.project-panel h3 {
  margin: 0;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.project-description {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 7px 10px;
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  color: var(--muted);
  font: 10px/1 var(--mono);
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-small);
  background: rgba(9, 9, 11, 0.52);
  font: 600 11px/1 var(--mono);
  transition: border-color 180ms ease, background 180ms ease;
}

.project-link:hover {
  border-color: var(--accent-soft);
  background: rgba(116, 12, 32, 0.18);
}

.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.interest-grid article > span {
  display: block;
  margin-bottom: 70px;
  color: var(--accent-light);
  font: 500 10px/1 var(--mono);
}

.resume-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
}

.resume-timeline,
.toolkit-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 17, 20, 0.8);
}

.resume-timeline {
  overflow: hidden;
}

.resume-timeline article {
  position: relative;
  padding: 30px 34px 31px 52px;
  border-bottom: 1px solid var(--border);
}

.resume-timeline article:last-child {
  border-bottom: 0;
}

.resume-timeline article::before {
  position: absolute;
  top: 38px;
  left: 27px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 0 6px rgba(116, 12, 32, 0.2);
  content: "";
}

.resume-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.resume-meta time {
  color: var(--faint);
}

.resume-timeline h3,
.toolkit-card h3 {
  margin: 13px 0 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.resume-timeline p {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 14px;
}

.toolkit-card {
  padding: 30px;
  box-shadow: inset 4px 0 0 var(--accent-deep);
}

.toolkit-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 29px 0 0;
  padding: 0;
  list-style: none;
}

.toolkit-card li {
  padding: 8px 10px;
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  color: var(--muted);
  font: 10px/1.2 var(--mono);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.link-card {
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 180px;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 17, 20, 0.76);
  transition: transform 220ms var(--ease), border-color 220ms ease, background 220ms ease;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-bright);
  background: var(--panel-raised);
}

.link-card-label {
  grid-column: 1 / -1;
  color: var(--faint);
}

.link-card strong {
  align-self: end;
  font-family: var(--display);
  font-size: 24px;
}

.link-card > span:last-child {
  align-self: end;
  color: var(--accent-light);
}

.link-card-accent {
  border-color: #7e2937;
  background: rgba(116, 12, 32, 0.18);
}

.contact-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 8vw, 100px);
  overflow: hidden;
  padding: clamp(34px, 6vw, 68px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--panel-raised);
  box-shadow: inset 5px 0 0 var(--accent);
}

.contact-copy h2 {
  font-size: clamp(36px, 4.5vw, 56px);
}

.contact-copy > p:last-child {
  max-width: 440px;
  margin: 19px 0 0;
  color: var(--muted);
}

.contact-methods {
  border-top: 1px solid var(--border-bright);
}

.contact-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid var(--border);
}

.contact-row > span:first-child {
  color: var(--faint);
  font: 500 10px/1 var(--mono);
  text-transform: uppercase;
}

.contact-row a,
.contact-row address {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-style: normal;
  font-size: 14px;
}

.contact-row a:hover {
  color: var(--accent-light);
}

.contact-row button {
  padding: 7px 9px;
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  text-transform: uppercase;
  cursor: pointer;
}

.contact-row button:hover {
  border-color: var(--accent-soft);
  color: var(--text);
}

.contact-outbound {
  color: var(--accent-light);
}

.copy-status {
  position: absolute;
  right: clamp(34px, 6vw, 68px);
  bottom: 14px;
  margin: 0;
  color: var(--online);
  font: 10px/1.3 var(--mono);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 150px;
  gap: 24px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 13px;
}

.footer-signature {
  font-family: var(--mono);
  font-size: 10px;
}

.mode-enter {
  animation: mode-enter 340ms var(--ease) both;
}

@keyframes mode-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  50% { opacity: 0; }
}

.reveal {
  animation: reveal 720ms var(--ease) both;
}

.reveal-delay {
  animation-delay: 120ms;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1040px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .desktop-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 34px minmax(0, 1fr) minmax(280px, 0.62fr);
    gap: 28px;
  }

  .capability-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(calc(100% - 34px), var(--shell));
  }

  .hero {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: auto;
    padding-block: 78px;
  }

  .identity-rail {
    grid-row: 1 / 3;
    min-height: 100%;
  }

  .hero-console {
    grid-column: 2;
    margin-top: 10px;
  }

  .about-grid,
  .resume-layout,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .project-inspector {
    grid-template-columns: 1fr;
  }

  .project-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    overflow-x: auto;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-color: var(--accent) var(--panel);
  }

  .project-tabs::before {
    inset: auto 0 0;
    width: auto;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-light), var(--accent), transparent 82%);
  }

  .project-tab {
    min-height: 92px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .project-tab::before {
    inset: auto 12px 0;
    width: auto;
    height: 3px;
  }

  .project-panel {
    min-height: 500px;
  }

  .interest-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .interest-grid article > span {
    margin-bottom: 38px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    min-height: 70px;
    gap: 14px;
  }

  .brand-name {
    max-width: 165px;
    font-size: 11px;
    line-height: 1.25;
  }

  .brand-mark {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
  }

  .mode-switch {
    min-width: 154px;
  }

  .mode-switch button {
    min-height: 32px;
    padding-inline: 8px;
    font-size: 9px;
  }

  .section-heading-row {
    display: block;
  }

  .section-note {
    margin-top: 14px;
    text-align: left;
  }

  .hero h1 {
    font-size: clamp(44px, 14vw, 64px);
  }

  .hero-lede,
  .hero-alias {
    font-size: 16px;
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .capability-code {
    margin-bottom: 28px;
  }

  .project-panel {
    min-height: 490px;
    padding: 26px 22px;
  }

  .project-panel h3 {
    font-size: 42px;
  }

  .project-panel-content {
    padding-block: 38px;
  }

  .contact-panel {
    padding: 34px 25px 45px;
  }

  .contact-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .site-footer {
    display: block;
    padding-block: 46px;
  }
}

@media (max-width: 420px) {
  .shell {
    width: min(calc(100% - 24px), var(--shell));
  }

  .header-inner {
    grid-template-columns: 1fr;
    padding-block: 10px;
  }

  .brand {
    justify-self: center;
  }

  .brand-name {
    max-width: none;
  }

  .mode-switch {
    width: 100%;
  }

  .hero {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 14px;
    padding-block: 58px;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .console-bar {
    padding-inline: 12px;
  }

  .console-body {
    padding-inline: 16px;
    font-size: 11px;
  }

  .section {
    padding-block: 68px;
  }

  .section h2 {
    font-size: 37px;
  }

  .about-copy {
    font-size: 18px;
  }

  .fact-ledger div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .project-tab {
    grid-template-columns: 28px 1fr;
  }

  .project-tab-arrow {
    display: none;
  }

  .project-panel-topline {
    align-items: flex-start;
    gap: 14px;
  }

  .project-status {
    max-width: 145px;
    line-height: 1.4;
    text-align: right;
  }

  .resume-timeline article {
    padding: 27px 22px 28px 42px;
  }

  .resume-timeline article::before {
    left: 20px;
  }

  .resume-meta {
    display: block;
  }

  .resume-meta time {
    display: block;
    margin-top: 5px;
  }

  .contact-row {
    grid-template-columns: 1fr auto;
    padding-block: 13px;
  }

  .contact-row > span:first-child {
    grid-column: 1 / -1;
  }

  .contact-row a,
  .contact-row address {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.admin-mode {
  padding-bottom: 100px;
}

.admin-mode [data-admin-editable="true"] {
  border-radius: 3px;
  outline: 1px dashed rgba(213, 114, 121, 0.46);
  outline-offset: 3px;
  cursor: text;
}

.admin-mode [data-admin-editable="true"]:hover {
  outline-color: var(--accent-light);
}

.admin-mode [data-admin-editable="true"]:focus {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
  background: rgba(116, 12, 32, 0.18);
}

.admin-toolbar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
  padding: 12px 14px 12px 18px;
  border: 1px solid #3f4e46;
  border-radius: 11px;
  background: rgba(12, 18, 15, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
}

.admin-toolbar-copy {
  display: grid;
  gap: 4px;
}

.admin-toolbar-copy strong {
  color: #7ee2a8;
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.1em;
}

.admin-toolbar-copy span {
  color: #b6c6bd;
  font-size: 13px;
}

.admin-toolbar-copy span[data-state="saved"] {
  color: #7ee2a8;
}

.admin-toolbar-copy span[data-state="error"] {
  color: #ff9e9e;
}

.admin-toolbar-actions {
  display: flex;
  gap: 9px;
}

.admin-toolbar button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 6px;
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.admin-logout {
  border: 1px solid #4c5b52;
  background: transparent;
  color: #c9d6cf;
}

.admin-save {
  min-width: 116px;
  border: 1px solid #52c882;
  background: #24a85f;
  color: #041d0f;
}

.admin-save:hover,
.admin-save:focus-visible {
  background: #54d88b;
}

.admin-save:disabled {
  cursor: wait;
  opacity: 0.6;
}

.admin-dirty .admin-save {
  animation: admin-save-pulse 1.8s ease-in-out infinite;
}

@keyframes admin-save-pulse {
  50% { box-shadow: 0 0 0 7px rgba(82, 200, 130, 0.13); }
}

@media (max-width: 560px) {
  .admin-mode {
    padding-bottom: 148px;
  }

  .admin-toolbar {
    display: grid;
    right: 10px;
    bottom: 10px;
    left: 10px;
    gap: 10px;
  }

  .admin-toolbar-actions,
  .admin-toolbar button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-dirty .admin-save {
    animation: none;
  }
}
