:root {
  --background: 30 10% 7%;
  --foreground: 36 30% 94%;
  --card: 30 10% 9%;
  --primary: 28 85% 62%;
  --primary-foreground: 30 15% 8%;
  --primary-glow: 32 95% 70%;
  --secondary: 30 8% 14%;
  --muted: 30 8% 14%;
  --muted-foreground: 35 12% 62%;
  --border: 30 8% 16%;
  --radius: 12px;
  --gradient-fade-bottom: linear-gradient(180deg, transparent, hsl(var(--background)));
  --shadow-soft: 0 20px 60px -20px hsl(28 85% 50% / 0.25);
  --shadow-card: 0 10px 40px -20px hsl(0 0% 0% / 0.6);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Inter, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

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

ul,
ol,
p,
h1,
h2,
h3 {
  margin: 0;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

svg {
  display: block;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: 1.5rem;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  background: hsl(var(--background) / 0.7);
  backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand span,
.text-primary {
  color: hsl(var(--primary));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a[data-active="true"] {
  color: hsl(var(--foreground));
}

.nav-links span {
  color: hsl(var(--primary));
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
}

.hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  overflow: hidden;
  padding-top: 4rem;
}

.hero-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0.28;
  pointer-events: none;
}

.hero-art svg {
  width: 100%;
  max-width: 64rem;
  height: auto;
}

.hero-fade {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 10rem;
  background-image: var(--gradient-fade-bottom);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding-block: 8rem;
}

.eyebrow,
.section-heading p,
.side-title,
.currently li p,
.period {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 1.5rem;
  color: hsl(var(--primary));
}

h1,
h2,
h3,
.footer-inner > div > p {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 56rem;
  font-size: clamp(3rem, 11vw, 6rem);
  line-height: 0.95;
  text-wrap: balance;
}

h1 span,
footer span {
  color: hsl(var(--primary));
  font-style: italic;
}

.hero-copy {
  max-width: 36rem;
  margin-top: 2rem;
  color: hsl(var(--muted-foreground));
  font-size: 1.125rem;
  line-height: 1.625;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.button-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.button-primary:hover {
  box-shadow: var(--shadow-soft);
}

.button-primary span {
  transition: transform 0.2s ease;
}

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

.button-secondary {
  border: 1px solid hsl(var(--border));
}

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

.socials {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.socials a {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 8px;
  color: hsl(var(--muted-foreground));
  transition: background 0.2s ease, color 0.2s ease;
}

.socials a:hover {
  background: hsl(var(--secondary) / 0.6);
  color: hsl(var(--primary));
}

.socials svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.section {
  position: relative;
  z-index: 10;
  padding-block: 7rem;
}

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

.section-heading p {
  margin-bottom: 0.75rem;
  color: hsl(var(--primary));
}

.section-heading h2 {
  max-width: 48rem;
  font-size: clamp(2.25rem, 6vw, 3rem);
  line-height: 1.08;
  text-wrap: balance;
}

.about-grid {
  display: grid;
  gap: 3rem;
}

.about-copy {
  display: grid;
  gap: 1.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 1.125rem;
  line-height: 1.625;
}

.side-title {
  margin-bottom: 1rem;
  color: hsl(var(--primary));
}

.currently ul {
  display: grid;
  gap: 1rem;
  border-left: 1px solid hsl(var(--border));
  padding-left: 1.25rem;
}

.currently li p {
  color: hsl(var(--muted-foreground));
  letter-spacing: 0;
  text-transform: none;
}

.currently strong {
  display: block;
  margin-top: 0.1rem;
  font-weight: 400;
  color: hsl(var(--foreground));
}

.project-grid {
  display: grid;
  gap: 1.5rem;
}

.project-card {
  display: flex;
  min-height: 18rem;
  flex-direction: column;
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  background: hsl(var(--card));
  padding: 1.5rem;
  transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.5s ease;
}

.project-card:hover {
  border-color: hsl(var(--primary) / 0.4);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-head h3 {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  line-height: 1.2;
}

.project-head h3 span,
.story-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size 0.3s ease;
}

.project-card:hover h3 span,
.story-link:hover {
  background-size: 100% 1px;
}

.project-head time {
  padding-top: 0.5rem;
  color: hsl(var(--muted-foreground));
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
}

.project-card > p {
  color: hsl(var(--muted-foreground));
  line-height: 1.625;
}

.project-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.project-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-foot li {
  border-radius: 999px;
  background: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.project-links a {
  transition: color 0.2s ease;
}

.project-links a:hover {
  color: hsl(var(--primary));
}

.timeline {
  position: relative;
  display: grid;
  max-width: 48rem;
  gap: 3rem;
  border-left: 1px solid hsl(var(--border));
  padding-left: 2.5rem;
}

.timeline li {
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: -2.85rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid hsl(var(--primary));
  border-radius: 999px;
  background: hsl(var(--background));
}

.timeline .timeline-work::before {
  background: hsl(var(--primary));
}

.period {
  margin-bottom: 0.5rem;
  color: hsl(var(--muted-foreground));
}

.timeline h3 {
  margin-bottom: 0.25rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

.org {
  margin-bottom: 0.75rem;
  color: hsl(var(--primary));
}

.timeline li > p:last-child {
  color: hsl(var(--muted-foreground));
  line-height: 1.625;
}

.cv-action {
  margin-top: 3.5rem;
}

footer {
  position: relative;
  z-index: 10;
  margin-top: 5rem;
  border-top: 1px solid hsl(var(--border));
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 3rem;
}

.footer-inner > div > p {
  font-size: 1.5rem;
}

.footer-inner .story-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}

.footer-inner .story-link:hover {
  color: hsl(var(--foreground));
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.copyright {
  color: hsl(var(--muted-foreground));
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
}

.fade-in {
  animation: fade-in 0.6s ease-out both;
}

.fade-delay-1 {
  animation-delay: 0.1s;
}

.fade-delay-2 {
  animation-delay: 0.2s;
}

.fade-delay-3 {
  animation-delay: 0.3s;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes code-scroll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50%);
  }
}

@keyframes cursor-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes lamp-flicker {
  0%,
  100%,
  47% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.4;
  }
  53% {
    opacity: 0.75;
  }
}

@keyframes leaf-sway {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(3deg);
  }
}

@keyframes screen-glow {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes steam-rise {
  0% {
    opacity: 0;
    transform: translate(0) scale(1);
  }
  20% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translate(-4px, -28px) scale(1.6);
  }
}

@keyframes type-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.5px);
  }
}

