/* ============================================================
   Jan — personal site
   Design: dark "instrument panel" — deep slate, amber-gold signal
   accent, filesystem-path section labels. Plain CSS, no build step.
   ============================================================ */

:root {
  /* ── Color ── */
  --bg:          #0E1116;
  --surface:     #151922;
  --surface-2:   #1B212B;
  --border:      #262D38;
  --border-soft: #1D232D;
  --text:        #E9EDF2;
  --text-dim:    #AEB6C2;
  --muted:       #7E8794;
  --accent:      #E3AC57;  /* signal amber-gold — primary accent  */
  --accent-ink:  #0E1116;  /* text on the accent                  */
  --signal:      #5FB8A6;  /* "healthy/up" teal — status only     */

  /* ── Type ── */
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ── Layout ── */
  --rail-w: 264px;
  --maxw: 720px;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Global focus ring */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   Layout shell
   ============================================================ */
.layout { display: flex; align-items: flex-start; }

/* ── Side rail (desktop) ── */
.rail {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  height: 100vh;
  padding: 2.4rem 1.9rem;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.rail__top { display: flex; align-items: flex-start; justify-content: space-between; }

.brand { display: flex; flex-direction: column; gap: .25rem; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand__meta {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ── Nav ── */
.nav { display: flex; flex-direction: column; gap: .15rem; }
.nav a {
  position: relative;
  font-size: .95rem;
  color: var(--text-dim);
  padding: .5rem .7rem;
  border-radius: 7px;
  transition: color .15s ease, background .15s ease;
}
.nav a::before {
  content: attr(data-path);
  display: block;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--muted);
  opacity: 0;
  height: 0;
  transition: opacity .15s ease;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.is-active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav a.is-active::before { opacity: 1; height: auto; }

.rail__status {
  margin-top: auto;
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--text-dim);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(95, 184, 166, .5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(95, 184, 166, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(95, 184, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 184, 166, 0); }
}

/* Mobile menu toggle — hidden on desktop */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
.menu-toggle span {
  width: 22px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* ============================================================
   Main content
   ============================================================ */
.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 var(--pad);
}
.main > * { max-width: var(--maxw); margin-inline: auto; }

/* ── Hero ── */
.hero { padding: clamp(4rem, 12vh, 8rem) 0 clamp(3rem, 8vh, 5rem); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent);
  margin-bottom: 1.4rem;
  letter-spacing: .02em;
}
.hero__title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}
.hero__lead {
  font-size: 1.12rem;
  color: var(--text-dim);
  max-width: 44ch;
  margin-bottom: 2.2rem;
}
.statusline {
  display: inline-flex; align-items: baseline; gap: .7rem; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: .82rem;
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}
.statusline__label { color: var(--muted); }
.statusline__label::after { content: ":"; }
.statusline__value { color: var(--text-dim); }
.cursor {
  display: inline-block;
  width: 8px; height: 1.05em;
  margin-left: 3px;
  transform: translateY(2px);
  background: var(--accent);
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cursor, .dot { animation: none; }
}

/* ── Section scaffolding ── */
.section {
  padding: clamp(2.5rem, 7vh, 4.5rem) 0;
  border-top: 1px solid var(--border-soft);
}
.section__head { margin-bottom: 2rem; }
.section__path {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  margin-bottom: .5rem;
}
.section__title { font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -0.01em; }

/* ── Cards (Projects) ── */
.cards { display: grid; gap: 1rem; }
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.card:hover { border-color: #37424f; transform: translateY(-2px); background: var(--surface-2); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.card__title { font-size: 1.2rem; }
.card__body { color: var(--text-dim); font-size: .96rem; margin-bottom: 1rem; }
.card__foot { display: flex; gap: 1.3rem; flex-wrap: wrap; }

.tag {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: .2rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Links with underline animation ── */
.link {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--text);
  position: relative;
}
.link::after {
  content: "";
  position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;
}
.link:hover::after { transform: scaleX(1); }

/* ── Timeline (Work / Education) ── */
.timeline { display: grid; gap: 0; }
.entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--border-soft);
}
.entry:first-child { border-top: 0; padding-top: 0; }
.entry__date {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}
.entry__title { font-size: 1.15rem; margin-bottom: .2rem; }
.entry__org { color: var(--accent); font-size: .88rem; margin-bottom: .6rem; }
.entry__desc { color: var(--text-dim); font-size: .96rem; }

/* ── Skills ── */
.skills { display: grid; gap: 1.8rem; }
.skillset__title { font-size: 1.05rem; margin-bottom: .9rem; color: var(--text); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.chips li {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .4rem .8rem;
  border-radius: 8px;
  transition: color .15s ease, border-color .15s ease;
}
.chips li:hover { color: var(--text); border-color: #37424f; }

/* ── About ── */
.prose { display: grid; gap: 1.1rem; }
.prose p { color: var(--text-dim); font-size: 1.02rem; }
.prose em { color: var(--text); font-style: italic; }

/* ── Contact ── */
.contact__lead { color: var(--text-dim); margin-bottom: 1.5rem; }
.contact__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.contact__list li { display: flex; align-items: baseline; gap: 1rem; }
.contact__key {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--muted);
  width: 82px; flex: 0 0 82px;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 2rem 0 3rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--muted);
  display: flex; gap: .6rem; flex-wrap: wrap;
}
.footer__sep { color: var(--border); }

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Responsive — rail collapses to a top bar under 900px
   ============================================================ */
@media (max-width: 900px) {
  .layout { flex-direction: column; }

  .rail {
    position: sticky; top: 0; z-index: 50;
    width: 100%; flex-basis: auto; height: auto;
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: 1rem;
    padding: 1rem var(--pad);
    border-right: 0; border-bottom: 1px solid var(--border);
    background: rgba(14, 17, 22, .9);
    backdrop-filter: blur(10px);
  }
  .rail__top { flex: 1; align-items: center; }
  .menu-toggle { display: flex; }

  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: .1rem;
    padding: .6rem var(--pad) 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .rail.nav-open .nav { opacity: 1; transform: none; pointer-events: auto; }
  .nav a::before { display: none; }
  .nav a.is-active::before { display: none; }

  .rail.nav-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .rail.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .rail.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .rail__status { display: none; }
}

/* Narrow phones — stack the timeline */
@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; gap: .35rem; }
  .card__foot { gap: 1rem; }
}
