/* ==========================================================================
   Simula: shared stylesheet
   One stylesheet for every page, in this order:
   1. Design tokens (light, then dark)   2. Base and reset   3. Typography
   4. Layout helpers   5. Buttons and links   6. Cards, notes, chips
   7. Forms   8. Header, navigation, theme switch   9. Footer
   10. Page sections   11. Feature UI   12. Resume sheet   13. Motion
   Mobile-first: base styles are for phones; @media (min-width) adds more.
   ========================================================================== */


/* 1. DESIGN TOKENS ---------------------------------------------------------
   Every color, font, and size is a custom property, so the whole theme
   lives here. The brand is monochrome: ink on white in light mode, and the
   same roles flipped in dark mode. Hierarchy comes from contrast, weight,
   size and spacing, never from extra colors. */
:root {
  /* Seven color tokens (light). Contrast ratios are against --bg. */
  --bg: #FFFFFF;          /* page background */
  --surface: #F4F4F5;     /* soft fills: sections, inputs, chips */
  --line: #E4E4E7;        /* 1px borders, dividers, meter tracks */
  --muted: #A1A1AA;       /* decorative only (icons, placeholder bars), never text */
  --text-muted: #52525B;  /* secondary text, 7.7:1 */
  --ink: #0A0A0A;         /* text, headings, primary buttons, meter fills, 19.8:1 */
  --on-ink: #FFFFFF;      /* text and icons placed on --ink */

  /* Checklist tick, drawn in --on-ink. An image can't read CSS variables,
     so each theme block carries its own copy. */
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.75 2.75L12 5.5' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* The one exception: form errors (always paired with an icon or words) */
  --error: #B91C1C;       /* 6.5:1 on white */

  /* Paper: the resume preview is a printed page, so it never changes theme */
  --paper: #FFFFFF;
  --paper-ink: #0A0A0A;
  --paper-text-muted: #404040; /* neutral gray, so the page stays pure black and white */

  /* Header glass: the page color, slightly see-through */
  --header-bg: color-mix(in srgb, var(--bg) 86%, transparent);

  /* Fonts: Google Fonts first, then system fonts for offline use */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Type sizes (clamp grows with the screen, between a min and a max) */
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-h3: 1.25rem;
  --text-h2: clamp(1.5rem, 3vw, 2rem);
  --text-h1: clamp(2.125rem, 5vw, 3.25rem);

  /* Spacing scale (4px steps) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Rounded corners: one scale used everywhere */
  --radius-sm: 8px;      /* chips, checkboxes */
  --radius-md: 12px;     /* inputs, small cards */
  --radius-lg: 16px;     /* cards */
  --radius-xl: 24px;     /* sections, large panels, flashcards */
  --radius-2xl: 32px;    /* hero and illustration panels */
  --radius-pill: 999px;  /* buttons, pills, tags, meters */

  /* One very soft shadow, only for things that float (menus) */
  --shadow-float: 0 12px 32px -12px rgb(0 0 0 / 0.18);

  /* Motion: short and calm */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 180ms;

  --max-width: 72rem;
  color-scheme: light dark;
}

/* Dark theme: used when the visitor picks it, or when their device is dark
   and they haven't picked anything. Same roles, flipped values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0A;
    --surface: #18181B;
    --line: #27272A;
    --muted: #52525B;
    --text-muted: #A1A1AA;  /* 7.7:1 on --bg */
    --ink: #FAFAFA;
    --on-ink: #0A0A0A;
    --error: #F87171;       /* 7.2:1 on --bg */
    --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.75 2.75L12 5.5' fill='none' stroke='%230A0A0A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --shadow-float: 0 12px 32px -12px rgb(0 0 0 / 0.7);
  }
}

:root[data-theme="dark"] {
  --bg: #0A0A0A;
  --surface: #18181B;
  --line: #27272A;
  --muted: #52525B;
  --text-muted: #A1A1AA;
  --ink: #FAFAFA;
  --on-ink: #0A0A0A;
  --error: #F87171;
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.75 2.75L12 5.5' fill='none' stroke='%230A0A0A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --shadow-float: 0 12px 32px -12px rgb(0 0 0 / 0.7);
}

/* A visitor's manual choice also sets the browser's own controls (scrollbars) */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }


/* 2. BASE AND RESET --------------------------------------------------------
   Consistent box sizing, no default margins, readable defaults. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* anchored headings land below the sticky header */
  accent-color: var(--ink);
  caret-color: var(--ink);
  scrollbar-color: var(--muted) var(--bg);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* While the theme switches, colors fade instead of snapping */
.theme-changing,
.theme-changing *,
.theme-changing *::before,
.theme-changing *::after {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, fill 180ms ease, stroke 180ms ease !important;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background-color: var(--ink);
  color: var(--on-ink);
}

/* Keyboard focus: one clear ring, only for keyboard users (never on click) */
:focus {
  outline: none;
}

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

/* The hidden attribute always wins, even over display rules on .btn etc. */
[hidden] {
  display: none !important;
}

/* Hidden visually, still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: the first Tab stop on every page */
.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background-color: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration) var(--ease-out);
}

.skip-link:focus,
.skip-link:hover {
  transform: translateY(0);
  color: var(--on-ink);
}


/* 3. TYPOGRAPHY ------------------------------------------------------------
   IBM Plex Sans for everything; Plex Mono only for numbers and small labels. */
h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  letter-spacing: -0.035em;
}

h2 { font-size: var(--text-h2); letter-spacing: -0.025em; }
h3 { font-size: var(--text-h3); line-height: 1.3; letter-spacing: -0.01em; }
h4 { font-size: var(--text-base); letter-spacing: 0; }

p,
li,
dd {
  max-width: 66ch;
  text-wrap: pretty;
}

.lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.6;
}

small,
.small {
  font-size: var(--text-sm);
}

.muted {
  color: var(--text-muted);
}

.h3 {
  font-size: var(--text-h3);
}

/* Eyebrow: a small mono label above or beside content */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

mark {
  background-color: var(--ink);
  color: var(--on-ink);
  padding: 0.05em 0.35em;
  border-radius: 6px;
  font-weight: 600;
}

strong {
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--surface);
  border: 1px solid var(--line);
  padding: 0.05em 0.4em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

/* Stacked text blocks get even spacing */
.flow > * + * {
  margin-top: var(--space-4);
}


/* 4. LAYOUT HELPERS --------------------------------------------------------
   .container centers content; .section adds vertical room. */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.section {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.section-band {
  background-color: var(--surface);
}

.section-head {
  margin-bottom: var(--space-6);
}

.section-head > * + * {
  margin-top: var(--space-3);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.split {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 48rem) {
  .container { padding-inline: var(--space-6); }
  .section { padding-block: var(--space-9); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}


/* 5. BUTTONS AND LINKS -----------------------------------------------------
   Links are ink with a soft underline. Buttons are pills at least 44px tall:
   primary = ink fill, secondary = outline. Hover only changes fill or
   opacity; a press settles slightly. */
a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.2em;
  transition: color var(--duration) var(--ease-out), text-decoration-color var(--duration) var(--ease-out);
}

a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out),
              color var(--duration) var(--ease-out),
              opacity var(--duration) var(--ease-out),
              transform var(--duration) var(--ease-out);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--ink);
  color: var(--on-ink);
}

.btn-primary:hover {
  color: var(--on-ink);
  opacity: 0.86;
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  background-color: var(--surface);
  color: var(--ink);
}

.btn-quiet {
  background-color: transparent;
  color: var(--ink);
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.btn-quiet:hover {
  background-color: var(--surface);
  color: var(--ink);
}

/* Clear and Delete: an outline pill like .btn-secondary. They always ask
   before deleting, so they don't need a warning color. */
.btn-danger {
  background-color: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-danger:hover {
  background-color: var(--surface);
  color: var(--ink);
}

.btn-small {
  min-height: 40px;
  padding: 0.4rem 1rem;
  font-size: var(--text-sm);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}


/* 6. CARDS, NOTES, CHIPS ---------------------------------------------------
   Cards are quiet: a 1px line border and 16px corners, no shadow. Soft
   panels (notes, sections) use the --surface fill instead of a border. */
.card {
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card > * + * {
  margin-top: var(--space-3);
}

.card ul,
.card ol {
  padding-left: var(--space-5);
}

.card li + li {
  margin-top: var(--space-1);
}

/* Notes: soft gray panels for tips (white when they sit on a gray band) */
.section-band .note {
  background-color: var(--bg);
}

.note {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.note > * + * {
  margin-top: var(--space-1);
}

.note-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font-weight: 600;
}

.note-title svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.note-info {
  background-color: var(--surface);
}

.note-info .note-title {
  color: var(--ink);
}

/* Chips: small rounded labels */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.6;
}

/* Found: a solid ink pill. Missing: an outline pill with muted text. */
.chip-success {
  background-color: var(--ink);
  color: var(--on-ink);
}

.chip-danger {
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-muted);
}

.chip-gold {
  background-color: var(--surface);
  color: var(--ink);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

/* "Free under RA 11261" badge */
.badge-free {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-pill);
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--ink); /* an ink outline that doesn't change the size */
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

/* Check list: ink ticks drawn with CSS borders */
.check-list {
  padding: 0;
  list-style: none;
}

.card .check-list {
  padding-left: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.75rem;
}

.check-list li + li {
  margin-top: var(--space-2);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.4rem;
  width: 0.4rem;
  height: 0.75rem;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(40deg);
}

.article-list {
  padding-left: var(--space-5);
}

.article-list li + li {
  margin-top: var(--space-2);
}

/* Illustrations: each SVG draws its own rounded 32px panel, and there is a
   light and a dark file (see the <picture> tags), so no frame is needed */
.illus {
  justify-self: center;
  width: 100%;
  max-width: 22rem;
}

.illus img {
  width: 100%;
}

/* nav.js adds .theme-pending when a saved theme disagrees with the device:
   the <picture> has already chosen the device's file, so keep the
   illustration hidden for the moment it takes to swap to the right one */
html.theme-pending .illus img {
  visibility: hidden;
}


/* 7. FORMS -----------------------------------------------------------------
   Every input has a visible label above it; errors appear underneath. */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field + .field {
  margin-top: var(--space-4);
}

label,
.label {
  font-weight: 600;
  font-size: var(--text-sm);
}

.hint {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color var(--duration) var(--ease-out); /* the focus ring appears instantly */
}

/* Drop-down menu items follow the theme too */
option,
optgroup {
  background-color: var(--bg);
  color: var(--ink);
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--muted);
}

/* Fields inside a gray panel use the page color so they still stand out */
.entry :is(input, textarea, select),
.tool-panel :is(input, textarea, select) {
  background-color: var(--bg);
}

/* Focus on fields: the border turns ink, plus the shared 2px ring */
input:not([type="checkbox"]):not([type="radio"]):focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--ink);
}

[aria-invalid="true"] {
  border-color: var(--error);
}

/* Errors: the one non-gray color, always with a warning icon and words */
.error-text {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--error);
  font-size: var(--text-sm);
  font-weight: 600;
}

.error-text::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.7rem;
  line-height: 1;
}

