/* ============================================================
   Tyrien Jones — shared stylesheet (all pages use this one file)
   Static. Self-hosted. No CDNs, no remote fonts, no third-party.
   Lives at /assets/css/site.css — paths below are relative to HERE.
   ============================================================ */

/* ---- Self-hosted fonts ----------------------------------------
   Drop the .woff2 files into /assets/fonts/. Until then, the
   --font-* stacks below fall back to system fonts gracefully and
   NOTHING is requested over the network. Uncomment when bundled.
   (Paths are relative to this CSS file: ../fonts/ )

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
--------------------------------------------------------------- */

:root {
  /* Color */
  --bg:           #0d0f12;
  --bg-elev:      #14171c;
  --glass:        rgba(20, 23, 28, 0.55);
  --glass-solid:  rgba(20, 23, 28, 0.92); /* fallback when no blur */
  --glass-border: rgba(61, 220, 151, 0.35);
  --text:         #e8eaed;
  --text-muted:   #9aa0a8;
  --accent:       #3ddc97;
  --accent-dim:   #2aa873;

  /* Radius — one value everywhere, no sharp corners */
  --radius:    12px;
  --radius-sm: 8px;

  /* Spacing */
  --s-1: 8px;  --s-2: 16px; --s-3: 24px;
  --s-4: 40px; --s-5: 64px; --s-6: 96px;

  /* Layout */
  --maxw:  1200px;
  --nav-h: 72px;

  /* Type */
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.accent { color: var(--accent); }

/* ---- Page background texture (right side only, decorative) ----
   Disabled until /assets/img/circuit.svg exists, so the page makes
   ZERO failed requests. When you add the file, uncomment the
   `background:` line below (path is relative to this CSS file). */
.bg-texture {
  position: fixed;
  inset: 0 0 0 auto;
  width: 55%;
  /* background: url("../img/circuit.svg") right center / cover no-repeat; */
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to left, #000 40%, transparent 100%);
          mask-image: linear-gradient(to left, #000 40%, transparent 100%);
}

/* ============================================================
   Frosted glass top nav (shared, sticky)
   ============================================================ */
.nav {
  position: sticky;
  top: var(--s-1);
  z-index: 10;
  margin: var(--s-1);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--nav-h);
  padding: 0 var(--s-3);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-solid); /* fallback */
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav {
    background: var(--glass);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
  }
}

.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.08em; }
.brand-sub  { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.18em; }

.nav-links {
  display: flex;
  gap: var(--s-3);
  margin: 0 auto; /* center the links */
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}
.nav-links a {
  color: var(--text-muted);
  padding: var(--s-1) 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-icons { display: flex; gap: var(--s-2); }
.nav-icons a {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  transition: color 150ms ease, border-color 150ms ease;
}
.nav-icons a:hover { color: var(--accent); border-color: var(--glass-border); }
.nav-icons svg { width: 18px; height: 18px; }

/* site version chip — muted, sits left of the icon pair */
.nav-version {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
  white-space: nowrap;
}

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

/* ---- Mobile nav: zero-JS disclosure ---- */
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; gap: var(--s-2); }
  .nav-links {
    order: 3;
    width: 100%;
    margin: 0;
    flex-direction: column;
    gap: var(--s-1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 200ms ease;
  }
  .nav-toggle {
    display: grid; place-items: center;
    margin-left: auto;
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent; color: var(--text); cursor: pointer;
    font-size: 1.2rem;
  }
  /* checkbox hack — works with JS disabled */
  #nav-state:checked ~ .nav-links { max-height: 320px; }
  .bg-texture { display: none; }
}

/* ============================================================
   Layout helpers
   ============================================================ */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s-3);
}

/* ============================================================
   Hero (Home)
   ============================================================ */
.hero { padding: var(--s-6) 0 var(--s-5); }
.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  margin-bottom: var(--s-3);
}
.eyebrow::before { content: "\250C"; opacity: 0.8; } /* ┌ corner bracket */

.hero h1 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-3);
  max-width: 16ch;
}
.hero .sub {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 52ch;
  margin: 0 0 var(--s-4);
}

/* ---- Buttons ---- */
.btn-row { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-5); }
.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius);
  display: inline-flex; align-items: center; gap: var(--s-1);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn-primary {
  background: var(--accent);
  color: #07120c;
  border: 1px solid var(--accent);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); }

/* ---- Terminal status line ---- */
.status {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.status .lead { color: var(--accent); }
.caret {
  display: inline-block;
  width: 0.55em; height: 1.1em;
  background: var(--accent);
  margin-left: 0.3em;
  vertical-align: -0.18em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   Generic content page (stubs now, full pages later)
   Shared by eco / lily / portfolio / about / work.
   ============================================================ */
.page-head { padding: var(--s-6) 0 var(--s-3); }
.page-head h1 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2);
}
.page-head .sub {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  max-width: 60ch;
  margin: 0;
}
.page-body { padding-bottom: var(--s-5); }
.page-body p { color: var(--text-muted); max-width: 65ch; }

