/* Shared by all four looks: reset, skip link, theme toggle base, the figure's drawing, motion rules.
   Each look's style.css sets the look itself. Colours and sizes come from that look's tokens.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-kerning: normal;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 40;
  padding: 0.5rem 0.875rem;
  background: var(--bg);
  color: var(--ink);
  outline: 2px solid var(--accent);
}

.skip:focus {
  top: 1rem;
}

/* The toggle: small, fixed, top right. Looks restyle its face. */
.theme-toggle {
  position: fixed;
  top: 0.875rem;
  right: 0.875rem;
  z-index: 30;
  margin: 0;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: color 150ms ease-out, border-color 150ms ease-out;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The theme switch is one cross-fade of the whole page (theme.js uses View Transitions), not a transition on every
   element: per-element colour transitions on inherited text made the content flash after each switch. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 280ms;
  animation-timing-function: ease;
}

/* Short display lines wrap evenly instead of leaving one word behind */
.lead,
figcaption,
.intro {
  text-wrap: balance;
}

/* Code */
pre,
code {
  font-family: var(--font-mono);
}

pre.code {
  overflow-x: auto;
  font-size: var(--fs-code);
  line-height: var(--lh-code);
  tab-size: 2;
}

pre.code .c {
  color: var(--muted);
}

/* The figure: two drawn panels that wrap onto two rows on phones. */
.fig {
  margin: 0;
}

.fig-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.fig-panel {
  flex: 1 1 15rem;
  display: block;
  height: auto;
  min-width: 0;
}

.fig-panel text {
  fill: var(--ink);
  font-size: 12.5px;
}

.fp-bg {
  fill: var(--surface);
  stroke: var(--rule);
}

.fp-dot {
  fill: var(--rule);
}

.fp-mono {
  font-family: var(--font-mono);
}

.fp-sans {
  font-family: var(--font-ui);
}

.fig-panel .fp-muted {
  fill: var(--muted);
}

.fig-panel .fp-ok {
  fill: var(--accent);
}

.fig-panel .fp-strong {
  font-weight: 600;
}

.fp-field {
  fill: var(--bg);
  stroke: var(--rule);
}

.fp-button {
  fill: var(--accent);
}

.fig-panel .fp-button-text {
  fill: var(--on-accent);
  font-weight: 600;
}

.fp-cursor {
  fill: var(--ink);
  stroke: var(--bg);
  stroke-width: 1;
}

.fp-rule {
  stroke: var(--rule);
}

/* A note or section you jump to glows once, then fades back. */
@keyframes target-glow {
  from {
    background-color: var(--selection);
  }
  to {
    background-color: transparent;
  }
}

.footnotes li:target {
  animation: target-glow 1.6s ease-out;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Reduced motion: every micro-interaction switches off. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Style guide pages: structure only. Each look sets the type. */
.g-sec {
  margin-top: var(--space-7);
}

.g-font,
.g-spec,
.g-motion {
  margin: var(--space-5) 0;
}

.g-font-name {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-h3);
  line-height: 1.3;
}

.g-dl {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  margin: 0;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.g-dl dt {
  color: var(--muted);
}

.g-dl dd {
  margin: 0;
}

@media (max-width: 30rem) {
  .g-dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .g-dl dd {
    margin-bottom: var(--space-2);
  }
}

.g-sample {
  margin: 0 0 var(--space-1);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.g-meta,
.g-measured {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.g-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--space-4);
  margin: var(--space-3) 0 var(--space-5);
  padding: 0;
  list-style: none;
}

.g-swatch {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.g-chip {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--rule);
}

.g-sw-text code {
  font-size: 0.875em;
}

.g-ratio {
  color: var(--muted);
}

.g-space {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.g-space li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-1) 0;
  font-size: var(--fs-small);
}

.g-bar {
  display: block;
  height: 0.75rem;
  background: var(--accent);
}

.g-sp-label {
  color: var(--muted);
}

.g-measure-sample {
  max-width: var(--measure);
  margin-top: var(--space-4);
}

