/* ===== Theme ===== */
:root {
  --lav-50:  #f7f5ff;
  --lav-100: #efeaff;
  --lav-200: #ddd3ff;
  --lav-300: #c4b5fd;
  --lav-400: #a78bfa;
  --lav-500: #8b6cf0;
  --lav-600: #7150d8;
  --lav-700: #5a3db3;
  --ink:     #1d1730;
  --ink-2:   #4a4363;
  --line:    #e4def7;
  --white:   #ffffff;
  --cyan:    #5ad8e6;
  --radius:  14px;
  --shadow:  0 10px 30px -12px rgba(90, 61, 179, .25);
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--lav-50);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--lav-700); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.15rem; }

.container { width: min(1120px, 92%); margin-inline: auto; }
.accent { color: var(--lav-500); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 3px solid var(--lav-400); outline-offset: 3px; border-radius: 6px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 255, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-text { font-family: var(--mono); font-weight: 500; font-size: 1.05rem; letter-spacing: .02em; }
.brand-text.small { font-size: .95rem; margin: 0; }
.brand-mark { display: grid; gap: 3px; }
.brand-mark span { display: block; height: 4px; border-radius: 2px; background: var(--lav-500); }
.brand-mark span:nth-child(1) { width: 12px; margin-left: 5px; background: var(--lav-300); }
.brand-mark span:nth-child(2) { width: 18px; margin-left: 2px; background: var(--lav-400); }
.brand-mark span:nth-child(3) { width: 22px; }

.nav-links { list-style: none; display: flex; gap: 2rem; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .95rem;
  position: relative; padding: .25rem 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--lav-500); transition: width .2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 10px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--lav-600); color: #fff; box-shadow: 0 8px 20px -8px rgba(113, 80, 216, .7); }
.btn-primary:hover { background: var(--lav-700); transform: translateY(-1px); }
.btn-ghost { color: var(--lav-700); border: 1.5px solid var(--lav-300); background: var(--white); }
.btn-ghost:hover { border-color: var(--lav-500); transform: translateY(-1px); }
.btn.disabled { background: var(--lav-200); color: var(--ink-2); box-shadow: none; cursor: not-allowed; transform: none; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(4rem, 9vw, 7rem) 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(167, 139, 250, .28), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(90, 216, 230, .14), transparent 40%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  opacity: .7;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--lav-700); background: var(--white); border: 1px solid var(--line);
  padding: .35rem .8rem; border-radius: 999px; margin: 0 0 1.4rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lav-500); box-shadow: 0 0 0 4px var(--lav-200); }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 700; }
.grad {
  background: linear-gradient(90deg, var(--lav-600), var(--lav-400) 60%, #7fc8e8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 36rem; margin: 0 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Printer visual */
.printer-window {
  background: var(--ink); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(29, 23, 48, .55);
  border: 1px solid #2f2748;
}
.window-bar {
  display: flex; align-items: center; gap: 6px; padding: .7rem 1rem;
  background: #261f3d; font-family: var(--mono); font-size: .75rem; color: #a69cc8;
}
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: #4a3f6e; }
.window-bar i:first-child { background: var(--lav-400); }
.window-bar span { margin-left: .6rem; }
.layers {
  display: flex; flex-direction: column-reverse; align-items: center; gap: 5px;
  padding: 2.5rem 1.5rem 1.5rem; min-height: 240px;
  background-image:
    linear-gradient(rgba(167,139,250,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167,139,250,.08) 1px, transparent 1px);
  background-size: 20px 20px;
}
.build-plate { order: -1; width: 92%; height: 8px; border-radius: 3px; background: linear-gradient(90deg, #3a3060, #574a8a, #3a3060); margin-top: 4px; }
.layer {
  height: 14px; width: var(--w); border-radius: 5px;
  background: linear-gradient(90deg, var(--lav-600), var(--lav-400), var(--lav-300));
  opacity: 0; transform: translateY(-8px);
  animation: deposit .5s ease forwards;
}
.layer:nth-child(1) { animation-delay: .1s; }
.layer:nth-child(2) { animation-delay: .3s; }
.layer:nth-child(3) { animation-delay: .5s; }
.layer:nth-child(4) { animation-delay: .7s; }
.layer:nth-child(5) { animation-delay: .9s; }
.layer:nth-child(6) { animation-delay: 1.1s; }
.layer:nth-child(7) { animation-delay: 1.3s; }
.layer:nth-child(8) { animation-delay: 1.5s; box-shadow: 0 0 18px rgba(196, 181, 253, .6); }
@keyframes deposit { to { opacity: 1; transform: translateY(0); } }
.readout {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: .8rem 1.2rem; border-top: 1px solid #2f2748;
  font-family: var(--mono); font-size: .72rem; color: #8e84b3; letter-spacing: .06em;
}
.readout b { color: var(--cyan); font-weight: 500; }

/* ===== Sections ===== */
.section { padding: clamp(4rem, 8vw, 6rem) 0; }
.section-alt { background: var(--white); border-block: 1px solid var(--line); }
.section-tag {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--lav-600); margin: 0 0 .6rem;
}
.section-intro { color: var(--ink-2); max-width: 42rem; margin: 0 0 2.5rem; font-size: 1.05rem; }

/* About */
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 3rem; }
.role { font-family: var(--mono); font-size: .85rem; color: var(--ink-2); }
.about-body p { margin: 0 0 1.1rem; font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column;
}
.stat .num { font-family: var(--display); font-size: 1.7rem; font-weight: 700; color: var(--lav-600); }
.stat .label { font-size: .85rem; color: var(--ink-2); line-height: 1.4; }

/* Manual */
.manual-card {
  display: grid; grid-template-columns: 260px 1fr; gap: 2.5rem; align-items: center;
  background: var(--lav-50); border: 1px solid var(--line); border-radius: 20px;
  padding: 2rem; box-shadow: var(--shadow);
}
.manual-cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
  background: linear-gradient(150deg, var(--lav-700), var(--lav-500) 55%, var(--lav-300));
  color: #fff; padding: 1.4rem; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 20px 40px -18px rgba(90, 61, 179, .7);
}
.cover-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 22px 22px;
}
.cover-label { position: relative; font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; }
.cover-title { position: relative; font-family: var(--display); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.badge {
  display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  background: var(--lav-100); color: var(--lav-700); border: 1px solid var(--lav-200);
  padding: .25rem .65rem; border-radius: 999px; margin-bottom: .9rem;
}
.manual-info h3 { font-size: 1.5rem; }
.manual-info p { color: var(--ink-2); margin: 0 0 1.5rem; }

/* Resources */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.resource {
  position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.resource:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--lav-300); }