.error-text:empty {
  display: none;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

/* Custom checkbox: a rounded 8px box; checked = ink fill with a tick.
   It is still a real <input>, so keyboard and screen readers work. */
.check-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0.1rem 0 0;
  flex-shrink: 0;
  background-color: var(--bg);
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);
}

.check-row input[type="checkbox"]:hover {
  border-color: var(--ink);
}

/* Ticking a box gives it a small "pop" (not on page load) */
.check-row input[type="checkbox"].just-changed:checked {
  animation: pop 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.check-row input[type="checkbox"]:checked {
  background-color: var(--ink);
  background-image: var(--check-mark);
  background-size: 100% 100%;
  border-color: var(--ink);
}

.success-message {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.success-message[hidden] {
  display: none;
}

.success-message svg {
  flex-shrink: 0;
}


/* 8. HEADER, NAVIGATION, THEME SWITCH --------------------------------------
   A sticky glass bar: logo lockup, page links, the Build resume pill and
   the theme switch. The current page is ink with a small dot under it;
   other links are muted. Focus rings show only for the keyboard. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.brand:hover {
  color: var(--ink);
}

/* The mark is inline SVG painted with var(--ink) and var(--bg), so it
   inverts with the theme. It is never recolored or animated. */
.brand-mark {
  flex-shrink: 0;
}

/* Wordmark: lowercase "simula", Plex Sans SemiBold, tight tracking */
.wordmark {
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -0.045em;
  text-transform: lowercase;
}

/* Header call to action: shown once there is room for it */
.nav-cta {
  display: none;
}

@media (min-width: 30rem) {
  .nav-cta {
    display: inline-flex;
  }
}

/* Right side: theme switch and (on phones) the menu button */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Icon buttons in the header share one round shape */
.theme-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 40px;
  height: 40px;
  padding: 0 0.6rem;
  background-color: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.theme-toggle:hover,
.nav-toggle:hover {
  background-color: var(--surface);
}

.theme-toggle:active,
.nav-toggle:active {
  transform: scale(0.94);
}

/* Theme switch: the sun shows in dark mode (tap for light), the moon in light */
.theme-toggle {
  position: relative;
  width: 40px;
  padding: 0;
  overflow: hidden;
}

.theme-toggle svg {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  transition: transform var(--duration) var(--ease-out), opacity var(--duration) var(--ease-out);
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.theme-toggle[aria-pressed="true"] .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.theme-toggle[aria-pressed="true"] .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

/* Menu button: two lines that turn into a cross */
.nav-toggle {
  display: none; /* shown only when JavaScript is on (see .js rules below) */
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  font-weight: 600;
  font-size: var(--text-sm);
}

.nav-toggle-box {
  position: relative;
  width: 16px;
  height: 10px;
}

.nav-toggle-box span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background-color: currentColor;
  transition: transform var(--duration) var(--ease-out), top var(--duration) var(--ease-out);
}

.nav-toggle-box span:first-child { top: 0; }
.nav-toggle-box span:last-child { top: 8px; }

.nav-toggle.is-open .nav-toggle-box span:first-child {
  top: 4px;
  transform: rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-box span:last-child {
  top: 4px;
  transform: rotate(-45deg);
}

/* Navigation links (list items are never capped at the 66ch text width) */
.site-nav li {
  max-width: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: 0;
  list-style: none;
}

.site-nav a {
  position: relative;
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease-out), color var(--duration) var(--ease-out);
}

.site-nav a:hover {
  background-color: var(--surface);
  color: var(--ink);
}

/* Current page: ink text and one small ink dot under it (no underline) */
.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.1rem;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background-color: var(--ink);
}

/* Phones and tablets with JavaScript on: the links live in a rounded panel
   that floats under the header (the only element with a shadow) */
@media (max-width: 63.99rem) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: var(--space-4);
    right: var(--space-4);
    padding: var(--space-3);
    background-color: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    max-height: calc(100dvh - 6rem); /* short phones in landscape can scroll the list */
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out), visibility 0s linear var(--duration);
  }

  .js .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out), visibility 0s;
  }

  .js .site-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  .js .site-nav a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
  }

  /* In the panel the current page gets a soft fill; the dot moves left */
  .js .site-nav a[aria-current="page"] {
    background-color: var(--surface);
  }

  .js .site-nav a[aria-current="page"]::after {
    left: auto;
    right: 1rem;
    bottom: auto;
    top: 50%;
    margin: -2px 0 0;
  }

  /* While the panel is open the page behind it can't scroll, and it is
     frosted over so the menu clearly sits on top (a tap on it closes) */
  body.menu-open {
    overflow: hidden;
  }

  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 45; /* under the header (50), over the page */
    background-color: color-mix(in srgb, var(--bg) 55%, transparent);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: fade-in var(--duration) var(--ease-out);
  }
}

