:root {
  color-scheme: dark;
  --bg: #090506;
  --surface: #110809;
  --green: #d94f59;
  --green-strong: #ff7b83;
  --text: #e4c7c9;
  --muted: #9a777b;
  --border: #452226;
  --amber: #ef6a5b;
  --max-width: 1580px;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    repeating-linear-gradient(0deg, rgb(217 79 89 / 0.02) 0, rgb(217 79 89 / 0.02) 1px, transparent 1px, transparent 4px),
    var(--bg);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(0.94rem, 0.75rem + 0.35vw, 1.22rem);
  line-height: 1.55;
}

::selection {
  color: var(--bg);
  background: var(--green);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.55rem 0.8rem;
  color: var(--bg);
  background: var(--green);
  transform: translateY(-150%);
}

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

.terminal {
  width: min(calc(100% - 1rem), var(--max-width));
  min-height: calc(100vh - 1rem);
  margin: 0.5rem auto;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgb(9 5 6 / 0.72);
  box-shadow: 0 0 80px rgb(185 28 48 / 0.04) inset;
}

.titlebar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 3.3rem;
  padding: 0 clamp(1rem, 2vw, 1.75rem);
  border-bottom: 1px solid var(--border);
  background: rgb(9 5 6 / 0.92);
  backdrop-filter: blur(14px);
}

.terminal-title,
.nav a {
  color: var(--green);
  text-decoration: none;
}

.terminal-title {
  justify-self: start;
  letter-spacing: -0.035em;
}

.nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 3.8rem);
}

.nav a,
.terminal-title,
.project,
.profile-link,
.contact-link {
  text-underline-offset: 0.28em;
}

.nav a:hover,
.nav a:focus-visible,
.terminal-title:hover,
.terminal-title:focus-visible {
  color: var(--green-strong);
  text-decoration: underline;
}

.window-controls {
  justify-self: end;
  display: flex;
  gap: 2rem;
  color: var(--muted);
  font-size: 1.2rem;
}

.section {
  padding: clamp(2.4rem, 5vw, 5rem) var(--pad);
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 3.3rem;
}

