:root {
  --bg: #0a0e0a;
  --panel: #0d120d;
  --panel-2: #0b100b;
  --line: #1e2b1e;
  --line-soft: #172217;
  --green: #33ff66;
  --green-txt: #24984a;
  --amber: #ffb000;
  --white: #d8e6d8;
  --dim: #8aa68a;
  --muted: #5f7860;
  --paper: #f5f4ed;
  --paper-panel: #faf9f5;
  --paper-line: #d9d7cb;
  --paper-ink: #141413;
  --paper-dim: #5d5c56;
  --paper-brand: #1b365d;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  height: 100%;
  scroll-behavior: smooth;
}
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--white);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::selection {
  background: var(--green);
  color: #041004;
}
a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dashed var(--green-txt);
}
a:hover,
a:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
}
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.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 {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 20;
  background: var(--green);
  color: #000;
  padding: 8px 12px;
  font-weight: 700;
}
.skip:focus {
  top: 12px;
}

/* terminal shell: centered, fixed viewport, only the output scrolls */
.resume-shell {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.resume-term {
  width: min(1040px, 100%);
  height: min(900px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.35);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
  flex-shrink: 0;
}
.dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #222;
  display: block;
  border: 1px solid var(--line);
}
.dots i:nth-child(1) {
  background: #ff5f56;
}
.dots i:nth-child(2) {
  background: #ffbd2e;
}
.dots i:nth-child(3) {
  background: #27c93f;
}
.term-tab {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--green-txt);
  font: inherit;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--green);
  color: var(--green);
}
.theme-toggle[aria-pressed="true"] {
  color: var(--amber);
  border-color: var(--amber);
}

.resume-out {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 24px 30px 30px;
}
.resume-out p {
  margin: 0;
}

/* header + metrics */
.resume-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.resume-name {
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.resume-name span {
  color: var(--dim);
  font-weight: 400;
}
.resume-role {
  color: var(--green);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 6px;
}
.resume-contact {
  color: var(--dim);
  font-size: 12px;
  margin-top: 8px !important;
  overflow-wrap: anywhere;
}
.resume-contact span {
  color: var(--white);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 16px 0 22px;
}
.metric {
  background: var(--panel-2);
  padding: 10px 12px;
  min-width: 0;
}
.metric-value {
  display: block;
  color: var(--amber);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
}
.metric-label {
  display: block;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 3px;
}

/* command-echo section headings */
.resume-section {
  scroll-margin-top: 18px;
}
.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--green);
  margin: 26px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.section-title .ps {
  color: var(--amber);
  font-weight: 400;
  font-size: 12px;
  flex-shrink: 0;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
}
.resume-section.target .section-title {
  animation: section-flash 1.4s ease-out;
}
@keyframes section-flash {
  0%,
  100% {
    background: transparent;
    border-color: var(--line);
  }
  15%,
  55% {
    background: rgba(255, 176, 0, 0.12);
    border-color: var(--amber);
  }
}

.summary {
  color: var(--white);
  font-size: 13px;
  line-height: 1.7;
  max-width: 92ch;
}
.accent {
  color: var(--green);
}

/* experience */
.employer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--amber);
}
.employer:first-of-type {
  margin-top: 6px;
}
.employer-meta {
  font-size: 11px;
  font-weight: 400;
  color: var(--dim);
  letter-spacing: 0.02em;
}
.employer-intro {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.65;
  margin: 2px 0 6px !important;
}
.entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  break-inside: avoid;
}
.entry:last-child {
  border-bottom: 0;
}
.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.entry-head h4 {
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--white);
  min-width: 0;
}
.entry-name {
  color: var(--white);
}
.entry-kind {
  color: var(--dim);
  font-weight: 400;
  font-size: 11px;
}
.entry-role {
  flex-shrink: 0;
  color: var(--amber);
  border: 1px solid var(--line);
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.entry-details {
  margin-top: 6px;
}
.entry-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  padding: 2px 0;
}
.entry-row dt {
  color: var(--green-txt);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 2px;
}
.entry-row dd {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.65;
}

