/* Base: reset, type, the fixed frame (starfield, header, trail, sweep). */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s4)); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--field);
  color: var(--ink);
  font: 400 var(--t4)/var(--lh-body) var(--sans);
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink-strong); margin: 0; line-height: var(--lh-tight); }
h1, .display {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-weight: 560;
  letter-spacing: -0.015em;
}
h2 { font-family: var(--display); font-variation-settings: "SOFT" 100, "opsz" 72; font-weight: 560; font-size: var(--t7); }
h3 { font-size: var(--t5); font-weight: 650; }
p { margin: 0; }
a { color: var(--action); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, canvas { display: block; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.num { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { width: min(100% - 2 * var(--s4), var(--wrap)); margin-inline: auto; }

/* ── Starfield: fixed, behind everything, decorative ── */
#starfield {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
  view-transition-name: starfield;
}

/* ── Header: logo · trail · you ── */
.header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  background: color-mix(in srgb, var(--field) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  view-transition-name: header;
}
.header__in {
  height: 100%;
  display: flex; align-items: center; gap: var(--s5);
}
.logo {
  display: inline-flex; align-items: center; gap: var(--s2);
  color: var(--ink-strong); text-decoration: none; flex: none;
  font-family: var(--display); font-variation-settings: "SOFT" 100, "opsz" 48;
  font-weight: 600; font-size: 24px; letter-spacing: -0.01em;
}
.logo svg { width: 28px; height: 28px; }

/* The constellation trail — where am I, where have I been. */
.trail { flex: 1; min-width: 0; }
.trail ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; scrollbar-width: none;
}
.trail ol::-webkit-scrollbar { display: none; }
.trail li { display: flex; align-items: center; flex: none; }
.trail li + li::before {           /* the line between stars */
  content: ""; width: 22px; height: 1px; margin: 0 var(--s1);
  background: var(--rule-firm); opacity: .6;
}
.trail a, .trail span[aria-current] {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--pill);
  font-size: var(--t2); font-weight: 600; white-space: nowrap;
  color: var(--ink-soft); text-decoration: none;
  transition: color var(--t-quick), background var(--t-quick);
}
.trail a:hover { color: var(--ink-strong); background: var(--surface); }
.trail .tstar { width: 10px; height: 10px; flex: none; color: var(--rule-firm); }
.trail span[aria-current] { color: var(--you-deep); background: var(--you-tint); }
.trail span[aria-current] .tstar { color: var(--you); animation: you-glow 2.4s var(--ease-in-out) infinite; }

/* "My Nebula" — your stars, always one tap away. */
.you-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--pill);
  border: 1px solid var(--rule-firm); background: var(--surface);
  color: var(--ink); font-size: var(--t2); font-weight: 600; text-decoration: none;
  transition: transform var(--t-quick) var(--ease-out), background var(--t-quick);
}
.you-pill i { font-size: 18px; color: var(--ink-soft); }
.you-pill[data-count]:not([data-count="0"]) { border-color: var(--you); background: var(--you-tint); color: var(--you-deep); }
.you-pill[data-count]:not([data-count="0"]) i { color: var(--you); }
.you-pill.is-bump { animation: bump 420ms var(--ease-out); }
.you-pill[aria-current="page"] { outline: 2px solid var(--you); outline-offset: 2px; }

/* Travel sweep — the whole spectrum crossing the top while you move. */
.sweep {
  position: fixed; top: 0; left: 0; z-index: 40;
  height: 3px; width: 100%;
  background: var(--spectrum);
  transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
  pointer-events: none;
}
.is-travelling .sweep { animation: sweep var(--t-settle) var(--ease-out) forwards; }

main#view {
  position: relative; z-index: 1;
  padding-bottom: var(--s9);
  view-transition-name: view;
}

.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--rule);
  background: var(--band);
  padding: var(--s6) 0;
  font-size: var(--t2); color: var(--ink);  /* ink-soft on band was 4.48 */
}