/* Without JavaScript the links simply wrap under the logo */
html:not(.js) .header-inner {
  flex-wrap: wrap;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

html:not(.js) .site-nav {
  order: 3;
  width: 100%;
}

html:not(.js) .theme-toggle {
  display: none;
}


/* 9. FOOTER ----------------------------------------------------------------
   Quiet footer with a top rule. */
.site-footer {
  border-top: 1px solid var(--line);
  padding-top: var(--space-7);
  padding-bottom: var(--space-6);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.footer-inner {
  display: grid;
  gap: var(--space-5);
}

.footer-brand > * + * {
  margin-top: var(--space-2);
}

.footer-brand .brand {
  font-size: 1.05rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-fine {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
}

@media (min-width: 48rem) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .footer-fine {
    grid-column: 1 / -1;
  }
}


/* 10. PAGE SECTIONS --------------------------------------------------------
   Blocks used on the content pages. */

/* Home hero: promise on the left, "What's inside" card on the right.
   It fills the first screen (below the sticky header), so nothing after it
   shows until the visitor scrolls. motion.js reveals those sections then. */
.hero {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 4.0625rem); /* header: 4rem + its 1px border */
  min-height: calc(100svh - 4.0625rem);
  padding-top: var(--space-7);
  padding-bottom: var(--space-8);
}

.hero-inner {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

.hero-copy > * + * {
  margin-top: var(--space-5);
}

.hero-copy h1 {
  max-width: 13ch;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero-copy .lead {
  max-width: 36rem;
}

.hero-note {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

@media (min-width: 60rem) {
  .hero {
    padding-top: var(--space-9);
    padding-bottom: var(--space-9);
  }

  .hero-inner {
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-8);
  }
}

/* "School work, rewritten": the hero demo (home.js plays it).
   A soft 32px panel holding a before line, an arrow, and the strong
   bullet whose four parts light up in order, matching the legend. */
.bullet-demo {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  background-color: var(--surface);
  border-radius: var(--radius-2xl);
}

@media (min-width: 30rem) {
  .bullet-demo {
    padding: var(--space-6);
  }
}

.demo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}

.demo-title {
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}

.demo-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.demo-before,
.demo-after {
  display: grid;
  gap: var(--space-1);
  transition: opacity var(--duration) var(--ease-out);
}

/* Small mono labels: "Before" and "After" */
.demo-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

#demo-weak {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}

.demo-after {
  padding: var(--space-4);
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

#demo-strong {
  font-size: var(--text-lg);
  line-height: 1.55;
}

.demo-arrow {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted);
  margin-left: var(--space-4);
}

/* Each part of the bullet gets an underline that draws in when it lights
   up. The underline is a background image, so it can grow from the left. */
.part {
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
  padding-bottom: 1px;
}

.bullet-demo.is-ready .part {
  background-size: 0% 2px;
  transition: background-size 420ms cubic-bezier(0.16, 1, 0.3, 1), background-color var(--duration) var(--ease-out);
}

.bullet-demo.is-ready .part.is-lit {
  background-size: 100% 2px;
}

/* Legend: four small pills; the lit one fills with ink */
.demo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.demo-legend li {
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  cursor: default;
  transition: background-color var(--duration) var(--ease-out), color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);
}

.demo-legend li.is-lit {
  border-color: var(--ink);
  color: var(--ink);
}

/* Hovering a legend item dims the other parts of the bullet */
.bullet-demo[data-spotlight] .part {
  transition: opacity var(--duration) var(--ease-out);
  opacity: 0.35;
}

.bullet-demo[data-spotlight="verb"] .part[data-part="verb"],
.bullet-demo[data-spotlight="what"] .part[data-part="what"],
.bullet-demo[data-spotlight="tool"] .part[data-part="tool"],
.bullet-demo[data-spotlight="result"] .part[data-part="result"] {
  opacity: 1;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.demo-link {
  font-weight: 600;
  font-size: var(--text-sm);
}

/* While "Show another" swaps the example, the text fades out and back */
.bullet-demo.is-swapping .demo-before,
.bullet-demo.is-swapping .demo-after {
  opacity: 0;
}

/* Inner-page intro: title and lead, with an illustration on wide screens */
.page-intro {
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
  border-bottom: 1px solid var(--line);
}

.page-intro .lead {
  margin-top: var(--space-3);
  max-width: 40rem;
}

.page-intro .btn-row,
.page-intro .small {
  margin-top: var(--space-5);
}

.page-intro-inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.page-intro-inner .illus {
  display: none;
}

@media (min-width: 56rem) {
  .page-intro {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }

  .page-intro-inner {
    grid-template-columns: 1.5fr 1fr;
  }

  .page-intro-inner .illus {
    display: block;
    justify-self: end;
  }
}

/* Problem: two side-by-side lists */
.compare-lists {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}

.compare-col {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
}

.compare-col h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-3);
}

.compare-col ul {
  padding-left: var(--space-5);
}

.compare-col li + li {
  margin-top: var(--space-2);
}

.compare-col-empty {
  border: 1px dashed var(--muted);
  color: var(--text-muted);
}

.compare-col-empty li {
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
}

.compare-col-full {
  background-color: var(--surface);
}

.compare-col-full li::marker {
  color: var(--ink);
}

@media (min-width: 36rem) {
  .compare-lists {
    grid-template-columns: 1fr 1fr;
  }
}

/* Journey: three numbered steps (the order matters, so numbers show) */
.journey {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  list-style: none;
}

.journey-step {
  position: relative;
  padding: var(--space-5);
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: background-color var(--duration) var(--ease-out);
}

.journey-step:hover {
  background-color: var(--surface);
}

.journey-step > * + * {
  margin-top: var(--space-3);
}

.journey-step h3 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.journey-step p {
  color: var(--text-muted);
}

/* The step's link covers the whole card */
.journey-step a {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
}

.journey-step a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.journey-extra {
  margin-top: var(--space-6);
  color: var(--text-muted);
}

@media (min-width: 56rem) {
  .journey {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tables scroll sideways inside their box on small screens */
.table-wrap {
  overflow-x: auto;
  padding: var(--space-1);
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

thead th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  font-weight: 600;
}

tbody tr {
  transition: background-color var(--duration) var(--ease-out);
}

tbody tr:hover {
  background-color: var(--surface);
}

.compare-table td:nth-child(2) {
  background-color: var(--surface);
}

/* Phones: each comparison row becomes a small stacked card, and each
   cell shows its column name from data-label */
@media (max-width: 39.99rem) {
  .compare-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .compare-table,
  .compare-table tbody,
  .compare-table tr,
  .compare-table th,
  .compare-table td {
    display: block;
  }

  .compare-table tr {
    padding: var(--space-3) var(--space-2);
    border-bottom: 1px solid var(--line);
  }

  .compare-table tbody tr:last-child {
    border-bottom: 0;
  }

  .compare-table th,
  .compare-table td {
    padding: var(--space-1) var(--space-2);
    border: 0;
  }

  .compare-table tbody th {
    font-weight: 600;
    font-size: var(--text-base);
  }

  .compare-table td:nth-child(2) {
    background-color: transparent;
  }

  .compare-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
  }
}

.yes {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--ink);
  font-weight: 600;
}

