/* Snap Shut brand components. Load after tokens.css. Every class is prefixed sb- so it can sit beside the site's own ss- compact styles.
   Everything here is static CSS: gradients, borders and shadows that never animate at rest. Only transform and opacity ever move. */

body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }

/* A section takes its ground from data-theme="studio|workshop|paper" */
.sb-ground { background: var(--ground); color: var(--ink); }
.sb-pad { padding: var(--space-6) max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-6) max(var(--space-4), env(safe-area-inset-left, 0px)); }

/* Engraved type: upper case, tracked, with a 1px cut line from the engrave token */
.sb-caps, .sb-caps-small, .sb-wordmark { text-transform: uppercase; text-shadow: var(--engrave); }
.sb-caps { font: 600 12px/1.3 var(--font-sans); letter-spacing: .22em; color: var(--ink-muted); }
.sb-caps-small { font: 600 10px/1.3 var(--font-sans); letter-spacing: .18em; color: var(--ink-muted); }
.sb-wordmark { font: 600 15px/1 var(--font-sans); letter-spacing: .32em; margin-right: -.32em; color: var(--ink); white-space: nowrap; }

/* The lockup: the app icon and the wordmark, the icon at 1.9x the cap height */
.sb-lockup { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.sb-lockup img { width: 28px; height: 28px; border-radius: 6.5px; display: block; }

/* Section head: eyebrow, headline, lede */
.sb-head { display: flex; flex-direction: column; gap: var(--space-3); max-width: var(--measure); }
.sb-head h1, .sb-head h2 { margin: 0; text-wrap: balance; font: 600 48px/1.06 var(--font-sans); letter-spacing: -.022em; }
.sb-head p { margin: 0; font: 400 21px/1.45 var(--font-sans); letter-spacing: -.006em; color: var(--ink-muted); }
.sb-head .sb-caps { margin-bottom: -4px; }
@media (max-width: 600px) { .sb-head h1, .sb-head h2 { font-size: 32px; line-height: 1.1; } .sb-head p { font-size: 18px; } }

/* The machined key. Silver on studio, graphite on workshop and paper. A pill with a lit top edge; it sinks 1px when pressed. */
.sb-key { -webkit-appearance: none; appearance: none; border: 0; margin: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: var(--radius-key);
  background: linear-gradient(180deg, var(--key-top), var(--key-bottom)); color: var(--key-label); box-shadow: var(--shadow-key);
  font: 600 15px/1 var(--font-sans); letter-spacing: -.005em; transition: transform .12s cubic-bezier(.3, 1.4, .5, 1); -webkit-tap-highlight-color: transparent; }
.sb-key svg { width: 18px; height: 18px; flex: none; }
.sb-key:active, .sb-key.is-down { transform: translateY(1px); box-shadow: var(--shadow-key-down); }
.sb-key:focus-visible, .sb-ruler button:focus-visible, .sb-hallmark:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
/* The round key: a 44px turned dish for one glyph (Light, Flip, Change finish when space is tight) */
.sb-key--round { width: 44px; padding: 0;
  background: repeating-radial-gradient(circle at 50% 50%, #ffffff14 0 1px, #00000010 1px 2px), linear-gradient(180deg, var(--key-top), var(--key-bottom)); }
/* The quiet key: an engraved outline for secondary actions on any ground */
.sb-key--quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-strong); }
/* Choice keys: pick one of a few (the finish picker's materials). Off keys are cut into the ground; the chosen one is the machined key, so they read on every ground. */
.sb-choices { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--space-2); }
.sb-choice { -webkit-appearance: none; appearance: none; border: 0; margin: 0; cursor: pointer; min-width: 0; min-height: 44px; padding: 0 10px; border-radius: var(--radius-key);
  display: flex; align-items: center; justify-content: center; gap: 7px; font: 600 13.5px/1 var(--font-sans); color: var(--ink-muted);
  background: var(--ground-raised); box-shadow: var(--shadow-recess); transition: color .2s ease; -webkit-tap-highlight-color: transparent; }
