/* leptris.github.io — illuminated systems manuscript
   ink & vellum, gilded amber, cinnabar; Fraunces + IBM Plex Mono */

:root {
  --ink: #16130f;
  --ink-2: #1d1914;
  --ink-3: #241f18;
  --vellum: #ede3cd;
  --vellum-dim: #c9bd9f;
  --vellum-faint: #8f8570;
  --gold: #d9a441;
  --gold-bright: #efbe5e;
  --cinnabar: #c9502f;
  --malachite: #6fa889;
  --hairline: #3b342a;
  --hairline-soft: #2b261e;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --measure: 71rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--vellum);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--ink); }

/* grain + vignette atmosphere */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(0,0,0,0.42) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.055;
  mix-blend-mode: overlay;
}

main, header, footer { position: relative; z-index: 1; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 2rem; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

/* ————— manuscript rules: thin–thick–thin ————— */
.rule { border: none; height: 7px; margin: 0; }
.rule::before { content: ""; }

.rule triple {
  display: block;
}

hr.rule {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  position: relative;
}
hr.rule::after {
  content: ""; position: absolute; left: 0; right: 0; top: 2.5px;
  border-top: 1px solid var(--hairline-soft);
}

/* ————— header ————— */
.masthead {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline-soft);
}
.masthead .wrap {
  display: flex; align-items: center; gap: 1.1rem;
  padding-top: 0.85rem; padding-bottom: 0.85rem;
}
.masthead .mark { width: 34px; height: 34px; display: block; }
.masthead .wordmark {
  font-family: var(--font-display);
  font-weight: 640; font-size: 1.18rem; letter-spacing: 0.16em;
  color: var(--vellum);
}
.masthead nav { margin-left: auto; display: flex; gap: 1.6rem; }
.masthead nav a {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--vellum-dim);
}
.masthead nav a:hover { color: var(--gold-bright); }
.masthead .gh { display: flex; align-items: center; gap: 0.45rem; }

@media (max-width: 720px) { .masthead nav { display: none; } }

/* ————— hero ————— */
.hero {
  padding: 6.5rem 0 5rem;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 3rem; align-items: center;
}
.hero-kicker {
  font-size: 0.75rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--cinnabar); margin-bottom: 1.6rem;
}
.hero-kicker::before { content: "❧ "; color: var(--gold); }
h1.display {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 1.7rem;
}
h1.display em {
  font-style: italic; font-weight: 430; color: var(--gold);
}
.hero-lede {
  max-width: 34rem; color: var(--vellum-dim); font-size: 1.02rem;
  margin-bottom: 2.4rem;
}
.hero-lede strong { color: var(--vellum); font-weight: 500; }

.cta-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.78rem 1.5rem;
  font-family: var(--font-mono); font-size: 0.85rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--gold); color: var(--gold);
  transition: all 0.18s ease;
}
.btn:hover { background: var(--gold); color: var(--ink); }
.btn.solid { background: var(--gold); color: var(--ink); }
.btn.solid:hover { background: var(--gold-bright); border-color: var(--gold-bright); }

.hero-medallion { position: relative; justify-self: center; }
.hero-medallion .logo-svg { width: min(340px, 78vw); height: auto; }
.hero-medallion .logo-svg use + g,
.hero-medallion svg { animation: turn 90s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.medallion-caption {
  text-align: center; margin-top: 1.2rem;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--vellum-faint);
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 4rem; }
  .hero-medallion { order: -1; }
  .hero-medallion .logo-svg { width: min(230px, 60vw); }
}

/* logo colors (used by both inline SVG instances) */
.logo-svg .ring { stroke: var(--gold); }
.logo-svg .ring-fine { stroke: var(--hairline); }
.logo-svg .hare path, .logo-svg .hare circle { fill: var(--vellum); }
.logo-svg .hare .body { stroke: var(--vellum); fill: none; }
.logo-svg .hare .eye { fill: var(--ink); }

/* ————— stat strip ————— */
.stat-strip {
  border-top: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--ink-2);
}
.stat-strip .wrap {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-top: 0; padding-bottom: 0;
}
.stat {
  padding: 1.6rem 1.4rem;
  border-left: 1px solid var(--hairline-soft);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat .n {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.9rem; color: var(--gold); line-height: 1.1;
  display: block;
}
.stat .l {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--vellum-faint);
}
@media (max-width: 760px) {
  .stat-strip .wrap { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: none; }
}

/* ————— sections ————— */
section { padding: 5.2rem 0; }
.sec-kicker {
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--cinnabar); margin-bottom: 0.9rem;
}
.sec-kicker::before { content: "— "; color: var(--gold); }
h2.sec-title {
  font-family: var(--font-display); font-weight: 560;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.12;
  margin-bottom: 1.1rem; letter-spacing: -0.01em;
}
h2.sec-title em { font-style: italic; color: var(--gold); font-weight: 430; }
.sec-lede { color: var(--vellum-dim); max-width: 42rem; margin-bottom: 2.8rem; }

