/*
 * Alca Labs landing — page styles.
 * Components below are web transcriptions of @cillop/design-system components
 * (Button, Badge, Card, Divider, TextField, Alert) plus layout cillop does not
 * have (nav, hero, section grid, footer). Each block names its source.
 */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: var(--fs-text-md);
  line-height: var(--lh-text-md);
  color: var(--text-primary);
  /* cillop ScreenBackground: canvasWash → canvas vertical wash */
  background-color: var(--bg-canvas);
  background-image: linear-gradient(180deg, var(--bg-canvas-wash) 0%, var(--bg-canvas) 38%, var(--bg-canvas) 100%);
  background-repeat: no-repeat;
  background-size: 100% 1200px;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--border-brand); outline-offset: 2px; border-radius: var(--r-xs); }
/* The UA's [hidden] rule loses to any component that sets display (.alert is flex). */
[hidden] { display: none !important; }
::selection { background: var(--bg-brand-secondary); color: var(--text-primary); }

/* Skip link: visible only when focused. */
.skip {
  position: absolute; left: var(--sp-xl); top: var(--sp-xl); z-index: 30;
  padding: var(--sp-md) var(--sp-xl); border-radius: var(--r-full);
  background: var(--bg-brand-solid); color: var(--text-white); text-decoration: none; font-weight: var(--fw-medium);
  transform: translateY(-200%); transition: transform .15s ease;
}
.skip:focus { transform: none; }

/* ---- type ramp (primitives/Text.tsx: variant × weight) ---- */
.display-lg { font-size: var(--fs-display-lg); line-height: var(--lh-display-lg); letter-spacing: var(--ls-display-lg); font-weight: var(--fw-semibold); margin: 0; }
.display-md { font-size: var(--fs-display-md); line-height: var(--lh-display-md); letter-spacing: var(--ls-display-md); font-weight: var(--fw-semibold); margin: 0; }
.display-sm { font-size: var(--fs-display-sm); line-height: var(--lh-display-sm); font-weight: var(--fw-semibold); margin: 0; }
.display-xs { font-size: var(--fs-display-xs); line-height: var(--lh-display-xs); font-weight: var(--fw-semibold); margin: 0; }
.text-xl { font-size: var(--fs-text-xl); line-height: var(--lh-text-xl); margin: 0; }
.text-lg { font-size: var(--fs-text-lg); line-height: var(--lh-text-lg); margin: 0; }
.text-md { font-size: var(--fs-text-md); line-height: var(--lh-text-md); margin: 0; }
.text-sm { font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); margin: 0; }
.text-xs { font-size: var(--fs-text-xs); line-height: var(--lh-text-xs); margin: 0; }
.w-medium { font-weight: var(--fw-medium); }
.w-semibold { font-weight: var(--fw-semibold); }
.c-secondary { color: var(--text-secondary); }
.c-tertiary { color: var(--text-tertiary); }
.c-brand { color: var(--text-brand-secondary); }
.eyebrow { margin: 0; color: var(--text-brand-tertiary); font-weight: var(--fw-medium); letter-spacing: .04em; text-transform: uppercase; }
.text-balance { text-wrap: balance; }

@media (max-width: 767px) {
  .display-lg { font-size: var(--fs-display-md); line-height: var(--lh-display-md); letter-spacing: var(--ls-display-md); }
  .display-md { font-size: var(--fs-display-sm); line-height: var(--lh-display-sm); letter-spacing: 0; }
}

/* ---- layout ---- */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--sp-xl);
}
@media (min-width: 768px) { .wrap { padding-inline: var(--sp-4xl); } }

.section { padding-block: var(--sp-7xl); }
@media (min-width: 1024px) { .section { padding-block: var(--sp-9xl); } }
/* Sections after the first in a run share the previous section's bottom padding. */
.section--tight { padding-top: 0; }

.section-head { max-width: 680px; margin-bottom: var(--sp-6xl); }
.section-head .badge { margin-bottom: var(--sp-lg); }
.section-head h2 { text-wrap: balance; }
.section-head p { margin-top: var(--sp-xl); color: var(--text-secondary); }

.grid-3 { display: grid; gap: var(--sp-3xl); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: var(--sp-3xl); grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.stack { display: flex; flex-direction: column; gap: var(--sp-xl); }
.stack > .badge { align-self: flex-start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-lg); }

/* ---- Badge (components/Badge.tsx, size lg) ---- */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-xs);
  height: 28px; padding-inline: var(--sp-xl);
  border: 1px solid var(--badge-gray-border); border-radius: var(--r-full);
  background: var(--badge-gray-bg); color: var(--badge-gray-text);
  font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: var(--fw-medium);
  white-space: nowrap;
}
.badge--brand { background: var(--badge-brand-bg); border-color: var(--badge-brand-border); color: var(--badge-brand-text); }
.badge--success { background: var(--badge-success-bg); border-color: var(--badge-success-border); color: var(--badge-success-text); }
.badge--warning { background: var(--badge-warning-bg); border-color: var(--badge-warning-border); color: var(--badge-warning-text); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }

/* Placeholder marker: NOT a cillop component. Flags unverified copy for review. */
.ph {
  display: inline-flex; align-items: center; gap: var(--sp-xs);
  height: 22px; padding-inline: var(--sp-md);
  border: 1px dashed var(--warning-500); border-radius: var(--r-full);
  color: var(--badge-warning-text); background: var(--badge-warning-bg);
  font-size: var(--fs-text-xs); line-height: var(--lh-text-xs); font-weight: var(--fw-medium);
  vertical-align: middle; white-space: nowrap;
}

/* ---- Button (components/Button.tsx: pill, sizes md/lg/xl, hierarchy) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-sm);
  height: 44px; padding-inline: var(--sp-2xl);
  border: 1px solid transparent; border-radius: var(--r-full);
  font: inherit; font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: var(--fw-semibold);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, opacity .15s ease, border-color .15s ease;
}
.btn:active { opacity: .85; }
.btn--xl { height: 48px; padding-inline: var(--sp-3xl); }
.btn--md { height: 40px; padding-inline: var(--sp-xl); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); }
.btn--primary { background: var(--bg-brand-solid); color: var(--text-white); }
.btn--primary:hover { background: var(--bg-brand-solid-hover); }
.btn--secondary { background: var(--bg-primary); color: var(--text-secondary); border-color: var(--border-primary); }
.btn--secondary:hover { background: var(--bg-primary-hover); }
.btn--tertiary { background: transparent; color: var(--text-brand-tertiary); }
.btn--link { background: transparent; color: var(--text-brand-tertiary); padding-inline: 0; height: auto; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--xl svg { width: 24px; height: 24px; }

/* ---- Card (components/Card.tsx: outlined | elevated; padding 2xl; radius 2xl) ---- */
.card {
  background: var(--bg-primary);
  border-radius: var(--r-2xl);
  padding: var(--sp-3xl);
}
.card--outlined { border: 1px solid var(--border-secondary); }
.card--elevated { box-shadow: var(--shadow-card); }
/* Glass surface (themes: background.glass, border.glass, shadows.glass) */
.card--glass {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--text-secondary); }
.card .stack { gap: var(--sp-lg); }
.service { padding: var(--sp-4xl); transition: border-color .15s ease, box-shadow .15s ease; }
.service:hover { border-color: var(--border-primary); box-shadow: var(--shadow-glass); }
.service .icon-tile { margin-bottom: var(--sp-md); }
.service .eyebrow { margin-bottom: calc(-1 * var(--sp-md)); }

.icon-tile {
  width: 48px; height: 48px; border-radius: var(--r-xl);
  display: grid; place-items: center;
  background: var(--bg-brand-primary); color: var(--fg-brand-primary);
}
.icon-tile svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Divider (components/Divider.tsx) ---- */
.divider { height: 1px; background: var(--border-secondary); border: 0; margin: 0; }

/* ---- Alert (components/Alert.tsx: radius xl, padding xl, utility[color][50]) ---- */
.alert {
  display: flex; gap: var(--sp-lg); align-items: flex-start;
  padding: var(--sp-xl); border-radius: var(--r-xl);
  background: var(--badge-warning-bg); border: 1px solid var(--badge-warning-border);
  color: var(--badge-warning-text);
}
.alert svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.alert p { margin: 0; color: inherit; }

/* Honeypot field: off-screen for people, still filled in by naive bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- TextField / Textarea (components/TextField.tsx: height 44 lg, radius md) ---- */
.field { display: flex; flex-direction: column; gap: var(--sp-sm); }
.field label { font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: var(--fw-medium); color: var(--text-secondary); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text-primary);
  background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: var(--r-md);
  padding: 0 var(--sp-lg); height: 44px;
  box-shadow: var(--shadow-glass);
}
.field textarea { height: auto; min-height: 120px; padding: var(--sp-lg); resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-placeholder); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--border-brand); box-shadow: 0 0 0 4px var(--bg-brand-primary); }
.field .hint { font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-tertiary); }

/* ---- nav (not in cillop) ---- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: var(--bg-glass-strong);
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-xl); height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--sp-md); text-decoration: none; font-weight: var(--fw-semibold); font-size: var(--fs-text-lg); color: var(--text-primary); }
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--r-md);
  background: var(--bg-brand-solid); color: var(--text-white);
  display: grid; place-items: center;
  font-size: var(--fs-text-sm); font-weight: var(--fw-bold); letter-spacing: 0;
}
.nav-links { display: none; gap: var(--sp-4xl); list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-secondary); font-size: var(--fs-text-sm); font-weight: var(--fw-medium); }
.nav-links a:hover { color: var(--text-primary); }
@media (min-width: 768px) { .nav-links { display: flex; } }

/* ---- hero ---- */
.hero { padding-block: var(--sp-8xl) var(--sp-7xl); }
@media (min-width: 1024px) { .hero { padding-block: var(--sp-10xl) var(--sp-9xl); } }
.hero .wrap { display: grid; gap: var(--sp-6xl); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 1024px) { .hero .wrap { grid-template-columns: 7fr 5fr; } }
.hero h1 { margin-top: var(--sp-xl); text-wrap: balance; }
.hero h1 br { display: none; }
@media (min-width: 1024px) { .hero h1 br { display: inline; } }
.hero .lede { margin-top: var(--sp-3xl); max-width: 560px; color: var(--text-secondary); }
.hero .cta { margin-top: var(--sp-4xl); }
.hero-note { margin: var(--sp-xl) 0 0; }