.sb-choice > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-choice:hover { color: var(--ink); }
.sb-choice[aria-checked="true"], .sb-choice[aria-pressed="true"], .sb-choice.is-on { color: var(--key-label); background: linear-gradient(180deg, var(--key-top), var(--key-bottom)); box-shadow: var(--shadow-key); }
.sb-choice:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sb-choice-bar { width: 6px; height: 16px; flex: none; border-radius: 1.5px; background: var(--c, #888); box-shadow: inset 0 0 0 .5px #ffffff4d, 0 1px 1px #00000066; }
.sb-choice-spark { color: var(--spark); }
.sb-choice[aria-checked="true"] .sb-choice-spark, .sb-choice[aria-pressed="true"] .sb-choice-spark, .sb-choice.is-on .sb-choice-spark { color: inherit; }
.sb-choice small { font: 500 12px/1 var(--font-sans); opacity: .75; }
.sb-choice--wide { grid-column: 1 / -1; }
/* The dial: one line of spaced caps, like the Camera app's mode switcher (finish-picker R15). The chosen word is ink with a dot under it; the rest are muted and fade at the edges. */
.sb-dial { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.sb-dial::-webkit-scrollbar { display: none; }
.sb-dial button { -webkit-appearance: none; appearance: none; border: 0; margin: 0; background: none; cursor: pointer; flex: none; position: relative; min-height: 44px; padding: 0 2px 6px;
  scroll-snap-align: center; font: 600 12px/1 var(--font-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted); -webkit-tap-highlight-color: transparent; }
.sb-dial button.is-extra { color: var(--spark); }
.sb-dial button[aria-checked="true"] { color: var(--ink); }
.sb-dial button.is-extra[aria-checked="true"] { color: var(--spark); }
.sb-dial button[aria-checked="true"]::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.sb-dial button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

/* The readout under a key: the finish's long name in the serif and a counter in mono */
.sb-readout { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sb-readout b { font: 500 22px/1.2 var(--font-serif); color: var(--ink); }
.sb-readout span { font: 500 13px/1 var(--font-mono); letter-spacing: .08em; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* The hallmark tile: atomic number top left, symbol in the serif. Compounds have no number. */
.sb-hallmark { -webkit-appearance: none; appearance: none; font: inherit; cursor: default; position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 6px; box-sizing: border-box; border-radius: var(--radius-tile); background: transparent;
  border: 1px solid var(--rule-strong); box-shadow: var(--shadow-recess); color: var(--ink); text-shadow: var(--engrave); }
button.sb-hallmark { cursor: pointer; }
.sb-hallmark sup { position: absolute; left: 4px; top: 3px; font: 600 9px/1 var(--font-sans); color: var(--ink-muted); }
.sb-hallmark b { font: 600 18px/1 var(--font-serif); padding-top: 4px; }
.sb-hallmark b.is-long { font-size: 13px; padding-top: 2px; }
.sb-hallmark.is-on::before { content: ""; position: absolute; left: 50%; top: -12px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--index-red); }
.sb-hallmark.is-on { border-color: var(--ink); }

/* The serial and the cartouche (tile | serial), as engraved on the lid */
.sb-serial { font: 500 13px/1 var(--font-mono); letter-spacing: .08em; color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-cartouche { display: inline-flex; align-items: center; gap: 10px; height: 28px; padding: 0 10px; border-radius: var(--radius-tile); border: 1px solid var(--rule-strong); box-shadow: var(--shadow-recess); text-shadow: var(--engrave); }
.sb-cartouche b { font: 600 15px/1 var(--font-serif); color: var(--ink); }
.sb-cartouche i { width: 1px; align-self: stretch; margin: 6px 0; background: var(--rule-strong); }

/* The credit line */
.sb-credit { font: 600 10px/1.4 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-muted); text-shadow: var(--engrave); }

/* The index: a hairline that ends in the red dot. Marks the live thing. */
.sb-index { display: inline-flex; align-items: center; width: 48px; height: 6px; }
.sb-index::before { content: ""; flex: 1; height: 1px; background: var(--rule-strong); }
.sb-index::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--index-red); }

/* The range ruler: one slim bar per finish, grouped by material, the red index over the current one */
.sb-ruler { display: flex; align-items: flex-end; justify-content: center; gap: 9px; padding: 14px 14px 10px; border-radius: 10px; background: var(--ground-raised); box-shadow: var(--shadow-recess); width: fit-content; max-width: 100%; box-sizing: border-box; }
.sb-ruler-group { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.sb-ruler-bars { display: flex; align-items: flex-end; gap: 2px; height: 30px; }
.sb-ruler button { -webkit-appearance: none; appearance: none; border: 0; padding: 0; margin: 0; cursor: pointer; position: relative; width: 4px; height: 20px; border-radius: 1px;
  background: var(--c); box-shadow: inset 0 1px 0 #ffffff59, inset 0 -1px 0 #00000059; transition: height .2s cubic-bezier(.3, 1.4, .5, 1); }
.sb-ruler button::after { content: ""; position: absolute; inset: -12px -2px; } /* a bigger target for fingers */
.sb-ruler button.is-on { height: 28px; }
.sb-ruler button.is-on::before { content: ""; position: absolute; left: 50%; top: -9px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--index-red); }
.sb-ruler-sym { font: 600 11px/1 var(--font-serif); color: var(--ink-muted); }

/* The finish plate: the share card's bottom strip and the From Chris header, cut from the finish's own metal.
   Set --f-stops, --f-hi, --f-lo, --f-ink and --f-cut from finish-range-r3.json (light finishes: dark ink, light cut below; dark: light ink, dark cut above). */
.sb-plate { --f-stops: #47506b 0%, #2a3148 38%, #1a1f30 64%, #39415b 100%; --f-hi: #7d87a6; --f-lo: #343b52; --f-ink: #eceff5c4; --f-cut: 0 -1px 0 #00000099;
  position: relative; overflow: hidden; display: grid; gap: 6px; padding: 14px 16px 16px; border-radius: var(--radius-plate);
  background: linear-gradient(165deg, var(--f-stops)); box-shadow: inset 0 1px 0 var(--f-hi), inset 0 -1px 0 var(--f-lo), 0 1px 2px #0000004d; color: var(--f-ink); text-shadow: var(--f-cut); }
.sb-plate::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(112deg, #ffffff00 18%, #ffffff2e 30%, #ffffff00 42%, #ffffff00 66%, #ffffff14 74%, #ffffff00 82%); }
.sb-plate-row { display: flex; justify-content: space-between; font: 600 9px/1 var(--font-sans); letter-spacing: .28em; text-transform: uppercase; }
.sb-plate-name { text-align: center; font: 500 19px/1.2 var(--font-serif); }
.sb-plate.is-light { --f-ink: #2c2824b8; --f-cut: 0 1px 0 #ffffffb3; }

/* The light pool: the finish's accent, falling from above onto studio. Static; swap --finish-acc to retint. */
.sb-pool { position: relative; isolation: isolate; }
.sb-pool::before { content: ""; position: absolute; z-index: -1; left: 50%; top: -6%; width: 130%; height: 80%; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, var(--finish-acc), #00000000); opacity: .26; }

/* The datasheet: printed rows on paper, like the back page of a camera manual */
.sb-datasheet { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 2px solid var(--rule-strong); }
.sb-datasheet > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.sb-datasheet dt { font: 500 11px/1.6 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.sb-datasheet dd { margin: 0; font: 500 17px/1.35 var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.sb-datasheet dd small { display: block; margin-top: 4px; font: 400 14px/1.45 var(--font-sans); color: var(--ink-muted); }
@media (max-width: 600px) { .sb-datasheet > div { grid-template-columns: minmax(0, 1fr); } }

/* The caseback seal: text round a ring, the turned insert in the middle */
.sb-seal { position: relative; width: 168px; height: 168px; flex: none; }
.sb-seal svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sb-seal-text { font: 600 8.6px var(--font-sans); letter-spacing: .26em; fill: var(--ink-muted); text-transform: uppercase; }
.sb-seal-ring { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.sb-seal-hair { fill: none; stroke: var(--hairline); stroke-width: 1; }
.sb-seal-dot { fill: var(--index-red); }
.sb-turned { position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; transform: translate(-50%, -50%); border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, #ffffff17 0 1px, #00000014 1px 2px),
    conic-gradient(from 10deg, #ffffff00 0deg, #ffffff57 35deg, #ffffff00 80deg, #ffffff00 190deg, #ffffff38 222deg, #ffffff00 262deg),
    linear-gradient(165deg, var(--key-top), var(--key-bottom));
  box-shadow: inset 0 0 0 1px #0000004d, 0 1px 0 #ffffff1f; }
.sb-turned::before { content: ""; position: absolute; left: 50%; top: 50%; width: 36%; height: 1.5px; margin-top: -.75px; background: #00000059; }
.sb-turned::after { content: ""; position: absolute; left: 88%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--index-red); box-shadow: inset 0 1px 1px #00000059; }

@media (prefers-reduced-motion: reduce) { .sb-key, .sb-ruler button { transition: none; } }