@media (max-width: 720px) {
  /* Phone trail: the header leaves it ~150px, too little for two crumbs. The section switcher and
     the page title already say where you are, so the trail keeps the way back: the place above,
     as "‹ Career map". The current crumb stays in the markup for screen readers. */
  .trail ol { overflow: hidden; }
  .trail li { min-width: 0; }
  .trail li:not(:nth-last-child(2)):not(:only-child) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .trail li::before { display: none; }
  .trail li:nth-last-child(2) .tstar { display: none; }
  .trail li:nth-last-child(2) a::before { content: "‹"; font-size: 18px; line-height: 1; margin-right: 2px; }
  .trail a, .trail span[aria-current] { min-width: 0; max-width: 100%; }
  .trail .tlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  :root { --header-h: 58px; }
  .header__in { gap: var(--s3); }
  .logo span { display: none; }
  .you-pill span { display: none; }
  .you-pill { padding: 7px 10px; }
}

/* ── Industry bar: pinned under the header inside any industry ── */
:root { --indbar-h: 50px; --chrome-h: var(--header-h); }
html.has-indbar { --chrome-h: calc(var(--header-h) + var(--indbar-h)); scroll-padding-top: calc(var(--chrome-h) + var(--s4)); }
.indbar {
  position: sticky; top: var(--header-h); z-index: 19;
  height: var(--indbar-h);
  background: color-mix(in srgb, var(--field) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  view-transition-name: indbar;
}
.indbar__in { height: 100%; display: flex; align-items: center; gap: var(--s5); }
.indbar__name { font-size: var(--t5); color: var(--ink-strong); flex: none; }
.indbar__tabs { display: flex; gap: var(--s1); height: 100%; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.indbar__tabs::-webkit-scrollbar { display: none; }
.indtab {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 var(--s3); height: 100%;
  color: var(--ink-soft); font-size: var(--t2); font-weight: 600; text-decoration: none;
  transition: color var(--t-quick);
}
.indtab i { font-size: 18px; }
.indtab::after { content: ""; position: absolute; left: var(--s3); right: var(--s3); bottom: -1px; height: 2px; border-radius: 2px; background: transparent; transition: background var(--t-quick); }
.indtab:hover { color: var(--ink-strong); }
.indtab:hover::after { background: var(--rule-firm); }
/* Current tab: ink, not pink — pink is reserved for you. */
.indtab[aria-current="page"] { color: var(--ink-strong); }
.indtab[aria-current="page"]::after { background: var(--ink-strong); }
.indbar__you { flex: none; display: grid; gap: 4px; min-width: 120px; font-size: var(--t2); font-weight: 650; color: var(--you-deep); text-align: right; }
.indbar__you small { font-weight: 500; color: var(--ink-soft); }
.indbar__you .progress { margin-top: 0; }
::view-transition-old(indbar), ::view-transition-new(indbar) { animation: none; }
/* Phone: the tabs collapse into one switcher that opens a sheet of every section (plan 03, D7).
   My Nebula's section tabs use the same switcher and sheet. */
.indbar__switch, .metabs__switch, .secsheet { display: none; }
@media (max-width: 720px) {
  :root { --indbar-h: 50px; }
  .indbar__name, .indbar__you, .indbar__tabs { display: none; }
  .indbar__in { gap: 0; }
  .metabs .metabs__in { display: none; }  /* views.css loads later; this must outrank it */
  .indbar__switch, .metabs__switch {
    display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 6px 14px; cursor: pointer;
    border: 1px solid var(--rule-firm); border-radius: var(--pill); background: var(--surface);
    font: inherit; font-size: var(--t3); font-weight: 600; color: var(--ink-strong);
  }
  .indbar__switch i, .metabs__switch i { font-size: 18px; }
  .indbar__switch i:last-child, .metabs__switch i:last-child { font-size: 14px; color: var(--ink-soft); }
  .metabs__switch b { font-weight: 700; color: var(--ink-soft); }
  .secsheet[open] {
    display: block; margin: auto 0 0; width: 100%; max-width: none; padding: 0; border: 0;
    border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink);
  }
  .secsheet::backdrop { background: color-mix(in srgb, var(--ink-strong) 28%, transparent); }
  .secsheet__in { padding: var(--s4) var(--s4) var(--s6); }
  .secsheet__in::before { content: ""; display: block; width: 40px; height: 4px; margin: 0 auto var(--s4); border-radius: 2px; background: var(--rule); }
  .secsheet__name { margin: 0 0 var(--s2); font-size: var(--t1); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
  .secsheet__link { width: 100%; padding: 0; border-width: 0 0 1px; border-style: solid; background: none; font-family: inherit; cursor: pointer; text-align: left; display: flex; align-items: center; gap: var(--s3); min-height: 48px; border-bottom: 1px solid var(--rule); font-size: var(--t4); font-weight: 600; color: var(--ink); text-decoration: none; }
  .secsheet__link:last-child { border-bottom: 0; }
  .secsheet__link i { font-size: 22px; color: var(--ink-soft); }
  .secsheet__link[aria-current="page"], .secsheet__link[aria-current="true"] { color: var(--ink-strong); }
  .secsheet__link[aria-current="page"]::after, .secsheet__link[aria-current="true"]::after { content: "✓"; margin-left: auto; }
}

/* ── Search ── */
.search-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 10px 7px 12px; border-radius: var(--pill);
  border: 1px solid var(--rule-firm); background: var(--surface);
  color: var(--ink-soft); font-size: var(--t2); font-weight: 600;
}
.search-btn i { font-size: 18px; }
.search-btn:hover { color: var(--ink-strong); border-color: var(--ink-soft); }
dialog.search {
  width: min(640px, calc(100vw - 2 * var(--s4))); max-height: min(70vh, 640px);
  margin: 12vh auto auto; padding: 0; border: 1px solid var(--rule-firm); border-radius: 0 var(--petal-lg);
  background: var(--surface); color: var(--ink); display: none; flex-direction: column;
  box-shadow: 0 24px 60px -24px rgba(63, 47, 39, .35);
}
dialog.search[open] { display: flex; animation: rise 240ms var(--ease-out); }
dialog.search::backdrop { background: color-mix(in srgb, var(--ink-strong) 30%, transparent); backdrop-filter: blur(2px); }
.search__bar { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); }
.search__bar > i { font-size: 22px; color: var(--ink-soft); }
.search__input { flex: 1; border: 0; outline: 0; background: transparent; font-size: var(--t5); color: var(--ink-strong); min-width: 0; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__close { border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 20px; padding: 6px; border-radius: 8px; }
.search__close:hover { background: var(--field); color: var(--ink-strong); }
.search__results { overflow-y: auto; padding: var(--s2) var(--s2) var(--s3); }
.search__group { font-size: var(--t1); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: var(--s3) var(--s3) var(--s1); }
.search__item { display: flex; gap: var(--s3); align-items: flex-start; padding: 10px var(--s3); border-radius: 0 12px; text-decoration: none; color: var(--ink-strong); }
.search__item > svg, .search__item > i { width: 16px; height: 16px; font-size: 16px; flex: none; margin-top: 3px; color: var(--h, var(--ink-soft)); }
.search__item .star { opacity: 1; }
.search__item b { display: block; font-weight: 650; }
.search__item small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-soft); font-size: var(--t2); }
.search__item[aria-selected="true"] { background: var(--field); box-shadow: inset 3px 0 0 var(--h, var(--ink-strong)); }
.search__empty { padding: var(--s5) var(--s4); color: var(--ink-soft); }
.search__hint { padding: var(--s2) var(--s4); border-top: 1px solid var(--rule); font-size: var(--t1); color: var(--ink-soft); }
@media (max-width: 720px) { .search-btn span, .search-btn kbd { display: none; } .search__hint { display: none; } dialog.search { margin-top: var(--s4); } }
