/* JournalCo, a Kybos Labs project, in both looks at once.
   From Kybos Labs (kybos/site/README.md, "Design rules"): the page itself. Square corners, no
   shadows, gradients or glass, a 1-bit pixel mark, the moving pixel ground (bg.js), the desk of Kiris
   and the band. Avenir Next, with Nunito Sans from assets/fonts where Avenir is missing. Text at
   least 15px (body 18px), small text at least 4.5:1, tap targets at least 44px, reading text in
   full ink, grey only for labels and meta.
   From JournalCo (TASARIM.md in the app repo): the colours (espresso on warm cream, cream tiles,
   Cherry #8F1D2C as the one accent), Geist Mono for numbers, and the
   app's own screens in an espresso phone body. */
/* Nunito Sans and Geist Mono (SIL Open Font License, assets/fonts/OFL-*.txt), served from this site */
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("assets/fonts/nunito-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("assets/fonts/nunito-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("assets/fonts/geist-mono.woff2") format("woff2"); }

:root {
  --ink: #2a211c;                  /* JournalCo's espresso (C.ink) */
  --paper: #f1eae0;                /* its warm cream ground (C.bg) */
  --tile: #fffcf7;                 /* its tiles (C.tile) */
  --cherry: #8f1d2c;               /* its own colour: 8:1 under cream text, 7.6:1 on the ground */
  --cherry-soft: #e6cfcb;          /* the cherry mixed into the ground, for the coffee cherries in bg.js */
  --sans: "Avenir Next", "Nunito Sans", system-ui, sans-serif;
  --num: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: 40px;
  color-scheme: light;
  --ground: var(--paper);
  --ground-2: #e4d9c9;             /* the two darker steps of the moving ground */
  --ground-3: #d0c0aa;
  --text: var(--ink);
  --muted: #5e534b;                /* 6.5:1 on the ground (the app's #6a5e55, a step darker for 15px text) */
  --faint: #6a5e55;                /* 5.3:1 on the ground */
  --line: rgba(42, 33, 28, .2);
}
@media (max-width: 720px) { :root { --gutter: 16px; } .site-head { padding: 8px 0; } .nav { gap: 0 20px; } }
@media (max-width: 380px) { .nav { gap: 0 14px; } }

* { box-sizing: border-box; }
html { background: var(--ground); scroll-padding-top: 16px; }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 18px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-kerning: normal;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.skip { position: absolute; left: -999px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; }
.skip:focus { left: 16px; top: 16px; background: var(--text); color: var(--ground); padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; z-index: 9; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); flex: 1; display: flex; flex-direction: column; }
main { flex: 1; outline: none; min-width: 0; }
.num { font-family: var(--num); font-size: .92em; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }

/* header: JournalCo's own icon (logo/v60-glyph in the app repo) and the name */
.site-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; min-width: 44px; }
.mark { width: 32px; height: 32px; display: block; }
.brand-name { font-size: 22px; line-height: 1; font-weight: 700; letter-spacing: -.01em; }
.nav { display: flex; gap: 0 28px; flex-wrap: wrap; align-items: center; }
.nav a { font-size: 17px; line-height: 1; color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--text); }
@media (max-width: 420px) { .nav .wide { display: none; } }

/* animated pixel ground (bg.js), fixed behind everything */
.ground { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none;
  image-rendering: pixelated; image-rendering: crisp-edges; }
.ground-blur { filter: blur(5px); opacity: .6; }   /* the things behind long text (bg.js) */
.wrap, .band { position: relative; z-index: 1; }

/* hero: the words and the store links on the left, three screens on the right */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 56px; align-items: center; padding: 48px 0 24px; }
.hero h1 { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -.03em; margin: 0; }
.hero-sub { font-size: 20px; line-height: 1.55; color: var(--text); margin: 24px 0 32px; max-width: 32em; }
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 32px 0 0; }
  .hero-sub { font-size: 18px; }
}

/* the store links (mock addresses for now, build.py): ink blocks, two lines of text, no badge art */
.stores { display: flex; gap: 10px; flex-wrap: wrap; }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px 9px 16px;
  background: var(--ink); color: var(--tile); border: 1px solid var(--ink); text-decoration: none;
  font: 600 20px/1.1 var(--sans); letter-spacing: -.01em; transition: background-color 120ms, color 120ms; }
.store-mark { flex: none; width: 26px; height: 26px; fill: currentColor; }   /* the stores' marks, in the button's cream */
.store-words { display: flex; flex-direction: column; }
.store-words span { font-size: 15px; font-weight: 500; letter-spacing: 0; color: #d9cdbf; }   /* 10:1 on espresso */
.store:hover { background: var(--cherry); border-color: var(--cherry); }
.store:hover .store-words span { color: var(--tile); }

/* the app's screens: the screenshot inside an espresso phone body, so the app's cream never runs into
   the page's cream. They move (page.js): the hero phones float and change screens, sliding up as if
   scrolled. The feature phones play screen recordings of the app (video/); with reduced motion they show their first frame and stay still. */
.phone { margin: 0; padding: 6px; background: var(--ink); border-radius: 26px; }
.screen { position: relative; overflow: hidden; border-radius: 20px; aspect-ratio: 720 / 1560; background: var(--tile); }
.screen img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; transform: translateY(100%);
  transition: transform 900ms cubic-bezier(.2, .8, .2, 1); }
