/* auberry.xyz */

:root {
  --paper: #f3eee4;
  --paper-2: #e9e2d4;
  --ink: #1c1814;
  --ink-2: #5f564c;
  --rule: #cfc5b3;
  --red: #c8243a;
  --leaf: #2f6a3b;
  --seed: #f0d27a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "DejaVu Sans Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16120f;
    --paper-2: #211b17;
    --ink: #ece4d6;
    --ink-2: #a89c8b;
    --rule: #3a322b;
    --red: #ff5d6c;
    --leaf: #6fbf7e;
    --seed: #f6dc8c;
    --grey: #cfc5b3;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: var(--paper); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--red); }

.top, main, footer {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ---------- top bar ---------- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 14px;
}

.mark { text-decoration: none; font-weight: 700; }
.mark span { color: var(--red); }
.top nav { display: flex; gap: 20px; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.top nav a:hover { color: var(--red); }

/* ---------- intro ---------- */

.intro {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--rule);
}

.kicker, .section-label, .meta, .tree-title, .receipt figcaption, .covers span, footer, figcaption {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .02em;
}

.kicker { margin: 0 0 18px; color: var(--red); }

h1 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(2.3rem, 6.2vw, 4.4rem);
  line-height: 1.04;
  font-weight: 400;
  letter-spacing: -.02em;
}

h1 em {
  font-style: italic;
  color: var(--red);
}

i {
  color: var(--grey);
}

.sub { margin: 24px 0 0; max-width: 46ch; color: var(--ink-2); }

/* the strawberry */

.plant { margin: 0; text-align: center; }

#berry {
  display: block;
  width: 132px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 100%;
}

#berry:focus-visible { outline: 2px solid var(--red); outline-offset: 8px; }

#berry svg { display: block; width: 100%; overflow: visible; }
#berry .fruit { fill: var(--red); }
#berry .leaf { fill: var(--leaf); }
#berry .stem { fill: none; stroke: var(--leaf); stroke-width: 4; stroke-linecap: round; }
#berry .seeds path { stroke: var(--seed); stroke-width: 3; stroke-linecap: round; }

.plant figcaption { margin-top: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#count { color: var(--ink); font-weight: 700; }
#hint:not(:empty)::before { content: " · "; }

.sprout {
  position: fixed;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--red);
  z-index: 10;
}

/* ---------- sections ---------- */

.section-label {
  margin: 0 0 40px;
  font-weight: 400;
  text-transform: lowercase;
  color: var(--ink-2);
}
.section-label span { color: var(--red); margin-right: 10px; }

.patch, .about, .elsewhere { padding: 72px 0; border-bottom: 1px solid var(--rule); }

/* ---------- projects ---------- */

.project {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding: 40px 0;
}
.project + .project { border-top: 1px dashed var(--rule); }

.meta { color: var(--ink-2); }
.meta .num { margin: 0 0 16px; color: var(--red); }
.meta dl { margin: 0; display: grid; gap: 2px; }
.meta dt { color: var(--ink-2); opacity: .7; margin-top: 10px; }
.meta dd { margin: 0; color: var(--ink); }

.live::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--leaf);
  vertical-align: 1px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

.body { max-width: 62ch; }
.body h3 { margin: 0 0 .5em; font-size: 2rem; font-weight: 400; line-height: 1.1; }
.body p { margin: 0 0 1em; }

.acro { color: var(--ink-2); font-style: italic; margin-top: -.3em !important; }
.acro b { font-style: normal; color: var(--red); font-weight: 700; }

/* family tree */

.tree, .ladder { margin: 32px 0 0; }
.tree-title { margin: 0 0 12px !important; color: var(--ink-2); }
.tree-title small { font-size: inherit; opacity: .7; }

.tree ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; position: relative; }
.tree ol::before {
  content: "";
  position: absolute;
  left: 9px; top: 12px; bottom: 22px;
  border-left: 1px solid var(--rule);
}

