/* ============================================================
   OllieSolver — base system
   ============================================================ */

:root {
  --bg: #08090a;
  --bg-2: #0b0d0e;
  --panel: #101314;
  --panel-2: #141718;
  --ink: #f2f0e9;
  --ink-dim: #b6bbb1;
  --muted: #8b9188;
  --faint: #666c63;
  --line: rgba(242, 240, 233, 0.08);
  --line-2: rgba(242, 240, 233, 0.14);
  --lime: #d9ff66;
  --lime-soft: rgba(217, 255, 102, 0.09);
  --lime-line: rgba(217, 255, 102, 0.34);
  --amber: #ffc46b;
  --coral: #ff7a5c;
  --blue: #a8c8ff;
  --cream: #ece8de;
  --cream-ink: #101211;
  --cream-muted: #5d6158;
  --cream-line: rgba(16, 18, 17, 0.12);

  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1240px;
  --pad: clamp(20px, 3vw, 32px);
  --radius: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

::selection { background: var(--lime); color: #0a0b09; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #0a0b0a; }
::-webkit-scrollbar-thumb {
  background: #262a27;
  border-radius: 99px;
  border: 3px solid #0a0b0a;
}

/* Atmosphere ------------------------------------------------ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 560px at 82% -10%, rgba(217, 255, 102, 0.09), transparent 64%),
    radial-gradient(700px 520px at 4% 4%, rgba(90, 120, 255, 0.045), transparent 70%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.site {
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Typography helpers ---------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.eyebrow--dark { color: #6c7167; }

h2.display {
  margin-top: 20px;
  font-size: clamp(2.5rem, 4.9vw, 4.35rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h2.display em,
h1.display em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.lede {
  color: var(--ink-dim);
  font-size: 15.5px;
  line-height: 1.72;
}

.section { padding: clamp(84px, 10vw, 138px) 0; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 60px);
}

.section-head .lede { max-width: 450px; justify-self: end; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.site-header.is-scrolled {
  background: rgba(8, 9, 10, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 1px 0 var(--line);
}

.nav {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.logo .logo-mark { width: 28px; height: 28px; }
.logo .logo-dim { color: var(--muted); font-weight: 400; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 18px;
}

.nav-links a {
  position: relative;
  padding: 8px 13px;
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 3px;
  height: 1px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 9px var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(217, 255, 102, 0.5);
  animation: ping 2.8s var(--ease) infinite;
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(217, 255, 102, 0.45); }
  60%, 100% { box-shadow: 0 0 0 7px rgba(217, 255, 102, 0); }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    transform 0.35s var(--ease), box-shadow 0.35s ease;
}

.btn svg { width: 14px; height: 14px; transition: transform 0.35s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: scale(0.985); }

.btn--sm { height: 38px; padding: 0 16px; font-size: 12.5px; }

.btn--lime {
  background: var(--lime);
  color: #0a0b09;
  box-shadow: 0 0 0 1px rgba(217, 255, 102, 0.2), 0 12px 30px -14px rgba(217, 255, 102, 0.5);
}
.btn--lime:hover {
  background: #e6ff8f;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(217, 255, 102, 0.3), 0 18px 38px -16px rgba(217, 255, 102, 0.6);
}

.btn--ghost {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: rgba(242, 240, 233, 0.28);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.btn--dark {
  background: #0a0b09;
  color: var(--lime);
  border-color: #0a0b09;
}
.btn--dark:hover { background: #14170f; transform: translateY(-1px); }

.btn--block { width: 100%; }

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.25s ease;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.2s ease;
}
body.menu-open .menu-btn span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu ----------------------------------------------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  padding: 104px var(--pad) 32px;
  background: rgba(8, 9, 10, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}

body.menu-open .mobile-menu { opacity: 1; visibility: visible; }

.mobile-menu nav { display: flex; flex-direction: column; }

.mobile-menu .mm-link {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(34px, 9vw, 48px);
  line-height: 1.1;
  color: var(--ink);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

body.menu-open .mobile-menu .mm-link { opacity: 1; transform: none; }
body.menu-open .mobile-menu .mm-link:nth-child(1) { transition-delay: 0.08s; }
body.menu-open .mobile-menu .mm-link:nth-child(2) { transition-delay: 0.14s; }
body.menu-open .mobile-menu .mm-link:nth-child(3) { transition-delay: 0.2s; }
body.menu-open .mobile-menu .mm-link:nth-child(4) { transition-delay: 0.26s; }
body.menu-open .mobile-menu .mm-link:nth-child(5) { transition-delay: 0.32s; }

.mobile-menu .mm-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  font: 10px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Reveals & motion ------------------------------------------ */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0ms);
}

