/* ==========================================================================
   Lantean Lab — "terminal meets research lab"
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #f5f7fa;
  --bg-grid: rgba(15, 30, 50, .07);
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #0c1422;
  --muted: #566275;
  --faint: #8c97a8;
  --border: #dde3ea;
  --accent: #0a7f8c;
  --accent-glow: rgba(10, 127, 140, .18);
  --accent-soft: #e2f3f4;
  --amber: #a85d00;
  --green: #1a7f37;
  --violet: #7a3fbf;
  --radius: 10px;
  --max: 70rem;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080c12;
    --bg-grid: rgba(120, 200, 230, .06);
    --surface: #0d131b;
    --surface-2: #121a24;
    --text: #dbe2ec;
    --muted: #8a96a8;
    --faint: #5a6678;
    --border: #1b2532;
    --accent: #5ce1e6;
    --accent-glow: rgba(92, 225, 230, .22);
    --accent-soft: #0f2a30;
    --amber: #ffb454;
    --green: #7ee787;
    --violet: #c4a1ff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #080c12;
  --bg-grid: rgba(120, 200, 230, .06);
  --surface: #0d131b;
  --surface-2: #121a24;
  --text: #dbe2ec;
  --muted: #8a96a8;
  --faint: #5a6678;
  --border: #1b2532;
  --accent: #5ce1e6;
  --accent-glow: rgba(92, 225, 230, .22);
  --accent-soft: #0f2a30;
  --amber: #ffb454;
  --green: #7ee787;
  --violet: #c4a1ff;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-grid) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

img, svg { max-width: 100%; display: block; }

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

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.2rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; letter-spacing: -0.01em; }
p  { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .9em; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; }
.brand .dot { color: var(--accent); }

.nav { display: flex; align-items: center; gap: .25rem; font-family: var(--mono); }
.nav a {
  color: var(--muted);
  font-size: .85rem;
  padding: .35rem .6rem;
  border-radius: 6px;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a .tilde { color: var(--faint); }

.theme-toggle {
  margin-left: .4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  height: 2rem;
  padding: 0 .55rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .8rem;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }

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

.hero { padding: 5.5rem 0 3rem; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2.5rem;
}
@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: 1.35fr 1fr; }
}

.prompt {
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.prompt .user { color: var(--green); }
.prompt .path { color: var(--accent); }
.prompt .cmd  { color: var(--text); }

.hero h1 .accent {
  color: var(--accent);
  text-shadow: 0 0 32px var(--accent-glow);
}

.role {
  font-family: var(--mono);
  font-size: clamp(.95rem, 1.6vw, 1.1rem);
  color: var(--amber);
  margin-bottom: 1.25rem;
}
.cursor {
  display: inline-block;
  width: .6em;
  height: 1.1em;
  margin-left: .15em;
  vertical-align: -.15em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }

/* Neural net ------------------------------------------------------------ */

.nnet {
  justify-self: center;
  width: min(100%, 20rem);
  overflow: visible;
}
.nnet .edges line { stroke: var(--border); stroke-width: 1; }
.nnet .pulses line {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 14 100;
  stroke-dashoffset: 14;
  opacity: 0;
  filter: drop-shadow(0 0 4px var(--accent));
  animation: fire 6s linear infinite;
}
.nnet .pulses .l1 { animation-delay: .6s; }
.nnet .pulses .l2 { animation-delay: 1.2s; }
.nnet .pulses .p1.l0 { animation-delay: 2s; }
.nnet .pulses .p1.l1 { animation-delay: 2.6s; }
.nnet .pulses .p1.l2 { animation-delay: 3.2s; }
.nnet .pulses .p2.l0 { animation-delay: 4s; }
.nnet .pulses .p2.l1 { animation-delay: 4.6s; }
.nnet .pulses .p2.l2 { animation-delay: 5.2s; }
.nnet .nodes circle { fill: var(--surface); stroke: var(--faint); stroke-width: 1.5; }
.nnet .nodes circle.on {
  stroke: var(--accent);
  fill: var(--accent-soft);
  animation: glow 3s ease-in-out infinite;
}
@keyframes fire {
  0%       { stroke-dashoffset: 14; opacity: 1; }
  10%      { stroke-dashoffset: -100; opacity: 1; }
  10.1%, 100% { opacity: 0; }
}
@keyframes glow {
  0%, 100% { filter: none; }
  50%      { filter: drop-shadow(0 0 6px var(--accent)); }
}

