/* webAgentic beta page. Tokens from web-agentic/src/app/globals.css. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/nunito-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/nunito-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --bg: #0A0A0A;
  --surface: #121212;
  --surface-elevated: #1A1A1A;
  --surface-hover: #222222;
  --border: #2A2A2A;
  --border-light: #3A3A3A;
  /* Form controls need 3:1 against their background (WCAG 1.4.11); #3A3A3A has 1.7:1. */
  --border-control: #666666;

  --red: #8C1D1D;
  --red-light: #A52525;
  /* Icons only: the brand reds vanish on the tinted icon tiles. */
  --red-icon: #E05A5A;

  --text: #F5F5F5;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;

  --good: #22C55E;
  --bad: #EF4444;

  /* The brand reds are too dark for a focus ring on #0A0A0A (2.7:1), so focus is white. */
  --focus: #F5F5F5;

  --font-heading: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  --gutter: 16px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--text);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface-elevated);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 6px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--red);
  color: #FFFFFF;
  font: 700 0.875rem/1 var(--font-heading);
}

.brand-word {
  font: 700 1.0625rem/1 var(--font-heading);
  letter-spacing: -0.01em;
}

.brand-word span {
  color: var(--red-light);
}

.badge {
  padding: 3px 8px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lang-switch {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
}

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

/* Layout: one column on phones (hero, form, loop, memory, process), the form
   in a sticky right column from tablet width up. */

.layout {
  display: grid;
  gap: 40px;
  padding-top: 32px;
  padding-bottom: 56px;
}

@media (min-width: 900px) {
  :root {
    --gutter: 24px;
  }

  .layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas:
      "hero signup"
      "loop signup"
      "memory signup"
      "process signup";
    column-gap: 64px;
    row-gap: 56px;
    padding-top: 64px;
    padding-bottom: 80px;
  }

  .hero { grid-area: hero; }
  .loop { grid-area: loop; }
  .memory { grid-area: memory; }
  .process { grid-area: process; }

  .signup {
    grid-area: signup;
    align-self: start;
    position: sticky;
    top: 24px;
  }
}

/* Hero */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--red-light);
  border-radius: 999px;
  background: rgba(140, 29, 29, 0.18);
  font-size: 0.875rem;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-light);
}

.hero h1 {
  font-size: clamp(2rem, 8vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lead {
  margin-top: 16px;
  max-width: 38em;
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

@media (min-width: 900px) {
  .lead {
    font-size: 1.1875rem;
  }
}

.loop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.loop-chips li {
  padding: 5px 12px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 700;
}

.loop-chips li span {
  color: var(--red-icon);
  font-weight: 700;
  margin-right: 2px;
}

.loop-chips .loop-again {
  border-style: dashed;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Card and form */

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

@media (min-width: 480px) {
  .card {
    padding: 28px;
  }
}

.form h2,
.success h2 {
  font-size: 1.375rem;
}

.form-intro {
  margin-top: 6px;
  color: var(--text-secondary);
}

.form-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--bad);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
}

.form-alert:empty {
  margin: 0;
  padding: 0;
  border: 0;
}

.field {
  margin-top: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.hint {
  color: var(--text-secondary);
  font-weight: 400;
}

input[type="email"],
input[type="text"],
select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  /* 16px keeps iOS Safari from zooming into the field. */
  font: 400 1rem/1.4 var(--font-body);
}

input[type="email"]:hover,
input[type="text"]:hover,
select:hover {
  border-color: var(--text-secondary);
}

input[type="email"]:focus-visible,
input[type="text"]:focus-visible,
select:focus-visible {
  border-color: var(--text);
}

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A0A0A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

[aria-invalid="true"] {
  border-color: var(--bad) !important;
}

.field-error {
  margin-top: 6px;
  color: var(--bad);
  font-size: 0.9375rem;
  font-weight: 700;
}

.field-error:empty {
  display: none;
}

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 20px;
}

.check + .field-error {
  margin-left: 34px;
}

.check input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--red-light);
  cursor: pointer;
}

/* Native checkboxes ignore border colours, so a missing consent gets a ring. */
.check input[aria-invalid="true"] {
  outline: 2px solid var(--bad);
  outline-offset: 2px;
}

.check input[aria-invalid="true"]:focus-visible {
  outline-color: var(--focus);
}

.check label {
  font-size: 0.9375rem;
  line-height: 1.5;
  cursor: pointer;
}

.privacy-note {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 22px;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--red);
  color: #FFFFFF;
  font: 700 1.0625rem/1.2 var(--font-heading);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.button:hover {
  background: var(--red-light);
  color: #FFFFFF;
  text-decoration: none;
}

.button[disabled] {
  cursor: progress;
  opacity: 0.75;
}

.button-secondary {
  border: 1px solid var(--border-light);
  background: var(--surface-elevated);
}

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

/* Honeypot: out of sight and out of the tab order, but still in the form. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.success {
  text-align: center;
  padding: 16px 0 8px;
}

.success-icon {
  display: inline-flex;
  color: var(--good);
  margin-bottom: 12px;
}

.success-icon svg {
  width: 48px;
  height: 48px;
}

.success p {
  margin-top: 8px;
  color: var(--text-secondary);
}

.alert-icon {
  display: inline-flex;
  color: var(--bad);
  margin-bottom: 12px;
}

.alert-icon svg {
  width: 48px;
  height: 48px;
}

.confirm-email {
  margin-top: 16px !important;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text) !important;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.success h2:focus {
  outline: none;
}

/* Loop, memory and process */

.loop h2,
.memory h2,
.process h2 {
  font-size: 1.5rem;
  text-wrap: balance;
}

.station-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.station {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.station-icon {
  grid-row: span 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(165, 37, 37, 0.16);
  color: var(--red-icon);
}

.station-label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.station-label span {
  color: var(--red-icon);
}

.station h3 {
  margin-top: 2px;
  font-size: 1.0625rem;
}

.station-text {
  margin-top: 6px;
  color: var(--text-secondary);
}

.memory {
  padding: 24px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--red-light);
  border-radius: var(--radius);
  background: var(--surface-elevated);
}

.memory-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font: 700 1.125rem/1.3 var(--font-heading);
}

.memory-text {
  margin-top: 14px;
  color: var(--text-secondary);
}

.steps {
  display: grid;
  gap: 16px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 48px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red);
  color: #FFFFFF;
  font: 700 0.9375rem/1 var(--font-heading);
}

.steps h3 {
  font-size: 1.0625rem;
  line-height: 32px;
}

.steps p {
  color: var(--text-secondary);
}

/* Thank-you and 404 pages */

.center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 48px;
}

.center-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.center-card h1 {
  font-size: 1.75rem;
}

.center-card p {
  margin-top: 10px;
  color: var(--text-secondary);
}

.text-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--text-secondary);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
}

.footer-links li:first-child a {
  padding-left: 0;
}

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