/* =========================================================
   Madeleine Neaves — personal site
   Dark & techy. Single theme (dark only).
   ========================================================= */

/* Self-hosted variable fonts (no CDN dependency).
   IBM Plex Sans — body / writing.
   Space Grotesk — headings, subheadings, emphasis. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk.woff2") format("woff2");
}

:root {
  --bg:        #0b0c08;
  --bg-soft:   #12130c;
  --panel:     #15160f;
  --border:    #292b1b;
  --text:      #edf0e1;
  --text-dim:  #94987d;
  --accent:    #aebf5e;   /* olive  (lead) */
  --accent-2:  #ff7849;   /* ember  */
  --accent-3:  #ff4dcb;   /* magenta */
  --accent-4:  #ffc24b;   /* gold   */
  --glow:      rgba(174, 191, 94, 0.25);

  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Fira Code",
          "Cascadia Code", Consolas, monospace;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system,
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* Skip-to-content link (visible only when focused) */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  font-family: var(--mono);
  font-size: 0.9rem;
  background: var(--accent);
  color: #14160a;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.18s;
}
.skip-link:focus { top: 1rem; }

/* Offset anchored sections so they clear the sticky header */
section[id] { scroll-margin-top: 5rem; }

/* Scroll-reveal (only when JS is on and motion is allowed) */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Background canvas */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* Layout */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

section { padding: 4.5rem 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(8px);
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  transition: border-color 0.2s, color 0.2s;
}
.brand:hover { border-color: var(--accent); color: var(--accent); }

.site-header nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.site-header nav a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.site-header nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding-top: 5rem; }

.eyebrow {
  font-family: var(--mono);
  color: var(--accent-4);
  margin: 0 0 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  color: var(--text-dim);
  max-width: 36ch;
  margin: 0 0 2.5rem;
}
.accent { font-family: var(--display); color: var(--text); font-weight: 600; }
.accent:nth-of-type(1) { color: var(--accent); }   /* olive   */
.accent:nth-of-type(2) { color: var(--accent-2); } /* ember   */
.accent:nth-of-type(3) { color: var(--accent-3); } /* magenta */

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  text-decoration: none;
  background: var(--accent);
  color: #14160a;
  font-weight: 600;
  border: 1px solid var(--accent);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--glow);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

/* Section titles */
.section-title {
  font-family: var(--display);
  font-size: 1.6rem;
  margin: 0 0 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
/* keep the terminal-style $ prompt monospaced */
.prompt { font-family: var(--mono); color: var(--accent); margin-right: 0.5rem; }

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.project-card {
  display: block;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s, border-color 0.2s, box-shadow 0.25s;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 100% 0%, var(--glow), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.project-card:hover::before { opacity: 1; }

.project-status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-4);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  margin-bottom: 1rem;
}
.project-card h3 { font-family: var(--display); margin: 0 0 0.6rem; font-size: 1.3rem; }
.project-card p { margin: 0 0 1.25rem; color: var(--text-dim); font-size: 0.95rem; }
.project-link {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
}

/* About */
.about p { max-width: 60ch; color: var(--text-dim); font-size: 1.05rem; }

/* Timeline */
.timeline {
  list-style: none;
  margin: 2.75rem 0 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline li {
  position: relative;
  padding: 0 0 2.25rem 2.4rem;
}
.timeline li:last-child { padding-bottom: 0; }

.timeline .node {
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--c, var(--accent));
  box-shadow: 0 0 0 4px var(--bg);
  transition: transform 0.45s ease, background 0.45s ease, box-shadow 0.45s ease;
}
.timeline .t-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--c, var(--accent));
  margin: 0;
}
.timeline .t-role {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0.2rem 0 0.1rem;
}
.timeline .t-org { color: var(--text-dim); font-size: 0.95rem; margin: 0; }
.timeline .t-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0.45rem 0 0;
  max-width: 60ch;
}

/* Cycle each entry's accent through the palette via a per-item variable */
.timeline li:nth-child(4n + 1) { --c: var(--accent); }
.timeline li:nth-child(4n + 2) { --c: var(--accent-2); }
.timeline li:nth-child(4n + 3) { --c: var(--accent-3); }
.timeline li:nth-child(4n + 4) { --c: var(--accent-4); }

/* Scroll emphasis: entries dim until scrolled into view, then the dot
   fills, glows and scales up. Only when JS is on and motion is allowed. */
html.js .timeline li {
  opacity: 0.4;
  transition: opacity 0.5s ease;
}
html.js .timeline li.is-visible { opacity: 1; }
html.js .timeline li.is-visible .node {
  background: var(--c, var(--accent));
  transform: scale(1.25);
  box-shadow: 0 0 0 4px var(--bg), 0 0 16px var(--c, var(--accent));
}
@media (prefers-reduced-motion: reduce) {
  html.js .timeline li { opacity: 1; }
  html.js .timeline li .node { transition: none; }
}

/* Contact */
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.links a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  max-width: 460px;
  transition: border-color 0.2s, transform 0.15s;
}
.links a:hover { border-color: var(--accent); transform: translateX(4px); }
.link-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.link-value { font-family: var(--mono); font-size: 0.95rem; }

/* Footer */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #bg { display: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}
