/*
 * jarcadia.com: the game's own world. A naturalist's field notebook laid on the potting bench, as in the
 * game (src/ui/style.css): aged paper and pencil, fountain-pen ruling, the red correction pen down the
 * margin, masking tape, and the wooden garden labels the game uses for every button. One visual world,
 * so one theme: every colour is set here, whatever the visitor's system prefers.
 */

@font-face {
  font-family: 'Fredoka';
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fredoka-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Kalam';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/kalam-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Kalam';
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/kalam-700.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --bench: #6e5036;
  --bench-deep: #3e2a1a;
  --paper: #efe7d8;
  --paper-warm: #e9dfca;
  --ink: #2c2a26;
  --dim: #6f675a;
  --leaf: #4f7a3c;
  --leaf-deep: #3c5f2c;
  --pen: #3f6b8a;
  --margin: #bf6a58;
  --tape: rgba(236, 224, 186, 0.86);
  --cream: #f7efdc;
  --lift: 0 1px 2px rgba(40, 20, 6, 0.35), 0 14px 30px -12px rgba(30, 14, 4, 0.7);
  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', ui-serif, serif;
  --hand: 'Kalam', 'Segoe Print', 'Chalkboard SE', 'Comic Sans MS', sans-serif;
  --round: 'Fredoka', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
  --rule: 30px;
}