/* ————— the name / motif ————— */
.motif {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 3.2rem; align-items: center;
}
.motif .logo-svg { width: min(300px, 70vw); margin: 0 auto; display: block; }
.motif-text p { margin-bottom: 1.2rem; color: var(--vellum-dim); }
.motif-text p strong { color: var(--vellum); font-weight: 500; }
.motif-sign {
  margin-top: 2rem; font-family: var(--font-display); font-style: italic;
  font-size: 1.05rem; color: var(--gold);
}
@media (max-width: 880px) { .motif { grid-template-columns: 1fr; } }

/* ————— features ————— */
.feat-grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 1.1rem;
}
.feat {
  border: 1px solid var(--hairline-soft);
  background: linear-gradient(160deg, var(--ink-2), var(--ink));
  padding: 1.9rem 1.7rem 1.7rem;
  position: relative;
}
.feat::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 2.4rem; height: 2px; background: var(--gold);
}
.feat.red::before { background: var(--cinnabar); }
.feat.green::before { background: var(--malachite); }
.feat h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.22rem; margin-bottom: 0.7rem; letter-spacing: 0.01em;
}
.feat p { color: var(--vellum-dim); font-size: 0.88rem; }
.feat .big {
  font-family: var(--font-display); font-weight: 560;
  font-size: 2.2rem; color: var(--gold); line-height: 1;
  margin: 0.2rem 0 0.5rem; display: block;
}
.feat .big small { font-size: 1rem; color: var(--vellum-faint); }

/* asymmetric placement */
.feat-speed    { grid-column: span 7; }
.feat-bound    { grid-column: span 5; }
.feat-conform  { grid-column: span 4; }
.feat-compact  { grid-column: span 4; }
.feat-sax      { grid-column: span 4; }
.feat-bindings { grid-column: span 5; }
.feat-cli      { grid-column: span 7; }
@media (max-width: 880px) {
  .feat-grid > .feat { grid-column: span 12 !important; }
}

/* ————— benchmarks ————— */
.bench { background: var(--ink-2); border-top: 1px solid var(--hairline-soft); border-bottom: 1px solid var(--hairline-soft); }

.bench-block { margin-bottom: 3rem; }
.bench-block:last-child { margin-bottom: 0; }
.bench-block h3 {
  font-family: var(--font-display); font-weight: 560; font-size: 1.15rem;
  margin-bottom: 0.3rem;
}
.bench-block .sub { color: var(--vellum-faint); font-size: 0.78rem; margin-bottom: 1.4rem; }

.bar-row {
  display: grid; grid-template-columns: 11rem 1fr 6.5rem;
  gap: 1.1rem; align-items: center; margin-bottom: 0.75rem;
}
.bar-row .who { font-size: 0.82rem; color: var(--vellum-dim); text-align: right; }
.bar-row .who .ver { color: var(--vellum-faint); font-size: 0.68rem; display: block; }
.bar-track { height: 1.55rem; background: var(--ink-3); position: relative; overflow: hidden; }
.bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-row.them .bar-fill { background: var(--hairline); }
.bar-row .val { font-size: 0.84rem; color: var(--vellum); white-space: nowrap; }
.bar-row .val b { color: var(--gold); font-weight: 600; }

.bench-note { margin-top: 2.2rem; color: var(--vellum-faint); font-size: 0.74rem; }
.bench-note a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 720px) {
  .bar-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .bar-row .who { text-align: left; }
}

/* ————— memory table ————— */
.mem-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  margin-top: 1.4rem;
}
.mem-table th {
  text-align: left; font-weight: 500; color: var(--vellum-faint);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--hairline);
}
.mem-table td {
  padding: 0.62rem 1rem 0.62rem 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.mem-table td:first-child { color: var(--vellum-dim); }
.mem-table .bytes { color: var(--gold); font-weight: 600; }
.mem-table .note { color: var(--vellum-faint); font-size: 0.75rem; }

/* ————— install ————— */
.install-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
@media (max-width: 880px) { .install-cols { grid-template-columns: 1fr; } }
.install-card {
  border: 1px solid var(--hairline-soft); background: var(--ink-2);
  padding: 1.5rem 1.5rem 1.3rem;
}
.install-card h4 {
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem; font-weight: 500;
}
pre.code {
  font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.75;
  color: var(--vellum-dim); overflow-x: auto; tab-size: 4;
}
pre.code .k { color: var(--gold-bright); }        /* keyword-ish */
pre.code .s { color: var(--malachite); }          /* strings */
pre.code .c { color: var(--vellum-faint); font-style: italic; } /* comments */
pre.code .f { color: var(--vellum); }             /* functions/api */
pre.code .n { color: var(--cinnabar); }           /* numbers/punct-accent */

/* ————— reveal choreography ————— */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-medallion svg, .hero-medallion .logo-svg { animation: none; }
  .bar-fill { transition: none; }
}

/* ————— footer ————— */
footer {
  border-top: 1px solid var(--hairline-soft);
  padding: 2.6rem 0 3.2rem; margin-top: 2rem;
}
footer .wrap {
  display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
  color: var(--vellum-faint); font-size: 0.78rem;
}
footer .mini-mark { width: 26px; height: 26px; opacity: 0.8; }
footer .sep { color: var(--hairline); }
footer .formerly { font-style: italic; font-family: var(--font-display); }
