/* Authtext marketing site. Colours, type and radii come from tokens.css (the brand kit). */

@font-face { font-family: "Sora"; font-weight: 400; font-display: swap; src: url("/fonts/sora-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url("/fonts/sora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 700; font-display: swap; src: url("/fonts/sora-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url("/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); }

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--at-space-5); }

body {
  margin: 0;
  background: var(--at-color-bg);
  color: var(--at-color-text);
  font: var(--at-text-body);
  overflow-x: hidden;
}

a { color: var(--at-color-text-muted); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--at-color-text); }
p a, td a, li a { color: var(--at-color-info); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--at-color-focus); outline-offset: 2px; border-radius: var(--at-radius-sm); }

h1, h2, h3, p, ul, dl, table { margin: 0; }
h1 { font: var(--at-text-display); letter-spacing: var(--at-tracking-display); font-size: clamp(2.5rem, 6vw, 4.25rem); }
h2 { font: var(--at-text-h2); letter-spacing: var(--at-tracking-h2); }
h3 { font: var(--at-text-h3); letter-spacing: var(--at-tracking-h3); font-size: 1.125rem; }
code, pre, .mono { font-family: var(--at-font-mono); font-weight: 500; }
p code, li code, td code { font-size: 0.875em; color: var(--at-color-text); }
strong { font-weight: 600; color: var(--at-color-text); }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: var(--at-space-5); padding-right: var(--at-space-5); }
.stack { display: flex; flex-direction: column; gap: var(--at-space-6); padding-top: var(--at-space-8); padding-bottom: var(--at-space-8); }
.stack.tight { padding-top: 0; }
.muted { color: var(--at-color-text-muted); }
.small { font: var(--at-text-small); color: var(--at-color-text-muted); }
.section-lede { max-width: 720px; font-size: 1.125rem; color: var(--at-color-text-muted); margin-top: calc(var(--at-space-4) * -1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.caption { font: var(--at-text-caption); letter-spacing: var(--at-tracking-caption); text-transform: uppercase; color: var(--at-color-text-muted); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--at-space-4); top: var(--at-space-4); background: var(--at-color-accent); color: var(--at-color-on-accent); padding: var(--at-space-2) var(--at-space-4); border-radius: var(--at-radius-md); z-index: 10; }

/* Header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--at-space-2) var(--at-space-5); padding-top: var(--at-space-4); padding-bottom: var(--at-space-4); }
.logo { display: flex; align-items: center; min-height: 44px; margin-right: auto; }
.logo img { display: block; height: 30px; width: auto; }
.top nav { display: flex; flex-wrap: wrap; gap: var(--at-space-1) var(--at-space-5); font-size: 0.9375rem; font-weight: 600; }
.top nav a, .foot a { display: flex; align-items: center; min-height: 44px; }
.nav-strong { color: var(--at-color-text); }

/* Hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--at-space-7); padding-top: var(--at-space-7); padding-bottom: var(--at-space-8); }
.hero-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: var(--at-space-5); }
.chip { align-self: flex-start; display: flex; align-items: center; gap: var(--at-space-2); padding: 6px 12px; border: 1px solid var(--at-color-border); border-radius: var(--at-radius-pill); font-family: var(--at-font-mono); font-size: 0.8125rem; color: var(--at-color-text); }
.chip-next { color: var(--at-color-text-muted); }
.pulse { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--at-color-success); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--at-color-success); animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite; }
.lede { max-width: 480px; font-size: 1.125rem; line-height: 1.55; color: var(--at-color-text-muted); }

.ticks, .plain { padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--at-space-3); }
.ticks li { display: flex; align-items: flex-start; gap: var(--at-space-3); font-size: 0.9375rem; color: var(--at-color-text-muted); }
.hero .ticks li { color: var(--at-color-text); }
.ticks li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px;
  background: var(--at-color-success);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.plain li { padding-left: var(--at-space-4); border-left: 1px solid var(--at-color-border); color: var(--at-color-text-muted); font-size: 0.9375rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--at-space-5); border: 0; border-radius: var(--at-radius-md); font-family: var(--at-font-sans); font-weight: 600; font-size: 1rem; cursor: pointer; transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--at-color-accent); color: var(--at-color-on-accent); }
.btn.primary:hover { background: var(--at-color-accent-hover); }
.btn.primary:active { background: var(--at-color-accent-press); }
.btn.big { min-height: 56px; font-size: 1.0625rem; }
.btn.ghost { flex: 1 1 150px; border: 1px solid var(--at-color-border); background: transparent; color: var(--at-color-text); font-weight: 500; font-size: 0.9375rem; }
.btn.ghost:hover { border-color: var(--at-color-text-muted); background: var(--at-color-surface-raised); }
.btn.on-volt { background: var(--at-color-accent); color: var(--at-color-on-accent); min-height: 56px; padding: 0 28px; font-size: 1.0625rem; }
.btn.on-volt:hover { background: var(--at-color-accent-hover); color: var(--at-color-on-accent); }

/* Sign-up card */
.panel { padding: 28px; border: 1px solid var(--at-color-border); border-radius: var(--at-radius-xl); background: var(--at-color-surface); display: flex; flex-direction: column; gap: var(--at-space-4); }
.signup { flex: 1 1 380px; min-width: 0; }
.signup h2 { font: var(--at-text-h3); letter-spacing: -0.4px; }
.field { display: flex; align-items: center; height: 56px; border: 1px solid var(--at-color-text); border-radius: var(--at-radius-md); background: var(--at-color-bg); font-family: var(--at-font-mono); font-size: 1.125rem; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.field:focus-within { box-shadow: 0 0 0 1px var(--at-color-text); }
.prefix { padding: 0 14px; color: var(--at-color-text-muted); border-right: 1px solid var(--at-color-border); }
.field input { flex: 1; min-width: 0; height: 100%; padding: 0 14px; border: 0; outline: 0; background: transparent; color: var(--at-color-text); font: inherit; }
.field input::placeholder { color: var(--at-slate); }
.or { display: flex; align-items: center; gap: var(--at-space-3); font-size: 0.8125rem; color: var(--at-color-text-muted); }
.or span { flex: 1; height: 1px; background: var(--at-color-border); }
.alts { display: flex; flex-wrap: wrap; gap: 10px; }
.notice { padding: var(--at-space-3) var(--at-space-4); border: 1px solid var(--at-color-warning); border-radius: var(--at-radius-md); color: var(--at-color-text); font-size: 0.875rem; line-height: 1.5; }
.notice.flash { animation: flash 0.5s ease; }

/* Cards and grids */
.grid { display: grid; gap: var(--at-space-4); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.card { padding: 22px; border: 1px solid var(--at-color-border); border-radius: var(--at-radius-lg); display: flex; flex-direction: column; gap: 14px; transition: border-color 0.2s ease, transform 0.2s ease; }
.card:hover { border-color: var(--at-slate); }
.card p { font-size: 0.875rem; line-height: 1.55; color: var(--at-color-text-muted); }
.band .card { background: var(--at-color-surface); }
.rows { gap: 0 var(--at-space-6); }
.rows .card { padding: var(--at-space-5) 0 0; border: 0; border-top: 1px solid var(--at-color-text); border-radius: 0; }
.rows .card:hover { border-color: var(--at-color-text); }
.num { font-family: var(--at-font-mono); font-size: 0.8125rem; color: var(--at-color-text-muted); }

/* The three step demos */
.demo { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--at-color-border); border-radius: var(--at-radius-md); background: var(--at-color-bg); font-size: 0.9375rem; white-space: nowrap; overflow: hidden; }
.demo.key { padding-right: 6px; }
.grow { margin-right: auto; }
.copy { padding: 6px 10px; border-radius: var(--at-radius-sm); background: var(--at-color-surface-raised); font-family: var(--at-font-sans); font-size: 0.8125rem; font-weight: 600; }
.typed { display: inline-block; overflow: hidden; white-space: nowrap; border-right: 2px solid var(--at-color-accent); width: 11ch; animation: typing 5.2s steps(11, end) infinite, caret 0.8s step-end infinite; }
.digits { display: flex; gap: 6px; font-weight: 700; font-size: 1.25rem; }
.digits span { flex: 1; max-width: 44px; height: 48px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--at-color-border); border-radius: var(--at-radius-md); background: var(--at-color-bg); animation: digit 5.2s ease infinite; animation-delay: calc(var(--d) * 0.28s); }
.digits .last { animation-name: digit-last; }

/* Bands and splits */
.band { border-top: 1px solid var(--at-color-border); border-bottom: 1px solid var(--at-color-border); background: #0D1322; }
.split { display: flex; flex-wrap: wrap; align-items: center; gap: var(--at-space-7); padding-top: 72px; padding-bottom: 72px; }
.split > div { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.split > div > p { color: var(--at-color-text-muted); }
.split > .code { flex: 1.2 1 420px; }
.split.even { padding: 0; align-items: flex-start; }
.pills { display: flex; flex-wrap: wrap; gap: var(--at-space-2); font-size: 0.8125rem; }
.pills span { padding: 8px 14px; border: 1px solid var(--at-color-border); border-radius: var(--at-radius-pill); color: var(--at-color-text-muted); }
.pills .on { color: var(--at-color-text); border-color: var(--at-slate); }
.more { align-self: flex-start; display: flex; align-items: center; min-height: 44px; color: var(--at-color-text); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--at-slate); }
.more:hover { text-decoration-color: var(--at-color-text); }

/* Code */
.code { border: 1px solid var(--at-color-border); border-radius: var(--at-radius-lg); background: var(--at-ink-900); gap: 0 !important; }
.code-head { display: flex; gap: var(--at-space-1); padding: 10px 14px; border-bottom: 1px solid var(--at-color-border); font-family: var(--at-font-mono); font-size: 0.8125rem; }
.tab { padding: 6px 10px; border-radius: 8px; color: var(--at-color-text-muted); }
.tab.on { background: var(--at-color-surface-raised); color: var(--at-color-text); }
pre { margin: 0; padding: 20px; overflow-x: auto; font: var(--at-text-code); color: #E8EAF2; }
pre .s { color: var(--at-volt); }
pre .u, pre .k { color: var(--at-info); }
pre .c { color: var(--at-slate-300); }
pre .ok { color: var(--at-volt); font-weight: 700; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
caption { text-align: left; padding-bottom: var(--at-space-2); }
td { padding: 10px var(--at-space-3) 10px 0; border-top: 1px solid var(--at-color-border); }
td:last-child { color: var(--at-color-text-muted); }

/* Call to action: ink, with the one volt button. Volt is a signal, not a fill. */
.cta { border-top: 1px solid var(--at-color-border); background: var(--at-color-bg); color: var(--at-color-text); }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--at-space-5); padding-top: var(--at-space-8); padding-bottom: var(--at-space-8); }
.cta h2 { flex: 1 1 380px; font: var(--at-text-h1); letter-spacing: var(--at-tracking-h1); font-size: clamp(1.875rem, 4.5vw, 2.75rem); }

/* Footer */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--at-space-1) var(--at-space-5); padding-top: 20px; padding-bottom: 20px; font-size: 0.875rem; }
.foot span { margin-right: auto; color: var(--at-color-text-muted); }

