/* AloBonusX.com — member perks ledger, Turku desk
   Static site stylesheet. No build step. */

:root {
  --ink: #0E1512;
  --ink-2: #16201B;
  --ink-3: #22302A;
  --rule: #2C3A34;
  --paper: #EAF0E6;
  --paper-2: #D9E2D4;
  --paper-rule: #C9D6C3;
  --moss: #4FB286;
  --moss-deep: #1F6B4A;
  --moss-soft: rgba(79, 178, 134, 0.14);
  --mute: #97A89D;
  --text: #EAF0E6;
  --text-on-paper: #0E1512;
  --mute-on-paper: #4A5A51;

  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Martian Mono", "Cascadia Mono", "Consolas", monospace;

  --step--1: 0.85rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.6875rem;
  --step-3: 2.0625rem;
  --step-4: 2.625rem;
  --step-5: 3.25rem;

  --measure: 62ch;
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 4px;
  --focus: 3px solid var(--moss);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5.2vw, var(--step-5)); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, var(--step-3)); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }

p { margin: 0 0 1em; max-width: var(--measure); }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: 0.4em; }

a {
  color: var(--moss);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover { color: #7CCBA6; }

:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--moss);
  color: var(--ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

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

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

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--mute);
  letter-spacing: 0;
}

.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 1.5rem;
}
.site-nav li { margin: 0; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--moss);
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--ink-2);
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
  }
  .site-nav a { display: block; padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--moss); }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.35rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}
.btn-solid { background: var(--moss); color: var(--ink); }
.btn-solid:hover { background: #63C097; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--moss); color: var(--text); }
.btn-paper { background: var(--ink); color: var(--paper); }
.btn-paper:hover { background: var(--ink-3); color: var(--paper); }

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

.hero {
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 85% 15%, rgba(79,178,134,0.13), transparent 70%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero-desk {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--mute);
  margin-bottom: 1.5rem;
}
.hero-desk svg { width: 16px; height: 16px; }
.hero h1 { max-width: 14ch; }
.hero .dek {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--mute);
  max-width: 44ch;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Ledger tape: a mono receipt of live entries */
.tape {
  background: var(--paper);
  color: var(--text-on-paper);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 1.1rem 1.25rem 1.4rem;
  border-radius: 2px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.8);
  position: relative;
  transform: rotate(-1.2deg);
  max-width: 400px;
  justify-self: end;
  width: 100%;
}
.tape::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -7px;
  height: 8px;
  background:
    linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 14px 8px repeat-x,
    linear-gradient(-135deg, var(--paper) 50%, transparent 50%) 0 0 / 14px 8px repeat-x;
}
.tape-head {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--mute-on-paper);
  padding-bottom: 0.5rem;
  margin-bottom: 0.6rem;
  color: var(--mute-on-paper);
}
.tape-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  padding: 0.3rem 0;
}
.tape-row .id { color: var(--moss-deep); }
.tape-row .due { color: var(--mute-on-paper); white-space: nowrap; }
.tape-foot {
  border-top: 1px dashed var(--mute-on-paper);
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  color: var(--mute-on-paper);
  display: flex;
  justify-content: space-between;
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .tape { justify-self: start; transform: rotate(0); max-width: 460px; }
}

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

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 2.25rem; }
.section-head p { color: var(--mute); font-size: var(--step-0); }
.section-paper {
  background: var(--paper);
  color: var(--text-on-paper);
}
.section-paper .section-head p { color: var(--mute-on-paper); }
.section-paper a { color: var(--moss-deep); }
.section-paper a:hover { color: #155238; }
.section-paper :focus-visible { outline-color: var(--moss-deep); }

/* ---------- Index cards ---------- */

.cards {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.card {
  --line: 1.65rem;
  position: relative;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--line) - 1px),
      var(--paper-rule) calc(var(--line) - 1px),
      var(--paper-rule) var(--line)
    ) 0 3.4rem / 100% 100% no-repeat,
    var(--paper);
  color: var(--text-on-paper);
  border-radius: var(--radius);
  padding: 0 1.4rem 1.6rem;
  margin: 0;
  min-height: 15rem;
  box-shadow: 0 18px 30px -22px rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.4rem;
  border-bottom: 2px solid var(--moss);
  margin: 0 -1.4rem 0.75rem;
  padding: 0 1.4rem;
}
.card-top svg { width: 26px; height: 26px; color: var(--moss-deep); }
.card-ref {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--mute-on-paper);
  letter-spacing: 0.02em;
}
.card h3 {
  font-size: 1.1rem;
  line-height: var(--line);
  margin: 0;
}
.card p {
  font-size: 0.95rem;
  line-height: var(--line);
  margin: 0;
  color: #253028;
}
.card-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--mute-on-paper);
  line-height: var(--line);
}

@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Numbered process rail ---------- */

.rail {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  position: relative;
  counter-reset: step;
}
.rail::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 1.4rem;
  height: 2px;
  background: var(--rule);
}
.rail li {
  counter-increment: step;
  position: relative;
  padding: 0 1.5rem 0 0;
  margin: 0;
}
.rail li:last-child { padding-right: 0; }
.rail-num {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem; height: 2.8rem;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--moss);
  color: var(--moss);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}
