/* BornOnce — original stylesheet. System fonts only, no webfonts, no external assets. */
:root {
  --paper: #f7f2e9;
  --card: #fffdf7;
  --ink: #221d16;
  --muted: #6f6657;
  --line: #e3d9c4;
  --accent: #9a3b26;   /* brick red */
  --accent-soft: #f3e2d8;
  --teal: #1f5c4d;
  --gold: #b98a2f;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
h1 { font-size: 1.7rem; line-height: 1.3; margin: .4em 0; }
h2 { font-size: 1.3rem; margin: .2em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
a { color: var(--teal); }
p { margin: .5em 0; }
.kicker { color: var(--accent); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin: 0; font-weight: 700; }
.lede { color: #3d362b; }
.fine { color: var(--muted); font-size: .85rem; }
.center { text-align: center; }

/* header */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.head-in { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); font-weight: 700; font-size: .95rem; }
.nav { display: flex; gap: 14px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.nav a:hover { color: var(--ink); }
.head-btns { display: flex; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: .85rem; cursor: pointer;
}
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button { font: inherit; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 18px 0;
}
.hero { margin-top: 18px; }
.counters { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0 4px; }
.counter strong { display: block; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.counter span { color: var(--muted); font-size: .85rem; }

/* setup form */
.setup fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; padding: 10px 12px; }
.setup legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.radio, .check { display: block; padding: 4px 0; cursor: pointer; }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
select, input[type="search"], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem;
}
.big {
  display: block; width: 100%; margin: 16px 0 8px; padding: 14px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 1.15rem; font-weight: 800; cursor: pointer;
}
.big:hover { filter: brightness(1.08); }
.btn {
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 600;
}
.btn.ghost { background: transparent; color: var(--ink); }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.share-row .btn { flex: 1 1 160px; }

/* life view */
.life-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.life-ctl { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.speeds { display: flex; gap: 6px; flex-wrap: wrap; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.progress > div { height: 100%; width: 0%; background: var(--accent); transition: width .3s linear; }
.age-line { font-weight: 700; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 12px 0 0; padding: 0; }
.stats div { border-top: 1px solid var(--line); padding-top: 6px; }
.stats dt { color: var(--muted); font-size: .8rem; }
.stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats dd small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.life-grid { display: grid; gap: 0 18px; }
@media (min-width: 700px) { .life-grid { grid-template-columns: 1.6fr 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.timeline li { padding: 8px 0 8px 12px; border-left: 3px solid var(--line); margin-left: 4px; position: relative; }
.timeline li b { color: var(--accent); font-variant-numeric: tabular-nums; }
.timeline li.milestone { border-left-color: var(--gold); background: #fdf6e3; margin-left: 0; padding-left: 16px; border-radius: 0 8px 8px 0; }
.peer-list { list-style: none; margin: 0; padding: 0; }
.peer-list li { border-top: 1px solid var(--line); padding: 8px 0; }
.peer-list .bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.peer-list .bar > div { height: 100%; background: var(--teal); }
.peer-list small { color: var(--muted); }

/* end of life */
.grain { display: grid; gap: 10px; margin: 8px 0; }
.grain-row { display: grid; grid-template-columns: 70px 1fr 70px; gap: 8px; align-items: center; font-size: .9rem; }
.grain-row .track { height: 8px; background: var(--line); border-radius: 99px; position: relative; }
.grain-row .dot { position: absolute; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.keepsake { border: 1.5px dashed var(--gold); border-radius: 12px; padding: 14px 16px; margin: 18px 0; background: #fdf8ec; }
.past-list { list-style: none; padding: 0; margin: 0; }
.past-list li { border-top: 1px solid var(--line); padding: 8px 0; font-size: .95rem; }
.move-code { margin-top: 10px; font-family: ui-monospace, monospace; font-size: .8rem; }

/* explorer */
.exp-ctl { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.exp-ctl input { flex: 2 1 200px; }
.exp-ctl select { flex: 1 1 160px; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; min-width: 560px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: .8rem; }
td small { color: var(--muted); }

/* about lists */
.plain { padding-left: 20px; }
.plain li { margin: 8px 0; }

.site-foot { border-top: 1px solid var(--line); padding: 20px 0 40px; color: var(--muted); }

/* modals */
.modal {
  position: fixed; inset: 0; background: rgba(34, 29, 22, .55);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0;
}
@media (min-width: 600px) { .modal { align-items: center; padding: 20px; } }
.modal-box {
  background: var(--card); border-radius: 16px 16px 0 0; padding: 22px; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 600px) { .modal-box { border-radius: 16px; } }
.dec-options { display: grid; gap: 10px; margin-top: 14px; }
.dec-options button {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 12px 14px; cursor: pointer; line-height: 1.5;
}
.dec-options button:hover { border-color: var(--accent); background: var(--accent-soft); }
.dec-options button b { display: block; }
.dec-options button span { color: var(--muted); font-size: .88rem; }

@media (max-width: 380px) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  .card { padding: 16px; }
  .counter strong { font-size: 1.6rem; }
  .nav { gap: 10px; }
}