.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

.rise {
  animation: rise 1s var(--ease) both;
  animation-delay: var(--d, 0s);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Shared code styling --------------------------------------- */

.code-window {
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #0a0c0d;
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
}

.code-bar .cb-title {
  font: 500 10px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.code-bar .cb-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

pre.code {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font: 12.5px/1.8 var(--mono);
  color: #d5dacf;
  tab-size: 2;
}

pre.code::-webkit-scrollbar { height: 8px; }

.tok-cmd { color: var(--lime); }
.tok-str { color: #dbe5c9; }
.tok-key { color: #94a3b6; }
.tok-com { color: #626960; font-style: italic; }
.tok-flag { color: #b8bdb3; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 500 9px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.copy-btn:hover { color: var(--ink); border-color: var(--line-2); }
.copy-btn.copied {
  color: var(--lime);
  border-color: var(--lime-line);
  background: var(--lime-soft);
}

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

.site-footer {
  position: relative;
  border-top: 1px solid var(--line);
  padding: clamp(48px, 6vw, 72px) 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 0.75fr);
  gap: 40px;
}

.footer-brand p {
  max-width: 290px;
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.72;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 9.5px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot-col h4 {
  margin: 4px 0 16px;
  font: 500 9.5px var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.foot-col a {
  display: block;
  padding: 5px 0;
  font-size: 13.5px;
  color: var(--ink-dim);
  transition: color 0.2s ease;
}
.foot-col a:hover { color: var(--lime); }

.footer-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: clamp(44px, 6vw, 64px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font: 10.5px/1.7 var(--mono);
  letter-spacing: 0.015em;
  color: var(--faint);
}

.footer-bottom .note { max-width: 600px; }
.footer-bottom .note a { color: var(--muted); border-bottom: 1px solid var(--line-2); }
.footer-bottom .note a:hover { color: var(--lime); }

/* Reduced motion -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* Responsive base ------------------------------------------- */

@media (max-width: 1080px) {
  .status-pill { display: none; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .nav { height: 70px; }
  .nav-actions .btn { display: none; }
  .section-head { grid-template-columns: 1fr; align-items: start; }
  .section-head .lede { justify-self: start; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .footer-bottom { flex-direction: column; gap: 14px; }
  .btn { height: 46px; }
}

/* Not found ------------------------------------------------ */

.nf-site {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.nf-header { padding: 22px 0; border-bottom: 1px solid var(--line); }
.nf-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.nf-main {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(88px, 13vw, 170px) var(--pad);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.nf-title {
  margin: 18px 0 20px;
  font-size: clamp(3.6rem, 10.5vw, 8rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.06em;
}
.nf-title em {
  color: var(--lime);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.nf-main .lede { max-width: 460px; }

.nf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.nf-code {
  margin-top: 52px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--faint);
  font: 10.5px var(--mono);
  letter-spacing: 0.03em;
}
.nf-code b { color: var(--coral); font-weight: 400; }

.nf-footer {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 9.5px var(--mono);
  letter-spacing: 0.06em;
}
.nf-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.nf-footer a:hover { color: var(--lime); }