@media (max-width: 55.99rem) { .nnet { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Stats strip ------------------------------------------------------------ */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 3.5rem;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 48rem) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { background: var(--surface); padding: 1rem 1.25rem; }
.stats b {
  display: block;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}
.stats span { font-family: var(--mono); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Buttons ----------------------------------------------------------- */

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 500;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.btn .k { color: var(--faint); }
.btn.primary .k { color: inherit; opacity: .6; }

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

main { padding-bottom: 3rem; }

.section { padding: 4rem 0 1rem; }

.label {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent);
  margin-bottom: .5rem;
}
.label .n { color: var(--faint); }
.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-head h2 { margin: 0; }
.section-head a { font-family: var(--mono); font-size: .85rem; white-space: nowrap; }

.page-head { padding: 4.5rem 0 1rem; }
.page-head p { color: var(--muted); max-width: 40rem; font-size: 1.1rem; margin-bottom: 0; }
.page-head + .section { padding-top: 2.5rem; }

/* ---- About ------------------------------------------------------------- */

.about { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
@media (min-width: 52rem) { .about { grid-template-columns: 1.2fr 1fr; } }
.about p { color: var(--muted); }
.about p strong { color: var(--text); font-weight: 600; }

/* Code window ------------------------------------------------------------ */

.window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .5);
}
.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
}
.window-bar .lang { color: var(--faint); }
.window pre {
  margin: 0;
  padding: 1rem 1.1rem;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text);
}
.tk-key { color: var(--accent); }
.tk-str { color: var(--green); }
.tk-num { color: var(--amber); }
.tk-pun { color: var(--faint); }
.tk-com { color: var(--faint); font-style: italic; }

/* ---- git log timeline -------------------------------------------------- */

.gitlog {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .95rem;
}
.gitlog li {
  position: relative;
  padding: 0 0 1.5rem 1.75rem;
}
.gitlog li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: .8rem;
  bottom: -.2rem;
  width: 2px;
  background: var(--border);
}
.gitlog li:last-child::before { display: none; }
.gitlog li::after {
  content: "";
  position: absolute;
  left: 0;
  top: .4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.gitlog li:first-child::after { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.gitlog .meta { font-family: var(--mono); font-size: .75rem; color: var(--faint); }
.gitlog .meta .hash { color: var(--amber); }
.gitlog .meta .ref  { color: var(--green); }
.gitlog .msg { font-family: var(--mono); font-size: .9rem; color: var(--text); margin: .1rem 0 .2rem; }
.gitlog .msg .type { color: var(--violet); }
.gitlog .body { color: var(--muted); font-size: .92rem; }

/* ---- Cards ------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}
.grid.four { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.2rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -24px var(--accent-glow);
}
.card .path {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--faint);
  margin-bottom: .6rem;
}
.card .path b { color: var(--accent); font-weight: 500; }
.card p { color: var(--muted); font-size: .94rem; flex: 1; }
.card .who { font-family: var(--mono); font-size: .78rem; color: var(--amber); margin: -.25rem 0 .75rem; }
.card .who span { color: var(--faint); }
.card .links { display: flex; flex-wrap: wrap; gap: 1rem; font-family: var(--mono); font-size: .8rem; }
.card .links a::before { content: "→ "; color: var(--faint); }

.card .idx {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--accent);
  margin-bottom: .9rem;
  display: flex;
  justify-content: space-between;
}
.card .idx .glyph { color: var(--faint); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.tags li {
  font-family: var(--mono);
  font-size: .72rem;
  padding: .12rem .5rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tags.stack { margin-top: 1.5rem; }
.tags.stack li { background: transparent; border: 1px solid var(--border); color: var(--muted); }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 40%, transparent);
  border-radius: 4px;
  padding: .05rem .4rem;
  margin-left: .4rem;
  vertical-align: middle;
}

/* ---- Publications ------------------------------------------------------ */

.pubs { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--border); }
.pubs li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
}
.pubs .year { font-family: var(--mono); font-size: .85rem; color: var(--amber); padding-top: .1rem; }
.pubs .title { font-weight: 600; color: var(--text); }
.pubs a.title:hover { color: var(--accent); }
.pubs .authors { color: var(--muted); font-size: .9rem; }
.pubs .venue { font-family: var(--mono); font-size: .75rem; color: var(--faint); margin-top: .2rem; }
.pubs .venue a { margin-left: .5rem; }
@media (max-width: 34rem) {
  .pubs li { grid-template-columns: 1fr; gap: .2rem; }
}

/* ---- Terminal block (contact) ------------------------------------------ */

.term pre { white-space: pre-wrap; }
.term .ps { color: var(--green); }
.term .out { color: var(--muted); }
.term a { color: var(--accent); }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: .78rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem 1.5rem;
}
.site-footer nav { display: flex; gap: 1rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .ok { color: var(--green); }
kbd {
  font-family: var(--mono);
  font-size: .72rem;
  padding: .05rem .35rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--muted);
}

/* ---- 404 --------------------------------------------------------------- */

.notfound { min-height: 70vh; display: grid; place-items: center; text-align: left; }
.notfound .window { width: min(100%, 36rem); }
.notfound .err { color: #ff7b72; }

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 44rem) {
  .site-header .container {
    flex-wrap: wrap;
    height: auto;
    padding-top: .6rem;
    padding-bottom: .5rem;
    row-gap: .3rem;
  }
  .nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: -.6rem;
  }
  .nav .theme-toggle { margin-left: auto; flex-shrink: 0; }
  .nav a { padding: .35rem .5rem; }
  .nav a .tilde { display: none; }
  .window pre { white-space: pre-wrap; word-break: break-word; }
  .stats { margin-top: 2.5rem; }
  .hero { padding: 2.5rem 0 1.5rem; }
  .section { padding-top: 3rem; }
}
