/* ═══════════════════════════════════════════════════════════════════
   50K design system — page art direction and component recipes.
   Reads tokens.css; the page itself runs on the product's dark values.
   Scoped to this document's class names; no reset beyond box-sizing.
   ═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--green);
  color: #04251A; padding: 12px 20px; border-radius: 0 0 12px 0; font: var(--t-label);
  text-decoration: none; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }

body {
  margin: 0;
  /* the site's ground, not the app's - the product surfaces keep their own
     grounds inside their specimens */
  background: #08090A;
  color: var(--text);
  font: var(--t-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ── the site's primary bar, then the system's own ──────────────── */
.sitebar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(8, 9, 10, .78);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sitebar-in { display: flex; align-items: center; gap: var(--s4); min-height: 64px; }
.sb-brand { display: flex; align-items: center; gap: 9px; font: 600 15.5px/1 var(--font);
  color: #F0F0F3; text-decoration: none; white-space: nowrap; min-height: 44px; }
.sb-brand span { width: 9px; height: 9px; border-radius: 3px; background: var(--green); }
.sb-links { display: flex; gap: 4px; margin-inline-start: auto; }
.sb-links a { display: flex; align-items: center; min-height: 44px; padding: 0 13px;
  font: 600 14px/1 var(--font); color: #A8A8B2; text-decoration: none; border-radius: 10px;
  transition: color var(--dur-base) var(--ease); }
.sb-links a:hover { color: #F0F0F3; }
.sb-links a[aria-current] { color: var(--green); }
.sb-contact { display: inline-flex; align-items: center; min-height: 44px; padding: 0 19px;
  border-radius: 999px; background: var(--green); color: #04251A;
  font: 600 14px/1 var(--font); text-decoration: none; }
.sb-contact:hover { filter: brightness(1.07); }

.dsnav {
  position: sticky; top: 64px; z-index: 50;
  background: color-mix(in srgb, #08090A 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.dsnav-in { display: flex; align-items: center; gap: var(--s3); min-height: 49px; }
.ds-back { display: flex; align-items: center; gap: 7px; min-height: 44px;
  font: var(--t-label); color: var(--green); text-decoration: none; white-space: nowrap;
  padding-inline-end: var(--s3); border-inline-end: 1px solid rgba(255, 255, 255, .09); }
.ds-back:hover { color: #F0F0F3; }
.ds-links { display: flex; gap: 1px; overflow-x: auto; scrollbar-width: none; }
.ds-links::-webkit-scrollbar { display: none; }
.ds-links a { display: flex; align-items: center; min-height: 44px; padding: 0 10px;
  font: var(--t-label); font-size: 12.5px; color: var(--text-2); text-decoration: none;
  white-space: nowrap; transition: color var(--dur-base) var(--ease); }
.ds-links a:hover { color: var(--text); }
.ds-links a.on { color: var(--green); }

/* ── hero ───────────────────────────────────────────────────────── */
.hero { padding: var(--s8) 0 var(--s7); border-bottom: 1px solid var(--card); }
.eyebrow { font: var(--t-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--green); }
.hero h1 { font: var(--t-display); letter-spacing: -.035em; margin: var(--s3) 0 0; }
.hero .sub { font: var(--t-h3); font-weight: 400; color: var(--text-2); max-width: 48ch; margin-top: var(--s3); }

/* 340px: six entries land 3x2, no orphan cell */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
        gap: 1px; margin-top: var(--s6); background: var(--line);
        border: 1px solid var(--line); border-radius: var(--r-sheet); overflow: hidden; }
.meta > div { background: var(--card); padding: var(--s3) var(--s4); }
.meta dt { font: var(--t-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); }
.meta dd { margin: 6px 0 0; font: var(--t-sm); color: var(--text); }

/* ── sections ───────────────────────────────────────────────────── */
section { padding: var(--s8) 0; border-bottom: 1px solid var(--card); scroll-margin-top: 128px; }
.s-i { font: var(--t-mono); letter-spacing: .13em; color: var(--green); }
section h2 { font: var(--t-h1); letter-spacing: -.03em; margin: var(--s2) 0 0; max-width: 22ch; }
section .lede { font: var(--t-h3); font-weight: 400; color: var(--text-2); max-width: 62ch; margin-top: var(--s3); }
section p { color: var(--text-2); max-width: 66ch; }
h3.sub { font: var(--t-h3); margin: var(--s7) 0 var(--s3); letter-spacing: -.01em; }
.note { font: var(--t-sm); color: var(--text-2); max-width: 62ch; margin-top: var(--s2); }
.note code, section p code { font: var(--t-mono); color: var(--text); }

/* ── the light/dark colour map ──────────────────────────────────── */
.cmap { margin-top: var(--s5); border: 1px solid var(--line); border-radius: var(--r-sheet);
        overflow: hidden; max-width: 940px; }
.cmap-h, .crow { display: grid; grid-template-columns: 1fr 44px 1fr; align-items: stretch; }
.cmap-h { background: var(--card); border-bottom: 1px solid var(--line); }
.cmap-h div { padding: 13px var(--s3); font: var(--t-mono); letter-spacing: .1em;
              text-transform: uppercase; color: var(--text-2); }
.cmap-h div:last-child { text-align: end; }
.crow { border-top: 1px solid var(--card); }
.crow:first-of-type { border-top: 0; }
.cside { display: flex; align-items: center; gap: 12px; padding: 10px var(--s3); min-width: 0; background: var(--bg); }
.cside.light { background: #FFFFFF; flex-direction: row-reverse; text-align: end; }
.cside i { width: 44px; height: 44px; border-radius: 10px; flex: none;
           box-shadow: inset 0 0 0 1px rgba(127,127,127,.28); }
.cside .cn { min-width: 0; }
.cside .cn b { display: block; font: var(--t-label); color: var(--text); }
.cside .cn code { display: block; font: var(--t-mono); color: var(--text-2); margin-top: 2px; }
.cside.light .cn b { color: #191B1C; }
.cside.light .cn code { color: #505C59; }
.carrow { display: flex; align-items: center; justify-content: center;
          color: var(--scroll); background: linear-gradient(90deg, var(--bg) 0%, var(--bg) 50%, #FFFFFF 50%); }
.crole { background: var(--bg); padding: 8px var(--s3) 14px; font: var(--t-sm); font-size: 13px; color: var(--text-2);
         border-top: 1px dashed var(--card); }

/* ── type ───────────────────────────────────────────────────────── */
.weights { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s5); margin-top: var(--s4);
           align-items: baseline; }
.weights span { font-size: 30px; line-height: 1; font-family: var(--font); }
.weights small { display: block; font: var(--t-mono); color: var(--text-2); margin-top: 8px; }
.typerow { display: grid; grid-template-columns: 200px 1fr; gap: var(--s4);
           padding: var(--s4) 0; border-top: 1px solid var(--card); align-items: baseline; }
.typerow .k { font: var(--t-mono); color: var(--text-2); }
.typerow .k b { display: block; color: var(--green); font: var(--t-mono); margin-bottom: 3px; }
.typerow .spec { font-family: var(--font); line-height: 1; }   /* the app's height: 1.0 */

pre.code { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-btn);
           padding: var(--s3) var(--s4); overflow-x: auto; margin: var(--s4) 0 0;
           font: var(--t-mono); color: var(--text-2); max-width: 860px; }
pre.code em { font-style: normal; color: var(--green); }

/* ── space ──────────────────────────────────────────────────────── */
.scale { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s4); align-items: flex-end; }
.scale figure { margin: 0; text-align: center; }
.scale i { display: block; background: var(--green); border-radius: 2px; }
.scale figcaption { font: var(--t-mono); font-size: 12px; color: var(--text-2); margin-top: 8px; }
.specfig { margin: var(--s5) 0 0; max-width: 460px; }
.specfig img { width: 100%; height: auto; display: block; border-radius: var(--r-sheet);
               border: 1px solid var(--line); background: #fff; }
.specfig figcaption { font: var(--t-sm); font-size: 13px; color: var(--text-2); margin-top: 10px; }

.radii { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
.radii figure { margin: 0; text-align: center; }
.radii i { display: block; width: 84px; height: 56px; background: var(--card); border: 1px solid var(--line); }
.radii figcaption { font: var(--t-mono); font-size: 12px; color: var(--text-2); margin-top: 8px; }

/* the primary-button contract, shown at phone width with real assets */
.btnspec { max-width: 390px; background: var(--card); border: 1px solid var(--line);
           border-radius: var(--r-sheet); padding: var(--s4) 0; margin-top: var(--s4); }
.btnspec .edge { padding: 0 var(--btn-inset); display: grid; gap: var(--btn-gap); }
.btnspec img { width: 100%; height: auto; display: block; }
.btnspec figcaption { font: var(--t-sm); font-size: 13px; color: var(--text-2);
                      padding: var(--s3) var(--s3) 0; text-align: center; }
.btnspec.on-light { background: #FFFFFF; border-color: #E2E9EC; }
.btnspec.on-light figcaption { color: #505C59; }

/* ── demo shells and live components ────────────────────────────── */
.demo { background: var(--card); border: 1px solid var(--line);
        border-radius: var(--r-sheet); padding: var(--s4); margin-top: var(--s4); }
.demo + .note { margin-top: var(--s2); }
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.row + .row { margin-top: var(--s2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--btn-h); padding: 0 22px; border: 0; border-radius: var(--r-btn);
  font: var(--t-label); font-size: 15px; cursor: pointer;
  background: var(--green); color: #191B1C;
  transition: filter var(--dur-tap) var(--ease), transform var(--dur-tap) var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { filter: brightness(.92); transform: scale(.99); }
.btn:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
/* disabled matches the component files: DarkGray3 fill, DarkMidGray label */
.btn[disabled] { background: #5D5D64; color: #BCD1CC; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--card); filter: none; }
.btn.quiet { background: transparent; color: var(--green); padding: 0 10px; }
.btn.quiet:hover { background: color-mix(in srgb, var(--green) 12%, transparent); filter: none; }
.btn .spin { width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, #191B1C 35%, transparent); border-top-color: #191B1C;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* fields — card surface, DarkGray2 border, exactly the app's recipe */
.field { display: block; max-width: 380px; }
.field + .field { margin-top: var(--s3); }
.field .lab { display: block; font: var(--t-label); color: var(--text-2); margin-bottom: 7px; }
.field input {
  width: 100%; min-height: 48px; padding: 0 15px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-btn);
  font: var(--t-body); font-size: 15px;
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.field input::placeholder { color: var(--scroll); }
.field input:focus {
  outline: 0; border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent);
}
.field .help { display: block; font: var(--t-sm); font-size: 13px; color: var(--text-2); margin-top: 7px; }
.field.bad input { border-color: var(--red); }
.field.bad .help { color: var(--red); }

.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 15px;
        border-radius: var(--r-pill); background: var(--bg); color: var(--text-2);
        font: var(--t-label); border: 1px solid var(--line); cursor: pointer; }
.chip.on { background: color-mix(in srgb, var(--green) 14%, transparent);
        color: var(--green); border-color: color-mix(in srgb, var(--green) 42%, transparent); }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line);
       border-radius: var(--r-pill); padding: 4px; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
        border-radius: var(--r-pill); color: var(--text-2); font: var(--t-label); }
.seg span.on { background: var(--green); color: #191B1C; }

.dir { display: grid; grid-template-columns: 1fr 1fr; max-width: 420px; }
.dir span { display: block; padding: 10px 0 13px;
        color: var(--text-2); font: var(--t-label); text-align: center;
        border-bottom: 3px solid var(--line); }
.dir span b { display: block; font: var(--t-h3); color: var(--text); margin-top: 3px; }
.dir span.on { color: var(--text); border-bottom-color: var(--green); }
.dir span.on[data-side="short"] { border-bottom-color: var(--red); }

.sw-t { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
        min-height: 44px; font: var(--t-sm); color: var(--text-2); }
.sw-t input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-t i { width: 50px; height: 30px; border-radius: var(--r-pill); background: var(--line);
        position: relative; transition: background var(--dur-base) var(--ease); flex: none; }
.sw-t i::after { content: ""; position: absolute; inset: 3px auto 3px 3px; width: 24px;
        border-radius: 50%; background: #fff; transition: transform var(--dur-base) var(--ease); }
.sw-t input:checked + i { background: var(--green); }
.sw-t input:checked + i::after { transform: translateX(20px); }
.sw-t input:focus-visible + i { outline: 3px solid var(--green); outline-offset: 3px; }

.rows { border: 1px solid var(--line); border-radius: var(--r-btn); overflow: hidden; max-width: 520px; }
.lrow { display: flex; align-items: center; gap: var(--s3); padding: 14px var(--s3);
        background: var(--card); border-top: 1px solid var(--bg); }
.rows .lrow:first-child { border-top: 0; }
.lrow .nm { flex: 1; }
.lrow .nm b { display: block; font: var(--t-label); font-size: 15px; color: var(--text); }
.lrow .nm span { font: var(--t-sm); font-size: 13px; color: var(--text-2); }
.lrow .val { text-align: end; font: var(--t-label); font-size: 15px; color: var(--text); }
.lrow .val span { display: block; font: var(--t-sm); font-size: 13px; margin-top: 2px; }
.up { color: var(--green); } .down { color: var(--red); } .flat { color: var(--icon); }

.callout { display: flex; gap: 12px; padding: 14px var(--s3); border-radius: var(--r-btn);
        font: var(--t-sm); max-width: 560px; }
.callout b { display: block; margin-bottom: 3px; color: var(--text); }
.callout.info { background: color-mix(in srgb, var(--green) 10%, transparent);
        color: var(--text-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 28%, transparent); }
.callout.bad  { background: color-mix(in srgb, var(--red) 12%, transparent);
        color: var(--text-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 32%, transparent); }

/* the two real pop-ups, shown on the light surface they ship on */
.popups { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
          gap: var(--s4); margin-top: var(--s4); max-width: 800px; }
/* the pop-up files are complete cards on their own; no bright wrapper */
.popups figure { margin: 0; }
.popups img { width: 100%; max-width: 358px; height: auto; display: block; margin-inline: auto; }
.popups figcaption { font: var(--t-sm); font-size: 13px; color: var(--text-2); margin-top: 12px; text-align: center; }

/* the real Lottie files */
.motion { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: var(--s3); margin-top: var(--s4); max-width: 860px; }
.motion figure { margin: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-btn); padding: var(--s3); text-align: center; }
.motion .lot { aspect-ratio: 1; max-width: 110px; margin-inline: auto; }
.motion figcaption { font: var(--t-sm); font-size: 12.5px; color: var(--text-2); margin-top: 8px; }

/* skeleton */
.skel { background: var(--line); border-radius: 8px; position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 8%, transparent), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ── themes: the same screen twice ──────────────────────────────── */
.explore { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
           gap: var(--s4); margin-top: var(--s4); max-width: 880px; }
.explore figure { margin: 0; }
.explore img { width: 100%; height: auto; display: block; border-radius: var(--r-sheet); }
.explore figcaption { font: var(--t-sm); font-size: 13px; color: var(--text-2); margin-top: 10px; }
.explore figcaption b { display: block; color: var(--text); font: var(--t-label); margin-bottom: 3px; }

/* ── logos and icon boards ──────────────────────────────────────── */
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
          gap: var(--s4); margin-top: var(--s4); }
.boards figure { margin: 0; }
.boards img { width: 100%; height: auto; display: block; border-radius: var(--r-sheet);
              border: 1px solid var(--line); }
.boards figcaption { font: var(--t-sm); font-size: 13px; color: var(--text-2); margin-top: 10px; }

/* ── shots and cards ────────────────────────────────────────────── */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s4); margin-top: var(--s4); }
.shots figure { margin: 0; }
.shots img { width: 100%; height: auto; display: block; border-radius: var(--r-sheet); border: 1px solid var(--card); }
.shots figcaption { font: var(--t-sm); font-size: 13px; color: var(--text-2); margin-top: 10px; }
.shots figcaption b { display: block; color: var(--text); font: var(--t-label); margin-bottom: 3px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sheet); padding: var(--s4); }
.card b { display: block; font: var(--t-h3); font-size: 17px; margin-bottom: 8px; }
.card p { font: var(--t-sm); color: var(--text-2); margin: 0; }
.card .n { font: var(--t-mono); color: var(--green); display: block; margin-bottom: 10px; }

/* multicol masonry: mixed-height widget cards pack without ragged holes */
.wid { columns: 3 240px; column-gap: var(--s3); margin-top: var(--s4); max-width: 940px; }
.wid img { width: 100%; height: auto; display: block; border-radius: var(--r-btn);
  break-inside: avoid; margin-bottom: var(--s3); }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s4); margin-top: var(--s4); }

/* ── rules ──────────────────────────────────────────────────────── */
.rules { list-style: none; padding: 0; margin: var(--s4) 0 0; max-width: 720px; }
.rules li { padding: 14px 0 14px 30px; border-top: 1px solid var(--card);
        font: var(--t-sm); color: var(--text-2); position: relative; }
.rules li::before { content: "→"; position: absolute; left: 0; color: var(--green); }
.rules li b { color: var(--text); }
.rules.no li::before { content: "✕"; color: var(--red); }

.colophon { padding: var(--s7) 0 var(--s8); }
.colophon p { font: var(--t-sm); color: var(--text-2); max-width: 64ch; }
.colophon a { color: var(--green); }
.colophon-nav { display: flex; flex-wrap: wrap; gap: var(--s4); }
.colophon-nav a { font: var(--t-label); text-decoration: none; min-height: 44px;
  display: inline-flex; align-items: center; }

@media (max-width: 760px) {
  /* the site's own header collapses on phones; here the section links live in
     the second bar anyway, so the primary bar keeps just brand and contact */
  .sb-links { display: none; }
  .sitebar-in { min-height: 58px; }
  .dsnav { top: 58px; }
  section { scroll-margin-top: 116px; }
}

@media (max-width: 760px) {
  /* the long patterns gallery becomes a sideways rail instead of a very tall
     column: snap per screen, ~78vw each, next card peeking as the cue */
  .pat-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: var(--s3); margin-inline: calc(50% - 50vw); padding: 2px 20px var(--s2);
    scrollbar-width: none; }
  .pat-scroll::-webkit-scrollbar { display: none; }
  .pat-scroll figure { flex: 0 0 78vw; scroll-snap-align: start; }
}

@media (max-width: 720px) {
  .typerow { grid-template-columns: 1fr; gap: var(--s1); }
  .hero { padding: var(--s7) 0 var(--s6); }
  section { padding: var(--s7) 0; }
  .cmap-h, .crow { grid-template-columns: 1fr 34px 1fr; }
  .cside { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cside.light { align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