.screen img.on { transform: none; z-index: 1; }   /* the screen showing; the next comes up from below */
.screen img.gone { transform: translateY(-35%); }      /* the one before, pushed up behind it */
.phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.phones .phone { animation: float 6s ease-in-out infinite alternate; }
.phones .phone:nth-child(1) { --lift: 0px; animation-delay: -1s; }
.phones .phone:nth-child(2) { --lift: -24px; animation-delay: -3s; }
.phones .phone:nth-child(3) { --lift: 0px; animation-delay: -5s; }
@keyframes float { from { transform: translateY(var(--lift, 0px)); } to { transform: translateY(calc(var(--lift, 0px) - 10px)); } }
@media (max-width: 960px) { .phones { max-width: 560px; } .phones .phone:nth-child(2) { --lift: 0px; } }
@media (max-width: 560px) {
  .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .phones .phone:nth-child(3) { display: none; }
  .phone { padding: 5px; border-radius: 20px; }
  .screen { border-radius: 15px; }
}
.screen video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) {
  .phones .phone { animation: none; transform: translateY(var(--lift, 0px)); }
  .screen img { transition: none; }
}

/* blocks: a full ink rule above each section */
.block { padding: 96px 0 0; }
.block > h2, .pair h2, .feature h2 { font-size: 32px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 20px; }
.block > h2, .pair { padding-top: 18px; border-top: 1px solid var(--text); }
.block p { margin: 0 0 14px; color: var(--text); max-width: 36em; }
.block p:last-child { margin-bottom: 0; }

/* the timer: words, and a screen recording of the app's brew timer in a phone beside them */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.pair.timer { grid-template-columns: minmax(0, 1fr) 220px; }
.timer-phone { margin: 0; }
.timer-phone figcaption { margin-top: 12px; font: 400 15px/1.4 var(--sans); color: var(--muted); }
@media (max-width: 860px) { .pair, .pair.timer { grid-template-columns: minmax(0, 1fr); gap: 28px; } .timer-phone { max-width: 220px; } }

/* features: two to a row, each a small phone beside its words; stacked on narrow screens */
.features { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 56px; padding: 18px 0 0; margin-top: 96px; border-top: 1px solid var(--text); }
.feature { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; padding: 28px 0 40px; align-items: start; }
.feature + .feature + .feature { border-top: 1px solid var(--line); }
.feature h2 { font-size: 26px; margin-bottom: 12px; }
.feature p { font-size: 18px; }
@media (max-width: 1000px) {
  .features { grid-template-columns: minmax(0, 1fr); }
  .feature + .feature { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .feature { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }
  .feature h2 { font-size: 22px; }
  .feature p { font-size: 18px; }
}

/* the spec list on the credits page */
.spec { margin: 0; border-top: 1px solid var(--line); }
.spec div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-size: 18px; color: var(--muted); }
.spec dd { margin: 0; font-size: 18px; text-align: right; }

/* footer and band */
.site-foot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; padding: 48px 0 32px;
  margin-top: 112px; border-top: 1px solid var(--line); font-size: 16px; color: var(--muted); }
.foot-label { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.foot-contact { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 4px 16px; }
.foot-contact .foot-label { flex-basis: 100%; }
.foot-mail { font-size: clamp(22px, 2.6vw, 32px); font-weight: 600; letter-spacing: -.01em; color: var(--text);
  text-decoration: none; overflow-wrap: anywhere; min-height: 44px; display: inline-flex; align-items: center; }
.foot-mail:hover { text-decoration: underline; text-underline-offset: .15em; }
.copy { min-height: 44px; padding: 0 14px; font: 500 15px/1 var(--sans); color: var(--muted); background: none;
  border: 1px solid var(--line); cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--text); }
.foot-nav { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 48px; align-content: start; }   /* the links two to a row */
.foot-nav .foot-label { grid-column: 1 / -1; }
.foot-nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--text); text-decoration: none; font-size: 17px; }
.foot-nav a:hover, .foot-meta a:hover { text-decoration: underline; text-underline-offset: .2em; }
.foot-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-top: 20px; border-top: 1px solid var(--line); }
.foot-meta a { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; margin: -12px 0; }
@media (max-width: 720px) {
  .site-foot { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 40px; margin-top: 80px; }
  .foot-meta { flex-direction: column; }
}
.band { height: 40px; background: var(--text); }
/* the desk of Kiris, the Kybos Labs mascot, above the band (desk.js, copied from the Kybos site) */
.desk { position: relative; z-index: 1; }
.desk-art { display: block; width: 100%; height: 220px; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: manipulation; }
@media (max-width: 720px) { .desk-art { height: 212px; } }

/* credits page */
.credits { padding: 32px 0 0; max-width: 46em; }
.credits h1 { font-size: 48px; line-height: 1.05; letter-spacing: -.02em; margin: 0 0 12px; }
.credits .lede { color: var(--text); margin: 0 0 40px; }
.credits .spec dd a { color: var(--text); display: inline-block; padding: 10px 0; margin: -10px 0; }
@media (max-width: 720px) { .credits h1 { font-size: 36px; } }
