/* ---------------------------------------------------
   Tokens
--------------------------------------------------- */
:root {
  --bg: #0e1417;
  --bg-alt: #121a1e;
  --surface: #161f24;
  --border: #263038;
  --border-soft: #1d262c;
  --text: #e8edf0;
  --muted: #8fa0a8;
  --muted-dim: #64747c;
  --accent: #4fa8c9;
  --accent-soft: rgba(79, 168, 201, 0.14);
  --accent-2: #e2a13c;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --wrap: 1120px;
  --radius: 3px;
}

/* ---------------------------------------------------
   Reset & base
--------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
p { margin: 0; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* faint structural grid, evokes a schematic / rack diagram */
.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 112px 100%;
  opacity: 0.5;
}

/* ---------------------------------------------------
   Header
--------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 20, 23, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 68px;
}

.site-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 28px;
}

.nav-link {
  font-size: 14.5px;
  color: var(--muted);
  transition: color 0.15s ease;
  position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------
   Buttons
--------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #0b1215;
}
.btn-primary:hover { background: #6bb9d6; }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-small { padding: 9px 18px; font-size: 13.5px; }

/* ---------------------------------------------------
   Hero
--------------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 96px;
}

.hero-text { opacity: 0; animation: rise 0.7s ease forwards; }
.panel { opacity: 0; animation: rise 0.7s ease 0.15s forwards; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(40px, 5.2vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.hero-role {
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 23px);
  color: var(--muted);
  margin-bottom: 24px;
}

.hero-pitch {
  max-width: 46ch;
  color: var(--muted);
  font-size: 16.5px;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* system panel — signature element */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.panel-dots { display: flex; gap: 6px; }
.panel-dots i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  display: block;
}

.panel-path {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted-dim);
}

.panel-fields { padding: 18px 20px 20px; }

.panel-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  border-bottom: 1px dashed var(--border-soft);
}
.panel-row:last-child { border-bottom: none; }

.panel-row dt { color: var(--muted-dim); }
.panel-row dd { color: var(--text); margin: 0; }

.panel-status dd {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex-shrink: 0;
}

/* ---------------------------------------------------
   Sections generic
--------------------------------------------------- */
section {
  position: relative;
  z-index: 1;
  padding: 88px 0;
  border-top: 1px solid var(--border-soft);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(26px, 3vw, 32px);
}

.section-note { color: var(--muted-dim); font-size: 14.5px; }

/* ---------------------------------------------------
   About
--------------------------------------------------- */
.about-content {
  display: grid;
  gap: 18px;
  max-width: 68ch;
}
.about-content p { color: var(--muted); font-size: 16.5px; }

/* ---------------------------------------------------
   Stack
--------------------------------------------------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 28px;
}

.stack-group-wide { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--border-soft); }

.stack-group h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-list li {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  background: var(--surface);
}

.tag-list-muted li { color: var(--muted); border-color: var(--border-soft); background: transparent; }

.tag-list-compact li { padding: 5px 9px; font-size: 12px; }

/* ---------------------------------------------------
   Experience timeline
--------------------------------------------------- */
.timeline {
  display: grid;
  gap: 0;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}

.timeline-item {
  position: relative;
  padding: 0 0 44px 32px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-marker {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 8px;
}

.timeline-body h3 { font-size: 19px; margin-bottom: 4px; }

.timeline-sub {
  color: var(--muted-dim);
  font-size: 14px;
  margin-bottom: 14px;
}

.timeline-list { display: grid; gap: 10px; max-width: 68ch; }
.timeline-list li { color: var(--muted); font-size: 15px; line-height: 1.55; }
.timeline-list strong { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------
   Projects
--------------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card-featured {
  grid-column: 1 / -1;
  background: var(--bg-alt);
}
.project-card-featured p { max-width: 68ch; }

.project-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s ease;
}
.project-card:hover { border-color: var(--accent); }

/* corner bracket accent instead of a drop shadow */
.project-card::before,
.project-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent-2);
  opacity: 0.9;
}
.project-card::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--accent-2);
  border-left: 2px solid var(--accent-2);
}
.project-card::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--accent-2);
  border-right: 2px solid var(--accent-2);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-dim);
}

.project-card h3 {
  font-size: 20px;
  margin: 12px 0 10px;
}

.project-card p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 18px;
}

.project-links {
  margin-top: 20px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.link-arrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.link-arrow:hover { border-color: var(--accent); }

/* ---------------------------------------------------
   Contact
--------------------------------------------------- */
.contact-inner { max-width: 68ch; }

.contact-lede {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 36px;
  max-width: 52ch;
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.contact-method {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.contact-method:hover { border-color: var(--accent); transform: translateY(-2px); }

.contact-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-dim);
}
.contact-value { font-size: 15px; }

/* ---------------------------------------------------
   Footer
--------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 0 40px;
}
.footer-inner {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 24px;
  color: var(--muted-dim);
  font-size: 13.5px;
}
.footer-inner > span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.footer-top { color: var(--muted-dim); transition: color 0.15s ease; }
.footer-top:hover { color: var(--accent); }

/* ---------------------------------------------------
   Toast (copy email)
--------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 14px;
  padding: 11px 18px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------------------------------------------
   Responsive
--------------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 56px; padding-bottom: 64px; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 20px; }

  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    transform: none;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-soft);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav.open { max-height: 340px; }
  .nav-link {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
  }
  .nav-link.active::after { display: none; }

  .nav-toggle { display: flex; }

  .contact-methods { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
}