/* ---------------------------------------------------------------------------
   alldunne — minimalist, professional, with a hint of 1980s CRT.
   No JavaScript. Dark by default, light on request.
   ------------------------------------------------------------------------- */

:root {
  --bg: #0b0b14;
  --bg-elev: #12121d;
  --fg: #e6e6ef;
  --fg-muted: #9a9ab0;
  --line: #22223a;
  --cyan: #2de2e6;
  --magenta: #ff2d95;
  --violet: #7a5cff;
  --accent: var(--cyan);
  --accent-2: var(--magenta);
  --scanline: rgba(255, 255, 255, 0.025);
  --grid: rgba(45, 226, 230, 0.06);

  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;

  --measure: 68ch;
  --wrap: 960px;
  --radius: 6px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f6f2;
    --bg-elev: #ffffff;
    --fg: #16161f;
    --fg-muted: #5c5c70;
    --line: #e0dfe8;
    --cyan: #0a8f93;
    --magenta: #d2127a;
    --scanline: rgba(0, 0, 0, 0.018);
    --grid: rgba(10, 143, 147, 0.07);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Faint CRT scanlines across the whole page. Purely decorative. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    var(--scanline) 2px 3px
  );
}

/* Keep anchored sections clear of the sticky header. */
.section, .project { scroll-margin-top: 4.5rem; }

@media (max-width: 560px) {
  .bar { flex-wrap: wrap; row-gap: 0.25rem; font-size: 0.9rem; }
  nav { gap: 1rem; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

code { font-family: var(--mono); font-size: 0.95em; color: var(--accent-2); }

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--bg-elev);
  padding: 0.5rem 0.75rem;
  z-index: 20;
}
.skip:focus { left: 0.5rem; }

/* Header ------------------------------------------------------------------ */

.site-header { position: sticky; top: 0; background: var(--bg); z-index: 5; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  font-family: var(--mono);
  font-size: 0.95rem;
}

.brand { color: var(--fg); letter-spacing: 0.02em; }
.brand:hover { text-decoration: none; }
.prompt { color: var(--accent); }
.prompt-sep { color: var(--fg-muted); }

nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
nav a { color: var(--fg-muted); }
nav a::before { content: "./"; opacity: 0.5; }
nav a[aria-current="page"], nav a:hover { color: var(--fg); text-decoration: none; }
nav a[aria-current="page"] { border-bottom: 1px solid var(--accent-2); }

/* The "horizon": a thin neon line under the header. */
.horizon {
  height: 1px;
  background: linear-gradient(90deg, var(--accent-2), var(--violet) 50%, var(--accent));
  opacity: 0.8;
}

/* Hero -------------------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 10vw, 6rem) clamp(2rem, 6vw, 4rem);
  position: relative;
}

/* A faint receding grid behind the hero, fading out towards the bottom. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
}

.hero-small { padding-block: clamp(2rem, 6vw, 3.5rem) 1rem; }

.eyebrow {
  font-family: var(--mono);
  color: var(--fg-muted);
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

h1 {
  font-family: var(--mono);
  font-size: clamp(2.25rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-weight: 700;
}

/* Subtle chromatic-aberration glow on the name only. */
.glow {
  text-shadow:
    1px 0 0 rgba(255, 45, 149, 0.55),
    -1px 0 0 rgba(45, 226, 230, 0.55);
}

.lede {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  max-width: var(--measure);
  color: var(--fg);
  margin: 0 0 1.75rem;
}

.cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1.1em;
  margin-left: 0.2ch;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(45, 226, 230, 0.25);
}
.btn-ghost { background: transparent; color: var(--accent); }

/* Sections ---------------------------------------------------------------- */

.section { padding-block: 2.5rem; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }

h2 {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.num { color: var(--accent-2); font-weight: 400; }
.num::after { content: " //"; color: var(--line); }

h3 { font-size: 1.1rem; margin: 0; font-weight: 600; }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }
.section-intro { color: var(--fg-muted); margin: -0.5rem 0 1.5rem; }

/* Tags -------------------------------------------------------------------- */

.tags {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tags li {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-muted);
  background: var(--bg-elev);
}

/* Skills ------------------------------------------------------------------ */

.skills { margin: 0; display: grid; gap: 1rem; }
.skill-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  align-items: start;
}
.skill-row dt { font-family: var(--mono); color: var(--fg-muted); font-size: 0.9rem; padding-top: 0.35rem; }
.skill-row dd { margin: 0; }
.skill-row .tags { margin-top: 0; }

@media (max-width: 560px) {
  .skill-row { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* Timeline ---------------------------------------------------------------- */

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  border-left: 1px solid var(--line);
}
.role { padding: 0 0 2rem 1.5rem; position: relative; }
.role:last-child { padding-bottom: 0; }
.role::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.55rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(45, 226, 230, 0.5);
}
.role-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  align-items: baseline;
}
.at { color: var(--fg-muted); font-weight: 400; }
.period { font-family: var(--mono); font-size: 0.85rem; color: var(--fg-muted); white-space: nowrap; }
.role p { margin: 0.5rem 0 0; max-width: var(--measure); }
.points { margin: 0.5rem 0 0; padding-left: 1.2rem; max-width: var(--measure); }
.points li { margin-bottom: 0.25rem; }
.points li::marker { color: var(--accent-2); }

/* Project cards ----------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 150ms ease, transform 150ms ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.7;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card p { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.card-head a { color: var(--fg); }
.card-tagline { color: var(--accent-2); font-family: var(--mono); font-size: 0.95rem; }
.meta { color: var(--fg-muted); font-family: var(--mono); font-size: 0.85rem; }

.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  white-space: nowrap;
}
.badge-live { border-color: var(--accent); color: var(--accent); }

/* Project detail page ----------------------------------------------------- */

.project h2 .badge { font-weight: 400; margin-left: 0.25rem; }
.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14rem;
  gap: 2rem;
  margin-top: 1rem;
}
@media (max-width: 720px) { .project-body { grid-template-columns: 1fr; } }

.facts dl { margin: 0; font-size: 0.95rem; }
.facts dt { font-family: var(--mono); color: var(--fg-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1rem; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 0.2rem 0 0; }

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-block: 2rem 2.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }
