@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f7f8fb;
  --surface-hover: #fff8da;
  --border: #dfe4ee;
  --border-hover: #f1cb36;
  --text: #1d3363;
  --text-secondary: #44516e;
  --text-tertiary: #6f7890;
  --accent: #f1cb36;
  --accent-hover: #e8bd1d;
  --accent-strong: #e53f26;
  --accent-strong-hover: #c93420;
  --bg-rgb: 255, 255, 255;
  --text-rgb: 29, 51, 99;
  --accent-rgb: 241, 203, 54;
  --accent-strong-rgb: 229, 63, 38;
  --success: #257d4f;
  --error: #e53f26;
  --warning: #f1cb36;
  --shadow-subtle: 0 8px 24px rgba(var(--text-rgb), 0.06);
  --shadow-elevated: 0 18px 48px rgba(var(--text-rgb), 0.08);
  --shadow-modal: 0 24px 80px rgba(var(--text-rgb), 0.24);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.18), transparent 34rem),
    linear-gradient(180deg, var(--surface-alt), var(--bg) 26rem);
}

button,
video {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100svh;
  padding: 12px;
}

.shell {
  width: min(100%, 1080px);
  margin: 0 auto;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 12px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow-subtle);
}

.brand-name {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(var(--bg-rgb), 0.94);
  box-shadow: var(--shadow-elevated);
}

.intro-panel {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: grid;
  gap: 16px;
  padding: 16px;
  transition: gap 180ms ease, padding 180ms ease, box-shadow 180ms ease;
}

.intro-copy,
.process-note {
  overflow: hidden;
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 220ms ease, opacity 180ms ease, transform 180ms ease, margin 180ms ease, padding 180ms ease, border-width 180ms ease;
}

.shell.is-compact .intro-panel {
  gap: 0;
  padding: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.shell.is-compact .intro-copy,
.shell.is-compact .process-note {
  display: none;
  max-height: 0;
  margin: 0;
  border-width: 0;
  padding-left: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.intro-panel h1,
.intro-panel p,
.process-note h2,
.process-note p,
.video-heading h2,
.eyebrow {
  margin: 0;
}

.intro-panel h1 {
  max-width: 12em;
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.08;
}

.intro-panel p,
.dialog p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
}

.badge {
  width: fit-content;
  border: 1px solid rgba(var(--accent-rgb), 0.65);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 750;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  padding: 4px;
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.tab:active {
  transform: translateY(1px);
}

.tab:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 2px;
}

.tab[aria-selected="true"] {
  background: var(--text);
  color: var(--bg);
}

.process-note {
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

.process-note h2 {
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.2;
}

.process-note p {
  margin-top: 5px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0.72rem 0.9rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.42);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--text);
}

.button-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button-compact {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.56rem 0.74rem;
}

.button-ghost {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.56rem 0.74rem;
}

.button-icon {
  width: 18px;
  height: 18px;
}

.full-width {
  width: 100%;
}

.video-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.video-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 0;
}

.eyebrow {
  color: var(--text-tertiary);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.video-heading h2 {
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.2;
}

.video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  aspect-ratio: 9 / 20;
  background: var(--text);
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--text);
  object-fit: contain;
}

.dialog {
  width: min(92vw, 500px);
  max-height: min(86svh, 720px);
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow-modal);
}

.dialog::backdrop {
  background: rgba(var(--text-rgb), 0.52);
}

.dialog-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.dialog h2 {
  margin: 0;
  padding-right: 52px;
  color: var(--text);
  font-size: 1.28rem;
  line-height: 1.18;
}

.chat-preview {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 38%),
    var(--surface-alt);
  padding: 12px;
}

.chat-bubble {
  display: grid;
  gap: 6px;
  width: fit-content;
  max-width: min(88%, 360px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.42;
}

.chat-bubble-assistant {
  justify-self: start;
  background: var(--surface);
}

.chat-bubble-user {
  justify-self: end;
  border-color: rgba(var(--accent-rgb), 0.65);
  background: rgba(var(--accent-rgb), 0.26);
}

.chat-bubble strong,
.chat-bubble small {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.chat-bubble code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  font-weight: 700;
}

.icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.icon-button:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.icon-button:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.42);
  outline-offset: 2px;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.reveal-in {
  animation: fadeInUp 360ms ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .page {
    padding: 20px;
  }

  .intro-panel,
  .video-panel {
    padding: 22px;
  }
}

@media (min-width: 900px) {
  .page {
    display: grid;
    align-items: center;
    padding: 32px;
  }

  .masthead {
    padding-bottom: 18px;
  }

  .layout {
    grid-template-columns: minmax(320px, 420px) minmax(280px, 380px);
    align-items: start;
    justify-content: center;
    gap: 18px;
  }

  .intro-panel {
    position: sticky;
    top: 24px;
  }

  .intro-panel h1 {
    font-size: 2.15rem;
  }

  .video-frame {
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
  }
}

@media (max-width: 420px) {
  .brand-name {
    max-width: 144px;
  }

  .button-ghost {
    padding-inline: 0.62rem;
  }

  .intro-panel {
    padding: 14px;
  }

  .dialog-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
