/* Fonts: IBM Plex Sans and IBM Plex Mono, both under the SIL Open Font License. */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/ibm-plex-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

/* One dark theme. Neutrals lean toward blue (hue 255); the accent is a warm postmark orange. */
:root {
  color-scheme: dark;
  --bg: oklch(15% 0.014 255);
  --panel: oklch(18.5% 0.016 255);
  --panel-bar: oklch(21.5% 0.018 255);
  --rule: oklch(29% 0.02 255);
  /* Borders that mark a control need 3:1 against the page. */
  --control-border: oklch(52% 0.02 255);
  --text: oklch(94% 0.008 255);
  --muted: oklch(76% 0.018 255);
  --faint: oklch(64% 0.022 255);
  --accent: oklch(76% 0.15 45);
  --accent-hover: oklch(83% 0.12 50);
  --green: oklch(82% 0.12 155);
  --danger: oklch(72% 0.16 25);
  --danger-bg: oklch(22% 0.045 25);
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --section-gap: clamp(4.5rem, 10vw, 7.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 380 1.0625rem/1.7 var(--sans);
  -webkit-text-size-adjust: 100%;
}
::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--accent-hover);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

code,
pre,
kbd {
  font-family: var(--mono);
  font-variant-ligatures: none;
}
:not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--panel-bar);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}
h2 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1.125rem;
  line-height: 1.3;
}
p {
  margin: 0;
}

.wrap {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font: 600 1rem/1 var(--mono);
  text-decoration: none;
}
.wordmark img {
  display: block;
}
.wordmark:hover {
  color: var(--text);
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin-left: auto;
  font-size: 0.9375rem;
}
.site-header nav a:not(.button) {
  color: var(--muted);
  text-decoration: none;
}
.site-header nav a:not(.button):hover {
  color: var(--text);
}

/* Buttons */
button {
  font: inherit;
  cursor: pointer;
}
.button {
  display: inline-block;
  padding: 0.7em 1.15em;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
}
.button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--bg);
}
.button-quiet {
  padding: 0.45em 0.9em;
  border-color: var(--control-border);
  background: transparent;
  color: var(--text);
  font-size: 0.9375rem;
}
.button-quiet:hover {
  border-color: var(--text);
  background: transparent;
  color: var(--text);
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}
.text-button:hover {
  color: var(--text);
  text-decoration-color: var(--accent);
}

/* Hero */
.hero {
  padding-block: clamp(3.5rem, 9vw, 6.5rem) 0;
}
.hero h1 {
  max-width: 22ch;
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
}
.lede {
  max-width: 40rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.125rem, 1.8vw, 1.3125rem);
  line-height: 1.55;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
}

/* Terminal and code windows */
.window {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--panel-bar);
  color: var(--faint);
  font: 400 0.8125rem/1.3 var(--mono);
  overflow-wrap: anywhere;
}
/* Three window dots, drawn from one element. */
.window-bar::before {
  content: '';
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  margin-right: 2rem;
  border-radius: 50%;
  background: var(--rule);
  box-shadow:
    1rem 0 0 var(--rule),
    2rem 0 0 var(--rule);
}
.window pre {
  margin: 0;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.75;
  tab-size: 2;
}
.terminal {
  margin-top: clamp(3rem, 7vw, 4.5rem);
}

/* Token colors, shared by the terminal and code samples. */
.t-prompt {
  color: var(--accent);
}
.t-str,
.t-ok {
  color: var(--green);
}
.t-dim {
  color: var(--faint);
}
.t-flag {
  color: var(--muted);
}

