/* Mirrors AppPalette, AppSpacing and AppRadius in shared/AuthdUI/AuthdDesignSystem.swift. */
:root {
  --canvas: hsl(0 0% 95%);
  --surface: #fff;
  --raised: hsl(0 0% 92.5%);
  --hairline: rgb(0 0 0 / 0.12);
  --accent: hsl(0 0% 13%);
  --accent-contrast: hsl(0 0% 98%);
  --control: rgb(0 0 0 / 0.06);
  --control-hover: rgb(0 0 0 / 0.09);
  --secondary: hsl(0 0% 42%);
  --green: #34c759;
  --red: #ff3b30;
  --ridge: rgb(0 0 0 / 0.08);
  --radius-control: 8px;
  --radius-card: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 32px rgb(0 0 0 / 0.08);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: hsl(0 0% 5.5%);
    --surface: hsl(0 0% 10%);
    --raised: hsl(0 0% 14.5%);
    --hairline: rgb(255 255 255 / 0.09);
    --accent: hsl(0 0% 93%);
    --accent-contrast: hsl(0 0% 6%);
    --control: rgb(255 255 255 / 0.09);
    --control-hover: rgb(255 255 255 / 0.13);
    --secondary: hsl(0 0% 60%);
    --green: #30d158;
    --red: #ff453a;
    --ridge: rgb(255 255 255 / 0.07);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px rgb(0 0 0 / 0.45);
  }
  .mark img { filter: invert(1); }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--accent);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  margin: 0;
  letter-spacing: -0.02em;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 32px;
  background: color-mix(in srgb, var(--canvas) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 17px;
}

.nav nav { display: flex; gap: 4px; }

.nav nav a {
  padding: 6px 12px;
  border-radius: var(--radius-control);
  color: var(--secondary);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.nav nav a:hover { background: var(--control); color: var(--accent); }

/* Buttons, matching AuthdButtonStyle */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}

.button.filled { background: var(--accent); color: var(--accent-contrast); }
.button.filled:hover { opacity: 0.88; }
.button.tinted { background: var(--control); }
.button.tinted:hover { background: var(--control-hover); }

/* Hero */

main { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* Fingerprint ridges behind the top of the page, after the Authd mark's loop */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 820px;
  z-index: -1;
  background: var(--ridge);
  /* The ridges, faded out well before the bottom of the box */
  -webkit-mask: url(ridges.svg) center top / cover no-repeat, linear-gradient(#000 45%, transparent 95%);
  -webkit-mask-composite: source-in;
  mask: url(ridges.svg) center top / cover no-repeat, linear-gradient(#000 45%, transparent 95%);
  mask-composite: intersect;
  pointer-events: none;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 0 40px;
}

.mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.mark img { width: 44px; height: 44px; }

h1 {
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.06;
  font-weight: 700;
}

h1 span { color: var(--secondary); }

.lede {
  max-width: 560px;
  margin-top: 22px;
  font-size: 19px;
  color: var(--secondary);
}

.actions { display: flex; gap: 8px; margin-top: 32px; flex-wrap: wrap; justify-content: center; }

.fine { margin-top: 14px; font-size: 13px; color: var(--secondary); }

/* The agent approval card, after AgentRequestCard and KeyBadge in the app.
   Sizes are the Mac's point sizes; the figure scales the whole card. */

.demo { margin: 64px 0 0; width: 100%; max-width: 680px; }

.window {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding: 44px 24px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 1px 1px, var(--hairline) 1px, transparent 0) 0 0 / 18px 18px,
    var(--raised);
}

.request {
  zoom: 1.2;
  width: 100%;
  max-width: 440px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  font-size: 13px;
  line-height: 1.3;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.06), 0 10px 30px rgb(0 0 0 / 0.16);
}

.request p { margin: 0; }

.request-head { display: flex; align-items: flex-start; gap: 14px; }
.request-head > div:last-child { display: flex; flex-direction: column; gap: 2px; }

.agent-mark {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgb(255 255 255 / 0.14);
}