* { box-sizing: border-box; }
/*
 * The scrollbar: a wooden garden label, as the game's buttons are, in a dark groove of the bench. Chrome,
 * Edge and Safari draw it from these; Firefox can only take the two colours (below).
 */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track {
  background:
    repeating-linear-gradient(90deg, rgba(255, 220, 170, 0.04) 0 2px, transparent 2px 5px),
    #2e1f12;
  box-shadow: inset 3px 0 5px rgba(0, 0, 0, 0.55);
}
::-webkit-scrollbar-thumb {
  border: 3px solid #2e1f12;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 13px, transparent 2.6px, #b48a3c 3px 4.4px, transparent 4.8px),
    linear-gradient(180deg, transparent 23px, #9c7748 23px 25px, transparent 25px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(150, 100, 45, 0.1) 3px 4px, transparent 4px 7px),
    linear-gradient(90deg, #f4e6c8, #e2cb9e);
}
::-webkit-scrollbar-thumb:hover {
  background:
    radial-gradient(circle at 50% 13px, transparent 2.6px, #b48a3c 3px 4.4px, transparent 4.8px),
    linear-gradient(180deg, transparent 23px, var(--leaf) 23px 25px, transparent 25px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(150, 100, 45, 0.1) 3px 4px, transparent 4px 7px),
    linear-gradient(90deg, #fbf0d6, #ead6ae);
}
::-webkit-scrollbar-corner { background: #2e1f12; }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: #e6d0a6 #2e1f12; }
}

/* Hidden means hidden, whatever display a label otherwise has (the footer's links before they are filled in). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 17px/1.6 var(--serif);
  /* The bench: planks a hand wide, alternately lighter and darker, the grain running along them. */
  background-color: var(--bench);
  background-image:
    repeating-linear-gradient(180deg, transparent 0 136px, rgba(26, 14, 5, 0.6) 136px 138px, rgba(255, 220, 170, 0.07) 138px 139px, transparent 139px 140px),
    repeating-linear-gradient(180deg, rgba(255, 236, 200, 0.035) 0 140px, rgba(20, 10, 2, 0.06) 140px 280px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='280'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0025 0.11' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.09 0 0 0 0 0.03 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

a { color: var(--pen); text-underline-offset: 3px; }
a:hover { color: var(--leaf-deep); }
:focus-visible { outline: 2px dashed var(--pen); outline-offset: 3px; }
img, video { display: block; max-width: 100%; }

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 6px 12px;
  background: var(--paper);
  font-family: var(--hand);
}
.skip:focus { top: 12px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ------------------------------------------------------------------ the header: labels on a nail */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 8px;
}
.site-head .home img { width: 200px; height: auto; filter: drop-shadow(0 3px 4px rgba(20, 10, 2, 0.45)); }
.site-head .home.hidden { visibility: hidden; }
.site-nav { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: flex-end; }

/* The game's wooden garden label: a tag with a pointed end, an eyelet, a band of paint at its root. */
.wood {
  --tag: #9c7748;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 28px 6px 36px;
  font: 400 17px/1.2 var(--hand);
  color: #4a3420;
  text-decoration: none;
  white-space: nowrap;
  filter: drop-shadow(0 1px 0 rgba(30, 15, 4, 0.5)) drop-shadow(0 4px 5px rgba(30, 15, 4, 0.38));
  transition: transform 140ms ease, filter 140ms ease;
}
.wood::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(5px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  -webkit-mask: radial-gradient(circle at 14px 50%, transparent 3.8px, #000 4.4px);
  mask: radial-gradient(circle at 14px 50%, transparent 3.8px, #000 4.4px);
  background:
    linear-gradient(90deg, transparent 25px, var(--tag) 25px 27px, transparent 27px),
    linear-gradient(180deg, rgba(255, 250, 235, 0.6) 0 1px, transparent 1px calc(100% - 2px), rgba(110, 70, 30, 0.25) calc(100% - 2px)),
    repeating-linear-gradient(180deg, transparent 0 5px, rgba(150, 100, 45, 0.08) 5px 6px, transparent 6px 9px, rgba(150, 100, 45, 0.05) 9px 11px),
    linear-gradient(180deg, #f4e6c8, #e6d0a6);
}
.wood::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  border: 1.8px solid #b48a3c;
  box-shadow: inset 0 0 0 0.6px rgba(255, 235, 170, 0.6), 0 0 0 0.6px rgba(80, 50, 15, 0.5);
}
a.wood:hover, button.wood:hover:not(:disabled) { color: #4a3420; transform: translateX(4px); }
.wood[aria-current='page'] { font-weight: 700; color: var(--leaf-deep); --tag: var(--leaf); }
/* The way forward: its root dipped in the leaf green. */
.wood.go { font-weight: 700; color: var(--leaf-deep); --tag: var(--leaf); }
.wood.go::before {
  background:
    linear-gradient(90deg, var(--tag) 0 27px, transparent 27px),
    linear-gradient(180deg, rgba(255, 250, 235, 0.6) 0 1px, transparent 1px calc(100% - 2px), rgba(110, 70, 30, 0.25) calc(100% - 2px)),
    repeating-linear-gradient(180deg, transparent 0 5px, rgba(150, 100, 45, 0.08) 5px 6px, transparent 6px 9px, rgba(150, 100, 45, 0.05) 9px 11px),
    linear-gradient(180deg, #f4e6c8, #e6d0a6);
}
.wood.big { min-height: 52px; padding: 8px 34px 8px 42px; font-size: 21px; }
@media (max-width: 480px) {
  .wood.big { min-height: 46px; padding: 6px 28px 6px 38px; font-size: 17px; white-space: normal; text-align: left; }
}
/* Not yet a link: the store page is not up. Still a label, hung a little crooked. */
.wood.soon { cursor: default; transform: rotate(-1.5deg); }
.wood svg { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------------ paper, tape and stamps */

.paper {
  position: relative;
  background: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255, 252, 240, 0.55), transparent 60%),
    radial-gradient(ellipse at 90% 100%, rgba(150, 110, 60, 0.12), transparent 45%);
  box-shadow: var(--lift);
  border-radius: 2px;
}
/* A notebook page: fountain-pen ruling and the red margin. */
.paper.ruled {
  background-image:
    linear-gradient(90deg, transparent 54px, rgba(191, 106, 88, 0.55) 54px 55.5px, transparent 55.5px),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--rule) - 1px), rgba(63, 107, 138, 0.17) calc(var(--rule) - 1px) var(--rule)),
    radial-gradient(ellipse at 20% 10%, rgba(255, 252, 240, 0.55), transparent 60%);
}
.tape::before, .tape::after {
  content: '';
  position: absolute;
  top: -12px;
  width: 92px;
  height: 26px;
  background: var(--tape);
  box-shadow: 0 1px 2px rgba(60, 40, 10, 0.18);
}
.tape::before { left: 14px; transform: rotate(-5deg); }
.tape::after { right: 14px; transform: rotate(4deg); }
.tape.one::after { display: none; }
.tape.one::before { left: 50%; margin-left: -46px; transform: rotate(-2deg); }

/* The trailer's big rounded letters: cream, with a dark outline. Used sparingly. */
.stamp {
  margin: 0;
  font: 600 clamp(30px, 5.4vw, 56px)/1.05 var(--round);
  letter-spacing: 0.01em;
  color: var(--cream);
  text-transform: uppercase;
  text-wrap: balance;
  paint-order: stroke fill;
  -webkit-text-stroke: 7px #2a1a0c;
  text-shadow: 0 5px 0 rgba(30, 16, 6, 0.55);
}

.hand { font-family: var(--hand); }

h1, h2, h3 { font-family: var(--round); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(26px, 3.4vw, 34px); color: var(--ink); }
h3 { font-size: 21px; }
p { margin: 0 0 0.8em; }

/* ------------------------------------------------------------------ home: the banner and the hero */

/* The game's bench, as on the YouTube channel: sunbeams, pots, seed packets, a trowel; the logo on it. */
.banner {
  position: relative;
  background: #5e4229 url('../media/banner.jpg') center / cover no-repeat;
  border-bottom: 3px solid rgba(26, 14, 5, 0.85);
  box-shadow: inset 0 -40px 50px -30px rgba(20, 10, 2, 0.6), 0 8px 22px rgba(20, 10, 2, 0.5);
}
.banner-mid {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  min-height: clamp(300px, 34vw, 520px);
  padding: 8px 0 54px;
  text-align: center;
}
.banner h1 { width: min(820px, 100%); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 22px; padding: 46px 0 56px; text-align: center; }
.hero-logo { width: 100%; height: auto; filter: drop-shadow(0 6px 8px rgba(20, 10, 2, 0.5)); }
.hero-line {
  margin: 0;
  padding: 6px 22px 4px;
  font: 400 clamp(19px, 2.6vw, 25px)/1.3 var(--hand);
  color: #3a2c1c;
  background: var(--tape);
  transform: rotate(-1.2deg);
  box-shadow: 0 1px 2px rgba(60, 40, 10, 0.2);
}
.trailer {
  width: min(960px, 100%);
  padding: 14px 14px 40px;
  transform: rotate(0.5deg);
}
.trailer video { width: 100%; aspect-ratio: 16 / 9; background: #1e150c; }
.trailer figcaption { position: absolute; left: 0; right: 0; bottom: 8px; font: 400 17px/1 var(--hand); color: var(--dim); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 26px; }
.cta .note { font: 400 16px/1.3 var(--hand); color: #f1e6cf; text-shadow: 0 1px 2px rgba(20, 10, 2, 0.7); }

/* ------------------------------------------------------------------ home: how a jar goes */

.steps {
  padding: 34px 32px 34px 82px;
  margin-bottom: 64px;
  transform: rotate(-0.4deg);
}
.steps h2 { margin-bottom: 16px; }
.steps ol { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 22px; }
.steps li { display: grid; gap: 2px; }
.steps .n { font: 700 22px/1 var(--hand); color: var(--margin); }
.steps .verb { font: 600 26px/1.1 var(--round); }
.steps .what { font-size: 15.5px; color: var(--dim); line-height: 1.45; }
.steps .then { max-width: 62ch; margin: 0; font-size: 18px; line-height: var(--rule); }
/* The secret, hinted at and no more: a line on its own, in the hand, a little apart. */
.steps .secret { max-width: 62ch; margin: var(--rule) 0 0; font-size: 19px; line-height: var(--rule); color: #6a4a5a; }

/* ------------------------------------------------------------------ home: what lives in a jar */

.section-head { display: grid; justify-items: center; gap: 6px; margin-bottom: 30px; text-align: center; }
.section-head .hand { font-size: 19px; color: #f1e6cf; text-shadow: 0 1px 2px rgba(20, 10, 2, 0.7); }
.lives { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 40px 30px; margin-bottom: 72px; }
.life { padding: 12px 12px 18px; }
.life:nth-child(3n + 1) { transform: rotate(-1deg); }
.life:nth-child(3n + 2) { transform: rotate(0.7deg); }
.life:nth-child(3n) { transform: rotate(-0.3deg); }
.life video, .life img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #e6dcc6; }
.life h3 { margin: 14px 4px 4px; }
.life p { margin: 0 4px; font-size: 15.5px; color: var(--dim); line-height: 1.5; }

/* ------------------------------------------------------------------ a page's title */

.page-title { padding: 26px 0 30px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.page-title .hand { font-size: 19px; color: #f1e6cf; text-shadow: 0 1px 2px rgba(20, 10, 2, 0.7); max-width: 60ch; }
@media (max-width: 760px) {
  .steps { padding: 28px 20px 28px 70px; }
  .paper.ruled { background-image:
    linear-gradient(90deg, transparent 44px, rgba(191, 106, 88, 0.55) 44px 45.5px, transparent 45.5px),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--rule) - 1px), rgba(63, 107, 138, 0.17) calc(var(--rule) - 1px) var(--rule)); }
  .site-head { flex-direction: column; align-items: center; }
  .site-head .home.hidden { display: none; }
  .site-nav { justify-content: center; }
}

/* ------------------------------------------------------------------ the press kit */

.press { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 34px; align-items: start; margin-bottom: 40px; }
.facts { padding: 26px 24px 22px; transform: rotate(-0.8deg); }
.facts h2 { font-size: 24px; margin-bottom: 12px; }
.facts dl { margin: 0; display: grid; gap: 10px; }
.facts dt { font: 700 15px/1.2 var(--hand); color: var(--margin); }
.facts dd { margin: 0; font-size: 16px; line-height: 1.4; }
.press-body { display: grid; gap: 34px; }
.sheet { padding: 30px 32px 26px 82px; }
.sheet h2 { margin-bottom: 14px; }
.sheet p, .sheet li { line-height: var(--rule); }
.sheet ul { margin: 0 0 0.8em; padding-left: 1.2em; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 18px; margin: 6px 0 14px; }
.shots a { display: block; padding: 6px 6px 22px; background: #f7f2e6; box-shadow: 0 2px 4px rgba(40, 20, 6, 0.3); text-decoration: none; position: relative; }
.shots a:nth-child(odd) { transform: rotate(-1deg); }
.shots a:nth-child(even) { transform: rotate(1deg); }
.shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.shots span { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font: 400 13px/1.2 var(--hand); color: var(--dim); }
.downloads { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 8px; }
@media (max-width: 860px) {
  .press { grid-template-columns: 1fr; }
  .sheet { padding: 26px 20px 22px 66px; }
}

/* ------------------------------------------------------------------ footer */

.site-foot {
  padding: 34px 0 44px;
  color: #eadfc8;
  text-align: center;
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(20, 10, 2, 0.7);
}
.site-foot .follow { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-bottom: 18px; }
.site-foot a { color: #f6ecd6; }
.site-foot small { display: block; margin-top: 6px; color: #d9cbb0; font-size: 14px; }