.rail-num::before { content: counter(step, decimal-leading-zero); }
.rail h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.rail p { font-size: 0.95rem; color: var(--mute); margin: 0; }

@media (max-width: 760px) {
  .rail { grid-template-columns: 1fr; gap: 1.75rem; }
  .rail::before {
    left: 1.4rem; right: auto; top: 0; bottom: 0;
    width: 2px; height: auto;
  }
  .rail li { padding: 0 0 0 4rem; }
  .rail-num { position: absolute; left: 0; top: -0.2rem; margin: 0; }
}

/* ---------- Ledger list ---------- */

.ledger-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mute);
  margin-bottom: 1.5rem;
}
.ledger-meta span { display: inline-flex; gap: 0.5rem; }
.ledger-meta b { color: var(--text); font-weight: 500; }

.ledger {
  list-style: none;
  margin: 0; padding: 0;
  border-top: 1px solid var(--rule);
}
.entry {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) 17rem;
  gap: 1rem 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
  align-items: start;
}
.entry-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--moss);
  padding-top: 0.25rem;
}
.entry-id small {
  display: block;
  color: var(--mute);
  font-size: 0.72rem;
  margin-top: 0.25rem;
}
.entry h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.entry p { color: var(--mute); font-size: 0.95rem; margin-bottom: 0.6rem; }
.entry-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.85rem;
  color: var(--mute);
  margin: 0; padding: 0;
  list-style: none;
}
.entry-facts li { margin: 0; }
.entry-facts b { color: var(--text); font-weight: 600; }
.entry-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
  min-width: 0;
}
.code-box {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--ink-2);
  overflow: hidden;
}
.code-box code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: center;
}
.code-box button {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--rule);
  color: var(--moss);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0 0.85rem;
  cursor: pointer;
}
.code-box button:hover { background: var(--moss-soft); }
.code-box button[data-copied="true"] { color: var(--text); }
.entry-actions .btn { justify-content: center; }
.entry-note {
  font-size: 0.78rem;
  color: var(--mute);
  margin: 0;
}

@media (max-width: 760px) {
  .entry { grid-template-columns: 1fr; gap: 0.75rem; }
  .entry-actions { min-width: 0; }
}

/* ---------- Definition panels (email practice) ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 3rem;
  margin: 0;
}
.facts div {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}
.section-paper .facts div { border-top-color: var(--paper-rule); }
.facts dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}
.facts dd { margin: 0; color: var(--mute); font-size: 0.95rem; max-width: 46ch; }
.section-paper .facts dd { color: var(--mute-on-paper); }
.facts address { font-style: normal; }

@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } }

/* ---------- Subscribe ---------- */

.subscribe {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 2.5rem;
  align-items: center;
}
.subscribe-form {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}
.field input[type="email"],
.field input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--ink);
  color: var(--text);
}
.field input::placeholder { color: #6B7A71; }
.field input:focus-visible { outline: var(--focus); outline-offset: 2px; border-color: var(--moss); }
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--mute);
  margin-bottom: 1.25rem;
}
.check input { margin-top: 0.3rem; accent-color: var(--moss); width: 1rem; height: 1rem; flex: none; }
.form-note { font-size: 0.82rem; color: var(--mute); margin: 0.9rem 0 0; }
.form-status {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: none;
}
.form-status.is-ok { display: block; background: var(--moss-soft); color: var(--text); border: 1px solid var(--moss); }
.form-status.is-err { display: block; background: rgba(214, 92, 92, 0.12); color: #F3C1C1; border: 1px solid #B85B5B; }

@media (max-width: 820px) { .subscribe { grid-template-columns: 1fr; } }

/* ---------- Prose pages ---------- */

.page-head {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}
.page-head p { color: var(--mute); }
.page-head .updated {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mute);
}
.prose { padding: clamp(2.5rem, 6vw, 4rem) 0; max-width: 72ch; }
.prose h2 { font-size: var(--step-1); margin-top: 2.25rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-0); margin-top: 1.5rem; }
.prose p, .prose li { color: #CBD6CE; }
.prose li { margin-bottom: 0.5em; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1rem 0 1.5rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.prose th { color: var(--text); font-weight: 700; }
.prose td { color: #CBD6CE; }
.prose address { font-style: normal; color: #CBD6CE; }

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

.lost {
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding: 4rem 0;
}
.lost-inner { max-width: 56ch; }
.lost .code {
  font-family: var(--font-mono);
  color: var(--moss);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.lost p { color: var(--mute); }

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

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--ink-2);
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}
.footer-grid h4 {
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}
.footer-grid p, .footer-grid li { color: var(--mute); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--moss); text-decoration: underline; }
.footer-grid address { font-style: normal; color: var(--mute); line-height: 1.6; }
.footer-grid .brand { margin-bottom: 0.9rem; }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--mute);
  font-size: 0.82rem;
}
.footer-bottom p { margin: 0; max-width: none; }

@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
