/* ============================================================================
   Ablaufmeister — site.css
   Page-level layout + components built on top of design-tokens.css.
   Tokens (colors, type scale, spacing, buttons, cards, bento, forms, header,
   action-bar, bubbles, chips, reveal, ring-seg) live in design-tokens.css.
   ============================================================================ */

/* --- a few site-wide niceties --------------------------------------------- */
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
ul { padding: 0; margin: 0; list-style: none; }

/* anchored sections clear the sticky header */
:target,
[id] { scroll-margin-top: 84px; }

.section__title { text-align: center; margin-inline: auto; max-width: 22ch; }

/* ============================================================================
   HEADER
   ============================================================================ */
.site-header__inner {
  display: flex; align-items: center; gap: var(--space-4);
  min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; text-decoration: none; }
.brand__mark { flex: 0 0 auto; }
.brand__word { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; color: var(--text); }

.nav { margin-left: var(--space-6); flex: 1 1 auto; }
.nav__list { display: flex; gap: var(--space-6); }
.nav__list a {
  color: var(--text); text-decoration: none; font-size: var(--fs-small); font-weight: 600;
  padding: 6px 2px; border-bottom: 2px solid transparent;
  transition: color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.nav__list a:hover { color: var(--primary); border-color: var(--primary); }

.site-header__actions { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }

.theme-toggle {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  background: transparent; border: 1px solid var(--line); color: var(--text);
  cursor: pointer; transition: border-color var(--motion-fast), color var(--motion-fast), background var(--motion-fast);
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: block; }

/* mobile menu trigger (hidden on desktop) */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 0 10px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle__bar { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px;
  transition: transform var(--motion-base) var(--ease-out), opacity var(--motion-fast); }
.sheet[data-open="true"] ~ * .nav-toggle { /* no-op safeguard */ }

/* ============================================================================
   MOBILE NAV SHEET
   ============================================================================ */
.sheet { position: fixed; inset: 0; z-index: 80; }
.sheet[hidden] { display: none; }
.sheet__backdrop {
  position: absolute; inset: 0; background: rgba(19,33,49,.42);
  opacity: 0; transition: opacity var(--motion-base) var(--ease-out);
}
.sheet[data-open="true"] .sheet__backdrop { opacity: 1; }
.sheet__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(86vw, 340px);
  background: var(--surface); border-left: 1px solid var(--line);
  padding: var(--space-8) var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-4);
  transform: translateX(100%); transition: transform var(--motion-base) var(--ease-out);
  box-shadow: var(--shadow-soft);
}
.sheet[data-open="true"] .sheet__panel { transform: translateX(0); }
.sheet__close {
  align-self: flex-end; width: 44px; height: 44px; font-size: 28px; line-height: 1;
  background: transparent; border: 0; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm);
}
.sheet__close:hover { color: var(--text); }
.sheet__list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.sheet__list a {
  display: block; padding: var(--space-3) var(--space-2); color: var(--text);
  text-decoration: none; font-size: var(--fs-lead); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.sheet__list a:hover { color: var(--primary); }
.sheet__cta { margin-top: auto; width: 100%; }

/* ============================================================================
   HERO
   ============================================================================ */
.hero { position: relative; overflow: clip; padding-block: clamp(40px, 7vw, 96px) var(--section-pad); }
.hero__inner {
  position: relative; z-index: 1;
  display: grid; gap: clamp(32px, 5vw, 64px);
  grid-template-columns: 1.05fr 0.95fr; align-items: center;
}
.hero__copy { max-width: 36rem; }
.hero h1 { margin-top: var(--space-3); max-width: 16ch; }
.hero__subline { margin-top: var(--space-5, 20px); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.hero__trust { margin-top: var(--space-5, 20px); font-size: var(--fs-small); color: var(--text-muted); }

.hero__ring {
  position: absolute; z-index: 0; right: -6%; top: 50%; transform: translateY(-50%);
  pointer-events: none; filter: saturate(.9);
}
.hero__ring svg { width: clamp(360px, 42vw, 560px); height: auto; }

/* ---- demo card ---- */
.hero__demo { position: relative; z-index: 1; }
.demo__label { font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); margin: 0 0 var(--space-3); }
.demo__note { font-size: var(--fs-micro); color: var(--text-muted); margin: var(--space-3) 2px 0; }

.chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 520px; }
.chat__head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.chat__avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-petrol-tint); color: var(--primary); flex: 0 0 auto;
}
.chat__title { font-weight: 700; font-size: var(--fs-small); color: var(--text); }
.chat__status {
  margin-left: auto; font-size: var(--fs-micro); color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chat__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-success); }

