:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-soft: #10182a;
  --surface: #121c30;
  --text: #edf2ff;
  --muted: #aab6cb;
  --subtle: #7786a2;
  --border: rgba(160, 180, 220, 0.16);
  --accent: #8bbaff;
  --accent-strong: #b4d2ff;
  --green: #82d7b3;
  --amber: #f0c477;
  --container: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

button {
  font: inherit;
}

.container {
  width: min(calc(100% - 3rem), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 100;
  left: 1rem;
  top: -5rem;
  padding: 0.7rem 1rem;
  background: var(--accent);
  color: #071326;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

/* Navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 16, 32, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  font-size: 1.08rem;
  font-weight: 780;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.brand span,
.hero-period {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
}

.nav-links a,
.nav-social {
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-links a:hover,
.nav-social:hover {
  color: var(--text);
}

.nav-social {
  padding-left: 1.1rem;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.nav-social span {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.menu-toggle svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* Hero */

.hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
  padding-block: clamp(5rem, 11vw, 8rem);
}

.hero-content {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0.45rem 0.08rem 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(130, 215, 179, 0.1);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 7.5vw, 5.5rem);
  font-weight: 760;
  line-height: 1.03;
  letter-spacing: -0.075em;
}

.hero-statement {
  max-width: 720px;
  margin: 1.5rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.38;
  letter-spacing: -0.04em;
}

.hero-statement em {
  color: var(--accent);
  font-style: normal;
}

.hero-copy {
  max-width: 620px;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.94rem;
  transition: background 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease;
}

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

.button.primary {
  background: var(--accent);
  color: #091326;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.button.secondary:hover {
  border-color: var(--accent);
}

.currently {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.currently span {
  color: var(--text);
  font-weight: 700;
  margin-right: 0.4rem;
}

.hero-aside {
  align-self: center;
  padding-left: 1.5rem;
  border-left: 1px solid var(--border);
  color: var(--muted);
}

.aside-label,
.aside-foot {
  color: var(--subtle);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.aside-line {
  width: 46px;
  height: 2px;
  margin: 1.2rem 0;
  background: var(--accent);
}

.hero-aside p:not(.aside-label) {
  margin: 0.5rem 0;
  color: var(--text);
  font-size: 1.02rem;
}

.aside-foot {
  display: block;
  margin-top: 2rem;
  letter-spacing: 0.04em;
}

/* Shared sections */

.section {
  padding-block: clamp(4rem, 8vw, 6.5rem);
}

.section-heading {
  max-width: 740px;
  margin-bottom: 2.5rem;
}

.section-heading h2,
.about-inner h2,
.contact-inner h2 {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.15rem);
  line-height: 1.16;
  letter-spacing: -0.055em;
}

.section-intro {
  max-width: 620px;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Projects */

.project-list {
  display: grid;
  gap: 1rem;
}

.project-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(210px, 285px);
  gap: 1.5rem;
  align-items: center;
  padding: 1.65rem 0;
  border-top: 1px solid var(--border);
}

.project-card:last-child {
  border-bottom: 1px solid var(--border);
}

.project-index {
  align-self: start;
  padding-top: 0.2rem;
  color: var(--subtle);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.project-body {
  min-width: 0;
}

.project-kicker {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-card h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.project-description {
  margin: 0.8rem 0 0;
  max-width: 65ch;
  color: var(--muted);
  font-size: 1rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.tech-tags li {
  padding: 0.2rem 0.58rem;
  border-radius: 4px;
  background: rgba(139, 186, 255, 0.08);
  color: #c1d6f5;
  font-size: 0.78rem;
  line-height: 1.6;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 1.1rem;
}

.project-links a,
.about-link {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 720;
}

.project-links a:hover,
.about-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Lightweight project illustrations */

.project-visual {
  min-height: 155px;
  overflow: hidden;
  border: 1px solid rgba(160, 180, 220, 0.13);
  border-radius: 10px;
  background: #0e1728;
}

.terminal-bar,
.browser-top {
  height: 31px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(160, 180, 220, 0.1);
}

.terminal-bar > span,
.browser-top > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #53617b;
}

.terminal-bar small {
  margin-left: auto;
  color: #8190a9;
  font-size: 0.68rem;
}

.terminal-visual pre {
  margin: 0;
  padding: 0.75rem 0.8rem 0.35rem;
  white-space: pre-wrap;
  font: 0.72rem/1.85 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #d5dfef;
}

.terminal-muted {
  color: #8b9bb5;
}

.terminal-green {
  color: var(--green);
}

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

.visual-caption {
  margin: 0.4rem 0.8rem 0.7rem;
  color: #9aa8bf;
  font-size: 0.68rem;
  line-height: 1.5;
}

.browser-top div {
  height: 13px;
  margin-left: 7px;
  flex: 1;
  border-radius: 4px;
  background: #1b2940;
}

.browser-content {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 13px;
}

.browser-content i,
.browser-content b {
  display: block;
  width: 80%;
  height: 6px;
  border-radius: 4px;
  background: #26364f;
}

.browser-content i:nth-child(2) {
  width: 56%;
}

.browser-content b {
  width: 67%;
  height: 22px;
  border: 1px solid #8bbaff;
  background: rgba(139, 186, 255, 0.08);
}

.browser-alert {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
  padding: 8px;
  border: 1px solid rgba(240, 196, 119, 0.3);
  border-radius: 6px;
  background: rgba(240, 196, 119, 0.05);
}

.browser-alert > span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: #0b1020;
  background: var(--amber);
  font-size: 0.75rem;
  font-weight: 800;
}

.browser-alert strong,
.browser-alert small {
  display: block;
  font-size: 0.66rem;
  line-height: 1.4;
}

.browser-alert small {
  color: #aab6cb;
}

.process-visual {
  padding: 1rem;
}

.process-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(160, 180, 220, 0.08);
  color: #cdd7e8;
  font-size: 0.72rem;
}

.process-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.process-row code {
  font: inherit;
}

.process-row small {
  margin-left: auto;
  color: #aab6cb;
  font-size: 0.65rem;
}

.process-warning {
  color: var(--amber);
}

.process-warning .process-led {
  background: var(--amber);
}

.section-note {
  margin: 1.4rem 0 0;
  color: var(--subtle);
  font-size: 0.88rem;
}

/* Writing */

.writing-section {
  background: var(--bg-soft);
  border-block: 1px solid var(--border);
}

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

.writing-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--border);
}