.res-letter {
  font-family: var(--mono); font-weight: 500; font-size: .85rem;
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  border-radius: 8px; background: var(--lav-100); color: var(--lav-700);
  border: 1px solid var(--lav-200); margin-bottom: 1rem;
}
.resource p { color: var(--ink-2); font-size: .95rem; margin: 0 0 1.25rem; flex: 1; }
.res-links { display: flex; gap: .5rem; }
.res-links a {
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .05em;
  text-decoration: none; padding: .45rem .8rem; border-radius: 8px;
  border: 1px solid var(--lav-300); color: var(--lav-700); background: var(--lav-50);
  transition: background .15s ease, color .15s ease;
}
.res-links a::before { content: "↓ "; }
.res-links a:hover { background: var(--lav-600); color: #fff; border-color: var(--lav-600); }

/* Affiliations */
.cred-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.cred-block {
  background: var(--lav-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem;
}
.cred-block h3 {
  font-family: var(--mono); font-size: .8rem; font-weight: 500; text-transform: uppercase; letter-spacing: .12em;
  color: var(--lav-600); margin-bottom: 1.1rem;
}
.cred-block h3.mt { margin-top: 2rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 1.1rem 1.2rem; border-left: 2px solid var(--lav-200);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: .3rem; width: 10px; height: 10px;
  border-radius: 50%; background: var(--white); border: 2px solid var(--lav-500);
}
.when { display: block; font-family: var(--mono); font-size: .72rem; color: var(--ink-2); letter-spacing: .05em; }
.timeline strong { display: block; font-size: .95rem; line-height: 1.35; margin: .15rem 0; }
.timeline div span { font-size: .87rem; color: var(--ink-2); }
.pubs { margin: 0; padding: 0; list-style: none; }
.pubs li {
  font-size: .88rem; color: var(--ink-2); line-height: 1.55;
  padding-left: 2em; text-indent: -2em; margin-bottom: 1rem; /* APA hanging indent */
  word-break: break-word;
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips span {
  font-size: .82rem; background: var(--white); border: 1px solid var(--lav-200); color: var(--lav-700);
  padding: .35rem .75rem; border-radius: 999px;
}

/* Footer */
.site-footer { background: var(--ink); color: #b7aed6; padding: 2rem 0; font-size: .88rem; }
.site-footer .accent { color: var(--lav-300); }
.site-footer .brand-text { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .cred-grid { grid-template-columns: 1fr 1fr; }
  .cred-grid .cred-block:last-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; }
  .manual-card { grid-template-columns: 1fr; }
  .manual-cover { max-width: 220px; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    display: none; padding: .5rem 4%;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .8rem 0; }
  .cred-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .layer { animation: none; opacity: 1; transform: none; }
  * { transition: none !important; }
}
