/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens (Midnight defaults; overridden at runtime by theme-bar.js) ── */
:root {
  --bg:      #0f1117;
  --bg2:     #171b26;
  --bg3:     #1e2333;
  --border:  rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text:    #e8eaf0;
  --muted:   #7a8099;
  --faint:   #454960;
  --accent:  #5b8aff;
  --accent2: #3ecf8e;
  --warn:    #f5a524;
  --mono:    'IBM Plex Mono', monospace;
  --sans:    'IBM Plex Sans', sans-serif;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  padding-bottom: 4.5rem; /* clear fixed theme bar */
}

a { color: var(--accent); text-decoration: none; }

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 56px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

/* applied by JS after 2s or first scroll */
.nav--visible {
  background: var(--bg2);
  border-bottom-color: var(--border);
}

.nav-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .05em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .02em;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ── Animations ── */

/* Entrance: fade up from 20px below */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll cue: gentle continuous bounce */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 4rem;
}

.hero-content { max-width: 720px; }

/* Each element starts invisible; animation drives it to opacity:1 */
.hero-name {
  font-family: var(--mono);
  font-size: clamp(2.2rem, 6vw, 3.75rem);
  font-weight: 500;
  color: var(--accent);
  line-height: 1.15;
  letter-spacing: -.01em;
  opacity: 0;
  animation: fadeUp 1.5s ease both;
  animation-delay: 0s;
}

.hero-tagline {
  margin-top: 1.25rem;
  font-family: var(--sans);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 300;
  color: var(--muted);
  letter-spacing: .01em;
  opacity: 0;
  animation: fadeUp 1.5s ease both;
  animation-delay: 1.2s;
}

.hero-links {
  margin-top: 2.5rem;
  display: flex;
  gap: .875rem;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 1.5s ease both;
  animation-delay: 2.1s;
}

.hero-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hero-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg3);
}

.hero-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.hero-scroll-cue {
  margin-top: 4rem;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 1.5s ease both;
  animation-delay: 3s;
}

.hero-scroll-cue svg {
  width: 22px;
  height: 22px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: bounce 1.8s ease-in-out infinite;
}

/* ── Sections ── */
.section {
  padding: 6rem 2rem;
  border-top: 1px solid var(--border);
}

.section-container {
  max-width: 900px;
  margin: 0 auto;
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

/* ── Placeholder ── */
.placeholder {
  font-size: 14px;
  color: var(--faint);
  font-style: italic;
}

/* ── About ── */
.about-body p {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  max-width: 70ch;
  margin-bottom: 1.25rem;
}

.about-body p:last-child {
  margin-bottom: 0;
}

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border2); }

.card-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.card-name,
.card-platform {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.card-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.card-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .5rem;
}

.card-desc {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.card-arrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  align-self: flex-start;
}

/* ── Buttons ── */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: var(--accent);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--bg);
  text-decoration: none;
  transition: opacity .15s;
}

.btn-primary:hover { opacity: .85; }

/* ── Engineering section ── */
.profile-links {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.subsection-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 0;
}

/* ── Contact ── */
.contact-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 520px;
}

.contact-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

/* ── Theme bar ── */
#theme-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg2);
  border-top: 1px solid var(--border2);
  padding: .5rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform .3s ease;
}

#theme-bar.theme-bar--visible {
  transform: translateY(0);
}

.theme-swatches {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theme-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.theme-group-dark {
  justify-content: flex-start;
}

.theme-group-light {
  justify-content: flex-start;
}

.theme-bar-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.swatch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg3);
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}

.swatch:hover { border-color: var(--border2); color: var(--text); }

.swatch.active {
  border-color: var(--accent);
  color: var(--text);
}

.swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mode-divider {
  display: none;
}

/* ── Blog post list ── */
.post-list {
  margin-bottom: 2rem;
}

.post-list-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.post-list-item:first-child {
  border-top: 1px solid var(--border);
}

.post-list-item:hover .post-list-title { color: var(--accent); }

.post-list-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-list-title {
  font-size: 15px;
  color: var(--text);
  transition: color 0.15s;
}

.post-all-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

/* ── Blog post page ── */
.post-header {
  margin-bottom: 2.5rem;
}

.post-title {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: .75rem;
}

.post-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: .02em;
  display: block;
}

.post-body p {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  max-width: 66ch;
  margin-bottom: 1.25rem;
}

.post-body p:last-child { margin-bottom: 0; }

.post-back {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.post-back:hover { color: var(--accent); }

/* ── Mobile ── */
@media (max-width: 640px) {
  .nav-hamburger { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: .25rem;
    padding: 1rem 1.5rem 1.5rem;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.nav-links--open { display: flex; }

  .nav-links a {
    font-size: 15px;
    padding: .4rem 0;
  }

  .section { padding: 4rem 1.25rem; }

  .card-grid { grid-template-columns: 1fr; }

  .profile-links { flex-direction: column; }
}