/* ---- Motion ------------------------------------------------------------ */

/* Hero pieces rise in on load, one after another. */
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 90ms + 60ms); }

/* Sections fade up as they scroll into view. Only when the script is running, so nothing is hidden without it. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* The response line arrives after the request has been read. */
.js .code.reveal .resp { opacity: 0; transition: opacity 0.5s ease 0.9s; }
.js .code.reveal.in .resp { opacity: 1; }
.js .code.reveal .ok { display: inline-block; transform: scale(0); transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) 1.3s; }
.js .code.reveal.in .ok { transform: scale(1); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes flash { 0% { background: rgba(255, 176, 32, 0.25); } 100% { background: transparent; } }
@keyframes caret { 50% { border-color: transparent; } }
@keyframes typing { 0% { width: 0; } 30%, 88% { width: 11ch; } 96%, 100% { width: 0; } }
@keyframes digit {
  0%, 22% { color: transparent; border-color: var(--at-color-border); }
  28% { color: var(--at-color-text); border-color: var(--at-color-text); transform: translateY(-3px); }
  34%, 86% { color: var(--at-color-text); border-color: var(--at-color-border); transform: none; }
  94%, 100% { color: transparent; }
}
@keyframes digit-last {
  0%, 22% { color: transparent; background: var(--at-color-bg); border-color: var(--at-color-border); }
  28% { transform: translateY(-3px); }
  34%, 86% { color: var(--at-ink); background: var(--at-volt); border-color: var(--at-volt); transform: none; }
  94%, 100% { color: transparent; background: var(--at-color-bg); border-color: var(--at-color-border); }
}

/* People who ask for less motion get a still page with everything visible. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .code.reveal .resp { opacity: 1; transform: none; }
  .js .code.reveal .ok { transform: none; }
  .typed { width: 11ch; border-right: 0; }
  .digits .last { color: var(--at-ink); background: var(--at-volt); border-color: var(--at-volt); }
}