/* The session plays in beats: the prompt is typed, then Claude answers, calls the API, and reports. */
.step {
  display: block;
  animation: step-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.step-2 {
  animation-delay: 1.6s;
}
.step-3 {
  animation-delay: 2.3s;
}
.step-4 {
  animation-delay: 3.3s;
}
.step-5 {
  animation-delay: 4.1s;
}
/* The prompt is 25 characters, so it types in 25 steps. clip-path keeps layout still. */
.typed {
  animation: type 1.1s steps(25, end) 0.3s both;
}
@keyframes type {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
}
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--text);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.window b {
  font-weight: 600;
}
/* Claude Code marks. Drawn in CSS, so each takes exactly one character cell on every platform. */
.dot {
  display: inline-block;
  width: 1ch;
  height: 1ch;
  border-radius: 50%;
  background: currentColor;
  transform: scale(0.72);
}
.elbow {
  display: inline-block;
  width: 1ch;
  height: 0.75em;
  border-bottom: 1px solid var(--faint);
  border-left: 1px solid var(--faint);
  vertical-align: 0.35em;
}
.cc-input {
  margin-top: 1.25rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

/* Page sections */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
.section {
  margin-top: var(--section-gap);
  scroll-margin-top: 1.5rem;
}
.section-intro {
  max-width: 40rem;
  margin-top: 0.75rem;
  color: var(--muted);
}

.provider-table {
  width: 100%;
  max-width: 46rem;
  margin-top: 2rem;
  border-collapse: collapse;
}
.provider-table th,
.provider-table td {
  padding: 0.8rem 1.25rem 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: baseline;
}
.provider-table thead th {
  padding-top: 0;
  color: var(--faint);
  font: 400 0.8125rem/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.provider-table tbody th {
  font-weight: 500;
}
.provider-table td:last-child {
  padding-right: 0;
  color: var(--muted);
}

.features,
.handling {
  max-width: 46rem;
}
.features h2,
.handling h2 {
  margin-bottom: 1.5rem;
}
.handling h3 {
  margin: 2.75rem 0 0.75rem;
}
.handling p + p {
  margin-top: 1rem;
}
.facts {
  margin: 0;
  padding: 0;
  list-style: none;
}
.facts li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.75rem;
  border-top: 1px solid var(--rule);
}
.facts li:last-child {
  border-bottom: 1px solid var(--rule);
}
.facts li::before {
  content: '-';
  position: absolute;
  left: 0.25rem;
  color: var(--accent);
  font-family: var(--mono);
}

/* Footer */
.site-footer {
  margin-top: var(--section-gap);
  padding-block: 1.75rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.875rem;
}
.site-footer p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.site-footer p + p {
  margin-top: 0.5rem;
}
.site-footer a {
  color: var(--muted);
}

/* Privacy policy */
.letter {
  max-width: 44rem;
  padding-block: clamp(2.5rem, 7vw, 4.5rem) 0;
}
.letter-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.letter .effective {
  margin: 0.75rem 0 2.5rem;
  color: var(--faint);
  font: 400 0.875rem/1.5 var(--mono);
}
.letter h2 {
  margin: 3rem 0 0.75rem;
  font-size: 1.375rem;
}
.letter p {
  margin: 0 0 1rem;
}
.letter ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
.letter li + li {
  margin-top: 0.5rem;
}
.letter li::marker {
  color: var(--accent);
}
.records {
  margin: 1.25rem 0 0;
  border-bottom: 1px solid var(--rule);
}
.records > div {
  padding-block: 0.9rem;
  border-top: 1px solid var(--rule);
}
.records dt {
  font-weight: 600;
}
.records dd {
  margin: 0.15rem 0 0;
}
.records .kept {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.875rem;
}

/* Forms */
label {
  font-size: 0.9375rem;
  font-weight: 500;
}
input,
select {
  width: 100%;
  padding: 0.6em 0.8em;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.4 var(--mono);
}
input:hover,
select:hover {
  border-color: var(--muted);
}
input:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: 0;
}
input::placeholder {
  color: var(--faint);
}
.stacked-form {
  display: grid;
  gap: 0.5rem;
}
.stacked-form .button {
  margin-top: 0.75rem;
}
.stacked-form .text-button {
  justify-self: start;
  margin-top: 0.5rem;
}
#code {
  letter-spacing: 0.3em;
}
#code-note {
  margin-bottom: 0.75rem;
  color: var(--muted);
}
.form-message {
  margin: 0 0 1.5rem;
  padding: 0.75em 1em;
  border: 1px solid var(--danger);
  border-radius: 4px;
  background: var(--danger-bg);
  color: var(--text);
}