/* Hero visual: a stylised worklist, drawn with cillop surfaces (glass card + badges + list rows).
 * It stands in for a product screenshot the owner has not supplied. */
.worklist { padding: var(--sp-2xl); }
.worklist-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-lg); }
.worklist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-md); }
.worklist li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-lg);
  padding: var(--sp-lg) var(--sp-xl);
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
}
.worklist li .name { font-weight: var(--fw-medium); }
.worklist li .meta { color: var(--text-tertiary); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); }
.worklist-foot { margin: var(--sp-lg) 0 0; }

/* ---- how it works ---- */
.steps { counter-reset: step; display: grid; gap: var(--sp-3xl); grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4xl) var(--sp-3xl); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; padding-top: var(--sp-6xl); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; top: 0; left: 0;
  font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: var(--fw-semibold);
  color: var(--text-brand-tertiary);
  padding-bottom: var(--sp-md); border-bottom: 2px solid var(--border-brand); min-width: 40px;
}
.step h3 { margin: 0 0 var(--sp-md); }
.step p { margin: 0; color: var(--text-secondary); }

/* ---- brand section (background.brandSection) ---- */
.band {
  background: var(--bg-brand-section); color: var(--text-primary-on-brand);
  border-radius: var(--r-4xl); padding: var(--sp-6xl) var(--sp-3xl);
}
@media (min-width: 768px) { .band { padding: var(--sp-8xl) var(--sp-7xl); } }
.band .eyebrow { color: var(--text-secondary-on-brand); font-weight: var(--fw-medium); }
.band p { color: var(--text-secondary-on-brand); }
.band .display-md, .band .display-sm { color: var(--text-primary-on-brand); }
.band .btn--secondary { background: var(--bg-primary); }
.band-head { max-width: 560px; }
.band-head h2 { margin-top: var(--sp-lg); text-wrap: balance; }
.principles { list-style: none; margin: var(--sp-5xl) 0 0; padding: 0; display: grid; gap: var(--sp-3xl); grid-template-columns: 1fr; }
@media (min-width: 768px) { .principles { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4xl); } }
.principles li { padding-top: var(--sp-xl); border-top: 1px solid var(--alpha-white-20); }
.principles h3 { margin: 0 0 var(--sp-md); color: var(--text-primary-on-brand); }
.principles p { margin: 0; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); }

/* ---- contact ---- */
.contact-card { padding: var(--sp-3xl); }
@media (min-width: 768px) { .contact-card { padding: var(--sp-5xl); } }
.contact-grid { display: grid; gap: var(--sp-4xl); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 5fr 7fr; } }
.contact-direct { display: flex; flex-direction: column; gap: var(--sp-lg); }
.contact-direct a { color: var(--text-brand-secondary); text-decoration: none; font-weight: var(--fw-medium); }
.contact-direct a:hover { text-decoration: underline; }
form.contact { display: flex; flex-direction: column; gap: var(--sp-xl); }
form.contact .two { display: grid; gap: var(--sp-xl); grid-template-columns: 1fr; }
@media (min-width: 480px) { form.contact .two { grid-template-columns: 1fr 1fr; } }
form.contact .actions { display: flex; flex-wrap: wrap; gap: var(--sp-lg); align-items: center; }

/* ---- footer ---- */
footer { padding-block: var(--sp-6xl); color: var(--text-tertiary); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); }
footer .top { display: flex; flex-wrap: wrap; gap: var(--sp-xl) var(--sp-4xl); justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-3xl); }
.footer-brand { display: flex; flex-direction: column; gap: var(--sp-md); }
.footer-brand p { margin: 0; }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-xl) var(--sp-3xl); }
footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--text-primary); }
footer .legal { margin-top: var(--sp-3xl); }
footer .legal p { margin: var(--sp-xs) 0; }

/* ---- cookie bar (not in cillop) — hidden unless analytics is enabled ---- */
.cookie {
  position: fixed; inset-inline: var(--sp-xl); bottom: calc(var(--sp-xl) + env(safe-area-inset-bottom, 0px)); z-index: 20;
  margin-inline: auto; max-width: 640px;
}
.cookie .card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-lg); }
.cookie p { flex: 1 1 260px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .service, .skip { transition: none; }
}
