/* Shared course shell: tokens and the header used by every page. Linked before each page's own stylesheet. */
:root {
  /* The 0x44 look (Cap, 2026-11-05), from constellations-gen-0x44-site/site-0x44/public/style.css:5 and :12-15. */
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1B1B1A;
  background: #E9E8E4;
  font-synthesis: none;
  --ground: #E9E8E4;
  --ink: #1B1B1A;
  --muted: #5F5E5A;
  --line: #CFCDC7;
  --paper: #f5f2e8;
  --surface: #F4F3EF;
  --btn-ink: #F4F3EF;
  --focus: #1B1B1A;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  /* The lifted shadow under a piece of art: stacked layers, blur doubling, low alpha cool neutral. */
  --sh: 18 24 32;
  --lifted: 0 1px 2px rgb(var(--sh) / .09), 0 3px 6px rgb(var(--sh) / .08), 0 6px 12px rgb(var(--sh) / .07), 0 10px 20px rgb(var(--sh) / .06), 0 16px 32px rgb(var(--sh) / .05), 0 20px 32px rgb(var(--sh) / .04);
}

body { margin: 0; background: var(--ground); }

.site-header { height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.masthead { display: flex; height: 100%; align-items: center; justify-content: space-between; gap: 24px; }
.course-title { min-width: 0; }
.course-title .eyebrow { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.2; letter-spacing: .025em; font-weight: 400; color: var(--muted); }
.course-title h1 { margin: 2px 0 0; font-size: 18px; line-height: 1.2; font-weight: 500; letter-spacing: -.025em; }

/* Tabs sit on the header's bottom line with the underline a few pixels under the text.
   The visible tab is short; ::after keeps the tap area 44px tall. */
.course-nav { display: flex; align-self: flex-end; align-items: flex-end; gap: 20px; margin-left: auto; font-family: var(--ui); }
.course-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 2px 7px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.course-nav a::after { content: ""; position: absolute; inset: auto 0 0; height: 44px; }
.course-nav a:hover { color: var(--ink); }
.course-nav a[aria-current=page] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.course-nav a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Phone: title on its own row so every page's eyebrow fits on one line, then the course nav. */
@media (max-width: 759px) {
  .site-header { height: auto; padding: 8px 16px 0; }
  .masthead { flex-wrap: wrap; align-items: flex-start; gap: 2px 0; }
  .course-title { flex: 1 0 100%; }
  .course-nav { margin: 6px 0 0 -2px; gap: 20px; }
}

.visually-hidden {
  position: absolute !important;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

/* The completion badge, on the finish page and the claim page. */
.badge-row { display: flex; align-items: center; gap: 10px; }
.badge-mark { display: block; flex: none; width: 44px; height: 44px; filter: drop-shadow(0 2px 3px rgb(34 63 55 / .4)); }
.badge-words { display: grid; gap: 1px; }
.badge-name { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
.badge-status { font-size: 12px; line-height: 16px; color: var(--muted); }

/* "About seeds" toggletip, used beside seed labels on every page. */
.seed-info { position: relative; display: inline-block; vertical-align: middle; margin-left: 6px; line-height: 1; }
.seed-info-button {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -5px -3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: italic 600 13px/1 Georgia, 'Times New Roman', serif;
  vertical-align: middle;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* The visible circle; the button around it is the larger touch target. */
.seed-info-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--muted);
  border-radius: 50%;
  box-sizing: border-box;
}
.seed-info-button:hover, .seed-info-button[aria-expanded=true] { color: #fff; }
.seed-info-button:hover::before, .seed-info-button[aria-expanded=true]::before { background: var(--ink); border-color: var(--ink); }
.seed-info-button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 50%; }
@media (max-width: 759px) {
  .seed-info-button { width: 44px; height: 44px; margin: -13px -11px; }
}
.seed-info-bubble {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: -12px;
  width: min(280px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--btn-ink);
  font: 400 13px/1.45 var(--ui);
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: normal;
  box-shadow: 0 6px 20px rgba(20, 30, 25, .18);
}

/* The code window: one shared modal, so opening it never changes a card's height. */
.code-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(80svh, 720px);
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #242c27;
  font: 14px/1.55 var(--ui);
  box-shadow: 0 2px 6px rgb(var(--sh) / .08), 0 12px 32px rgb(var(--sh) / .14), 0 32px 64px rgb(var(--sh) / .16);
  overflow: hidden;
}
.code-dialog[open] { display: flex; flex-direction: column; animation: pop .26s var(--ease); }
.code-dialog.closing { animation: drop .18s cubic-bezier(.4, 0, 1, 1) forwards; }
.code-dialog::backdrop { background: rgb(20 26 22 / .32); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fade .26s ease-out; }
.code-dialog.closing::backdrop { animation: fade .18s ease-in reverse forwards; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes drop { to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.code-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 20px; }
.code-head .sketch-index { font-family: var(--mono); }
.code-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.code-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font: 20px/1 var(--ui);
  transition: background-color .16s ease, color .16s ease;
}
.code-close:hover { background: rgb(36 62 49 / .08); color: var(--ink); }
.code-scroll { overflow: auto; padding: 0 20px 20px; }
.code-scroll .rule-text { margin: 0 0 14px; font-size: 14px; line-height: 1.6; max-width: 62ch; }
.code-window { border-radius: 4px; background: #151b18; overflow: hidden; }
.code-window-bar { padding: 9px 14px; font: 12px/1 var(--mono); letter-spacing: .06em; color: #8c978f; border-bottom: 1px solid rgb(255 255 255 / .06); }
.code-window pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font: 13px/1.65 var(--mono); color: #e4ebe5; }
.code-lineage { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.code-lineage h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.code-lineage p { margin: 0; font-size: 14px; line-height: 1.6; max-width: 62ch; }
.code-lineage .lineage-notice { margin-top: 4px; color: #4d5850; }
.code-scroll .rule-later { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.code-dialog :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .code-dialog[open], .code-dialog.closing, .code-dialog::backdrop { animation: none !important; }
}