.chat__log {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); overflow-y: auto; flex: 1 1 auto; min-height: 180px;
  scroll-behavior: smooth;
}
.bubble { line-height: 1.45; animation: bubble-in var(--motion-base) var(--ease-out); }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); opacity: .5;
  animation: typing 1s var(--ease-in-out) infinite;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%,100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-3px); opacity: 1; } }

.chat__chips { padding: 0 var(--space-4) var(--space-3); }
/* ensure chips meet the 44px tap-target rule (spec §10) */
.chip { min-height: 44px; display: inline-flex; align-items: center; }
.chat__form {
  display: flex; gap: var(--space-2); align-items: center;
  padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); background: var(--surface);
}
.chat__input {
  flex: 1 1 auto; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--bg); color: var(--text); font: 400 var(--fs-small)/1.4 var(--font-brand);
}
.chat__input:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: 2px; border-color: var(--primary); }
.chat__send {
  display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto;
  border: 0; border-radius: 50%; background: var(--primary); color: #fff; cursor: pointer;
  transition: background var(--motion-fast) var(--ease-out);
}
.chat__send:hover { background: var(--primary-hover); }
.chat__send:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: 2px; }

/* ============================================================================
   PROBLEM
   ============================================================================ */
.problem__grid {
  display: grid; gap: var(--space-4); margin-top: var(--space-12);
  grid-template-columns: repeat(2, 1fr);
}
.problem__card { display: flex; gap: var(--space-4); align-items: flex-start; box-shadow: var(--shadow-sm); }
.problem__card p { margin: 0; color: var(--text); }
.problem__card .icon-chip { flex: 0 0 auto; }
.problem__close {
  text-align: center; margin: var(--space-12) auto 0; max-width: 40ch;
  font-size: var(--fs-lead); color: var(--text-muted);
}

/* ============================================================================
   SOLUTION
   ============================================================================ */
.solution__inner {
  display: grid; gap: clamp(32px, 5vw, 64px); align-items: center;
  grid-template-columns: 1fr 1fr;
}
.solution__copy h2 { max-width: 16ch; }
.solution__copy p { margin-top: var(--space-5, 20px); }

.solution__viz { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-4); align-items: center; }
.ba { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); background: var(--surface); }
.ba--before { background: var(--surface-soft); }
.ba__tag {
  display: inline-block; font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-3);
}
.ba__tag--ok { color: var(--brand-success); }
.ba__lines { display: grid; gap: var(--space-2); }
.ba__lines li {
  font-size: var(--fs-small); color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.ba__arrow { color: var(--primary); display: grid; place-items: center; }
.ba__summary-title { font-weight: 700; margin: 0 0 var(--space-2); }
.ba__summary-line { font-size: var(--fs-small); margin: 0 0 6px; color: var(--text); }
.ba__check {
  display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-2);
  font-size: var(--fs-small); font-weight: 600; color: var(--brand-success);
}

/* ============================================================================
   HOW IT WORKS — stepper + signature ring
   ============================================================================ */
.steps__layout {
  display: grid; grid-template-columns: 240px 1fr; gap: clamp(32px, 5vw, 72px);
  align-items: center; margin-top: var(--space-16);
}
.steps__ring { justify-self: center; }
.ring-check { stroke-dasharray: 1; stroke-dashoffset: 1; }
.ring-check.is-drawn { transition: stroke-dashoffset var(--motion-slow) var(--ease-out) .9s; stroke-dashoffset: 0; }

