/* Core components. Built only from tokens/colors.css and tokens/foundations.css.
   The brand hub shows these on its Components page. The site will import this same file. */

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5);
  font-family: var(--font-head); font-weight: var(--weight-bold); font-size: 0.9375rem; letter-spacing: 0.03em; line-height: 1;
  text-decoration: none; cursor: pointer;
  border: var(--line-control) solid transparent; border-radius: var(--radius-control);
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn-cta { background: var(--fill-cta); color: var(--text-on-accent); }
.btn-cta:hover, .btn-cta.is-hover { background: var(--fill-cta-hover); color: var(--text-on-accent); }
.btn-cta:active, .btn-cta.is-pressed { background: var(--fill-cta-pressed); transition-duration: var(--duration-instant); }
.btn-ghost { background: transparent; border-color: var(--stroke-default); color: var(--text-primary); }
.btn-ghost:hover, .btn-ghost.is-hover { border-color: var(--stroke-strong); background: var(--state-hover); color: var(--text-primary); }
.btn-ghost:active, .btn-ghost.is-pressed { background: var(--state-pressed); }
.btn-quiet { background: transparent; color: var(--text-link); padding: 0 var(--space-3); }
.btn-quiet:hover, .btn-quiet.is-hover { background: var(--state-hover); color: var(--text-link-hover); }
.btn[disabled], .btn.is-disabled { background: var(--fill-disabled); border-color: transparent; color: var(--text-disabled); cursor: not-allowed; }
.btn-small { min-height: 36px; padding: 0 var(--space-4); font-size: 0.8125rem; }

/* ---- Links ---- */
.link { color: var(--text-link); text-underline-offset: 3px; transition: color var(--duration-fast) var(--ease-out); }
.link:hover { color: var(--text-link-hover); }
.link-arrow { font-family: var(--font-head); font-weight: var(--weight-bold); text-decoration: none; }
.link-arrow::after { content: ' \2192'; }

/* ---- Form fields ---- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .field-label { font-size: var(--type-small-size); color: var(--text-secondary); }
.field .hint { font-size: var(--type-caption-size); color: var(--text-muted); }
.field .error { font-size: var(--type-caption-size); color: var(--text-error); }
.input, .field input[type='text'], .field input[type='email'], .field input[type='number'], .field textarea, .field select {
  width: 100%; font: inherit; font-size: 0.9375rem; color: var(--text-primary);
  background: var(--surface-0); border: var(--line-control) solid var(--stroke-default); border-radius: var(--radius-control);
  padding: 10px 12px; min-height: 44px;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field ::placeholder { color: var(--text-muted); }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--stroke-strong); }
.field input:focus, .field textarea:focus, .field select:focus, .input.is-focus { outline: none; border-color: var(--stroke-focus); box-shadow: var(--shadow-focus); }
.field .is-error, .input.is-error { border-color: var(--stroke-error); }

/* Choice chips: radio buttons and checkboxes shown as pills you can tap. */
.choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-4);
  border: var(--line-control) solid var(--stroke-default); border-radius: var(--radius-control);
  font-size: 0.9375rem; color: var(--text-primary);
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.choice:hover span { border-color: var(--stroke-strong); background: var(--state-hover); }
.choice input:checked + span { background: var(--state-selected); border-color: var(--stroke-accent); }
.choice input:focus-visible + span { box-shadow: var(--shadow-focus); }

/* ---- Tags and badges ---- */
.tag {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 var(--space-2);
  font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1; white-space: nowrap;
  color: var(--text-secondary); border: var(--line-thin) solid var(--stroke-subtle); border-radius: var(--radius-tag);
}
.tag-accent { background: var(--fill-accent-quiet); border-color: transparent; color: var(--text-link); }
.tag-new { background: var(--fill-highlight); border-color: transparent; color: var(--text-on-accent); }

