/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #0D1210;
  --bg-alt: #10201A;
  --surface: #141C18;
  --surface-2: #182420;
  --line: #253830;
  --line-soft: #1C2A24;

  --text: #ECF0ED;
  --text-mute: #98A89E;
  --text-dim: #6E7D74;

  --copper: #C9823F;
  --copper-bright: #E0A868;

  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --wrap: 1080px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;

  --radius: 3px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    /* Site is designed dark-only by intent (PCB aesthetic); keep consistent
       regardless of OS theme so the design reads as intended. */
  }
}

/* ==========================================================================
   Reset / base
   ========================================================================== */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-mono); font-weight: 600; margin: 0; line-height: 1.25; }
p { margin: 0 0 var(--space-2); max-width: 62ch; }
:focus-visible {
  outline: 2px solid var(--copper-bright);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--copper);
  margin: 0 0 var(--space-2);
  position: relative;
  padding-left: 18px;
}
.section-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--copper);
  background: var(--bg);
}

section {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--line-soft);
  position: relative;
}
section::after {
  content: "";
  position: absolute;
  top: -1px;
  left: var(--space-3);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line);
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 18, 16, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.logo-blink { color: var(--copper); }
.site-nav {
  display: flex;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: 14px;
}
.site-nav a {
  color: var(--text-mute);
  transition: color 0.15s ease;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--copper-bright); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  border-top: none;
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
  background:
    linear-gradient(var(--bg-alt), var(--bg) 70%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--space-5);
  align-items: center;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--copper);
  margin-bottom: var(--space-3);
}
.hero-text h1 {
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}
.hero-lede {
  color: var(--text-mute);
  font-size: 18px;
  max-width: 52ch;
  margin-bottom: var(--space-4);
}
.hero-cta { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--copper);
  color: #12100C;
  font-weight: 600;
}
.btn-primary:hover { background: var(--copper-bright); }
.btn-ghost {
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--copper); color: var(--copper-bright); }

.hero-media img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
}

/* ==========================================================================
   Services
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4) var(--space-3);
}
.services-grid li {
  border-left: 1px solid var(--line);
  padding-left: var(--space-2);
}
.services-grid h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text);
}
.services-grid p {
  color: var(--text-mute);
  font-size: 15px;
  margin: 0;
}

/* ==========================================================================
   About
   ========================================================================== */
.about-inner h2 {
  font-size: clamp(22px, 3vw, 30px);
  max-width: 24ch;
  margin-bottom: var(--space-4);
  font-weight: 600;
}
.about-body {
  max-width: 70ch;
  color: var(--text-mute);
  margin-bottom: var(--space-5);
}
.about-body p { max-width: 70ch; }

.about-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  border-top: 1px solid var(--line-soft);
  padding-top: var(--space-4);
}
.about-facts h4 {
  font-size: 13px;
  color: var(--copper);
  margin-bottom: var(--space-1);
}
.about-facts p {
  font-size: 15px;
  color: var(--text-mute);
  margin-bottom: 4px;
}

/* ==========================================================================
   Skills
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}
.skill-group h3 {
  font-size: 16px;
  margin-bottom: var(--space-2);
  color: var(--text);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-mute);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
}
.tag-list.small li { font-size: 12px; padding: 4px 8px; }

/* ==========================================================================
   Experience / timeline
   ========================================================================== */
.timeline {
  border-left: 1px solid var(--line);
  margin-left: 4px;
}
.timeline li {
  position: relative;
  padding: 0 0 var(--space-4) var(--space-4);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--copper);
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--copper);
  margin-bottom: 6px;
}
.timeline-body h3 {
  font-size: 18px;
  margin-bottom: 2px;
}
.timeline-org {
  color: var(--text-mute);
  font-size: 14px;
  font-style: normal;
  margin-bottom: var(--space-2);
}
.timeline-body p:last-child { color: var(--text-mute); margin-bottom: 0; }

/* ==========================================================================
   Projects
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--line-soft);
}
.project-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-body h3 {
  font-size: 17px;
  margin-bottom: var(--space-1);
}
.project-body p {
  color: var(--text-mute);
  font-size: 14.5px;
  margin-bottom: var(--space-2);
}
.project-body .tag-list { margin-bottom: var(--space-2); }
.project-link {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--copper);
  align-self: flex-start;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.project-link:hover {
  color: var(--copper-bright);
  border-color: var(--copper-bright);
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-inner h2 {
  font-size: clamp(22px, 3vw, 30px);
  max-width: 22ch;
  margin: var(--space-2) 0;
}
.contact-lede {
  color: var(--text-mute);
  max-width: 60ch;
  margin-bottom: var(--space-4);
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.contact-links a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 200px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.contact-links a:hover {
  border-color: var(--copper);
  background: var(--surface);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--copper);
}
.contact-value {
  font-size: 15px;
  color: var(--text);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: var(--space-3) 0 var(--space-4);
}
.site-footer p {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-media { order: -1; max-width: 220px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line-soft);
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
    display: none;
  }
  .site-nav.open { display: flex; }
  section { padding: var(--space-5) 0; }
}