.yes svg {
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.table-source {
  margin-top: var(--space-3);
}

/* Closing call to action */
.cta-inner {
  max-width: 40rem;
  text-align: center;
}

.cta-inner > * + * {
  margin-top: var(--space-4);
}

.cta-inner p {
  margin-inline: auto;
  color: var(--text-muted);
}

.cta-inner .btn {
  margin-top: var(--space-5);
}

/* Guide layout: contents on the side, article on the right */
.guide-layout {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-7);
  padding-bottom: var(--space-8);
}

.toc {
  align-self: start;
  padding: var(--space-5);
  background-color: var(--surface);
  border-radius: var(--radius-lg);
}

.toc-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.toc ol {
  padding-left: var(--space-5);
  font-size: var(--text-sm);
}

.toc li + li {
  margin-top: var(--space-1);
}

.toc a {
  color: var(--text-muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.article > section + section {
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  border-top: 1px solid var(--line);
}

.article h2 {
  margin-bottom: var(--space-3);
}

.article > section > p + * {
  margin-top: var(--space-4);
}

.article ul,
.article ol {
  padding-left: var(--space-5);
}

.article li + li {
  margin-top: var(--space-2);
}

.article .note {
  margin-top: var(--space-5);
}

@media (min-width: 60rem) {
  .guide-layout {
    grid-template-columns: 14rem 1fr;
    gap: var(--space-8);
  }

  .toc {
    position: sticky;
    top: 5.5rem;
  }
}

/* Definition lists: term on the left, explanation on the right */
.section-list {
  display: grid;
  margin-top: var(--space-4);
}

.section-list > div {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  border-top: 1px solid var(--line);
}

.section-list > div:last-child {
  border-bottom: 1px solid var(--line);
}

.section-list dt {
  font-weight: 600;
}

.section-list dd {
  color: var(--text-muted);
}

@media (min-width: 40rem) {
  .section-list > div {
    grid-template-columns: 13rem 1fr;
    gap: var(--space-5);
  }
}

/* Dos and don'ts */
.do-dont {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.do-dont > div {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background-color: var(--bg);
  border: 1px solid var(--line);
}

.do-dont h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-size: var(--text-base);
}

.do-dont h3 svg {
  width: 1.25rem;
  height: 1.25rem;
}

.do-list h3 { color: var(--ink); }
.dont-list h3 { color: var(--ink); } /* the X icon and the word "Don't" carry the meaning */

@media (min-width: 48rem) {
  .do-dont {
    grid-template-columns: 1fr 1fr;
  }
}

/* Weak vs strong bullet pairs */
.bullet-pairs {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
}

.article .bullet-pairs {
  padding-left: 0;
}

.article .bullet-pairs li + li {
  margin-top: 0;
}

.bullet-pair {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg);
}

.bullet-pair p {
  max-width: none;
  padding: var(--space-3) var(--space-4);
}

.bullet-pair .weak {
  background-color: var(--surface);
  color: var(--text-muted);
}

.bullet-pair .strong {
  border-top: 1px solid var(--line);
}

.pair-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-1);
}

.weak .pair-label { color: var(--text-muted); }
.strong .pair-label { color: var(--ink); }