.g-motion h3 {
  margin: 0 0 var(--space-2);
}

/* ---------------------------------------------------------------- round 3 (looks E, F, G) */

/* The sliding Dark/Light switch (first seen in look H). The knob sits on the side of the current theme. */
.theme-toggle.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  background: var(--bg);
  border-color: var(--rule);
  color: var(--muted);
}

.theme-toggle.switch::before {
  content: "";
  flex: none;
  width: 2.1rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--muted);
  transition: background-color 200ms ease;
}

.theme-toggle.switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.55rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transform: translate(0, -50%);
  transition: transform 200ms ease;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle.switch::before {
    background: var(--accent);
  }
  :root:not([data-theme="light"]) .theme-toggle.switch::after {
    transform: translate(0.85rem, -50%);
  }
}

:root[data-theme="dark"] .theme-toggle.switch::before {
  background: var(--accent);
}

:root[data-theme="dark"] .theme-toggle.switch::after {
  transform: translate(0.85rem, -50%);
}

/* Topic filter: the list fades back in after a click */
.filters[hidden] {
  display: none;
}

.groups.is-fading,
.feat-list.is-fading {
  animation: filter-fade 150ms ease-out;
}

@keyframes filter-fade {
  from {
    opacity: 0.2;
  }
  to {
    opacity: 1;
  }
}

/* Landing: sample stills */
.stills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.still {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.still img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface);
}

.still-name,
.still-what {
  display: block;
}

.still-what {
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

/* Summit form: structure. Looks set the borders and type. */
.hello {
  display: grid;
  gap: var(--space-4);
}

.field label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 600;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--muted);
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent-text, var(--accent));
  outline-offset: 1px;
}

.hint {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
}

.form-actions button {
  cursor: pointer;
  font: inherit;
}