@keyframes type-bob-alt {
  0%,
  100% {
    transform: translateY(-1.5px);
  }
  50% {
    transform: translateY(0);
  }
}

.code-scroll {
  animation: code-scroll 16s linear infinite;
}

.cursor-blink {
  animation: cursor-blink 1s step-end infinite;
}

.lamp-flicker {
  animation: lamp-flicker 6s ease-in-out infinite;
}

.leaf-sway {
  animation: leaf-sway 5s ease-in-out infinite;
}

.screen-glow {
  animation: screen-glow 4s ease-in-out infinite;
}

.steam-rise {
  animation: steam-rise 3.5s ease-out infinite;
}

.steam-delay-1 {
  animation-delay: 0.9s;
}

.steam-delay-2 {
  animation-delay: 1.7s;
}

.type-bob {
  animation: type-bob 0.45s ease-in-out infinite;
}

.type-bob-alt {
  animation: type-bob-alt 0.45s ease-in-out infinite;
}

@media (min-width: 640px) {
  .nav-links {
    gap: 0.5rem;
  }

  .hero-content {
    padding-block: 10rem;
  }

  .section {
    padding-block: 10rem;
  }

  .project-card {
    padding: 2rem;
  }

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

  .footer-inner {
    flex-direction: row;
    align-items: center;
  }

  .footer-right {
    align-items: flex-end;
  }
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5rem;
  }

  .about-copy {
    grid-column: span 2 / span 2;
  }
}

@media (max-width: 639px) {
  .container {
    padding-inline: 1.25rem;
  }

  .nav-links span {
    display: none;
  }

  .nav-links a {
    padding-inline: 0.55rem;
  }

  .hero-art {
    opacity: 0.22;
  }

  .hero-actions {
    align-items: stretch;
  }

  .button {
    justify-content: center;
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline li::before {
    left: -2.35rem;
  }
}

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