@media (min-width: 48rem) {
  .bullet-pair {
    grid-template-columns: 1fr 1.4fr;
  }

  .bullet-pair .strong {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

/* Cover letter: three numbered parts and a folded example */
.letter-steps li::marker {
  font-family: var(--font-mono);
}

.letter-sample {
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background-color: var(--surface);
  border-radius: var(--radius-lg);
}

.letter-sample summary {
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.letter-sample[open] summary {
  margin-bottom: var(--space-3);
}

.letter-sample p + p {
  margin-top: var(--space-3);
}

.letter-sample[open] > p {
  animation: fade-in 240ms var(--ease-out);
}

/* Formula chips */
.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
}

.formula .chip {
  font-size: var(--text-sm);
  padding: 0.3rem 0.8rem;
}

/* End-of-page next step */
.next-step {
  display: grid;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-7);
  padding: var(--space-6);
  background-color: var(--surface);
  border-radius: var(--radius-xl);
}

.next-step h2 {
  font-size: 1.375rem;
  margin-bottom: 0;
}

.next-step p {
  margin-top: var(--space-1);
  color: var(--text-muted);
}

@media (min-width: 48rem) {
  .next-step {
    grid-template-columns: 1fr auto;
  }
}

/* About: team */
.team-list {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  list-style: none;
}

.team-member {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.team-member h3 {
  font-size: var(--text-base);
}

.avatar {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-sm);
}

.team-role {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

@media (min-width: 48rem) {
  .team-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* About: "What Simula saves" list with the data buttons */
.data-card .btn-row {
  gap: var(--space-2);
}

.data-list {
  display: grid;
}

.data-list > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
}

.data-list dt {
  font-weight: 600;
}

.data-list dd {
  color: var(--text-muted);
}

.data-card [data-backup-status]:empty {
  display: none;
}

.source-card h3 {
  font-size: var(--text-base);
}

.source-card ul + h3 {
  margin-top: var(--space-5);
}

.source-card li {
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
}

.contact-form .btn {
  margin-top: var(--space-5);
  width: 100%;
}

.contact-form .success-message {
  margin-top: var(--space-4);
}


/* 11. FEATURE UI -----------------------------------------------------------
   Interactive parts: filter chips, flashcards, checklist, switch, builder. */

/* Filter chips: radio buttons styled as pills */
.filter-bar,
.template-switch {
  border: 0;
  padding: 0;
}

.filter-bar legend,
.template-switch legend {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background-color: var(--bg);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background-color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out), color var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

/* The real radio is invisible on top of the chip, so it stays keyboard-usable */
.filter-chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.filter-chip:hover {
  background-color: var(--surface);
}

.filter-chip:active {
  transform: scale(0.97);
}

.filter-chip:has(input:checked) {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.filter-chip:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Flashcards */
.practice {
  display: grid;
  gap: var(--space-5);
}

.practice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.flashcard {
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-5);
}

@media (min-width: 48rem) {
  .flashcard {
    padding: var(--space-7);
  }
}

.flashcard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* A new question slides in from the side it came from (interview.js) */
@keyframes from-next {
  from { opacity: 0; transform: translateX(16px); }
}

@keyframes from-prev {
  from { opacity: 0; transform: translateX(-16px); }
}

.flashcard-question.from-next { animation: from-next 280ms cubic-bezier(0.16, 1, 0.3, 1); }
.flashcard-question.from-prev { animation: from-prev 280ms cubic-bezier(0.16, 1, 0.3, 1); }

.flashcard-question {
  margin-top: var(--space-4);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.125rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* The revealed answer flips to ink, like the answer bubble in interview.svg */
.flashcard-answer {
  margin-top: var(--space-5);
  padding: var(--space-5);
  background-color: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-lg);
  transform-origin: top center;
  animation: unfold 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* The ink answer panel unfolds downward when revealed */
@keyframes unfold {
  from { opacity: 0; transform: translateY(-6px) scaleY(0.96); }
}

/* Labels inside the ink panel: --on-ink, slightly faded (still over 9:1) */
.flashcard-answer h3 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-ink);
  opacity: 0.75;
}

.flashcard-answer h3 + p {
  margin-top: var(--space-1);
}

.flashcard-answer p + h3 {
  margin-top: var(--space-4);
}

.flashcard-actions {
  margin-top: var(--space-6);
}

.flashcard-empty {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 1px dashed var(--muted);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
}

.flashcard-empty[hidden] {
  display: none;
}

.card-editor .field + .field {
  margin-top: var(--space-3);
}

.card-editor .btn-row {
  margin-top: var(--space-4);
}

.question-bank {
  padding: var(--space-4) var(--space-5);
  background-color: var(--surface);
  border-radius: var(--radius-lg);
}

.question-bank summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--radius-sm);
}

.question-bank ol {
  margin-top: var(--space-3);
  padding-left: var(--space-5);
}

.question-bank li + li {
  margin-top: var(--space-1);
}

.question-bank button {
  padding: var(--space-1) 0;
  background: none;
  border: 0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color var(--duration) var(--ease-out);
}

.question-bank button:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* STAR list and form */
.star-list {
  display: grid;
  gap: var(--space-2);
}

.star-list div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--surface);
  border-radius: var(--radius-md);
}

.star-list dt {
  font-weight: 600;
  color: var(--ink);
}

.star-list dd {
  color: var(--text-muted);
}

.star-form .field + .field {
  margin-top: var(--space-3);
}

.star-form .btn-row {
  margin-top: var(--space-4);
}

/* Online tips: numbered steps */
.tip-steps {
  display: grid;
  gap: var(--space-5);
  padding: 0;
  list-style: none;
  counter-reset: tip;
}

.tip-steps li {
  counter-increment: tip;
  position: relative;
  padding-left: 3rem;
}

.tip-steps li::before {
  content: counter(tip);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
}

.tip-steps h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.tip-steps p {
  color: var(--text-muted);
}

/* Online and technical prep: two columns of numbered tips */
.prep-grid {
  gap: var(--space-6);
}

.prep-grid h3 {
  margin-bottom: var(--space-4);
}

.prep-grid .tip-steps {
  gap: var(--space-4);
}

.prep-grid .tip-steps p {
  color: var(--ink);
}

.prep-grid .tip-steps strong {
  font-weight: 600;
}

/* Follow-up email templates with a Copy button */
.template-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.template-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.template-head h3 {
  font-size: var(--text-base);
}

.template-text {
  margin: 0;
  padding: var(--space-4);
  background-color: var(--surface);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Copy button: the copy icon swaps for a check mark once copied */
.copy-btn .icon-done {
  display: none;
}

.copy-btn.is-copied {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.copy-btn.is-copied .icon-copy {
  display: none;
}

.copy-btn.is-copied .icon-done {
  display: block;
  animation: pop 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

#copy-status {
  margin-top: var(--space-3);
}

/* Checklist page */
.checklist-layout {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 60rem) {
  .checklist-layout {
    grid-template-columns: 1fr 18rem;
    align-items: start;
  }

  .checklist-aside {
    position: sticky;
    top: 5.5rem;
  }
}

.checklist-aside h2 {
  margin-bottom: var(--space-2);
}

.checklist-aside li {
  font-size: var(--text-sm);
}

.progress-box {
  padding: var(--space-4) var(--space-5);
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-variant-numeric: tabular-nums;
}

.progress-text strong {
  font-weight: 600;
}

.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background-color: var(--ink);
  border-radius: inherit;
  transition: width var(--duration) var(--ease-out);
}

.checklist {
  display: grid;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.checklist-item {
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: border-color var(--duration) var(--ease-out), background-color var(--duration) var(--ease-out);
}

.checklist-item:hover {
  border-color: var(--muted);
}

/* Done items sink into a soft gray fill */

.checklist-item.is-done {
  background-color: var(--surface);
  border-color: transparent;
}

.checklist-item.is-done .item-name {
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--ink) 60%, transparent);
  text-decoration-thickness: 1.5px;
}

