/* The site's one style sheet. A naturalist's notebook about a small fox: paper, ink, the amber of its fur and the green
   of its jacket. Only system fonts (nothing is loaded from anywhere else): Apple's rounded face for names, as the app
   uses for the pet's name, a serif for the notes, a monospace for what the scene reports. */

:root {
  --paper: #eeeae1;
  --paper-2: #e6e0d3;
  --card: #f8f5ee;
  --ink: #2b2118;
  --ink-2: #6d5f50;
  --rule: #cfc6b3;
  --amber: #c96a12;
  --amber-soft: #f0c08a;
  --green: #4a7a3c;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 6vw, 88px);
  --bar: 36px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1611;
    --paper-2: #231c15;
    --card: #2b2118;
    --ink: #f2eadd;
    --ink-2: #b5a693;
    --rule: #3d3126;
    --amber: #f0963c;
    --amber-soft: #6b4520;
    --green: #8dba74;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.55 var(--serif);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 24px);
}

body {
  margin: 0;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* The fox mark, tinted by the text colour: the menu bar item of the app, drawn here from the same file */
.mark {
  display: inline-block;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: url("fox-mark.svg") center / contain no-repeat;
  mask: url("fox-mark.svg") center / contain no-repeat;
}

/* ---- the bar: the one piece of chrome, where the Mac keeps its menu bar ---- */
.bar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  font: 600 13px/1 var(--round);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}

