/* ─── Design Tokens ─────────────────────────────────────────────── */
:root {
  --bg:          #0a0a0a;
  --bg-surface:  #111111;
  --bg-card:     #181818;
  --border:      #2a2a2a;
  --text:        #f0f0f0;
  --text-muted:  #888888;
  --accent:      #f59e0b;
  --accent-hover:#d97706;

  --font-display:'DM Serif Display', serif;
  --font-body:   'DM Sans', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  --max-w: 1100px;
  --section-py: clamp(4rem, 8vw, 7rem);
  --section-px: clamp(1.25rem, 5vw, 3rem);
}

body.mode-php {
  --accent:       #3b82f6;
  --accent-hover: #2563eb;
}

/* ─── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body { min-height: 100svh; }

::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

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

img, svg { display: block; }

/* ─── Grain Overlay ──────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 9998;
}

/* ─── Layout ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--section-px);
}

section {
  padding-block: var(--section-py);
  border-top: 1px solid var(--border);
}

section:first-of-type { border-top: none; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 3rem;
}

/* ─── Navigation ─────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; inset-inline: 0;
  z-index: 100;
  height: 3.5rem;
  display: flex;
  align-items: center;
  transition: background 0.2s, border-color 0.2s;
}

.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--section-px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo svg { height: 22px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text);
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

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

.nav-mobile a {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

@media (max-width: 767px) {
  .nav-links  { display: none; }
  .nav-toggle { display: flex; }
}

/* ─── Hero ───────────────────────────────────────────────────────── */
#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 5rem;
  border-top: none;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 400;
  line-height: 0.95;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-family: var(--font-body);
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.hero-scroll {
  margin-top: auto;
  padding-top: 3rem;
  padding-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.hero-scroll::before {
  content: '';
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--border);
}

/* ─── Projects ───────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 767px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s;
}

.project-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.project-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
}

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

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

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.25rem 0.625rem;
}

.project-footer {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.project-gh {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.project-gh svg { width: 14px; height: 14px; }

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

/* ─── Skills ─────────────────────────────────────────────────────── */
.skills-groups { display: flex; flex-direction: column; gap: 2rem; }

.skills-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.skills-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  transition: color 0.2s, border-color 0.2s;
  cursor: default;
}

.skill-tag:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ─── Experience / Education ────────────────────────────────────── */
.entry {
  padding-left: 1.25rem;
  border-left: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.entry-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.entry-org {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
}

.entry-role {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 0.2rem;
}

.entry-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.entry-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Contact ────────────────────────────────────────────────────── */
.contact-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 28rem;
  margin-bottom: 2.5rem;
}

.contact-links { display: flex; flex-direction: column; gap: 1rem; }

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
  padding: 0.25rem 0;
}

.contact-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--border);
  width: 5rem;
  flex-shrink: 0;
  transition: color 0.2s;
}

.contact-link:hover { color: var(--text); }
.contact-link:hover .contact-label { color: var(--accent); }

.contact-arrow {
  margin-left: auto;
  opacity: 0;
  font-size: 0.85rem;
  color: var(--accent);
  transition: opacity 0.2s;
}

.contact-link:hover .contact-arrow { opacity: 1; }

.contact-footer {
  margin-top: 4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--border);
}

/* ─── PHP badge ──────────────────────────────────────────────────── */
.php-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 0.375rem;
  padding: 0.15rem 0.5rem;
  margin-top: 0.75rem;
}

/* ─── Toggle Pill ────────────────────────────────────────────────── */
.toggle-pill {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.toggle-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s, opacity 0.2s;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
}

.toggle-label:hover { opacity: 0.8; }

.toggle-label.active { color: var(--accent); }

.toggle-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex-shrink: 0;
}