.agent-mark .logo { width: 22.4px; height: 22.4px; }
.agent-mark.claude { background: rgb(217 120 87); color: #fff; }
.agent-mark.dark { background: #000; color: #fff; }
.agent-mark.light { background: #fff; color: #000; box-shadow: inset 0 0 0 1px var(--hairline); }

.caption-label { font-size: 10px; font-weight: 600; color: var(--secondary); }
.question { font-size: 13px; font-weight: 700; }

.request-box { background: var(--raised); border-radius: var(--radius-card); }

.item-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }

.service-glyph {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--hairline);
  color: #000;
}

.service-glyph .logo { width: 15.7px; height: 15.7px; }
.item-name { font-size: 12px; font-weight: 600; }
.item-account { font-size: 10px; color: var(--secondary); }

.reason {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-top: 1px solid var(--hairline);
}

.reason-text { font-size: 12px; }
.footnote { font-size: 10px; color: var(--secondary); }

.request-actions { display: flex; gap: 8px; }

.pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.pill.deny { background: var(--control); color: var(--red); }
.pill.allow { background: var(--green); color: #fff; }

.keycap {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-right: -4px;
  padding: 0 4px;
  border-radius: 5px;
  font: 600 10px ui-rounded, -apple-system, sans-serif;
  background: color-mix(in srgb, currentColor 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 32%, transparent);
  opacity: 0.92;
}

.keycap.fill { padding: 0 1px; font-size: 12px; background: color-mix(in srgb, currentColor 16%, transparent); }

figcaption { margin-top: 14px; font-size: 13px; color: var(--secondary); }

/* Sections */

.section { padding: 88px 0 0; }

.section-head { max-width: 760px; margin-bottom: 32px; }
.section-head p:not(.eyebrow) { margin-top: 12px; color: var(--secondary); font-size: 17px; }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
}

h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

/* Agents */

.logo {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

/* Agents and import: a few big logos, centred, with room around them */

.centered { text-align: center; padding-top: 120px; }
.centered h2 { margin-bottom: 48px; }
#features .section-head { margin-left: auto; margin-right: auto; text-align: center; }

.featured, .brands {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.featured { gap: 56px; }
.brands { gap: 40px; }

.featured li, .brands li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 600;
}

.brands li { gap: 10px; font-size: 13px; font-weight: 500; color: var(--secondary); }

.agent-mark.lg { width: 72px; height: 72px; }
.agent-mark.lg .logo, .agent-mark.lg img { width: 38px; height: 38px; }

.more-label { margin-top: 40px; font-size: 15px; color: var(--secondary); }

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--hairline);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 14px;
  background: var(--c);
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

/* Features */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.card {
  padding: 22px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.card p { margin-top: 6px; font-size: 14px; color: var(--secondary); }

.icon {
  width: 28px;
  height: 28px;
  padding: 6px;
  box-sizing: content-box;
  margin-bottom: 14px;
  border-radius: var(--radius-control);
  background: var(--control);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

/* Beta sign-up, in a dialog over the page */

.join-dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 32px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.25);
  overflow: auto;
}

.join-dialog::backdrop {
  background: rgb(0 0 0 / 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.join-dialog[open] { animation: dialog-in 0.18s ease-out; }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--control);
  color: var(--secondary);
  cursor: pointer;
}

.dialog-close:hover { background: var(--control-hover); color: var(--accent); }
.dialog-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.join-form, .join-done { display: flex; flex-direction: column; gap: 20px; }
.join-done { align-items: flex-start; }
.join-dialog h2 { font-size: 26px; }
.join-sub { margin-top: -12px; color: var(--secondary); font-size: 15px; }
.dialog-done { border: 0; cursor: pointer; font-family: inherit; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 13px; font-weight: 600; }
.field em { font-style: normal; font-weight: 400; color: var(--secondary); margin-left: 4px; }

.field input {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: inherit;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--control); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { cursor: pointer; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }

.choices span {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--control);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.choices label:hover span { background: var(--control-hover); }
.choices input:checked + span { background: var(--accent); color: var(--accent-contrast); }
.choices input:focus-visible + span { box-shadow: 0 0 0 3px var(--control-hover); }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.form-error { color: var(--red); font-size: 14px; }

.button.wide { justify-content: center; height: 44px; border: 0; cursor: pointer; font-family: inherit; }
.button.wide:disabled { opacity: 0.6; cursor: default; }

/* Closing: one line */

.cta {
  margin: 96px 0 0;
  padding: 28px 32px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cta h2 { font-size: clamp(22px, 3vw, 28px); }

footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 32px 56px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--secondary);
}

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .nav nav { display: none; }
  .request { zoom: 1; }
  .cta { flex-direction: column; text-align: center; }
}

@media (max-width: 520px) {
  main, .nav, footer { padding-left: 20px; padding-right: 20px; }
  .window { padding: 28px 12px; }
  .join-dialog { padding: 24px 20px; }
  .featured { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 12px; }
  .brands { flex-wrap: nowrap; gap: 0; justify-content: space-between; }
  .brand-mark { width: 52px; height: 52px; }
  .brand-mark::after { inset: 13px; }
  .centered { padding-top: 88px; }
  .grid { grid-template-columns: 1fr; }
}
