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

/* ── Tokens ── */
:root[data-theme="dark"] {
  --bg: #0A0A09;
  --bg-2: #111110;
  --ink: #F0EFE9;
  --muted: #6B6B63;
  --muted-2: #2E2E2B;
  --accent: #D97706;
  --border: #1E1E1C;
  --hover-bg: #161614;
}

:root[data-theme="light"] {
  --bg: #F7F6F2;
  --bg-2: #EDECEA;
  --ink: #0D0D0C;
  --muted: #6B6B63;
  --muted-2: #D4D3CC;
  --accent: #D97706;
  --border: #E0DFD8;
  --hover-bg: #E8E7E2;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--muted-2); }

/* ── Nav ── */
#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 28px; }

.nav-links { display: flex; gap: 24px; list-style: none; }

.nav-links a {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a:focus { color: var(--ink); outline: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 6px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }

/* ── Layout ── */
.container { max-width: 900px; margin: 0 auto; padding: 0 40px; }

section { padding: 100px 0; border-bottom: 1px solid var(--border); }

/* ── Section label ── */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 64px;
}

.label-num { font-size: 10px; color: var(--accent); letter-spacing: 0.1em; }
.label-text { font-size: 10px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.label-line { flex: 1; height: 1px; background: var(--border); }

/* ── Hero ── */
#hero {
  padding-top: 160px;
  padding-bottom: 120px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.status-dot {
  width: 6px; height: 6px;
  background: #22C55E;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero-divider { width: 1px; height: 14px; background: var(--border); }
.hero-location { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-title em { font-style: italic; color: var(--muted); }

.hero-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.3s forwards;
}

.hero-desc strong { color: var(--ink); font-weight: 400; }

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.4s forwards;
}

/* ── Buttons ── */
.btn-primary {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 24px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  display: inline-block;
}

.btn-primary:hover { opacity: 0.8; }

.btn-ghost {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.btn-ghost:hover { color: var(--ink); }

/* ── Work Timeline ── */
.timeline { display: grid; gap: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: 1px solid var(--border); }

.timeline-period { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 6px; }

.timeline-company {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.timeline-role {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.timeline-bullets { list-style: none; display: grid; gap: 8px; }

.timeline-bullets li {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  padding-left: 18px;
  position: relative;
}

.timeline-bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--muted-2);
  font-size: 11px;
  top: 1px;
}

.timeline-bullets li strong { color: var(--ink); font-weight: 400; }

/* ── Projects ── */
.projects-grid { display: grid; gap: 12px; }

.project-card {
  background: var(--bg-2);
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 24px;
  align-items: start;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-left: 2px solid transparent;
}

.project-card:hover,
.project-card:focus {
  background: var(--hover-bg);
  border-left-color: var(--accent);
  outline: none;
}

.project-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
}

.project-name {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.project-badge {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  padding: 2px 8px;
  opacity: 0.6;
}

.project-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 580px;
}

.project-stack { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }

.stack-tag {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  padding: 3px 10px;
}

.project-arrow {
  font-size: 16px;
  color: var(--border);
  transition: color 0.15s, transform 0.2s;
  margin-top: 6px;
}

.project-card:hover .project-arrow { color: var(--accent); transform: translate(3px, -3px); }

/* ── Stack ── */
.stack-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px 80px;
}

.stack-group-title {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.stack-list { list-style: none; display: grid; gap: 10px; }

.stack-list li {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: color 0.15s;
}

.stack-list li:hover { color: var(--ink); }

.stack-list li::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--muted-2);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Contact ── */
#contact { border-bottom: none; }

.contact-heading {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 40px;
}

.contact-heading em { font-style: italic; color: var(--muted); }

.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 64px; }

.contact-link {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 10px 18px;
  transition: all 0.15s;
}

.contact-link:hover,
.contact-link:focus { color: var(--ink); border-color: var(--ink); outline: none; }

/* ── Footer ── */
footer { padding: 28px 0; border-top: 1px solid var(--border); }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-note { font-size: 11px; color: var(--muted); letter-spacing: 0.03em; }
.footer-note span { color: var(--accent); }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  nav { padding: 16px 20px; }
  .container { padding: 0 20px; }
  section { padding: 72px 0; }
  #hero { padding-top: 120px; }
  .timeline-item { grid-template-columns: 1fr; gap: 10px; }
  .stack-section { grid-template-columns: 1fr; gap: 40px; }
  .project-card { padding: 24px 20px; }
  .nav-links { display: none; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .contact-links { flex-direction: column; }
  .contact-link { text-align: center; }
}

/* ── About ── */
.about-body {
  max-width: 600px;
  display: grid;
  gap: 16px;
}

.about-body p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}

.about-body strong {
  color: var(--ink);
  font-weight: 400;
}

/* ── Easter egg toast ── */
#easter-egg {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: var(--bg);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 12px 24px;
  white-space: nowrap;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
  z-index: 300;
}

#easter-egg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
