/* Trailhead components. A calm single column inside a 1080px trail, tools as
   quiet boards, painted images carry the mood, blazes carry state.
   Tokens only: no literal colours below this line. */

/* top bar */
.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px;
  padding: 14px 32px;
  background: var(--card);
  border-bottom: var(--border-w) solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
  color: var(--ink);
}
.brand, .brand:hover { color: var(--ink); text-decoration: none; }
.brand .mark { color: var(--mark); flex: none; }
.brand.lg { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; gap: 12px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav a {
  color: var(--ink-2); font-weight: 600; font-size: 15px;
  padding: 8px 12px; border-radius: 8px; min-height: 40px;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on, .nav a[aria-current="page"] { color: var(--ink); background: var(--paper); }
.nav .count { font-size: 12px; font-weight: 700; color: var(--blaze-ink); }
.me { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.iconbtn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { color: var(--ink); background: var(--paper); }

@media (max-width: 640px) {
  .bar { padding: 10px 16px; gap: 4px 12px; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -12px; }
  .me { gap: 8px; }
  .theme-toggle { width: 36px; height: 36px; }
}

/* avatars */
.av {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: var(--on-av); background: var(--ink-2); flex: none;
}
.av.lg { width: 44px; height: 44px; font-size: 16px; }
.av.sm { width: 24px; height: 24px; font-size: 11px; }
.av.i { background: var(--lake); }
.av.e { background: var(--pine); }
.av.k { background: var(--plum); }
.av.m { background: var(--clay); }

/* containers */
.wrap {
  width: 100%; max-width: 1080px; margin: 0 auto;
  padding: 40px 32px 64px;
  display: flex; flex-direction: column; gap: 32px;
}
.wrap.narrow { max-width: 640px; }
@media (max-width: 640px) { .wrap { padding: 28px 16px 48px; gap: 24px; } }

.board {
  background: var(--card);
  border: var(--border-w) solid var(--line);
  border-radius: 14px;
}
.board.pad { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.lede { font-size: 18px; color: var(--ink-2); }
.tnum { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* page head: eyebrow, title, line of context, action on the right */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head .stack { gap: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--body);
  padding: 11px 16px; min-height: 44px;
  border-radius: 10px;
  border: var(--border-w) solid var(--line-2);
  background: var(--card); color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); }
.btn.go { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.go:hover { background: var(--pine); border-color: var(--pine); }
.btn.lg { font-size: 17px; padding: 16px 20px; min-height: 56px; }
.btn.block { width: 100%; }
.btn.link { background: transparent; border-color: transparent; color: var(--lake); padding-inline: 4px; }
.btn.link:hover { text-decoration: underline; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* blazes: the painted trail mark is the product's status language */
.blaze {
  display: inline-block; width: 10px; height: 16px;
  background: var(--blaze);
  border-radius: 2px 3px 2px 4px; transform: rotate(-3deg); flex: none;
}
.blaze.pine { background: var(--pine); }
.blaze.lake { background: var(--lake); }
.blaze.ghost { background: transparent; border: 2px solid var(--line-2); }
.blaze.double { box-shadow: 6px -5px 0 0 var(--blaze); margin-right: 6px; }

/* to-do check: an empty outline that fills when done */
.check {
  width: 22px; height: 22px; border: 2px solid var(--line-2); border-radius: 5px;
  background: var(--card); flex: none;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 2px;
  color: var(--on-ink);
}
.check.done { background: var(--pine); border-color: var(--pine); }

/* highlighter */
mark {
  background: linear-gradient(100deg, transparent 0.2em, var(--marker) 0.3em, var(--marker) calc(100% - 0.3em), transparent calc(100% - 0.2em));
  color: inherit; padding: 0 0.25em; border-radius: 0.2em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* date stamp */
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 52px; height: 56px; flex: none;
  border: 1.5px solid var(--ink); border-radius: 8px;
  font-variant-numeric: tabular-nums; background: var(--card);
}
.stamp b { font-family: var(--display); font-size: 22px; line-height: 1; }
.stamp span { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blaze-ink); }

/* illustration frames */
.ill { display: block; width: 100%; height: 100%; object-fit: cover; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 600; color: var(--ink); }
.hint { font-size: 14px; color: var(--ink-2); }
.input {
  width: 100%; min-height: 44px;
  padding: 10px 12px;
  font: inherit; color: var(--ink);
  background: var(--card);
  border: var(--border-w) solid var(--line-2);
  border-radius: 10px;
}
.input::placeholder { color: var(--ink-2); opacity: 1; }
.input:hover { border-color: var(--ink-2); }
.input:focus-visible { outline: var(--focus-w) solid var(--lake); outline-offset: 1px; border-color: var(--lake); border-radius: 10px; }
.input[aria-invalid="true"] { border-color: var(--blaze-ink); }
.field .error { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--blaze-ink); }
.field .error::before { content: ""; display: inline-block; width: 8px; height: 13px; background: var(--blaze); border-radius: 2px 3px 2px 4px; transform: rotate(-3deg); flex: none; }

/* flash: a quiet board with a blaze, never a coloured pill.
   notice: pine blaze (done). alert: orange blaze (needs you). */
.flashes { width: 100%; max-width: 1080px; margin: 0 auto; padding: 20px 32px 0; display: flex; flex-direction: column; gap: 10px; }
.flashes:empty { display: none; }
@media (max-width: 640px) { .flashes { padding: 16px 16px 0; } }
.flash {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  background: var(--card); color: var(--ink);
  border: var(--border-w) solid var(--line); border-radius: 12px;
}
.flash::before {
  content: ""; display: inline-block; flex: none;
  width: 10px; height: 16px; margin-top: 3px;
  border-radius: 2px 3px 2px 4px; transform: rotate(-3deg);
  background: var(--pine);
}
.flash.alert { background: var(--soft); }
.flash.alert::before { background: var(--blaze); }

/* auth: painted image left, panel right; stacks on phones */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; min-height: 100dvh; background: var(--paper); }
.auth .art { flex: 1 1 480px; min-width: 0; min-height: 280px; position: relative; overflow: hidden; }
.auth .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth .panel {
  flex: 1 1 480px; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
  padding: 56px max(24px, 6vw);
}
.auth .panel > section { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.auth .panel h1 { font-size: 40px; }
@media (max-width: 960px) {
  .auth .art { flex-basis: 100%; min-height: 0; height: 32vh; }
  .auth .panel { padding: 32px 20px 48px; justify-content: flex-start; flex-basis: 100%; }
  .auth .panel h1 { font-size: 34px; }
}

/* empty state: a painted image, a heading, a line of text */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 40px 24px;
}
.empty img {
  width: 100%; max-width: 480px; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 14px; margin-bottom: 12px;
}
.empty h2 { font-size: 26px; font-weight: 700; }
.empty p { color: var(--ink-2); max-width: 44ch; }

/* onboarding: the welcome screens after the first passkey */
.onboarding .panel { justify-content: flex-start; gap: 32px; }
.onboarding .panel > section { max-width: 520px; }
.onboarding-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 520px; flex-wrap: wrap; }
.onboarding-actions { align-items: center; gap: 16px; margin-top: 8px; }

/* progress as trail markers joined by a footpath: done = pine, now = orange, ahead = outline */
.trail-steps { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; }
.trail-steps li { display: flex; align-items: center; }
.trail-steps li + li::before {
  content: ""; width: 22px; height: 8px; margin: 0 4px; background: var(--line-2);
  -webkit-mask: url("/assets/marks/divider-e37cc1bb.png") left center / auto 100% repeat-x;
  mask: url("/assets/marks/divider-e37cc1bb.png") left center / auto 100% repeat-x;
}
.trail-steps li::after {
  content: ""; width: 9px; height: 18px; border: 2px solid var(--line-2); border-radius: 2px 3px 2px 4px; transform: rotate(-3deg);
}
.trail-steps li.done::after, .trail-steps li.now::after {
  border: 0; background: var(--pine);
  -webkit-mask: url("/assets/marks/blaze-a7568329.png") center / 100% 100% no-repeat;
  mask: url("/assets/marks/blaze-a7568329.png") center / 100% 100% no-repeat;
}
.trail-steps li.now::after { background: var(--blaze); width: 11px; height: 22px; }

.ways { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.ways li { display: flex; gap: 16px; align-items: flex-start; }
.ways .ticon { width: 34px; height: 34px; color: var(--blaze-ink); margin-top: 2px; }
.ways p { margin: 2px 0 0; color: var(--ink-2); }

.companion { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; border: 0; margin: 0; padding: 12px 0; border-bottom: var(--border-w) solid var(--line); }
.companion .grow { flex: 1 1 160px; }
.companion .year { flex: 0 1 110px; }
.companion .remove { font-size: 22px; min-height: 44px; color: var(--ink-2); }

fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.bare legend { margin-bottom: 8px; padding: 0; }

/* chips: checkbox labels; the checked state gets an orange blaze, not a coloured pill */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px;
  border: var(--border-w) solid var(--line-2); border-radius: 10px; background: var(--card); font-weight: 600;
}
.chip span::before {
  content: ""; width: 7px; height: 14px; border: 1.5px solid var(--line-2); border-radius: 2px 3px 2px 4px; transform: rotate(-3deg);
}
.chip input:checked + span { border-color: var(--ink); }
.chip input:checked + span::before {
  border: 0; background: var(--blaze);
  -webkit-mask: url("/assets/marks/blaze-a7568329.png") center / 100% 100% no-repeat;
  mask: url("/assets/marks/blaze-a7568329.png") center / 100% 100% no-repeat;
}
.chip input:focus-visible + span, .option input:focus-visible + span { outline: var(--focus-w) solid var(--lake); outline-offset: 2px; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.option span {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px;
  border: var(--border-w) solid var(--line-2); border-radius: 10px; background: var(--card);
}
.option small { color: var(--ink-2); font-size: 13px; }
.option input:checked + span { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--blaze); }

.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: var(--border-w) solid var(--line); border-radius: 12px; background: var(--card); }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--pine); flex: none; }