.tree .split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.gen {
  position: relative;
  padding-left: 30px;
  display: flex;
  flex-direction: column;
}
.gen::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 11px; height: 11px;
  background: var(--red);
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  box-shadow: 0 0 0 4px var(--paper);
}
.gen b { font-weight: 400; font-size: 1.15rem; }
.gen span { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.split .gen:nth-child(2)::before { left: 4px; }
.locked b { color: var(--ink-2); }
.locked::before { background: none; border: 1.5px dashed var(--ink-2); }

/* elo scale */

.scale {
  position: relative;
  height: 86px;
  margin: 0 8px;
  border-bottom: 2px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 10%) bottom / 100% 8px no-repeat;
}

.tick {
  position: absolute;
  bottom: -46px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  color: var(--ink-2);
  white-space: nowrap;
}
.tick i {
  position: absolute;
  left: 50%;
  bottom: 44px;
  width: 1px; height: 18px;
  background: var(--ink-2);
}
.tick.up { bottom: auto; top: 0; }
.tick.up i { bottom: auto; top: 30px; height: 56px; }
.tick.me { color: var(--red); font-weight: 700; }
.tick.me i { width: 2px; background: var(--red); }
.ladder { padding-bottom: 46px; }

/* receipt */

.receipt {
  margin: 28px 0;
  padding: 20px 22px;
  background: var(--paper-2);
  border-left: 3px solid var(--red);
}
.receipt figcaption { color: var(--ink-2); margin-bottom: 8px; }
.receipt pre { margin: 0 0 10px; overflow-x: auto; }
.receipt code { font-family: var(--mono); font-size: clamp(1rem, 3vw, 1.35rem); }
.receipt p { margin: 0 !important; font-size: 15px; color: var(--ink-2); }

.covers { font-size: 16px; color: var(--ink-2); }
.covers span { display: block; color: var(--red); margin-bottom: 2px; }

/* ---------- about / elsewhere ---------- */

.about p { margin: 0; max-width: 34ch; font-size: clamp(1.4rem, 3.2vw, 2rem); line-height: 1.3; }

.elsewhere ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 36px; }
.elsewhere a { font-size: 1.5rem; }
.elsewhere a::after { content: " →"; color: var(--red); }

footer {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 40px;
  color: var(--ink-2);
}

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

.lost { min-height: 80vh; display: grid; place-content: center; text-align: center; }
.lost h1 { max-width: none; font-size: clamp(5rem, 22vw, 11rem); }
.lost h1 span { color: var(--red); font-style: italic; }
.lost p { margin: 8px 0 0; color: var(--ink-2); }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .top, main, footer { padding-left: 16px; padding-right: 16px; }
  .intro { grid-template-columns: 1fr; padding: 56px 0 48px; }
  .plant { justify-self: start; display: flex; align-items: center; gap: 16px; }
  #berry { width: 72px; }
  .plant figcaption { margin: 0; text-align: left; }
  .project { grid-template-columns: 1fr; gap: 20px; }
  .meta dl { grid-template-columns: auto 1fr; gap: 2px 14px; }
  .meta dt { margin: 0; }
  .tree .split { grid-template-columns: 1fr; gap: 18px; }
  .tick { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before { animation: none !important; transition: none !important; }
}


/* QoL */
#center { text-align: center; }

/* ---------- berry blog (berry.html) ---------- */

:root {
  --c-berry: #1691b8;
  --c-straw: #c8243a;
  --c-huck: #6a33a8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-berry: #2ea6cc;
    --c-straw: #ff5d6c;
    --c-huck: #9a6cf0;
  }
}

.blog .blog-intro { padding: 80px 0 56px; border-bottom: 1px solid var(--rule); }
.blog .blog-intro h1 { max-width: 20ch; }
.blog .sub { max-width: 58ch; }
.blog .aside { color: var(--ink-2); font-style: italic; }

.blog .chapter { padding: 64px 0; border-bottom: 1px solid var(--rule); max-width: 760px; }
.blog .chapter > p, .blog .chapter li { max-width: 66ch; }
.blog .chapter p { margin: 0 0 1em; }
.blog h3 { font-weight: 400; font-size: 1.5rem; line-height: 1.2; margin: 0 0 .5em; }
.blog h3 small { font-family: var(--mono); font-size: 13px; color: var(--ink-2); margin-left: 8px; }