.writing-item time {
  padding-top: 0.25rem;
  color: var(--subtle);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.writing-topic {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.writing-item h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.writing-item h3 a:hover {
  color: var(--accent-strong);
}

.writing-item h3 span {
  color: var(--accent);
  white-space: nowrap;
}

.writing-item div > p:not(.writing-topic) {
  max-width: 72ch;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.related-link {
  display: inline-block;
  margin-top: 0.65rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
}

.muted-link {
  color: var(--subtle);
  font-weight: 500;
}

/* About */

.about-section {
  padding-block: clamp(4rem, 8vw, 6rem);
}

.about-inner {
  max-width: 760px;
}

.about-inner > p:not(.eyebrow) {
  margin: 1.2rem 0;
  color: var(--muted);
  font-size: 1.06rem;
}

/* Contact */

.contact-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.contact-inner > div {
  max-width: 660px;
}

.contact-inner > div > p:not(.eyebrow) {
  margin: 0.9rem 0 0;
  color: var(--muted);
}

/* Footer and social links */

.footer {
  padding-block: 1.25rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner > p {
  margin: 0;
  color: var(--subtle);
  font-size: 0.83rem;
}

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

.footer-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem 1rem;
}

.footer-connect > span {
  color: var(--muted);
  font-size: 0.83rem;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.social-links a:hover {
  color: var(--accent-strong);
}

.social-links svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Medium screens */

@media (min-width: 1300px) {
  .hero {
    min-height: 610px;
  }
}

@media (max-width: 850px) {
  .container {
    width: min(calc(100% - 2.5rem), var(--container));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 2rem;
  }

  .hero-aside {
    padding-left: 1rem;
  }

  .project-card {
    grid-template-columns: 28px minmax(0, 1fr) 210px;
    gap: 1rem;
  }

  .project-visual {
    min-height: 145px;
  }
}

/* Mobile */

@media (max-width: 640px) {
  html {
    scroll-padding-top: 76px;
  }

  .container {
    width: min(calc(100% - 2rem), var(--container));
  }

  .nav {
    min-height: 66px;
    gap: 0.75rem;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-social {
    padding-left: 0.75rem;
    font-size: 0.82rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: #0b1020;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.8rem 0.25rem;
    border-bottom: 1px solid rgba(160, 180, 220, 0.08);
    font-size: 1rem;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 5rem 4.5rem;
  }

  .hero h1 {
    font-size: clamp(3.1rem, 15vw, 4.5rem);
  }

  .hero-statement {
    margin-top: 1.2rem;
    font-size: clamp(1.45rem, 6vw, 1.8rem);
  }

  .hero-copy {
    font-size: 1rem;
  }

  .hero-actions {
    gap: 0.65rem;
  }

  .button {
    min-height: 46px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }

  .currently {
    margin-top: 1.35rem;
    font-size: 0.84rem;
    line-height: 1.6;
  }

  .currently span {
    display: block;
    margin: 0 0 0.15rem;
  }

  .hero-aside {
    display: none;
  }

  .section {
    padding-block: 4rem;
  }

  .section-heading {
    margin-bottom: 1.6rem;
  }

  .section-heading h2,
  .about-inner h2,
  .contact-inner h2 {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }

  .section-intro {
    font-size: 0.98rem;
  }

  .project-card {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 1.4rem 0;
  }

  .project-index {
    font-size: 0.72rem;
  }

  .project-card h3 {
    font-size: 1.3rem;
  }

  .project-description {
    font-size: 0.98rem;
  }

  .project-visual {
    grid-column: 2;
    min-height: 145px;
    max-width: 100%;
  }

  .tech-tags {
    gap: 0.4rem;
  }

  .tech-tags li {
    font-size: 0.76rem;
  }

  .project-links {
    gap: 0.85rem;
  }

  .project-links a {
    font-size: 0.87rem;
  }

  .writing-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 1.4rem 0;
  }

  .writing-item time {
    font-size: 0.78rem;
  }

  .writing-item h3 {
    font-size: 1.17rem;
  }

  .writing-item div > p:not(.writing-topic) {
    font-size: 0.95rem;
  }

  .contact-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.4rem;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }

  .footer-connect {
    justify-content: flex-start;
  }

  .social-links {
    gap: 1.1rem;
    flex-wrap: wrap;
  }
}

/* Very narrow screens, including 320–375px */

@media (max-width: 380px) {
  .container {
    width: min(calc(100% - 1.5rem), var(--container));
  }

  .nav {
    gap: 0.5rem;
  }

  .brand {
    font-size: 1rem;
  }

  .nav-social {
    font-size: 0.78rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    max-width: 250px;
  }

  .button {
    width: 100%;
  }

  .project-card {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 0.55rem;
  }

  .project-card h3 {
    font-size: 1.2rem;
  }
}

/* Respect the visitor's reduced-motion setting */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
