/*
 * Supertest participant-facing design language, distilled for the concept
 * prototypes. Values mirror apps/interview-next/frontend/src/styles.css and
 * the Typography/Palette stories: Inter Tight, Instrument Serif italic accent
 * words filled with the brand gradient, blackcurrant display ink, the pale
 * hero surface, the gradient primary CTA, hairline cards, glass pills.
 *
 * Every concept keeps its own layout and one signature moment; this file is
 * what makes them all read as Supertest.
 */
@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  --font-sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --brand-orange: #f87d4f;
  --brand-pink: #ee5c89;
  --brand-magenta: #ca48c2;
  --brand-purple: #933fe4;
  --brand-1: var(--brand-orange);
  --brand-2: var(--brand-pink);
  --brand-3: var(--brand-magenta);
  --brand-4: var(--brand-purple);
  --pastel-orange: color-mix(in srgb, var(--brand-orange) 15%, white);
  --pastel-pink: color-mix(in srgb, var(--brand-pink) 15%, white);
  --pastel-magenta: color-mix(in srgb, var(--brand-magenta) 15%, white);
  --pastel-purple: color-mix(in srgb, var(--brand-purple) 15%, white);

  --brand-ink: #14082b;
  --heading: var(--brand-ink);
  --primary: #933fe4;
  --primary-hover: #7f32c9;
  --primary-foreground: #f8f2fd;
  --fg: #171717;
  --muted-fg: #737373;
  --faint-fg: #a3a3a3;
  --border: #e5e5e5;
  --surface: #ffffff;
  --surface-muted: #f7f7f7;
  --hero-bg: #f6f9fc;
  --status-live: #17c964;
  --destructive: #dc2626;

  --gradient-brand: linear-gradient(135deg, var(--brand-1), var(--brand-2), var(--brand-3), var(--brand-4));
  --shadow-glass: 0 4px 12px -6px color-mix(in srgb, var(--heading) 8%, transparent);
  --shadow-cta: 0 8px 24px -8px color-mix(in srgb, var(--brand-3) 40%, transparent);
  --shadow-card: 0 12px 32px -14px color-mix(in srgb, var(--brand-ink) 12%, transparent);
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-2xl: 18px;
  --radius-3xl: 22px;
}

* {
  box-sizing: border-box;
}

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

main {
  /* pages lay main out as a grid; extra viewport height goes below the content, never into it */
  align-content: start;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--hero-bg);
  color: var(--fg);
  font: 400 16px / 1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The warm mesh that sits under participant-facing heroes. */
.mesh {
  background-color: var(--hero-bg);
  background-image:
    radial-gradient(60% 50% at 12% 8%, color-mix(in srgb, var(--brand-orange) 14%, transparent) 0%, transparent 70%),
    radial-gradient(50% 45% at 88% 12%, color-mix(in srgb, var(--brand-purple) 14%, transparent) 0%, transparent 70%),
    radial-gradient(45% 45% at 70% 90%, color-mix(in srgb, var(--brand-pink) 12%, transparent) 0%, transparent 70%);
  background-attachment: fixed;
}

/* ---- type scale (Typography.stories) */
.display {
  font-weight: 700;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--heading);
  text-wrap: balance;
  margin: 0;
}
.accent-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.h1 {
  font-weight: 600;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--heading);
  margin: 0;
}
.h2 {
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin: 0;
}
.h3 {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  color: var(--heading);
  margin: 0;
}
.body-sm {
  font-size: 14px;
  line-height: 1.5;
}
.label {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.3;
}
.caption {
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-fg);
}
.overline {
  font-weight: 600;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-fg);
}
.muted {
  color: var(--muted-fg);
}
.serif {
  font-family: var(--font-serif);
}

/* ---- header with the mark */
.st-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
}
.st-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.st-brand svg {
  width: 26px;
  height: 26px;
}
.st-header .crumb {
  color: var(--muted-fg);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.st-header .crumb:hover {
  color: var(--fg);
}

/* ---- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  height: 44px;
  font: 500 15px / 1 var(--font-sans);
  color: var(--fg);
  background: var(--surface);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-primary {
  height: 56px;
  padding: 0 8px 0 28px;
  font-size: 16px;
  color: #fff;
  background-image: var(--gradient-brand);
  box-shadow: var(--shadow-cta);
  transform: translateZ(0);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  opacity: 0.92;
}
.btn-primary:not(.no-arrow)::after {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ca48c2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14M13 6l6 6-6 6'/></svg>")
    center / 18px no-repeat;
  flex: none;
}
.btn-primary.no-arrow {
  padding-right: 28px;
}
.btn-secondary {
  border-color: var(--border);
  box-shadow: var(--shadow-glass);
}
.btn-secondary:hover:not(:disabled) {
  border-color: #cfcfcf;
}
.btn-ghost {
  background: transparent;
  color: var(--muted-fg);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--fg);
  background: var(--surface-muted);
}
.btn-dark {
  background: var(--brand-ink);
  color: #fff;
}
.btn-dark:hover:not(:disabled) {
  opacity: 0.9;
}

/* ---- inputs */
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--fg);
  font: 400 16px / 1 var(--font-sans);
  outline: none;
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.input::placeholder {
  color: var(--faint-fg);
}
.input:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
textarea.input {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

/* ---- surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, white 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(8px);
  font: 500 13px / 1 var(--font-sans);
  color: var(--fg);
}
.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint-fg);
}
.pill .dot.live {
  background: var(--status-live);
}
.pill .dot.busy {
  background: var(--brand-magenta);
  animation: st-pulse 1s ease-in-out infinite;
}
@keyframes st-pulse {
  50% {
    opacity: 0.35;
  }
}
.tint-orange {
  background: var(--pastel-orange);
}
.tint-pink {
  background: var(--pastel-pink);
}
.tint-magenta {
  background: var(--pastel-magenta);
}
.tint-purple {
  background: var(--pastel-purple);
}
.hairline {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---- the shared hand-off, rendered by lib.js runButton() */
.st-run {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.st-run-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 8px 0 28px;
  border-radius: 999px;
  font: 500 16px / 1 var(--font-sans);
  color: #fff;
  text-decoration: none;
  background-image: var(--gradient-brand);
  box-shadow: var(--shadow-cta);
  transform: translateZ(0);
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}
.st-run-button::after {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ca48c2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14M13 6l6 6-6 6'/></svg>")
    center / 18px no-repeat;
  flex: none;
}
.st-run-button:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}
.st-run-button:focus-visible {
  outline: none;
  box-shadow: var(--ring), var(--shadow-cta);
}
.st-run-frame {
  margin: 0;
  max-width: 52ch;
  color: var(--muted-fg);
  font-size: 14px;
}
.st-run-meta {
  margin: 0;
  color: var(--faint-fg);
  font-size: 12px;
}
.st-run-meta a {
  color: inherit;
}
.st-run-back {
  align-self: flex-start;
  margin-top: 4px;
  padding: 8px 14px;
  border: 1px solid var(--ring);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.st-run-back:hover {
  color: var(--heading);
}

/* ---- progress that never looks like a bare spinner */
.working {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-fg);
  font-size: 14px;
  font-weight: 500;
}
.working .spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--brand-magenta);
  animation: st-spin 0.8s linear infinite;
}
.working.done .spinner {
  animation: none;
  border-color: var(--status-live);
  background: var(--status-live);
}
@keyframes st-spin {
  to {
    transform: rotate(360deg);
  }
}

.error {
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--destructive) 6%, white);
  border: 1px solid color-mix(in srgb, var(--destructive) 30%, transparent);
  color: #8a1c1c;
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

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