/* version / status chip (sits under a page-head h1) */
.version {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  margin: 0 0 var(--s-3);
}
.note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ============================================================
   Long-form content (about / portfolio / eco / lily detail)
   Wrap content in <div class="prose"> inside a <section>.
   Accent colours use var(--accent) so the LILY page recolours
   automatically via body.theme-lily.
   ============================================================ */
.prose { padding-bottom: var(--s-5); }
.section { margin-bottom: var(--s-5); }
.section:last-child { margin-bottom: 0; }

.section h2 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 var(--s-3);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--glass-border);
}
.section h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: var(--s-4) 0 var(--s-2);
}

.prose p { color: var(--text); max-width: 70ch; margin: 0 0 var(--s-2); }
.prose p.lead { font-size: 1.1rem; }
.prose em { color: var(--text-muted); font-style: italic; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
  color: var(--accent);
  border-bottom: 1px solid var(--glass-border);
  transition: border-color 150ms ease;
}
.prose a:hover { border-bottom-color: var(--accent); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-elev);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  word-break: break-word;
}

/* teal-bullet lists */
.prose ul { list-style: none; margin: 0 0 var(--s-3); padding: 0; }
.prose ul li {
  position: relative;
  padding-left: var(--s-3);
  margin-bottom: var(--s-2);
  color: var(--text);
  max-width: 70ch;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 3px; top: 0.62em;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 2px;
}

/* project block (full write-up) */
.project {
  margin: 0 0 var(--s-3);
  padding: var(--s-3);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.project h3 { margin-top: 0; font-size: 1.4rem; }
.project.compact { border-left-color: rgba(255,255,255,0.12); }

/* labelled paragraphs / status / techline — projects AND detail pages.
   Scoped under .prose so they beat the generic `.prose p` colour. */
.prose .pstatus { font-style: italic; color: var(--text-muted); margin: 0 0 var(--s-2); font-size: 0.95rem; }
.prose .label { font-weight: 600; color: var(--accent); }
.prose .techline { color: var(--text-muted); font-size: 0.9rem; font-style: italic; margin-top: var(--s-2); }

/* clickable card (portfolio → eco/lily pages) */
.card {
  display: block;
  margin: 0 0 var(--s-3);
  padding: var(--s-3);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: inherit;
  transition: border-color 150ms ease, transform 150ms ease;
}
.card:hover { border-color: var(--glass-border); transform: translateY(-1px); }
.card h3 { margin: 0 0 var(--s-1); font-size: 1.4rem; }
.card p { color: var(--text-muted); margin: 0 0 var(--s-2); }
.card .more { color: var(--accent); font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.05em; }

/* blockquote */
.prose blockquote {
  margin: var(--s-3) 0;
  padding: var(--s-1) 0 var(--s-1) var(--s-3);
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}
.prose blockquote p { color: var(--text-muted); }

/* tables (scroll on narrow screens) */
.tablewrap { overflow-x: auto; margin: 0 0 var(--s-3); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.45; }
.prose th {
  text-align: left;
  vertical-align: bottom;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 0 var(--s-2) var(--s-1) 0;
  border-bottom: 2px solid var(--glass-border);
}
.prose td {
  vertical-align: top;
  padding: var(--s-2) var(--s-2) var(--s-2) 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
}
.prose td:last-child, .prose th:last-child { padding-right: 0; }

/* contact line at the foot of a content page */
.closing-contact {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.closing-contact strong { color: var(--text); }

/* ============================================================
   "What's inside" feature list (lily.html) — native <details>,
   zero JS. Two stacked groups: Core uses the page accent;
   After-hours gets a second L.I.LY-family shade via a scoped
   --accent override, so its cards / heading / chevrons recolour
   automatically while the nav + rest of the page stay lavender.
   ============================================================ */
.features .feature-group { margin-bottom: var(--s-4); }
.features .feature-group:last-child { margin-bottom: 0; }
.features .feature-head {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 var(--s-2);
}
/* second lily-family shade — deeper violet, still reads as L.I.LY */
.features .feature-group.afterhours {
  --accent: #a855f7;
  --glass-border: rgba(168, 85, 247, 0.35);
}

details.feature {
  margin: 0 0 var(--s-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
details.feature > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5ch;
  padding: var(--s-2) var(--s-4) var(--s-2) var(--s-3);
  position: relative;
}
details.feature > summary::-webkit-details-marker { display: none; }
details.feature > summary strong { color: var(--accent); font-weight: 600; }
details.feature > summary .feature-tag { color: var(--text-muted); }
details.feature > summary::after {
  content: "";
  position: absolute;
  right: var(--s-3);
  top: calc(var(--s-2) + 0.6em);
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 150ms ease;
}
details.feature[open] > summary::after { transform: rotate(-135deg); }
details.feature > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}
.feature-why {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 0 var(--s-3);
  padding: var(--s-2) 0 var(--s-3);
}
.feature-why p { color: var(--text-muted); margin: 0; max-width: 70ch; }

/* ============================================================
   On-page index rail ("ON THIS PAGE") — opt-in via <main class="has-index">.
   Zero JS: anchor jump links, hover/focus highlight, no scroll-spy
   (keeps the no-JavaScript promise). Rail collapses away on mobile.
   ============================================================ */
main.has-index {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: var(--s-5);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s-3);
  align-items: start;
}
main.has-index > .page-index { grid-column: 1; align-self: start; }
main.has-index > section { grid-column: 2; }
/* neutralise each section's inner .wrap so content fills the right column */
main.has-index > section > .wrap { max-width: none; margin: 0; padding: 0; }

.page-index {
  position: sticky;
  top: calc(var(--nav-h) + var(--s-2));
  padding-top: var(--s-3);
  font-family: var(--font-mono);
}
.page-index-head {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--s-2);
}
/* the rail track: dim by default so only the SELECTED row glows
   ("you are here"). Click-driven (:focus), recolours per page via --accent. */
