/* ==========================================================================
   The notebook frame of jasperhaynes.com ("Field notebook"), for flights.jasperhaynes.com.
   A selective port of the main site's shared/styles/site.css (JasperHaynes repo, origin/main):
   only the rules this site needs, with the main class names and values, so the bar, buttons,
   panels, labels and footer look the same as on jasperhaynes.com.
   Colours come only from /notebook/tokens.css (vendored, never edited here).
   Left out on purpose, because this site uses the same class names for other things:
   .links (check results), .checks, .faq, .table-wrap, .meter, .map and a bare .small
   (only the compound .btn.small is ported). Everything that belongs to the tracker itself
   (status plate, count, board, map, menu layout) is in /style.css, which loads after this file.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
/* The ground colour lives on html, never on body: the paper grain sits on body::before. */
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Paper grain. Fixed and behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.18; }
::selection { background: var(--pen-wash); color: var(--ink); }

/* Monospace labels: kinds, times, crumbs, small states. */
.label, .crumbs {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
}
.label { color: var(--muted); }
.label b, .label strong { color: var(--pen); font-weight: 500; }
.crumbs { color: var(--muted); margin: 0 0 20px; }
.crumbs a { color: inherit; text-decoration: underline; text-decoration-color: var(--pen); text-underline-offset: 3px; }
.lede { font-size: 20px; color: var(--muted); margin: 16px 0 0; max-width: 34em; }

/* Page heads: the h1 gets a hand-drawn wavy pen underline (a mask on a pen-coloured block).
   .recap-title is this site's subpage h1. */
.page-head h1::after, .recap-title::after {
  content: "";
  display: block;
  width: 132px;
  height: 10px;
  margin-top: 18px;
  background: var(--pen);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M3 7C30 2 58 11 98 6s70-4 99 1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M3 7C30 2 58 11 98 6s70-4 99 1' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}
/* A rough ruled line between parts of a page. */
.rough {
  height: 8px;
  border: 0;
  margin: 0;
  background: var(--ink);
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 8' preserveAspectRatio='none'%3E%3Cpath d='M2 4c120-3 210 3 340 0s250-2 380 1 300-3 476 0' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 8' preserveAspectRatio='none'%3E%3Cpath d='M2 4c120-3 210 3 340 0s250-2 380 1 300-3 476 0' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}

/* ---------- Band and navigation ---------- */
/* No colour block: the bar sits on the paper and ends with a ruled ink line. */
.band { position: relative; background: none; border-bottom: 1.5px solid var(--ink); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 600 17px/1 var(--display);
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.logo::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pen);
  margin-right: 9px;
}
.nav-end { display: flex; align-items: center; gap: 10px; }

/* Round icon button (the theme switch). 38px to see, 44px to tap. */
.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  font: inherit;
  padding: 0;
  margin: 0;
}
.icon-btn::after { content: ""; position: absolute; inset: -4px; border-radius: 999px; }
.icon-btn:hover { background: var(--glass); }
.icon-btn svg { width: 18px; height: 18px; }
/* Shows the current theme: sun in light, moon in dark. */
.theme-switch .icon-sun { display: block; }
.theme-switch .icon-moon { display: none; }
[data-theme="dark"] .theme-switch .icon-sun { display: none; }
[data-theme="dark"] .theme-switch .icon-moon { display: block; }

/* The Menu pill and its panel (layout of this site's panel is in /style.css). */
.menu summary {
  position: relative;
  list-style: none;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink);
  user-select: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; position: absolute; inset: -4px; border-radius: 999px; }
.menu summary:hover, .menu[open] > summary { background: var(--pen-wash); }
.menu-panel { background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 8px; box-shadow: var(--shadow-lg); }

/* ---------- Buttons: pen-filled or outlined, with a hard offset shadow that presses in ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font: 500 16px/1 var(--body);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn.primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); box-shadow: var(--btn-primary-shadow); }
.btn.primary:hover { background: var(--btn-primary-hover); transform: translate(1px, 1px); box-shadow: 1px 2px 0 var(--ink); }
[data-theme="dark"] .btn.primary { border-color: transparent; }
/* Main uses a 1px 2px black shadow here; the smallest dark token shadow is the closest without a literal. */
[data-theme="dark"] .btn.primary:hover { box-shadow: var(--shadow-sm); }
.btn.soft { background: transparent; color: var(--ink); }
.btn.soft:hover { background: var(--pen-wash); }
.btn.small { height: 36px; padding: 0 16px; font: 500 13px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

/* ---------- Cards and panels: paper slips with a fine edge ---------- */
.panel { display: block; background: var(--card); border: 1.5px solid var(--rule); border-radius: 8px; padding: 28px; box-shadow: none; }
.panel.tint { background: var(--tint); border: 1.5px dashed var(--rule); }
.panel > p { color: var(--muted); margin-top: 8px; }
a.panel { color: inherit; text-decoration: none; transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s; }
a.panel:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); border-color: var(--ink); }

/* ---------- Fields ---------- */
.field { display: block; }
.field input, .field textarea, .field select {
  width: 100%;
  font: 16px var(--body);
  color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
}

/* ---------- Footer: a ruled ink line, then one mono line ---------- */
.footer { border-top: 1.5px solid var(--ink); padding: 28px 0 40px; color: var(--muted); font: 400 12.5px/1.6 var(--mono); letter-spacing: 0.03em; }
.footer ul { display: flex; gap: 8px 20px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.footer a { color: inherit; text-decoration: underline; text-decoration-color: var(--pen); text-underline-offset: 3px; }

/* ---------- Not found ---------- */
.lost { padding: 56px 0 120px; max-width: 720px; }
.lost h1 { font: var(--h-weight) clamp(88px, 16vw, 160px)/0.95 var(--display); letter-spacing: var(--h-track); margin: 0; }
.lost h2 { margin-top: 12px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- The pen picker (/notebook/accent.js) ---------- */
/* One pill as on the main site: the mono label, then the six pens. Each pen is a 22px dot inside a
   44px tap target (main's dots are 22px with a 40px target). On this site the pill is part of the
   page at every width, centred just above the footer (accent.js puts it there), so it never floats
   over the text column. */
.pen-picker {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 28px;
  padding: 0 6px 0 16px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}
.pen-label { margin-right: 6px; font: 400 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pen {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.pen::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pen);
  transition: transform 0.12s;
}
.pen[aria-pressed="true"]::before { outline: 2px solid var(--ink); outline-offset: 2px; }
.pen:hover::before { transform: scale(1.12); }
.pen:focus-visible { outline-offset: -2px; border-radius: 50%; }

@media (prefers-reduced-motion: reduce) {
  .btn, .pen::before, a.panel { transition: none; }
  .btn.primary:hover, a.panel:hover, .pen:hover::before { transform: none; }
}

@media (max-width: 860px) {
  /* On the phone the label gets its own row above the six pens. */
  .pen-picker { width: auto; max-width: calc(6 * 44px + 15px); padding: 8px 6px 4px; border-radius: 14px; }
  .pen-label { flex-basis: 100%; margin: 0; padding-top: 4px; text-align: center; }
  .page-head h1::after, .recap-title::after { width: 96px; margin-top: 14px; }
  .panel { padding: 22px; }
  .lost { padding: 32px 0 72px; }
}

@media print {
  .pen-picker, body::before { display: none; }
}