.form-actions button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.status {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.hello.is-error .status {
  color: var(--ink);
  font-weight: 600;
}

.sent:focus {
  outline: none;
}

.sent-line {
  font-weight: 600;
}

/* On phones the switch drops its word and keeps the track; its label stays for screen readers (theme.js) */
@media (max-width: 47.99rem) {
  .theme-toggle.switch {
    gap: 0;
    padding: 0.3rem;
    font-size: 0;
  }
}

/* ---------------------------------------------------------------- round 5: the hanging lamp (looks E, G) */
.lamp {
  position: relative;
  flex: none;
  margin: 0;
  padding: 0 2px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.lamp:focus-visible {
  outline: 2px solid var(--accent-text, var(--accent));
  outline-offset: 2px;
}

.lamp-svg {
  display: block;
  overflow: visible;
}

.lamp-cord,
.lamp-shade,
.lamp-string,
.lamp-bulb,
.lamp-bead {
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lamp-shade {
  fill: var(--bg);
}

.lamp-bead {
  fill: currentColor;
  stroke-width: 0;
}

.lamp-bulb {
  fill: none;
  transition: fill 200ms ease;
}

.lamp-cone {
  opacity: 0;
  transition: opacity 250ms ease;
}

.lamp[aria-pressed="true"] .lamp-bulb {
  fill: #FFC35A;
}

.lamp[aria-pressed="true"] .lamp-cone {
  opacity: 1;
}

.lamp-string {
  transform-box: fill-box;
  transform-origin: 50% 0;
}

/* The string's pull and swing are a damped spring in theme.js (round 6), not CSS keyframes. */

/* "Lately" bar and "Now" notice: structure. Looks set the tint and type. */
.notice-bar p {
  margin: 0;
}

.now-note summary {
  cursor: pointer;
  list-style: none;
}

.now-note summary::-webkit-details-marker {
  display: none;
}

.why {
  white-space: nowrap;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.25em;
}

.why::after {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.2em) rotate(45deg);
  transition: transform 200ms ease;
}

.now-note[open] .why::after {
  transform: translateY(0.05em) rotate(225deg);
}

.now-note[open] .why-body {
  animation: why-open 220ms ease-out;
}

@keyframes why-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.why-body p {
  margin: 0 0 0.7em;
}

.why-body p:last-child {
  margin-bottom: 0;
}

/* Work cards: same frame, same size, still inset */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.card-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 11;
  padding: 7%;
  overflow: hidden;
}

.card-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-name,
.card-what {
  display: block;
}

.card-name {
  margin-top: var(--space-3);
}

.card-what {
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

/* ---------------------------------------------------------------- /ai-summit-vancouver/: three choices, then Calendly */
.choices {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
}

.choice {
  display: block;
  padding: var(--space-4) var(--space-4);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, opacity 150ms ease-out;
}

.choice-title,
.choice-what {
  display: block;
}

.choice-title {
  font-weight: 600;
}

.choice-what {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.has-pick .choice:not(.is-picked) {
  opacity: 0.62;
}

.has-pick .choice:not(.is-picked):hover,
.has-pick .choice:not(.is-picked):focus-visible {
  opacity: 1;
}

.booking {
  margin: 0 0 var(--space-5);
  scroll-margin-top: var(--space-4);
}

.booking:focus {
  outline: none;
}

.cal-embed {
  min-width: 320px;
  height: 700px;
}

.cal-fallback {
  margin: 0;
  padding: var(--space-4);
}

.link-button {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.note {
  scroll-margin-top: var(--space-4);
}

.note > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--fs-small);
  margin-bottom: var(--space-4);
}

.note[open] > summary {
  margin-bottom: var(--space-5);
}

/* ---------------------------------------------------------------- round 6: the lamp's string leans toward a near cursor */
.lamp-pull {
  transform-box: view-box;
  transform-origin: 19.5px 23px;  /* the top of the string, where it leaves the shade: theme.js swings it from here */
}

/* ---------------------------------------------------------------- round 6: summit page picks (radio cards) */
.summit-label {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.summit-h1 {
  margin: 0;
}

.summit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.summit-art {
  flex: none;
  color: var(--ink);
}

.qr-card {
  display: block;
  width: 4.5rem;
  height: auto;
}

.qr-card,
.pick-art svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qr-card .qr-edge {
  stroke-width: 1.2;
  opacity: 0.55;
}

.art-accent {
  fill: var(--accent);
  stroke: none;
}

.art-accent-soft {
  fill: color-mix(in srgb, var(--accent) 22%, transparent);
  stroke: var(--accent);
}

.art-accent-line {
  stroke: var(--accent);
}

.picks {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  margin: 0 0 var(--space-5);
  padding: 0;
  border: 0;
}

.pick {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  background: var(--bg);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out, background-color 150ms ease-out;
}

.pick:hover {
  border-color: var(--muted);
}

.pick:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.pick:has(input:focus-visible) {
  outline: 2px solid var(--accent-text, var(--accent));
  outline-offset: 3px;
}

/* The real radio stays in the page for keyboards and screen readers; the drawn circle shows its state */
.pick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pick-art {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg));
  color: var(--ink);
}

.pick-art svg {
  width: 2.6rem;
  height: auto;
}

.pick-title,
.pick-what {
  display: block;
}

.pick-title {
  font-weight: 600;
  line-height: 1.3;
}

.pick-what {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.pick-radio {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}

.pick-radio svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 150ms ease-out, transform 200ms cubic-bezier(0.3, 1.5, 0.5, 1);
}

.pick:has(input:checked) .pick-radio {
  background: var(--accent);
  border-color: var(--accent);
}

.pick:has(input:checked) .pick-radio svg {
  opacity: 1;
  transform: none;
}

@media (max-width: 30rem) {
  .pick {
    gap: var(--space-2) var(--space-3);
    padding: 0.7rem 0.8rem 0.7rem 0.7rem;
  }
  .pick-art {
    width: 2.9rem;
    height: 2.9rem;
  }
  .pick-art svg {
    width: 2.2rem;
  }
  .qr-card {
    width: 3.6rem;
  }
}

/* Landing h1 in two sentences ("Name's Sam." / "I help startups grow."): each starts its own line */
.h1-a,
.h1-b {
  display: block;
}

.h1-b {
  text-wrap: balance;
}