.page-index-list { position: relative; }
.page-index a,
.page-index-soon {
  position: relative;
  display: block;
  margin: 0;
  padding: var(--s-1) 0 var(--s-1) var(--s-3);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 150ms ease;
}
/* per-row line segment — the segments stack into one continuous dim track */
.page-index a::after,
.page-index-soon::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.10);
  transition: background 150ms ease, box-shadow 150ms ease;
}
/* per-row dot — dim until selected */
.page-index a::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 1em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
  transition: background 150ms ease, opacity 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
/* the row you click (or hover) lights up; everything else stays dark */
.page-index a:hover,
.page-index a:focus { color: var(--accent); }
.page-index a:hover::after,
.page-index a:focus::after {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent), 0 0 12px var(--accent-dim);
}
.page-index a:hover::before,
.page-index a:focus::before {
  background: var(--accent);
  opacity: 1;
  transform: scale(1.35);
  box-shadow: 0 0 10px var(--accent);
}
.page-index-soon { color: rgba(154, 160, 168, 0.5); }
.page-index-soon small {
  display: block;
  font-size: 0.66rem;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

/* jump targets clear the sticky nav when you land on them */
main.has-index [id] { scroll-margin-top: calc(var(--nav-h) + var(--s-3)); }

/* mobile: rail off, content full width, inner .wrap restored */
@media (max-width: 860px) {
  main.has-index { display: block; padding: 0; }
  main.has-index > .page-index { display: none; }
  main.has-index > section > .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-3); }
}

/* ============================================================
   Footer (shared)
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: var(--s-6);
  padding: var(--s-4) 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

/* ============================================================
   Per-page accent themes — one stylesheet, one frame.
   Each page sets a <body class="theme-*">; only --accent (+dim,
   +glass-border) change, so the active nav tab, hero, buttons,
   links, version chip and bullets all recolour automatically.
   Non-active tabs stay neutral grey (they use --text-muted), so
   only the current tab + its page glow in the section colour.
   ============================================================ */
body.theme-home      { --accent:#4fc3f7; --accent-dim:#2fa3d6; --glass-border:rgba(79,195,247,0.35); }   /* light blue */
body.theme-eco       { --accent:#3ddc97; --accent-dim:#2aa873; --glass-border:rgba(61,220,151,0.35); }   /* green (base) */
body.theme-lily      { --accent:#b59cff; --accent-dim:#8f6fe6; --glass-border:rgba(181,156,255,0.35); }  /* lavender */
body.theme-portfolio { --accent:#ff9f43; --accent-dim:#e07f1f; --glass-border:rgba(255,159,67,0.35); }   /* orange */
body.theme-about     { --accent:#6f9bff; --accent-dim:#4e79e0; --glass-border:rgba(111,155,255,0.35); }  /* blue */
body.theme-work      { --accent:#ff6b6b; --accent-dim:#e04f4f; --glass-border:rgba(255,107,107,0.35); }  /* red */
body.theme-this      { --accent:#ffd166; --accent-dim:#e0b347; --glass-border:rgba(255,209,102,0.35); }  /* gold */
body.theme-crew      { --accent:#a3e635; --accent-dim:#84cc16; --glass-border:rgba(163,230,53,0.35); }  /* yellow-green */

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