.bar-name {
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.bar-note {
  color: var(--ink-2);
  font-weight: 500;
}

.bar-space {
  flex: 1;
}

.bar-count {
  font: 500 12px/1 var(--mono);
  color: var(--ink-2);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.bar-count.bump {
  animation: bump 0.5s ease-out;
}

@keyframes bump {
  30% {
    color: var(--green);
    transform: translateY(-2px);
  }
}

.lang {
  display: inline-flex;
  gap: 2px;
}

.lang button {
  border: 0;
  background: none;
  padding: 5px 6px;
  border-radius: 6px;
  font: 600 12px/1 var(--round);
  color: var(--ink-2);
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}

.bar-mark {
  border: 0;
  background: none;
  width: 30px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 18px;
  cursor: pointer;
}

.bar-mark:hover,
.bar-mark[aria-expanded="true"] {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

/* ---- the menu: the app's menu bar panel, with the parts that mean something on a page ---- */
.menu {
  position: fixed;
  inset: calc(var(--bar) + 6px) max(10px, env(safe-area-inset-right)) auto auto;
  margin: 0;
  width: 272px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--ink);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 18px 50px -12px rgb(30 20 10 / 0.35), 0 2px 6px rgb(30 20 10 / 0.1);
  font: 14px/1.3 var(--round);
}

.menu-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.menu-portrait {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #fff;
  background: linear-gradient(160deg, #eea04f, #c96a12);
}

.menu-who {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.menu-who strong {
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34b455;
}

.dot[data-state="asleep"] {
  background: var(--amber);
}

.dot[data-state="hidden"],
.dot[data-state="away"] {
  background: var(--ink-2);
}

.menu-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tile {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 6px 9px;
  display: grid;
  justify-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  font: 600 12px/1.1 var(--round);
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}

.tile:hover {
  background: color-mix(in srgb, var(--ink) 11%, transparent);
  transform: translateY(-1px);
}

.tile:active {
  transform: scale(0.97);
}

.tile[aria-pressed="true"] {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 16%, transparent);
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
}

.tile-glyph {
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

.tile-glyph[data-glyph="hide"] {
  -webkit-mask-image: url("glyph-hide.svg");
  mask-image: url("glyph-hide.svg");
}

.tile-glyph[data-glyph="call"] {
  -webkit-mask-image: url("glyph-call.svg");
  mask-image: url("glyph-call.svg");
}

.menu-label {
  margin: 14px 0 6px;
  font: 600 11px/1 var(--round);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.menu-note {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

.ruler {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  font: 500 12px/1 var(--round);
}

.ruler button {
  border: 0;
  background: none;
  border-radius: 10px;
  padding: 8px 4px 7px;
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 5px;
  min-height: 54px;
  color: var(--ink-2);
  cursor: pointer;
}

.ruler button .mark {
  font-size: 15px;
}

.ruler button[data-size="normal"] .mark {
  font-size: 20px;
}

.ruler button[data-size="large"] .mark {
  font-size: 26px;
}

.ruler button[aria-pressed="true"] {
  color: var(--amber);
  font-weight: 700;
  background: color-mix(in srgb, var(--amber) 16%, transparent);
}

/* ---- the page ---- */
main {
  padding: 0 var(--gutter);
}

.kicker {
  margin: 0 0 18px;
  font: 500 12px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px 2px;
  border: 1px solid currentColor;
  border-radius: 99px;
  color: var(--amber);
  letter-spacing: 0.06em;
}

h1,
h2,
h3 {
  font-family: var(--round);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5.2vw, 4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 16ch;
}

h1 .who {
  color: var(--amber);
}

h2 {
  font-size: clamp(2rem, 3.2vw, 2.55rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.lead {
  margin: 22px 0 0;
  max-width: 34em;
  font-size: clamp(1.05rem, 1.3vw, 1.1rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.hero {
  min-height: 100svh;
  padding: calc(var(--bar) + clamp(40px, 9vh, 110px)) 0 clamp(190px, 34vh, 320px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.dare {
  margin: clamp(28px, 5vh, 56px) 0 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font: 700 clamp(1.3rem, 1.7vw, 1.4rem)/1.1 var(--round);
  color: var(--amber);
}

.arrow {
  width: clamp(64px, 8vw, 110px);
  margin-top: 0.35em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.readout {
  margin: 26px 0 0;
  min-height: 1.4em;
  font: 500 13px/1.4 var(--mono);
  color: var(--ink-2);
}

.band {
  padding: clamp(64px, 11vh, 130px) 0;
  border-top: 1px solid var(--rule);
}

/* ---- first contact ---- */
.tasks {
  list-style: none;
  margin: clamp(32px, 5vh, 56px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 0 clamp(24px, 4vw, 56px);
  counter-reset: task;
  max-width: 1100px;
}

.tasks li {
  counter-increment: task;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 12px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.tasks li::before {
  content: counter(task);
  grid-row: span 2;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 13px/1 var(--mono);
  color: var(--ink-2);
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}

.tasks li.done::before {
  content: "✓";
  background: var(--green);
  border-color: var(--green);
  color: var(--paper);
  transform: rotate(-8deg) scale(1.08);
}

.tasks strong {
  font: 700 1.1rem/1.25 var(--round);
}

.tasks span {
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.4;
}

.tasks li.done strong {
  color: var(--green);
}

/* ---- field notes ---- */
.tally {
  margin: 26px 0 0;
  font: 500 13px/1.4 var(--mono);
  color: var(--ink-2);
}

.chapter {
  margin-top: clamp(40px, 7vh, 72px);
}

.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.chapter-head h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.chapter-head span {
  font: 500 12px/1 var(--mono);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2 340px;
  column-gap: clamp(28px, 5vw, 72px);
}

.entry {
  break-inside: avoid;
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 0 10px;
  align-items: start;
  padding: 12px 0 13px;
  border-bottom: 1px solid var(--rule);
}

.entry-no {
  padding-top: 4px;
  font: 500 12px/1 var(--mono);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.entry-name {
  font: 700 1.05rem/1.25 var(--round);
}

.entry-note {
  display: block;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.4;
  font-style: italic;
}

.entry.seen .entry-no {
  color: var(--green);
}

.entry.seen .entry-name::after {
  content: "✓";
  margin-left: 7px;
  color: var(--green);
  font-size: 0.85em;
}

.entry.fresh {
  animation: fresh 1.6s ease-out;
}

@keyframes fresh {
  0% {
    background: color-mix(in srgb, var(--green) 26%, transparent);
  }

  100% {
    background: transparent;
  }
}

.play {
  align-self: center;
  border: 1.5px solid var(--rule);
  border-radius: 99px;
  background: none;
  padding: 6px 12px 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 12px/1 var(--round);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.play::before {
  content: "";
  border-left: 8px solid currentColor;
  border-block: 5px solid transparent;
}

.play:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.entry.playing .play {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--paper);
}

.entry::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--amber);
}

.entry.playing::after {
  animation: run var(--seconds, 3s) linear forwards;
}

@keyframes run {
  to {
    width: 100%;
  }
}

/* ---- its own day ---- */
.habits {
  margin-top: clamp(32px, 5vh, 56px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(28px, 4vw, 48px) clamp(28px, 5vw, 72px);
  max-width: 1100px;
}

.habits article {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: start;
}

.habits h3 {
  font-size: 1.25rem;
}

.habits p {
  margin: 0;
  max-width: 30em;
}

.habits .ruler {
  width: min(100%, 250px);
  margin-top: 4px;
}

.do {
  margin-top: 6px;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  background: none;
  padding: 9px 18px 8px;
  font: 700 0.9rem/1 var(--round);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.do:hover {
  background: var(--ink);
  color: var(--paper);
}

.do:active {
  transform: scale(0.97);
}

.name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.name input {
  width: min(100%, 190px);
  padding: 8px 12px 7px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  font: 600 0.95rem/1.2 var(--round);
}

.name .do {
  margin-top: 0;
}

/* ---- together ---- */
.pair {
  margin-top: clamp(28px, 5vh, 48px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(24px, 5vw, 72px);
  max-width: 1100px;
}

.pair-text p {
  margin: 0 0 1em;
  max-width: 32em;
}

.facts,
.nevers {
  list-style: none;
  margin: 0;
  padding: 0;
}

.facts li {
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  font: 600 1rem/1.4 var(--round);
}

.facts li:last-child {
  border-bottom: 1px solid var(--rule);
}

/* ---- what it never does ---- */
.nevers {
  margin-top: 16px;
  max-width: 900px;
}

.nevers li {
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  font: 700 clamp(1.15rem, 2.2vw, 1.6rem)/1.25 var(--round);
  text-wrap: balance;
}

.nevers li:last-child {
  border-bottom: 1px solid var(--rule);
}

.nevers small {
  display: block;
  margin-top: 6px;
  max-width: 36em;
  font: italic 400 0.95rem/1.45 var(--serif);
  color: var(--ink-2);
}

.aside {
  margin: 28px 0 0;
  max-width: 36em;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* ---- the end: room for the fox to stand under the last line ---- */
.end {
  padding: clamp(48px, 8vh, 90px) var(--gutter) clamp(240px, 44vh, 420px);
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}

.end p {
  margin: 0;
  font: 700 clamp(1.2rem, 2.4vw, 1.8rem)/1.2 var(--round);
}

.end .fine {
  margin-top: 14px;
  font: 500 12px/1.4 var(--mono);
  color: var(--ink-2);
}

/* ---- what the scene just reported: new sightings, bottom left ---- */
.log {
  position: fixed;
  z-index: 25;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  gap: 6px;
  justify-items: start;
  pointer-events: none;
}

.log p {
  margin: 0;
  padding: 8px 12px 7px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font: 600 13px/1.2 var(--round);
  box-shadow: 0 6px 18px -6px rgb(30 20 10 / 0.4);
  animation: note 4.2s ease forwards;
}

.log p.felt {
  background: color-mix(in srgb, var(--card) 94%, transparent);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  font: 500 12px/1.2 var(--mono);
  box-shadow: none;
  animation-duration: 2.6s;
}

.log p b {
  color: var(--amber-soft);
  font-weight: 700;
}

@keyframes note {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  8%,
  86% {
    opacity: 1;
    transform: none;
  }

  100% {
    opacity: 0;
  }
}

/* ---- the pet's window: a small box that follows the fox and takes the pointer only over its body ---- */
.pet-window {
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.pet-window[data-ready] {
  opacity: 1;
}

.pet-window.taking {
  pointer-events: auto;
  cursor: grab;
}

.pet-window canvas {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
}

.noscript {
  margin: 0;
  padding: 16px var(--gutter);
  background: var(--ink);
  color: var(--paper);
  font: 600 14px/1.4 var(--round);
}

@media (max-width: 620px) {
  html {
    font-size: 17px;
  }

  .bar-note {
    display: none;
  }

  .entry {
    grid-template-columns: 26px 1fr auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .log p,
  .entry.fresh,
  .bar-count.bump {
    animation-duration: 0.01s;
  }

  .log p {
    animation: none;
  }
}

/* ---- the two legal pages (privacy.html, terms.html): plain reading, no scene ---- */
.doc {
  max-width: calc(38em + 2 * var(--gutter));
  padding-top: calc(var(--bar) + clamp(40px, 9vh, 96px));
  padding-bottom: clamp(48px, 8vh, 90px);
}

.doc h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
  max-width: none;
}

.doc .kicker {
  margin: 18px 0 0;
}

.doc section {
  margin-top: clamp(36px, 6vh, 56px);
}

.doc h2 {
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: none;
}

.doc section p {
  margin: 12px 0 0;
  text-wrap: pretty;
}

/* no fox stands under these pages, so the end needs no room for one */
.doc-end {
  padding-bottom: clamp(48px, 8vh, 90px);
}

.end .links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