.fit { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; color: var(--ink); }

/* avatars: a photo or an explorer portrait, in a circle */
.av.pic { background: var(--card); overflow: hidden; padding: 0; box-shadow: inset 0 0 0 1px var(--line); }
.av.pic img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av.xl { width: 88px; height: 88px; font-size: 30px; }
.me-link { display: inline-flex; border-radius: 50%; }
.me-link:focus-visible { outline: var(--focus-w) solid var(--lake); outline-offset: 2px; }

/* the avatar picker: upload a photo, or pick an explorer */
.avatar-pick { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.explorers { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px 8px; margin-top: 10px; max-height: 320px; overflow-y: auto; padding: 6px 4px; }
.explorer { position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12px; line-height: 1.2; color: var(--ink-2); }
.explorer input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.explorer img { display: block; width: 56px; height: 56px; border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line); }
.explorer input:checked + img { box-shadow: 0 0 0 3px var(--blaze); }
.explorer input:checked ~ span { color: var(--ink); font-weight: 600; }
.explorer input:focus-visible + img { outline: var(--focus-w) solid var(--lake); outline-offset: 3px; }
.explorer-note { margin: 0; max-width: 46ch; }
.explorer-note [data-avatar-target="why"] { display: block; margin-top: 4px; }
.av.pic img { background: #FFFFFF; }
.avatar-actions { gap: 6px; min-width: 0; flex: 1 1 220px; align-items: flex-start; }
.avatar-preview { display: inline-flex; }
.avatar-preview .av img { width: 100%; height: 100%; }
.options.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 520px) { .options.four { grid-template-columns: repeat(4, 1fr); } }