.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.item-name {
  font-weight: 600;
  line-height: 1.4;
}

.item-meta {
  margin-top: var(--space-1);
  margin-left: 2rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.item-details {
  margin-top: var(--space-2);
  margin-left: 2rem;
}

.item-details summary {
  display: inline-block;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.item-details summary::-webkit-details-marker {
  display: none;
}

.item-details summary::after {
  content: " +";
}

.item-details[open] summary::after {
  content: " −";
}

.item-details dl {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}

.item-details dt {
  font-weight: 600;
}

.item-details dd {
  color: var(--text-muted);
}

.item-details .label {
  margin-top: var(--space-3);
}

.item-details ol {
  padding-left: var(--space-5);
  font-size: var(--text-sm);
}

.item-details li + li {
  margin-top: var(--space-1);
}

.item-details p.small {
  margin-top: var(--space-2);
}

.ra-grid {
  align-items: start;
}

/* RA 11261 "who qualifies": four short conditions in a row */
.qualify {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.qualify-item {
  padding-top: var(--space-4);
  border-top: 2px solid var(--ink);
}

.qualify-item h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.qualify-item p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

@media (min-width: 40rem) {
  .qualify { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64rem) {
  .qualify { grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
}

.ra-note {
  margin-top: var(--space-5);
}

/* Toggle switch (a real checkbox underneath) */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 2.5rem;
  height: 1.5rem;
  margin: 0;
  cursor: pointer;
}

.switch-track {
  position: relative;
  width: 2.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background-color: var(--text-muted);
  transition: background-color var(--duration) var(--ease-out);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.5rem - 6px);
  height: calc(1.5rem - 6px);
  border-radius: 50%;
  background-color: var(--bg);
  transition: transform var(--duration) var(--ease-out);
}

.switch input:checked + .switch-track {
  background-color: var(--ink);
}

.switch input:checked + .switch-track::after {
  transform: translateX(1rem);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Builder page */
.builder-intro {
  padding-top: var(--space-6);
  padding-bottom: var(--space-5);
}

.builder-intro .lead {
  margin-top: var(--space-2);
}

.builder-intro-inner {
  display: grid;
  gap: var(--space-4);
  align-items: end;
}

/* "Saved only in this browser" note with the backup buttons */
.data-note {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  background-color: var(--surface);
  border-radius: var(--radius-lg);
}

.data-note .btn-row {
  gap: var(--space-2);
}

.data-note [data-backup-status]:empty {
  display: none;
}

@media (min-width: 56rem) {
  .builder-intro-inner {
    grid-template-columns: 1fr auto;
  }

  .data-note {
    max-width: 24rem;
  }
}

.builder-toolbar {
  position: sticky;
  top: 4rem;
  z-index: 40;
  background-color: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--space-2) var(--space-1);
}

.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}

.template-switch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.template-switch legend {
  float: left;
  margin: 0 var(--space-2) 0 0;
}

.toolbar-actions {
  gap: var(--space-2);
}

/* A small dot blinks once each time the draft saves */
.save-status.just-saved::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.5em;
  border-radius: 50%;
  background-color: var(--ink);
  vertical-align: middle;
  animation: pop 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.save-status {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  min-height: 1.5em;
}

.builder-layout {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-6);
  padding-bottom: var(--space-8);
}

@media (min-width: 64rem) {
  .builder-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: start;
  }

  .preview-pane {
    position: sticky;
    top: 9.25rem;
  }

  .preview-scroll {
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
  }

  .toolbar-actions {
    margin-left: auto;
  }
}

.form-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background-color: var(--bg);
  padding: var(--space-5);
}

.form-section + .form-section,
.form-section + .no-exp-note,
.no-exp-note + .form-section {
  margin-top: var(--space-4);
}

.form-section legend {
  float: left;
  width: 100%;
  margin-bottom: var(--space-4);
  font-weight: 600;
  font-size: var(--text-h3);
  letter-spacing: -0.01em;
}

.form-section legend + * {
  clear: both;
}

.form-section > .hint {
  margin-bottom: var(--space-3);
}

.field-grid {
  display: grid;
  gap: var(--space-4);
}

.field-grid .field + .field {
  margin-top: 0;
}

@media (min-width: 36rem) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* One entry inside a repeatable section (a project, an org, etc.) */
.entry {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
}

.entry + .entry {
  margin-top: var(--space-3);
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.entry-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.entry .field-grid + .field,
.entry > .field + .field {
  margin-top: var(--space-3);
}

.add-btn {
  margin-top: var(--space-3);
}

.entry-list:empty + .add-btn {
  margin-top: 0;
}

/* Tool panels: bullet helper and job-fit checker */
.tool-panel {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background-color: var(--surface);
  border-radius: var(--radius-xl);
}

.tool-panel > * + * {
  margin-top: var(--space-4);
}

.tool-panel h2 {
  font-size: 1.375rem;
}

.tool-panel .hint {
  margin-top: var(--space-1);
}

.bh-output {
  padding: var(--space-4);
  background-color: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.bh-sentence {
  margin-top: var(--space-1);
  font-size: var(--text-lg);
}

.bh-sentence.is-empty {
  color: var(--text-muted);
}

/* While "Checking…" runs, old results fade back */
.jf-results.is-loading {
  opacity: 0.4;
  transition: opacity var(--duration) var(--ease-out);
}

.jf-results > * + * {
  margin-top: var(--space-3);
}

.jf-results h3 {
  font-size: var(--text-base);
  margin-top: var(--space-5);
}

.jf-score {
  font-weight: 600;
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
}

.jf-score span {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  color: var(--ink);
}

.jf-meter {
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--line);
  overflow: hidden;
}

.jf-meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background-color: var(--ink);
  transition: width var(--duration) var(--ease-out);
}