.howto, .toc {
  margin-top: 32px;
  padding: 18px 22px;
  background: var(--paper-2);
  border-radius: 4px;
  max-width: 66ch;
}
.howto p { margin: 0; }
.howto-title { font-family: var(--mono); font-size: 13px; color: var(--red); margin: 0 0 8px !important; }
.toc ol { margin: 0; padding-left: 1.4em; columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; }

.snack-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--red);
  color: var(--paper);
  vertical-align: 2px;
}
.snack {
  margin: 0 0 28px;
  padding: 16px 20px;
  border: 1.5px dashed var(--red);
  border-radius: 6px;
  max-width: 66ch;
}
.snack p { margin: 8px 0 0 !important; font-size: 1.05rem; }

.note {
  padding-left: 16px;
  border-left: 3px solid var(--leaf);
  color: var(--ink-2);
}

.style-word {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--red);
  letter-spacing: .04em;
  display: inline-block;
  transform: rotate(-3deg);
}

/* berry cards */

.berries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 28px 0; }
.berry-card {
  background: var(--paper-2);
  border-top: 4px solid var(--c);
  border-radius: 4px;
  padding: 16px 18px;
}
.berry-card b { display: block; font-size: 1.3rem; font-weight: 400; color: var(--c); }
.berry-card .mode { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.berry-card p { margin: 10px 0 0 !important; font-size: 15px; line-height: 1.5; }
.berry-card .count { font-size: 2.2rem; line-height: 1; color: var(--c); margin-top: 12px !important; }
.berry-card .count small { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.future li { margin-bottom: 4px; }

/* rules */

.rule { margin: 0 0 36px; }
.rule-num { font-family: var(--mono); font-size: 12px; color: var(--red); margin: 0 0 2px !important; }

.spirit { display: grid; gap: 8px; margin: 8px 0 20px; max-width: 520px; }
.spirit-row { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.spirit .bar { display: flex; height: 28px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--leaf) 22%, var(--paper-2)); }
.spirit .bar i {
  display: flex; align-items: center; padding-left: 8px;
  font-style: normal; white-space: nowrap;
  background: var(--c-straw); color: var(--paper);
}
.spirit .bar b { display: flex; align-items: center; padding-left: 10px; font-weight: 400; color: var(--ink); white-space: nowrap; }

/* chips + table */

.chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  color: color-mix(in srgb, var(--c) 78%, var(--ink));
}
.chip.new { box-shadow: inset 0 0 0 2px var(--c); }
.chip small { font-weight: 400; font-size: 11px; opacity: .8; }
.none { color: var(--rule); font-weight: 700; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }

.table-scroll { overflow-x: auto; margin: 0 0 16px; }
.table-scroll:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.rewards { width: 100%; min-width: 560px; border-collapse: collapse; }
.rewards th, .rewards td { padding: 9px 8px; border-bottom: 1px solid var(--rule); text-align: center; vertical-align: middle; }
.rewards thead th { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--c, var(--ink-2)); text-align: center; }
.rewards thead th:first-child { text-align: left; }
.rewards tbody th[scope="row"] { text-align: left; font-weight: 400; }
.rewards tbody th[scope="row"] b { display: block; font-family: var(--mono); font-size: 14px; }
.rewards tbody th[scope="row"] span { display: block; font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.rewards .cat th { text-align: left; background: var(--paper-2); font-size: 1.05rem; font-weight: 400; padding-top: 10px; }
.rewards .cat small { font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-left: 8px; }
.table-foot { font-size: 15px; color: var(--ink-2); }

/* walk-through + stories */

.group { margin: 0 0 40px; }
.group ul { padding-left: 1.2em; }
.group li { margin-bottom: 8px; }

.story {
  margin: 0 0 24px;
  padding: 18px 22px;
  background: var(--paper-2);
  border-left: 3px solid var(--red);
}
.story h3 { font-size: 1.2rem; }
.story p:last-child { margin-bottom: 0; }

.blog .ladder { margin: 28px 8px 8px; }

.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0 0 40px; }
.glossary dt { font-family: var(--mono); font-size: 14px; color: var(--red); padding-top: 3px; }
.glossary dd { margin: 0; }

