:root {
  --bg: #0a0e0f;
  --bg-panel: #10161a;
  --bg-panel-hover: #141b20;
  --wine: #a83246;
  --wine-bright: #ff5c72;
  --green: #5fd98a;
  --text: #e4e8e9;
  --text-muted: #7c8a8f;
  --border: #212a2e;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

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

a { color: inherit; }

/* faint techy grid background */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(168, 50, 70, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 50, 70, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
}

main, header, footer { position: relative; z-index: 1; }

.comment {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--green);
  margin: 0 0 0.75rem;
  opacity: 0.85;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
  background: rgba(10, 14, 15, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.prompt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.topbar nav a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-left: 2rem;
  transition: color 0.2s ease;
}
.topbar nav a:hover { color: var(--wine-bright); }

/* Hero */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem clamp(1.5rem, 5vw, 4rem) 4rem;
}

.scroll-arrow {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: bounce 2.2s ease-in-out infinite;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.scroll-arrow:hover {
  border-color: var(--wine-bright);
  color: var(--wine-bright);
  box-shadow: 0 0 20px -4px rgba(255, 92, 114, 0.5);
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(7px); }
}

.hero-inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

/* Terminal window */
.terminal {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(168,50,70,0.05), 0 20px 60px -20px rgba(168,50,70,0.15);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  background: #0d1215;
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.terminal-title {
  margin-left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-body { padding: 2rem clamp(1.25rem, 3vw, 2.5rem) 2.25rem; }

.terminal-body > p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.3rem;
}
.prompt-sign { color: var(--wine-bright); margin-right: 0.5em; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0.2rem 0 1.1rem;
}

.role-line { margin-top: 0 !important; }
.role-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text);
  margin: 0.2rem 0 1.5rem !important;
}
.type-cursor {
  color: var(--wine-bright);
  opacity: 0;
  margin-left: 2px;
}
.type-cursor.active {
  opacity: 1;
  animation: blink 0.9s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  font-family: var(--font-body) !important;
  font-size: 0.98rem !important;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 0 1.75rem !important;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.5rem;
  border-radius: 5px;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--wine);
  color: var(--text);
  border: 1px solid var(--wine);
}
.btn-primary:hover {
  background: var(--wine-bright);
  border-color: var(--wine-bright);
  box-shadow: 0 0 24px -4px rgba(255, 92, 114, 0.5);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--wine-bright); color: var(--text); }
.btn-large { font-size: 1rem; padding: 1.05rem 2rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
}
.badge-cmd { color: var(--text-muted); }
.badge-val { color: var(--green); }
.dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px 1px rgba(95, 217, 138, 0.6);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* About */
.about {
  padding: 6rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
}
.about-label h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.9rem;
  margin: 0;
}
.about-body p {
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 1.2rem;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--wine);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}
.tok-kw { color: var(--wine-bright); }
.tok-var { color: var(--text); }
.tok-str { color: var(--green); }

.skills {
  list-style: none;
  padding: 0 0 0 1.75rem;
  margin: 0.3rem 0;
}
.skills li { line-height: 1.9; }

/* Work */
.work {
  padding: 6rem clamp(1.5rem, 5vw, 4rem);
  max-width: 1100px;
  margin: 0 auto;
}
.section-comment { text-align: left; }
.section-comment.center { text-align: center; }
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  margin: 0 0 3rem;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 6px;
  overflow: hidden;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover {
  background: var(--bg-panel-hover);
  border-color: var(--wine);
  box-shadow: 0 0 0 1px rgba(168,50,70,0.2);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #0d1215;
  border-bottom: 1px solid var(--border);
}
.file-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.project-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--wine-bright);
}

.project-body { padding: 1.75rem 2rem; }
.project-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 0.6rem;
}
.project-body p {
  color: var(--text-muted);
  margin: 0 0 1rem;
  max-width: 60ch;
}
.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--green);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}
.project-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--wine-bright);
}
.project-links a:hover { color: var(--text); }

/* Contact */
.contact {
  padding: 7rem clamp(1.5rem, 5vw, 4rem) 8rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.contact-copy {
  color: var(--text-muted);
  max-width: 46ch;
  margin: 0 auto 2rem;
}
.socials {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
}
.socials a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text-muted);
}
.socials a:hover { color: var(--wine-bright); }

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Focus states */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--wine-bright);
  outline-offset: 3px;
}

/* Responsive */
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer { flex-direction: column; gap: 0.5rem; }
  .terminal-body { padding: 1.5rem 1.25rem 1.75rem; }
}