.hero {
  min-height: min(66vh, 670px);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(25rem, 0.85fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
  min-height: inherit;
}

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

.ascii-portrait {
  justify-self: end;
  width: min(100%, 44rem);
  margin: 0;
  overflow: hidden;
  color: var(--green);
  opacity: 0.68;
  filter: drop-shadow(0 0 12px rgb(217 79 89 / 0.17));
  mask-image: linear-gradient(to bottom, transparent, #000 5%, #000 94%, transparent);
}

.ascii-portrait pre {
  width: max-content;
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: min(0.44rem, 1.15vw);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  user-select: none;
}

.command {
  display: flex;
  gap: 0.85em;
  margin: 0 0 1.4rem;
  color: var(--green);
  font-size: 1em;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.figlet-name {
  max-width: 100%;
  color: #f3e3e4;
  text-shadow: 0 0 24px rgb(217 79 89 / 0.14);
}

.figlet-name pre {
  width: max-content;
  max-width: 100%;
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: clamp(0.42rem, 0.7vw, 0.65rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: 0;
  white-space: pre;
  user-select: none;
}

.hero-copy {
  max-width: 44rem;
  margin: clamp(1.4rem, 3vw, 2.2rem) 0 clamp(2rem, 4vw, 3.4rem);
  color: var(--muted);
  font-size: clamp(1rem, 1rem + 0.4vw, 1.45rem);
  letter-spacing: 0.01em;
}

.profile-link {
  align-self: flex-start;
  color: var(--green);
  font-size: 0.9em;
  overflow-wrap: anywhere;
  text-decoration-color: rgb(217 79 89 / 0.64);
}

.prompt {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 1.4rem;
  margin: 1.25rem 0 0;
  color: var(--green);
}

.cursor {
  width: 0.68em;
  height: 1.15em;
  background: var(--green);
  box-shadow: 0 0 12px rgb(217 79 89 / 0.45);
  animation: blink 1.12s steps(1) infinite;
}

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

.project-list {
  border-top: 1px solid var(--border);
}

.project {
  display: grid;
  grid-template-columns: 3rem minmax(15rem, 0.8fr) minmax(20rem, 1.7fr) 2rem;
  gap: 1.2rem;
  align-items: center;
  min-height: 4.7rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.project:hover,
.project:focus-visible {
  outline: none;
  background: rgb(217 79 89 / 0.07);
}

.project:hover .arrow,
.project:focus-visible .arrow {
  transform: translateX(0.28rem);
}

.index {
  color: var(--muted);
}

.project-name {
  color: var(--green);
  font-size: 1.07em;
}

.project-description {
  color: var(--text);
}

.arrow {
  justify-self: end;
  color: var(--green);
  font-size: 1.5rem;
  transition: transform 160ms ease;
}

.about > p:not(.prompt) {
  max-width: 76ch;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.02rem, 1rem + 0.35vw, 1.38rem);
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.section-heading-row .command {
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-link {
  color: var(--muted);
  font-size: 0.78em;
  text-underline-offset: 0.3em;
}

.source-link:hover,
.source-link:focus-visible {
  color: var(--green);
}

.experience-list {
  border-top: 1px solid var(--border);
}

.job {
  display: grid;
  grid-template-columns: minmax(7rem, 0.45fr) minmax(11rem, 0.8fr) minmax(20rem, 2fr);
  gap: clamp(1rem, 3vw, 3rem);
  padding: 1.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.job.current {
  background: rgb(217 79 89 / 0.05);
}

.job-period {
  color: var(--muted);
  font-size: 0.78em;
  letter-spacing: 0.08em;
}

.job-company {
  color: var(--green);
}

.job-details h3 {
  margin: 0 0 0.85rem;
  color: var(--text);
  font-size: 1.05em;
  font-weight: 500;
}

.job-details {
  min-width: 0;
  overflow-wrap: anywhere;
}

.job-details p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.82em;
}

.job-details p span {
  flex: 0 0 auto;
  color: #7d6064;
}

.job-highlights {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.55;
  list-style: none;
}

.job-highlights li {
  position: relative;
  padding-left: 1.25rem;
}

.job-highlights li::before {
  position: absolute;
  left: 0;
  color: var(--green);
  content: ">";
}

.contact-link {
  display: inline-block;
  color: var(--amber);
  font-size: clamp(1.35rem, 1rem + 1vw, 2rem);
}

.interactive-terminal {
  max-width: 58rem;
  margin-top: 3rem;
}

.interactive-terminal label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--text);
  font-size: 0.85em;
}

.muted {
  color: var(--muted);
}

.input-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  color: var(--green);
}

.input-line input {
  width: 100%;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  outline: 0;
  color: var(--green);
  background: transparent;
  caret-color: var(--green);
  font: inherit;
}

.input-line input:focus {
  border-color: var(--green);
  box-shadow: 0 1px 0 rgb(217 79 89 / 0.38);
}

.terminal-output {
  min-height: 1.55em;
  margin: 0.85rem 0 0 2rem;
  color: var(--text);
}

.terminal-output.error {
  color: var(--amber);
}

:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 5px;
}

@media (max-width: 800px) {
  .terminal {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-width: 0;
  }

  .titlebar {
    grid-template-columns: 1fr auto;
  }

  .window-controls {
    display: none;
  }

  .nav {
    gap: 0.85rem;
    font-size: 0.72rem;
  }

  .section {
    padding-block: 3rem;
  }

  .hero {
    min-height: 68vh;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    padding-block: 1rem;
  }

  .ascii-portrait {
    justify-self: center;
    width: max-content;
    max-width: 100%;
  }

  .project {
    grid-template-columns: 2.2rem 1fr auto;
    gap: 0.7rem;
    padding: 1rem 0;
  }

  .project-description {
    grid-column: 2 / -1;
    padding-right: 1rem;
    color: var(--muted);
    font-size: 0.88em;
  }

  .arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .job {
    grid-template-columns: 7rem 1fr;
    gap: 0.5rem 1rem;
    padding-inline: 0;
  }

  .job-details {
    grid-column: 2;
  }
}

@media (max-width: 520px) {
  .titlebar {
    position: relative;
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding-block: 0.8rem;
  }

  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem 1rem;
  }

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

  .job-company,
  .job-details {
    grid-column: 1;
  }

  .job-details p {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

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

  .source-link {
    display: inline-block;
    margin: -0.65rem 0 1.35rem 2.1rem;
  }
}

@media (max-width: 360px) {
  .figlet-name pre {
    font-size: 1.75vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .arrow { transition: none; }
}