/* offline: a quiet bar, and forms that need a connection look it */
.offline-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; background: var(--soft); color: var(--ink); border-bottom: var(--border-w) solid var(--line); font-size: 14px; font-weight: 600; }
.is-offline form[method="post"] [type="submit"], .is-offline form[method="post"] button:not([type="button"]) { opacity: 0.55; }

/* top bar: light/dark toggle (shows the moon in light mode, the sun in dark) */
.me { display: flex; align-items: center; gap: 10px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: var(--border-w) solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle:focus-visible { outline: var(--focus-w) solid var(--lake); outline-offset: 2px; }
.theme-toggle .sun { display: none; }
:root[data-mode$="dark"] .theme-toggle .sun { display: block; }
:root[data-mode$="dark"] .theme-toggle .moon { display: none; }

/* Settings: accent colour swatches (each shows its own light-mode mark) */
.accents { display: flex; flex-wrap: wrap; gap: 12px; }
.accent-swatch { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.accent-swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.accent-swatch .swatch { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.accent-swatch input:checked ~ .swatch { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.accent-swatch input:focus-visible ~ .swatch { outline: var(--focus-w) solid var(--lake); outline-offset: 4px; }
.swatch[data-accent-swatch="trail"] { background: #D4501C; }
.swatch[data-accent-swatch="moss"] { background: #56682C; }
.swatch[data-accent-swatch="lake"] { background: #2B5E86; }
.swatch[data-accent-swatch="plum"] { background: #8A5A9E; }
.swatch[data-accent-swatch="clay"] { background: #9A6A2E; }

/* Social card for a pasted link (ideas, comments): closable */
.link-card { position: relative; display: flex; gap: 12px; align-items: stretch; margin-top: 6px; border: var(--border-w) solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; max-width: 560px; }
.link-card-image { width: 120px; min-height: 90px; object-fit: cover; flex: none; background: var(--soft); }
.link-card-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 36px 10px 0; min-width: 0; }
.link-card-text .eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card-title { font-weight: 700; color: var(--ink); text-decoration: none; line-height: 1.3; }
.link-card-title:hover { text-decoration: underline; }
.link-card-text p { margin: 0; }
.link-card-close, .link-card-close-form { position: absolute; top: 4px; right: 4px; }
.link-card-close { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--paper); color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer; }
.link-card-close:hover { color: var(--ink); background: var(--soft); }
.link-card-close-form .link-card-close { position: static; }
.unfurl-card:empty { display: none; }
@media (max-width: 480px) { .link-card-image { width: 84px; } }

/* A new release is out */
.release-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); box-shadow: 0 8px 28px rgb(0 0 0 / .25); font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); }
.release-bar[hidden] { display: none; }
.release-bar .btn.go { background: var(--mark); border-color: var(--mark); color: #fff; }
