:root {
  color-scheme: light;
  --ink: #101712;
  --muted: #657069;
  --paper: #f3f5ef;
  --line: #cfd6ce;
  --acid: #9edb46;
  --green: #1e5835;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
}

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

html { background: #0b2518; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; }

.signal-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(510px, 0.92fr);
}

.signal-visual {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 650px;
  overflow: hidden;
  background: #0b2518;
  color: #efffe6;
  isolation: isolate;
}

[data-signal-canvas] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.signal-visual::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(8, 26, 17, 0.12), transparent 28%, transparent 72%, rgba(8, 26, 17, 0.2)),
    linear-gradient(0deg, rgba(8, 26, 17, 0.48), transparent 32%);
  content: "";
  pointer-events: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.34;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(224, 255, 206, 0.22) 4px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.visual-topline,
.visual-caption,
.visual-readout {
  position: absolute;
  z-index: 3;
  left: clamp(22px, 3.2vw, 48px);
  right: clamp(22px, 3.2vw, 48px);
}

.visual-topline {
  top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mini-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-decoration: none;
}

.mini-wordmark span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 255, 230, 0.66);
  font-family: var(--sans);
  font-weight: 800;
}

.visual-topline p,
.visual-readout {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.visual-topline p { display: flex; align-items: center; gap: 8px; margin: 0; }
.visual-topline i { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); }

.visual-caption { bottom: 92px; }
.visual-caption span { font-family: var(--mono); font-size: 0.61rem; letter-spacing: 0.12em; }
.visual-caption p { max-width: 570px; margin: 12px 0 0; font-size: clamp(1.6rem, 3vw, 3rem); font-weight: 700; letter-spacing: -0.055em; line-height: 1.03; }

.visual-readout {
  bottom: 28px;
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(239, 255, 230, 0.34);
  color: rgba(239, 255, 230, 0.74);
}

.portfolio-panel {
  min-height: 100svh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(30px, 5vw, 80px);
  background:
    linear-gradient(rgba(16, 23, 18, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 23, 18, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

.panel-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.panel-header a,
.panel-footer a {
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.03em;
  text-underline-offset: 5px;
}

.back-link { text-decoration: none; }
.back-link span { display: inline-block; margin-right: 8px; transition: transform 180ms ease; }
.back-link:hover span { transform: translateX(-4px); }
.resume-link { font-weight: 500; }

.identity { padding: clamp(48px, 7.5vh, 88px) 0 clamp(40px, 6vh, 70px); }
.overline,
.panel-label {
  margin: 0 0 20px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.identity h1 {
  margin: 0 0 28px;
  font-size: clamp(4rem, 7.4vw, 7.8rem);
  font-weight: 800;
  letter-spacing: -0.085em;
  line-height: 0.75;
}

.identity h1 span { color: var(--green); }
.identity-copy { max-width: 650px; margin: 0; color: #49534c; font-size: clamp(0.95rem, 1.4vw, 1.12rem); line-height: 1.75; }

.panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.panel-tabs button {
  min-height: 58px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.panel-tabs button:last-child { border-right: 0; }
.panel-tabs button span { margin-right: 12px; color: #98a198; }
.panel-tabs button:hover { color: var(--ink); }
.panel-tabs button[aria-selected="true"] { background: var(--ink); color: #f7fff2; }
.panel-tabs button[aria-selected="true"] span { color: var(--acid); }

.tab-stage { flex: 1; padding: 36px 0 42px; }
.tab-panel { animation: panel-in 380ms cubic-bezier(0.22, 1, 0.36, 1); }
.tab-panel[hidden] { display: none; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.current-role { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.current-role span { font-family: var(--mono); font-size: 0.58rem; color: var(--muted); }
.current-role h2 { margin: 8px 0 2px; font-size: clamp(1.55rem, 2.6vw, 2.45rem); letter-spacing: -0.05em; line-height: 1.08; }
.current-role p { margin: 0; color: var(--green); font-family: var(--mono); font-size: 0.68rem; }
.current-role .live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); color: var(--green); }
.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: #45a544; }
.panel-body { max-width: 620px; margin: 26px 0 34px; color: #566059; font-size: 0.88rem; line-height: 1.75; }

.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.metric-strip div { display: grid; gap: 5px; padding: 22px 18px 0 0; }
.metric-strip strong { font-size: clamp(1.25rem, 2.2vw, 2rem); letter-spacing: -0.05em; }
.metric-strip span { color: var(--muted); font-family: var(--mono); font-size: 0.58rem; text-transform: uppercase; }

.impact-cards { display: grid; gap: 0; }
.impact-cards article { display: grid; grid-template-columns: 0.65fr 1fr 1.2fr; gap: 24px; align-items: baseline; padding: 20px 0; border-top: 1px solid var(--line); }
.impact-cards article:last-child { border-bottom: 1px solid var(--line); }
.impact-cards span,
.stack-groups span { color: var(--green); font-family: var(--mono); font-size: 0.58rem; }
.impact-cards strong { font-size: 1rem; letter-spacing: -0.025em; }
.impact-cards p,
.stack-groups p { margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.55; }

.stack-groups { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stack-groups article { min-height: 122px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.panel-footer { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.panel-footer nav { display: flex; gap: 10px; }
.panel-footer nav a { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); text-decoration: none; transition: background 160ms ease, color 160ms ease; }
.panel-footer nav a:hover { background: var(--ink); color: white; }

@media (max-width: 1050px) {
  .signal-shell { grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr); }
  .impact-cards article { grid-template-columns: 1fr 1.4fr; }
  .impact-cards p { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .signal-shell { display: block; }
  .signal-visual { position: relative; height: 56svh; min-height: 430px; }
  .portfolio-panel { min-height: auto; }
  .identity h1 { line-height: 0.83; }
}

@media (max-width: 540px) {
  .signal-visual { height: 48svh; min-height: 380px; }
  .visual-caption { bottom: 72px; }
  .visual-caption p { font-size: 1.45rem; }
  .visual-readout span:nth-child(2) { display: none; }
  .portfolio-panel { padding-inline: 20px; }
  .panel-header { min-height: 68px; }
  .identity { padding-block: 52px 46px; }
  .identity h1 { font-size: clamp(3.25rem, 18vw, 5rem); line-height: 0.86; }
  .panel-tabs button { min-height: 52px; text-align: center; }
  .panel-tabs button span { display: none; }
  .current-role { display: grid; }
  .current-role .live-pill { grid-row: 1; width: fit-content; }
  .metric-strip div { padding-right: 8px; }
  .metric-strip strong { font-size: 1.2rem; }
  .impact-cards article { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .impact-cards p { grid-column: auto; }
  .stack-groups { grid-template-columns: 1fr; }
  .panel-footer { align-items: flex-start; flex-direction: column; padding: 22px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .scanlines { display: none; }
}