.steps__list { display: grid; gap: var(--space-6); }
.step { display: flex; gap: var(--space-4); align-items: flex-start; }
.step__num {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  font-weight: 800; font-size: var(--fs-lead);
  background: var(--brand-petrol-tint); color: var(--primary);
}
.step:nth-child(2) .step__num { background: rgba(141,167,132,.18); color: #4d6b48; }
.step:nth-child(3) .step__num { background: var(--brand-amber-tint); color: var(--brand-text-on-amber); }
.step__body h3 { margin-bottom: var(--space-2); }
.step__body p { margin: 0; color: var(--text-muted); }

/* ============================================================================
   USE CASES (BENTO)
   ============================================================================ */
.usecases .bento { margin-top: var(--space-12); }
.tile { display: flex; flex-direction: column; gap: var(--space-3); }
.tile h3 { margin: 0; }
.tile p { margin: 0; color: var(--text-muted); }
.tile .icon-chip { margin-bottom: var(--space-2); }
.tile--lg { justify-content: flex-start; }
.tile--lg h3 { font-size: var(--fs-h2); }
.tile--accent {
  background: var(--brand-amber-tint); border-color: transparent;
  justify-content: center; align-items: flex-start;
}
.tile--accent h3 { color: var(--brand-text-on-amber); }
.tile--accent p { color: var(--text); }
/* small accent tile occupies one cell */
.bento > .tile--sm { grid-column: span 2; }
@media (min-width: 721px) {
  .bento > .tile--sm { grid-column: span 2; grid-row: span 1; }
}

/* ============================================================================
   TRUST BAND
   ============================================================================ */
.trust__points {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6);
  margin-top: var(--space-12); max-width: 920px; margin-inline: auto;
}
.trust__points li {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3);
  font-weight: 600; color: var(--text);
}
.trust__line { text-align: center; margin: var(--space-12) auto 0; max-width: 48ch; color: var(--text-muted); font-size: var(--fs-lead); }

/* ============================================================================
   THE HUMAN
   ============================================================================ */
.human__inner { display: grid; grid-template-columns: 280px 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface-soft), var(--brand-petrol-tint));
  border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--primary);
  overflow: hidden;
}
.portrait__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}
.portrait__name {
  position: absolute; bottom: var(--space-4); left: var(--space-4);
  font-weight: 800; font-size: var(--fs-h3); color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.human__copy p { margin-top: var(--space-5, 20px); }
.human__honesty {
  border-left: 3px solid var(--brand-amber); padding-left: var(--space-4);
  color: var(--text);
}

/* ============================================================================
   PILOT OFFER
   ============================================================================ */
.pilot__card {
  position: relative; text-align: center; max-width: 640px; margin-inline: auto;
  background: var(--surface-soft); padding: clamp(28px, 5vw, 56px);
}
.pilot__card h2 { margin-inline: auto; max-width: 20ch; }
.pilot__card p { margin: var(--space-5, 20px) auto var(--space-8); max-width: 52ch; color: var(--text-muted); }
.pilot__badge {
  display: inline-block; margin-bottom: var(--space-4);
  background: var(--brand-amber); color: var(--brand-text-on-amber);
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  padding: 6px 14px; border-radius: var(--radius-pill);
}

/* ============================================================================
   CONTACT
   ============================================================================ */
.contact__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.contact__intro .lead { margin-top: var(--space-4); }
.contact__alt { margin-top: var(--space-12); }
.contact__alt-label { font-weight: 700; margin: 0 0 var(--space-3); }
.contact__channels { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.contact__channels a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  text-decoration: none; color: var(--text); font-weight: 600; font-size: var(--fs-small);
  transition: border-color var(--motion-fast), color var(--motion-fast);
}
.contact__channels a:hover { border-color: var(--primary); color: var(--primary); }

.contact__form { display: grid; gap: var(--space-4); }
.contact__submit { margin-top: var(--space-2); }
.contact__micro { font-size: var(--fs-small); color: var(--text-muted); margin: 0; }
.contact__success {
  margin: 0; padding: var(--space-4); border-radius: var(--radius-sm);
  background: rgba(62,125,79,.10); color: var(--brand-success); font-weight: 600;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ============================================================================
   FOOTER
   ============================================================================ */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--space-16); margin-top: var(--space-8); }