.jf-tips {
  padding-left: var(--space-5);
}

.jf-tips li + li {
  margin-top: var(--space-2);
}

/* "See preview" pill: floats at the bottom on phones and tablets, where
   the preview is below the form; hidden once the two sit side by side */
.preview-jump {
  position: fixed;
  right: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 1.1rem;
  background-color: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-float);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: opacity var(--duration) var(--ease-out);
}

.preview-jump.is-hidden {
  opacity: 0;
  visibility: hidden; /* also out of the Tab order while hidden */
  transition: opacity var(--duration) var(--ease-out), visibility 0s linear var(--duration);
}

.preview-jump:hover {
  color: var(--on-ink);
  opacity: 0.86;
}

.preview-jump svg {
  width: 1.1rem;
  height: 1.1rem;
}

@media (min-width: 64rem) {
  .preview-jump {
    display: none;
  }
}

@media print {
  .preview-jump {
    display: none;
  }
}

.preview-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.preview-head h2 {
  font-size: 1.25rem;
}

/* The "desk" the resume sheet sits on */
.preview-scroll {
  padding: var(--space-4);
  background-color: var(--surface);
  border-radius: var(--radius-xl);
}


/* 12. RESUME SHEET ---------------------------------------------------------
   The live preview is a printed page: black text on white paper in every
   theme (the --paper tokens never change), with standard system fonts so
   ATS software and printers read it well. Print layout is in print.css. */
.resume {
  background-color: var(--paper);
  color: var(--paper-ink);
  padding: 2rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.8125rem;
  line-height: 1.45;
  min-height: 24rem;
  overflow-wrap: anywhere;
}

.resume p,
.resume li {
  max-width: none;
}

.resume h1,
.resume h2,
.resume h3 {
  font-family: inherit;
  letter-spacing: 0;
  text-wrap: wrap;
}

.resume-name {
  font-size: 1.6rem;
  line-height: 1.15;
  font-weight: 700;
}

.resume-contact {
  margin-top: 0.25rem;
  color: var(--paper-text-muted);
}

.resume-section {
  margin-top: 1rem;
}

.resume-section h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.2rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--paper-ink);
}

.resume-item + .resume-item {
  margin-top: 0.55rem;
}

.resume-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1rem;
}

.resume-item-title {
  font-weight: 700;
}

.resume-item-sub {
  font-style: italic;
}

.resume ul {
  margin-top: 0.2rem;
  padding-left: 1.1rem;
}

.resume li + li {
  margin-top: 0.1rem;
}

.resume-empty {
  color: var(--paper-text-muted);
  font-style: italic;
}

/* Classic template: serif, centered header */
.resume-classic {
  font-family: Georgia, "Times New Roman", Times, serif;
}

.resume-classic .resume-header {
  text-align: center;
}

/* Modern template: sans-serif, left header, a heavy black rule under the name */
.resume-modern {
  font-family: Arial, Helvetica, sans-serif;
}

.resume-modern .resume-header {
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--paper-ink);
}

.resume-modern .resume-section h2 {
  border-bottom: 0;
  letter-spacing: 0.08em;
}


/* 13. MOTION ---------------------------------------------------------------
   Routine feedback is a 180ms fade (the --duration token). Three kinds of
   motion carry meaning on top of that:
   - Scroll reveals: after the first screen, sections rise in as they come
     into view (motion.js adds .is-revealed). Hidden only when JS is on.
   - Loading placeholders (.skeleton) where JavaScript builds the content.
   - Small confirmations: a checkbox tick, a copied template, a saved draft.
   With "reduce motion" on, movement stops but state changes still show. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js .reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* Inside a stagger group, children arrive one after another (motion.js
   numbers them with --stagger; the delay is capped so lists never drag) */
.js .reveal .reveal-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--stagger, 0) * 70ms + 120ms);
}

.js .reveal.is-revealed .reveal-stagger > * {
  opacity: 1;
  transform: none;
}

/* Loading placeholder: soft gray bars with a slow shimmer. Shown only
   until JavaScript has built the real content, then removed. */
@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.skeleton {
  display: grid;
  gap: var(--space-3);
}

.skeleton-line {
  display: block;
  height: 0.75rem;
  border-radius: var(--radius-pill);
  background-color: var(--line);
  background-image: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--bg) 60%, transparent) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-line.is-wide { width: 90%; }
.skeleton-line.is-mid { width: 65%; }
.skeleton-line.is-short { width: 40%; }
.skeleton-line.is-title { height: 1.5rem; width: 55%; }

/* Without JavaScript nothing would replace a placeholder, so hide them */
html:not(.js) .skeleton {
  display: none;
}

/* Spinner inside a button that is working (job-fit check, PDF, restore) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn.is-busy {
  pointer-events: none;
  opacity: 0.8;
}

.btn.is-busy::before {
  content: "";
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

/* A short "pop" when something is confirmed (checkbox ticked, text copied) */
@keyframes pop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* A freshly added or inserted entry glows once, so the eye finds it */
@keyframes settle {
  from { box-shadow: 0 0 0 3px var(--ink); }
  to { box-shadow: 0 0 0 3px transparent; }
}

.is-new {
  animation: settle 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal,
  .js .reveal .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }

  /* The theme switch is instant too */
  .theme-changing,
  .theme-changing *,
  .theme-changing *::before,
  .theme-changing *::after {
    transition: none !important;
  }
}