/* Sign-in */
.sign-in {
  max-width: 27rem;
  margin-inline: auto;
  padding-block: clamp(2.5rem, 9vw, 5.5rem) 3rem;
}
.sign-in .window-body {
  padding: clamp(1.25rem, 5vw, 2rem);
}
.sign-in h1 {
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.sign-in-sub {
  margin: 0.5rem 0 1.75rem;
  color: var(--muted);
}
.sign-in-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 1.25rem;
  color: var(--faint);
  font: 400 0.8125rem/1 var(--mono);
}
.sign-in-divider::before,
.sign-in-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--rule);
}
.sign-in-note {
  margin-top: 1.5rem;
  color: var(--faint);
  font-size: 0.9375rem;
}
/* Dark-theme colors and type from Google's Sign in with Google button guidelines. */
.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #8e918f;
  border-radius: 4px;
  background: #131314;
  color: #e3e3e3;
  font: 500 14px/20px 'Google Sans', Roboto, Arial, sans-serif;
  text-decoration: none;
}
.google-button:hover {
  background: #1f2022;
  color: #e3e3e3;
}

/* Dashboard */
.account-nav {
  overflow-wrap: anywhere;
}
#user-email {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.875rem;
}
.site-header + .form-message {
  margin-top: 2rem;
}
.dashboard {
  max-width: 48rem;
  padding-block: clamp(2.5rem, 6vw, 4rem) 0;
}
.dashboard h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.dashboard-intro {
  margin: 0.75rem 0 2rem;
  color: var(--muted);
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.inline-form > div {
  flex: 1 1 16rem;
  display: grid;
  gap: 0.4rem;
}
.new-key {
  margin-top: 2rem;
  border-color: var(--accent);
}
.new-key .window-body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.new-key h2 {
  font-size: 1.25rem;
}
.new-key p {
  margin: 0.25rem 0 1rem;
  color: var(--muted);
}
.new-key code {
  display: block;
  margin-bottom: 1rem;
  padding: 0.75em 1em;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
  color: var(--green);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
  user-select: all;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.no-keys {
  margin-top: 2rem;
  color: var(--faint);
}
.keys {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}
.keys:empty {
  display: none;
}
.keys li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 1.5rem;
  padding-block: 1rem;
  border-top: 1px solid var(--rule);
}
.keys li:last-child {
  border-bottom: 1px solid var(--rule);
}
.keys strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.keys code,
.keys .key-dates {
  grid-column: 1;
  color: var(--faint);
  font-size: 0.875rem;
}
.keys code {
  padding: 0;
  background: none;
}
.keys .text-button {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
.keys .text-button:hover {
  color: var(--danger);
  text-decoration-color: var(--danger);
}
.connect,
.usage,
.mailboxes {
  margin-top: 4rem;
}
.connect h2,
.usage h2,
.mailboxes h2 {
  font-size: 1.375rem;
}
.connect > p,
.usage > p,
.mailboxes > p {
  margin: 0.5rem 0 1.25rem;
  color: var(--muted);
}
.mailboxes h3 {
  margin-top: 2.5rem;
}
.connect-form {
  max-width: 27rem;
}
.connect-form .form-message {
  margin-bottom: 0.5rem;
}
.form-hint {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.button:disabled {
  cursor: wait;
  opacity: 0.7;
}
.agents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.agents li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.agents svg {
  width: 1.5rem;
  height: 1.5rem;
}
.mailboxes .keys {
  margin-top: 0;
}
.usage .more {
  margin-top: 1.25rem;
}

/* On a phone, wrap long lines the way a real terminal does, so nobody scrolls sideways to read. */
@media (max-width: 40rem) {
  /* Sign in stays beside the logo; the links take their own row. */
  .site-header > .button {
    margin-left: auto;
  }
  .site-header nav {
    order: 1;
    flex-basis: 100%;
    margin-left: 0;
  }
  /* Each provider becomes two lines: name and API value, then how you connect. */
  .provider-table {
    border-top: 1px solid var(--rule);
  }
  .provider-table thead {
    display: none;
  }
  .provider-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 1rem;
    padding-block: 0.8rem;
    border-bottom: 1px solid var(--rule);
  }
  .provider-table th,
  .provider-table td {
    padding: 0;
    border: 0;
  }
  .provider-table td:last-child {
    grid-column: 1 / -1;
  }
  .terminal pre {
    padding-inline: 1rem;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step,
  .typed,
  .cursor {
    animation: none;
  }
}