.site-footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-8); align-items: start; }
.site-footer__brand { display: flex; gap: var(--space-3); align-items: center; }
.site-footer__brand p { margin: 0; color: var(--text-muted); font-size: var(--fs-small); max-width: 26ch; }
.site-footer__mark { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.site-footer__nav { display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer__nav a, .site-footer__legal a { color: var(--text); text-decoration: none; font-size: var(--fs-small); }
.site-footer__nav a:hover, .site-footer__legal a:hover { color: var(--primary); }
.site-footer__legal { display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer__copy { margin: var(--space-3) 0 0; color: var(--text-muted); font-size: var(--fs-micro); }

/* ============================================================================
   MOBILE ACTION BAR (token base sets visibility < 768px)
   ============================================================================ */
.action-bar { transform: translateY(110%); transition: transform var(--motion-base) var(--ease-out); }
.action-bar[data-visible="true"] { transform: translateY(0); }
.action-bar__primary { flex: 1 1 auto; }
.action-bar__wa { flex: 0 0 auto; width: 56px; padding-inline: 0; background: var(--surface); }

/* ============================================================================
   DARK MODE contrast fix
   The dark primary (#3e9b92) is lightened so the fill reads on a dark page,
   but white text on it only reaches ~3.3:1. Use graphite text on filled
   buttons in dark mode (~4.8:1) — secondary/ghost buttons keep petrol text.
   ============================================================================ */
[data-theme="dark"] .btn:not(.btn--secondary) { color: var(--brand-graphite); }
[data-theme="dark"] .pilot__badge { color: var(--brand-graphite); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn:not(.btn--secondary) { color: var(--brand-graphite); }
}

/* success green #3e7d4f is tuned for white; lift it for dark surfaces */
[data-theme="dark"] { --brand-success: #74c98c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand-success: #74c98c; }
}
/* accent tile uses graphite-on-amber-tint; in dark the tint is dark, so use light text */
[data-theme="dark"] .tile--accent h3 { color: var(--text); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tile--accent h3 { color: var(--text); }
}

/* ============================================================================
   LEGAL / CONTENT PAGES
   ============================================================================ */
.legal { padding-block: clamp(48px, 8vw, 112px); }
.legal h1 { max-width: none; margin-bottom: var(--space-6); }
.legal h2 { font-size: var(--fs-h3); margin-top: var(--space-12); margin-bottom: var(--space-3); }
.legal p, .legal li { color: var(--text); }
.legal p { margin-block: var(--space-3); }
.legal a { color: var(--primary); }
.legal__back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--space-8); font-size: var(--fs-small); text-decoration: none; }
.legal ul { list-style: disc; padding-left: 1.4em; display: grid; gap: 6px; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero h1, .hero__subline { max-width: 100%; }
  .hero__ring { opacity: .35; right: -25%; }
  .solution__inner,
  .contact__inner { grid-template-columns: 1fr; }
  .human__inner { grid-template-columns: 200px 1fr; }
  .steps__layout { grid-template-columns: 1fr; }
  .steps__ring { display: none; } /* vertical stepper on small screens */
}

@media (max-width: 768px) {
  .nav { display: none; }
  .nav__cta { display: none; }
  .nav-toggle { display: flex; }
  .site-header__actions { gap: var(--space-2); }
  body { padding-bottom: 84px; } /* room for the action bar */
}

@media (max-width: 720px) {
  .problem__grid { grid-template-columns: 1fr; }
  .trust__points { grid-template-columns: 1fr; gap: var(--space-8); }
  .solution__viz { grid-template-columns: 1fr; }
  .ba__arrow { transform: rotate(90deg); }
  .human__inner { grid-template-columns: 1fr; }
  .portrait { max-width: 240px; }
  .bento > .tile--sm { grid-column: auto; }
}

@media (max-width: 520px) {
  .hero__actions .btn { width: 100%; }
}