/* skills + education */
.skill-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--line-soft);
  align-items: baseline;
}
.skill-row:last-child {
  border-bottom: 0;
}
.skill-label {
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.skill-body {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.65;
}
.edu-row {
  padding: 8px 0;
  border-bottom: 1px dotted var(--line-soft);
}
.edu-row:last-child {
  border-bottom: 0;
}
.edu-school {
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
}
.edu-detail {
  color: var(--dim);
  font-size: 12px;
}

/* status + command chips + prompt */
.status-line {
  min-height: 17px;
  padding: 0 30px;
  color: var(--amber);
  font-size: 11px;
  line-height: 1.4;
  flex-shrink: 0;
}
.status-line:empty {
  min-height: 0;
  padding: 0;
}
.resume-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  padding: 9px 30px 0;
}
.resume-suggest button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  padding: 4px 11px;
  cursor: pointer;
}
.resume-suggest button:hover,
.resume-suggest button:focus-visible {
  border-color: var(--green);
  color: var(--green);
}
.resume-suggest button.exec {
  border-color: var(--amber);
  color: var(--amber);
}
.resume-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 11px 30px;
  margin-top: 10px;
}
.resume-prompt label {
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.p-user {
  color: var(--green);
  font-weight: 700;
}
.p-path {
  color: #6ab0ff;
}
.p-sep {
  color: var(--dim);
}
.resume-prompt input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--white);
  font: inherit;
  font-size: 13px;
  min-width: 0;
}
.resume-prompt input::placeholder {
  color: var(--muted);
}
.caret {
  color: var(--green);
  animation: blink 1.1s steps(1) infinite;
  font-size: 12px;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* no JavaScript: full document, no terminal interaction */
.no-js body {
  overflow: auto;
}
.no-js .resume-shell {
  height: auto;
  display: block;
  padding: 0;
}
.no-js .resume-term {
  width: 100%;
  height: auto;
  border: 0;
  box-shadow: none;
}
.no-js .resume-out {
  overflow: visible;
}
.no-js .resume-suggest,
.no-js .resume-prompt,
.no-js .theme-toggle,
.no-js .status-line {
  display: none;
}
.js:not(.enhanced) .resume-suggest,
.js:not(.enhanced) .resume-prompt,
.js:not(.enhanced) .theme-toggle,
.js:not(.enhanced) .status-line {
  display: none;
}

/* light paper preview on screen */
body.light {
  background: #d9d7cb;
  color: var(--paper-ink);
}
body.light .resume-term {
  background: var(--paper-panel);
  border-color: #b9b6aa;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.12);
}
body.light .term-bar {
  border-color: var(--paper-line);
  color: var(--paper-dim);
}
body.light .resume-head,
body.light .entry,
body.light .section-title {
  border-color: var(--paper-line);
}
body.light .resume-name,
body.light .entry-name,
body.light .entry-head h4,
body.light .edu-school,
body.light .resume-contact span,
body.light .summary {
  color: var(--paper-ink);
}
body.light .resume-name span,
body.light .resume-contact,
body.light .entry-kind,
body.light .entry-row dd,
body.light .skill-body,
body.light .edu-detail,
body.light .employer-meta,
body.light .employer-intro {
  color: var(--paper-dim);
}
body.light .resume-role,
body.light .section-title,
body.light .skill-label,
body.light .accent,
body.light a {
  color: var(--paper-brand);
}
body.light .section-title .ps,
body.light .metric-value,
body.light .entry-role,
body.light .employer {
  color: #8a5a00;
}
body.light .metrics {
  background: var(--paper-line);
  border-color: var(--paper-line);
}
body.light .metric {
  background: var(--paper);
}
body.light .metric-label {
  color: var(--paper-dim);
}
body.light .entry-role {
  border-color: var(--paper-line);
}
body.light .resume-prompt {
  border-color: var(--paper-line);
}
body.light .resume-prompt input {
  color: var(--paper-ink);
}
body.light .resume-suggest button {
  border-color: var(--paper-line);
  color: var(--paper-dim);
}
body.light .resume-suggest button.exec {
  color: #8a5a00;
  border-color: #8a5a00;
}

/* mobile: normal document flow, full width */
@media (max-width: 760px) {
  body {
    overflow: auto;
    font-size: 13px;
  }
  .resume-shell {
    height: auto;
    display: block;
    padding: 0;
  }
  .resume-term {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    border: 0;
    box-shadow: none;
  }
  .resume-out {
    overflow: visible;
    padding: 20px 18px 24px;
  }
  .term-bar {
    padding: 9px 14px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-value {
    font-size: 14px;
    white-space: normal;
  }
  .entry-head {
    display: block;
  }
  .entry-role {
    display: inline-block;
    margin-top: 5px;
  }
  .entry-row {
    grid-template-columns: 1fr;
    gap: 1px;
    padding: 4px 0;
  }
  .entry-row dt {
    padding-top: 0;
  }
  .skill-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .status-line {
    padding: 0 18px;
  }
  .resume-suggest {
    padding: 9px 18px 0;
  }
  .resume-prompt {
    padding: 11px 18px;
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .caret {
    animation: none;
  }
  .resume-section.target .section-title {
    animation: none;
    background: rgba(255, 176, 0, 0.12);
    border-color: var(--amber);
  }
}

/* A4 print: light paper by default, terminal chrome and interaction hidden */
@page {
  size: A4;
  margin: 14mm;
}
@media print {
  :root {
    --print-ink: #141413;
    --print-dim: #4d4c47;
    --print-line: #d3d0c4;
    --print-brand: #1b365d;
    --print-amber: #8a5a00;
  }
  html,
  body {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: var(--print-ink) !important;
    font-size: 9pt;
  }
  body {
    line-height: 1.32;
  }
  .skip,
  .term-bar,
  .theme-toggle,
  .status-line,
  .resume-suggest,
  .resume-prompt,
  .term-tab,
  .dots {
    display: none !important;
  }
  .resume-shell {
    display: block !important;
    height: auto !important;
    padding: 0 !important;
  }
  .resume-term {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .resume-out {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  .resume-head {
    padding-bottom: 3mm !important;
    border-color: var(--print-line) !important;
  }
  .resume-name {
    font-size: 22pt !important;
    color: var(--print-ink) !important;
  }
  .resume-name span {
    color: var(--print-dim) !important;
  }
  .resume-role {
    font-size: 8.5pt !important;
    color: var(--print-brand) !important;
    margin-top: 1mm !important;
  }
  .resume-contact {
    font-size: 8.6pt !important;
    color: var(--print-dim) !important;
    margin-top: 1.5mm !important;
  }
  .resume-contact span {
    color: var(--print-dim) !important;
  }
  a {
    color: var(--print-brand) !important;
    border: 0 !important;
  }
  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    margin: 2.4mm 0 3.2mm !important;
    background: var(--print-line) !important;
    border-color: var(--print-line) !important;
    break-inside: avoid;
  }
  .metric {
    background: #faf9f5 !important;
    padding: 1.6mm 2mm !important;
  }
  .metric-value {
    font-size: 10pt !important;
    color: var(--print-amber) !important;
    white-space: nowrap !important;
  }
  .metric-label {
    font-size: 7.5pt !important;
    color: var(--print-dim) !important;
    margin-top: 0.3mm !important;
  }
  .section-title {
    font-size: 10.5pt !important;
    color: var(--print-ink) !important;
    margin: 2.2mm 0 0.9mm !important;
    padding-bottom: 0.8mm !important;
    border-color: var(--print-line) !important;
    break-after: avoid;
  }
  .section-title .ps {
    display: none !important;
  }
  .summary {
    font-size: 9pt !important;
    line-height: 1.45 !important;
    color: var(--print-ink) !important;
    max-width: none !important;
  }
  .accent {
    color: var(--print-brand) !important;
  }
  .employer {
    font-size: 10pt !important;
    color: var(--print-ink) !important;
    margin: 3mm 0 0.8mm !important;
    break-after: avoid;
  }
  .employer:first-of-type {
    margin-top: 0 !important;
  }
  .employer-meta {
    font-size: 7.5pt !important;
    color: var(--print-dim) !important;
  }
  .employer-intro {
    font-size: 8.6pt !important;
    line-height: 1.4 !important;
    color: var(--print-dim) !important;
    break-after: avoid;
  }
  .entry {
    padding: 0.7mm 0 !important;
    border-color: var(--print-line) !important;
    break-inside: avoid;
  }
  .entry-head h4 {
    font-size: 9.4pt !important;
    color: var(--print-ink) !important;
  }
  .entry-name {
    color: var(--print-ink) !important;
  }
  .entry-kind {
    font-size: 8pt !important;
    color: var(--print-dim) !important;
  }
  .entry-role {
    font-size: 6.5pt !important;
    color: var(--print-amber) !important;
    border-color: var(--print-line) !important;
    padding: 0 1.2mm !important;
  }
  .entry-details {
    margin-top: 0.8mm !important;
  }
  .entry-row {
    grid-template-columns: 12mm minmax(0, 1fr) !important;
    gap: 2mm !important;
    padding: 0.2mm 0 !important;
  }
  .entry-row dt {
    font-size: 6.5pt !important;
    color: var(--print-brand) !important;
    padding-top: 0.3mm !important;
  }
  .entry-row dd {
    font-size: 9pt !important;
    line-height: 1.36 !important;
    color: var(--print-ink) !important;
  }
  .skill-row {
    grid-template-columns: 27mm minmax(0, 1fr) !important;
    gap: 2mm !important;
    padding: 0.8mm 0 !important;
    border-color: var(--print-line) !important;
    break-inside: avoid;
  }
  .skill-label {
    font-size: 7pt !important;
    color: var(--print-brand) !important;
    white-space: nowrap !important;
  }
  .skill-body {
    font-size: 9pt !important;
    color: var(--print-ink) !important;
  }
  .edu-row {
    padding: 0.8mm 0 !important;
    border-color: var(--print-line) !important;
    break-inside: avoid;
  }
  .edu-school {
    font-size: 9pt !important;
    color: var(--print-ink) !important;
  }
  .edu-detail {
    font-size: 8.8pt !important;
    color: var(--print-dim) !important;
  }
  .resume-section {
    break-inside: auto;
  }
  .resume-head,
  .metrics,
  .section-title,
  .employer,
  .employer-intro,
  .entry,
  .skill-row,
  .edu-row {
    break-inside: avoid;
  }
}

/* explicit dark print variant */
@media print {
  body.print-dark {
    background: #0a0e0a !important;
    color: #d8e6d8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.print-dark .resume-term {
    background: #0d120d !important;
    border-color: #1e2b1e !important;
  }
  body.print-dark .resume-out {
    background: #0d120d !important;
  }
  body.print-dark .resume-name,
  body.print-dark .entry-name,
  body.print-dark .entry-head h4,
  body.print-dark .edu-school,
  body.print-dark .resume-contact span {
    color: #d8e6d8 !important;
  }
  body.print-dark .resume-name span,
  body.print-dark .resume-contact,
  body.print-dark .entry-kind,
  body.print-dark .entry-row dd,
  body.print-dark .skill-body,
  body.print-dark .edu-detail,
  body.print-dark .employer-meta,
  body.print-dark .employer-intro {
    color: #8aa68a !important;
  }
  body.print-dark .resume-role,
  body.print-dark .section-title,
  body.print-dark .skill-label,
  body.print-dark .accent,
  body.print-dark a {
    color: #33ff66 !important;
  }
  body.print-dark .section-title .ps,
  body.print-dark .metric-value,
  body.print-dark .entry-role,
  body.print-dark .employer {
    color: #ffb000 !important;
  }
  body.print-dark .metrics {
    background: #1e2b1e !important;
    border-color: #1e2b1e !important;
  }
  body.print-dark .metric {
    background: #0b100b !important;
  }
  body.print-dark .metric-label {
    color: #8aa68a !important;
  }
  body.print-dark .summary {
    color: #d8e6d8 !important;
  }
  body.print-dark .resume-head,
  body.print-dark .entry,
  body.print-dark .section-title,
  body.print-dark .entry-role,
  body.print-dark .skill-row,
  body.print-dark .edu-row {
    border-color: #1e2b1e !important;
  }
}