/* ---- Cards ---- */
.card {
  display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
  background: var(--surface-1); border: var(--line-thin) solid var(--stroke-subtle); border-radius: var(--radius-card);
  padding: var(--space-5);
}
.card-raised { background: var(--surface-2); box-shadow: var(--shadow-2); }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--text-secondary); font-size: 0.9375rem; }

/* A case study card: picture on top, label, title, one line, tags. The whole card is a link. */
.work-card {
  display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit;
  background: var(--surface-1); border: var(--line-thin) solid var(--stroke-subtle); border-radius: var(--radius-card); overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}
.work-card:hover, .work-card.is-hover { border-color: var(--stroke-accent); background: var(--surface-2); color: inherit; }
.work-card:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.work-card .thumb { aspect-ratio: 16 / 10; background: var(--surface-2) center / cover no-repeat; border-bottom: var(--line-thin) solid var(--stroke-subtle); }
.work-card .body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5) var(--space-5); }
.work-card .kicker { font-family: var(--font-mono); font-size: var(--type-mono-size); color: var(--text-secondary); }
.work-card .kicker b { color: var(--text-link); font-weight: var(--weight-medium); }
.work-card h3 { margin: 0; font-size: 1.375rem; }
.work-card p { margin: 0; color: var(--text-secondary); font-size: 0.9375rem; }
.work-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-1); }

/* ---- Media frame: for stills and video ---- */
.media { position: relative; background: var(--surface-1); border: var(--line-thin) solid var(--stroke-subtle); border-radius: var(--radius-media); overflow: hidden; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.media .play { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: var(--fill-cta); border: 0; border-radius: var(--radius-control); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out); }
.media .play:hover { background: var(--fill-cta-hover); }
.media .play:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.media .play::before { content: ''; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent var(--text-on-accent); margin-left: 4px; }
.media .caption { position: absolute; left: var(--space-3); bottom: var(--space-3); font-family: var(--font-mono); font-size: var(--type-mono-size); color: var(--text-secondary); background: var(--surface-0); padding: 3px 8px; }

/* ---- Messages ---- */
.alert { border: var(--line-thin) solid var(--stroke-default); border-radius: var(--radius-control); padding: var(--space-3) var(--space-4); font-size: 0.9375rem; background: var(--surface-1); }
.alert-error { background: var(--fill-error-quiet); border-color: var(--stroke-error); color: var(--red-200); }
.alert-ok { border-color: var(--lime-600); color: var(--lime-200); }

/* ---- Lists and menus ---- */
.menu { border: var(--line-thin) solid var(--stroke-subtle); border-radius: var(--radius-card); overflow: hidden; background: var(--surface-1); }
.menu-raised { background: var(--surface-2); box-shadow: var(--shadow-2); }
.menu > * { display: block; padding: 11px var(--space-4); font-size: 0.9375rem; color: var(--text-primary); text-decoration: none; border-bottom: var(--line-thin) solid var(--stroke-subtle); }
.menu > *:last-child { border-bottom: 0; }
.menu > *:hover, .menu > .is-hover { background: var(--state-hover); color: var(--text-primary); }
.menu > .is-selected { background: var(--state-selected); box-shadow: inset 3px 0 0 var(--stroke-accent); }

/* ---- Site header and footer ---- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 64px; padding: 0 var(--space-5); background: var(--surface-0); border-bottom: var(--line-thin) solid var(--stroke-subtle); }
.site-header img { height: 26px; display: block; }
.site-header nav { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.site-header nav a { font-family: var(--font-mono); font-size: var(--type-mono-size); color: var(--text-secondary); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--text-primary); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; padding: var(--space-6) var(--space-5); background: var(--surface-0); border-top: var(--line-thin) solid var(--stroke-subtle); font-family: var(--font-mono); font-size: var(--type-mono-size); color: var(--text-secondary); }
.site-footer img { height: 22px; display: block; }
.site-footer a { color: var(--text-secondary); text-decoration: none; margin-left: var(--space-4); }
.site-footer a:hover { color: var(--text-link-hover); }