.outro { font-size: 1.3rem; line-height: 1.4; }
.outro .back { font-size: 1rem; font-family: var(--mono); }

@media (max-width: 760px) {
  .blog .blog-intro { padding: 48px 0 40px; }
  .blog .chapter { padding: 48px 0; }
  .berries { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  .glossary { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 10px; }
}

/* shiny golden "style" (berry.html, chapter 3) */

.shiny {
  font-weight: 700;
  color: #d9a400; /* fallback if background-clip isn't supported */
  background: linear-gradient(115deg,
    #c98a00 0%, #f5c518 20%, #ffdf4a 40%,
    #ffdf4a 45%, #ffffff 50%, #ffdf4a 55%,
    #ffdf4a 60%, #f5c518 80%, #c98a00 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 .5px rgba(120, 80, 0, .55));
  animation: shine 2.4s linear infinite;
}

/* the window slides right over the gradient, so the white band moves right to left */
@keyframes shine {
  from { background-position: 0% 0; }
  to   { background-position: 100% 0; }
}


/* reward diagram (berry.html) */

.rchart-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 24px 0 10px; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.rchart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { display: inline-block; flex: none; width: 16px; height: 10px; border-radius: 3px; background: var(--c); }
.sw.striped, .rbar.pertick {
  background: repeating-linear-gradient(135deg, var(--c) 0 3px, color-mix(in srgb, var(--c) 30%, var(--paper)) 3px 5px);
}

.rchart { margin: 0 0 24px; }
.raxis, .rrow { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 14px; }
.raxis { position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 8px 0 6px; border-bottom: 1px solid var(--rule); }
.rscale { position: relative; height: 34px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.rtick { position: absolute; bottom: 0; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.rdir { position: absolute; top: 0; }
.rdir.neg { right: calc(100% - 26.83% + 6px); }
.rdir.pos { left: calc(26.83% + 6px); }

.rcat { padding: 18px 0 6px; font-size: 1.05rem; border-bottom: 1px solid var(--rule); }
.rcat small { font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-left: 8px; }

.rrow { align-items: center; padding: 8px 4px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 50%, transparent); border-radius: 4px; cursor: default; }
.rrow:hover { background: var(--paper-2); }
.rrow:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; background: var(--paper-2); }
.rname b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.rname span { display: block; font-size: 13px; line-height: 1.3; color: var(--ink-2); }

.rbars { position: relative; display: grid; gap: 2px; }
.rgrid { position: absolute; top: -8px; bottom: -8px; width: 1px; background: var(--rule); opacity: .45; }
.rgrid.zero { opacity: 1; background: var(--ink-2); }
.rline { position: relative; height: 11px; }
.rbar { position: absolute; top: 0; height: 100%; min-width: 3px; background: var(--c); border-radius: 0 4px 4px 0; }
.rbar.neg { border-radius: 4px 0 0 4px; }
.rval { position: absolute; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; line-height: 1; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.rtip {
  position: fixed; z-index: 20; pointer-events: none;
  max-width: 300px; padding: 10px 12px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  font-size: 14px; line-height: 1.35;
}
.rtip b { display: block; font-family: var(--mono); font-size: 13px; }
.rtip-desc { display: block; color: var(--ink-2); margin-bottom: 6px; }
.rtip-row { display: grid; grid-template-columns: 16px auto 1fr; align-items: center; gap: 8px; font-size: 13px; padding: 1px 0; }
.rtip-row span { text-align: right; font-family: var(--mono); font-size: 12px; }
.rtip-row em { color: var(--ink-2); font-style: normal; }

.table-details { margin: 8px 0 16px; }
.table-details summary { cursor: pointer; font-family: var(--mono); font-size: 14px; color: var(--red); padding: 6px 0; }
.table-details[open] summary { margin-bottom: 12px; }

@media (max-width: 600px) {
  .raxis { grid-template-columns: 1fr; }
  .raxis > span:first-child { display: none; }
  .rrow { grid-template-columns: 1fr; gap: 6px; }
}
