:root {
  --bg: #0d1117;
  --panel: #131a22;
  --panel-soft: #18222c;
  --text: #f2f0e8;
  --muted: #a8b1ad;
  --line: rgba(242, 240, 232, 0.14);
  --accent: #b7f07b;
  --accent-strong: #5dd39e;
  --warm: #f3b35b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before {
  content: none;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: #081014;
  background: var(--accent);
  border-radius: var(--radius);
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 20, 0.78);
  backdrop-filter: blur(18px);
}

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

.header-inner {
  min-height: 72px;
}

.brand {
  color: var(--text);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.site-nav a,
.menu-toggle,
.btn,
.card-actions a {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 0.9rem;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.card-actions a:hover,
.card-actions a:focus-visible {
  color: var(--text);
  border-color: rgba(183, 240, 123, 0.62);
  background: rgba(183, 240, 123, 0.08);
}

.site-nav a.is-current {
  color: var(--text);
  border-color: rgba(183, 240, 123, 0.62);
  background: rgba(183, 240, 123, 0.14);
}

.menu-toggle {
  display: none;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
}

.intro {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 1.3rem 2.2rem;
  align-items: center;
  padding: 3.2rem 0 2rem;
}

.portrait-frame {
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  padding: 0.55rem;
  border-radius: 22px;
  border: 1px solid rgba(242, 240, 232, 0.16);
  background: rgba(16, 24, 32, 0.9);
  box-shadow: var(--shadow);
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(242, 240, 232, 0.16);
}

.about-panel {
  display: grid;
  gap: 0.9rem;
}

.about-copy {
  max-width: 70ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 1;
}

h1 {
  max-width: 880px;
  margin-bottom: 0;
  font-size: 4.45rem;
}

h2 {
  margin-bottom: 0;
  font-size: 3rem;
}

h3 {
  margin-bottom: 0.8rem;
  font-size: 1.65rem;
}

.lead,
.section-copy {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.05rem;
}

.secondary-head {
  margin-top: 2.4rem;
}

.subsection-head {
  margin-top: 1.5rem;
}

.secondary-grid {
  margin-top: 1.1rem;
}

.project-disclosure {
  margin-top: 2.4rem;
}

.project-disclosure summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.72rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.project-disclosure summary::-webkit-details-marker {
  display: none;
}

.project-disclosure summary:hover,
.project-disclosure summary:focus-visible {
  border-color: rgba(183, 240, 123, 0.62);
  background: rgba(183, 240, 123, 0.08);
}

.project-disclosure[open] summary {
  margin-bottom: 1rem;
}

kbd {
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85em;
}

.hero-ctas,
.intro-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.intro-actions {
  grid-column: 2;
}

.btn,
.card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  font-weight: 700;
}

.btn-primary {
  color: #081014;
  border-color: transparent;
  background: var(--accent);
}

.btn-secondary {
  color: var(--text);
}

.text-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  color: var(--muted);
  border: 1px dashed rgba(183, 240, 123, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.text-link-btn:hover,
.text-link-btn:focus-visible {
  color: var(--text);
  border-style: solid;
  border-color: rgba(183, 240, 123, 0.62);
  background: rgba(183, 240, 123, 0.08);
}

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 24, 32, 0.9);
  box-shadow: var(--shadow);
}

section[id] {
  scroll-margin-top: 92px;
}

#projects {
  padding: 1.25rem 0 5rem;
}

.section-head {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.section-copy {
  max-width: 68ch;
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-grid > .project-disclosure {
  grid-column: 1 / -1;
}

.project-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1.2rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(183, 240, 123, 0.48);
  background: rgba(20, 33, 43, 0.98);
}

.pin-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(183, 240, 123, 0.44);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(183, 240, 123, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
}

.project-card header h3 {
  flex-basis: 100%;
  margin-top: 0.1rem;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(183, 240, 123, 0.28);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(183, 240, 123, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
}

.project-card p {
  color: var(--muted);
}

.project-card .stack {
  margin-top: auto;
  color: #cdd7d0;
  font-size: 0.92rem;
}

.card-actions {
  margin-top: 1rem;
}

.card-actions a {
  flex: 1;
  padding: 0.65rem 0.8rem;
}

.writing-section {
  padding-bottom: 4.5rem;
}

.writing-controls {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.writing-card {
  display: grid;
  gap: 0.75rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 24, 32, 0.9);
  box-shadow: var(--shadow);
}

.writing-card p {
  color: var(--muted);
}

.writing-card a {
  width: fit-content;
  padding-bottom: 0.1rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(183, 240, 123, 0.2);
}

.writing-card a:hover,
.writing-card a:focus-visible {
  border-color: rgba(183, 240, 123, 0.62);
}

.writing-meta {
  margin-bottom: 0;
  color: var(--warm);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card.highlighted {
  animation: project-highlight 1.6s ease;
}

@keyframes project-highlight {
  0%,
  100% {
    box-shadow: var(--shadow);
  }

  45% {
    box-shadow: 0 0 0 4px rgba(183, 240, 123, 0.25), var(--shadow);
  }
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0;
  color: var(--muted);
  background: rgba(8, 16, 20, 0.72);
}

.footer-inner p {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  h1 {
    font-size: 3.25rem;
  }

  h2 {
    font-size: 2.35rem;
  }

  .intro {
    grid-template-columns: 240px minmax(0, 1fr);
  }

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

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

@media (max-width: 700px) {
  .container {
    width: min(100% - 1.25rem, 1120px);
  }

  .header-inner {
    min-height: 64px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0.65rem;
    left: 0.65rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(8, 16, 20, 0.95);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    justify-content: center;
  }

  .intro {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1rem;
    padding: 2.1rem 0 1rem;
    text-align: center;
  }

  .about-panel {
    justify-items: center;
  }

  .intro-actions {
    grid-column: 1;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 2rem;
  }

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

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

  #projects {
    padding-top: 0.75rem;
    padding-bottom: 3.2rem;
  }
}

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