*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0c0c0c;
  --bg-surface: #111111;
  --text: #e8e6e3;
  --text-dim: #8a8a8a;
  --text-muted: #555555;
  --accent: #e2a84b;
  --border: #1e1e1e;
  --border-light: #2a2a2a;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --sans: 'Space Grotesk', -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  position: relative;
}

/* noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

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

/* --- Nav --- */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 3rem;
  background: rgba(12, 12, 12, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

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

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: var(--mono);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

/* --- Hero --- */

.hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 3rem 6rem;
  max-width: 860px;
}

.hero-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
}

.hero h1 {
  font-family: var(--sans);
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--text);
}

.hero-sub {
  font-family: var(--mono);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--accent);
  margin-top: 1.5rem;
  font-weight: 400;
}

/* --- Divider --- */

.divider {
  padding: 0 3rem;
}

.divider span {
  display: block;
  height: 1px;
  background: var(--border);
}

/* --- Section Grid --- */

.section-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  max-width: 960px;
}

section {
  padding: 5rem 3rem;
}

h2 {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  position: sticky;
  top: 5rem;
}

/* --- About --- */

.about blockquote {
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
}

.about .section-content > p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-dim);
}

.project-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.project-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-surface);
}

.project-card-name {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.project-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Past Projects --- */

.past-project {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.past-project-name {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
}

.past-project-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Work / Projects --- */

.project {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.project:first-of-type {
  padding-top: 0;
}

.project:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.project-status {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.project-status--exited {
  background: var(--text-muted);
  color: var(--bg);
}

.project-url {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.project-url:hover {
  color: var(--accent);
}

.project h3 {
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.project-stack span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  transition: border-color 0.2s, color 0.2s;
}

.project-stack span:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.project-points {
  list-style: none;
  padding: 0;
}

.project-points li {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.25rem;
}

.project-points li::before {
  content: '>';
  position: absolute;
  left: 0;
  font-family: var(--mono);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Ads Platform Page --- */

.hero--compact {
  min-height: auto;
  padding: 8rem 3rem 4rem;
}

.section-content .lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.section-content > p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.section-intro {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.inline-link:hover {
  border-color: var(--accent);
}

.api-block {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.api-block:first-of-type {
  padding-top: 0;
}

.api-block:last-of-type {
  border-bottom: none;
}

.api-block h3 {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.api-block p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.api-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.api-resources code {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(226, 168, 75, 0.08);
  border: 1px solid rgba(226, 168, 75, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}

.arch-diagram {
  margin-bottom: 2.5rem;
  overflow-x: auto;
}

.arch-diagram pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
}

.arch-diagram code {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.arch-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.arch-item h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.arch-item p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.65;
}

.capability-list {
  list-style: none;
  padding: 0;
}

.capability-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.capability-list li:first-child {
  padding-top: 0;
}

.capability-list li:last-child {
  border-bottom: none;
}

.cap-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.cap-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* --- Contact --- */

.email-link {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}

.email-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Footer --- */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Responsive --- */

@media (max-width: 768px) {
  nav {
    padding: 1rem 1.5rem;
  }

  .hero {
    min-height: 70vh;
    padding: 6rem 1.5rem 4rem;
  }

  section {
    padding: 3.5rem 1.5rem;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  h2 {
    position: static;
  }

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

  .divider {
    padding: 0 1.5rem;
  }

  footer {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

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

  .arch-diagram pre {
    padding: 1rem;
  }

  .arch-diagram code {
    font-size: 0.65rem;
  }

  .capability-list li {
    gap: 0.15rem;
  }
}
