/* ============================================================
   TalkLogics — talklogics.net
   Design system: "delivered" — deep signal green on pure white.
   Fonts: Archivo Variable (display+body), Martian Mono (codes/labels)
   ============================================================ */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Martian Mono';
  src: url('../fonts/martian-mono-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* palette — seed oklch(0.40 0.106 150) */
  --bg:       oklch(1 0 0);
  --surface:  oklch(0.965 0.007 150);
  --ink:      oklch(0.215 0.015 155);
  --muted:    oklch(0.45 0.02 152);
  --primary:  oklch(0.40 0.106 150);
  --primary-deep: oklch(0.30 0.075 152);
  --pine-950: oklch(0.235 0.045 155);   /* dark section bg */
  --pine-900: oklch(0.285 0.055 153);
  --accent:   oklch(0.88 0.155 125);    /* lichen — delivered */
  --accent-ink: oklch(0.32 0.09 130);
  --line:     oklch(0.88 0.01 150);
  --line-dark: oklch(0.38 0.04 152);

  --font-sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Martian Mono', ui-monospace, 'Cascadia Code', monospace;

  --wrap: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* z-scale */
  --z-header: 50;
  --z-skip: 100;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  font-variation-settings: 'wdth' 100;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: #fff;
  padding: 0.6rem 1rem; border-radius: 8px;
  z-index: var(--z-skip); transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- type scale ---------- */
h1, h2, h3 { text-wrap: balance; line-height: 1.06; letter-spacing: -0.025em; font-weight: 640; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); letter-spacing: -0.01em; line-height: 1.25; }
p  { max-width: 62ch; text-wrap: pretty; }

.lede { font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.55; color: var(--muted); }

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 600; font-size: 1rem; line-height: 1;
  padding: 0.95rem 1.5rem; border-radius: 999px;
  text-decoration: none; border: 1.5px solid transparent;
  transition: transform 0.25s var(--ease-out), background-color 0.25s var(--ease-out),
              border-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: var(--pine-950); }
.btn-light:hover { background: var(--accent); color: var(--accent-ink); }
.btn-outline-light { border-color: var(--line-dark); color: #fff; }
.btn-outline-light:hover { border-color: #fff; }
.btn .arrow { transition: transform 0.25s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.25rem; gap: 1rem;
}
.logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.logo svg { height: 1.6rem; width: auto; }
.main-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.main-nav a:not(.btn) {
  text-decoration: none; font-weight: 520; font-size: 0.95rem; color: var(--muted);
  transition: color 0.2s var(--ease-out);
}
.main-nav a:not(.btn):hover { color: var(--ink); }
.main-nav .btn { padding: 0.6rem 1.1rem; font-size: 0.9rem; }
.nav-links { display: contents; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: clip; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding-block: clamp(3.5rem, 9vh, 7rem);
}
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lede { margin-top: 1.4rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.2rem; }
.hero-note {
  margin-top: 1.1rem; font-size: 0.9rem; color: var(--muted);
}
.hero-note a { color: var(--primary); font-weight: 560; }

/* phone mock */
.phone-stage { position: relative; display: grid; place-items: center; }
.phone-stage::before {
  content: ''; position: absolute; inset: 8% -6% -4% -6%;
  background:
    radial-gradient(60% 55% at 65% 40%, oklch(0.94 0.035 148) 0%, transparent 70%),
    radial-gradient(45% 40% at 25% 75%, oklch(0.955 0.05 122) 0%, transparent 72%);
  border-radius: 32px;
  z-index: -1;
}
.phone {
  width: min(340px, 88vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow:
    0 1px 2px oklch(0.2 0.02 150 / 0.06),
    0 12px 32px oklch(0.2 0.04 150 / 0.10),
    0 32px 80px oklch(0.2 0.05 150 / 0.10);
  padding: 1.1rem 1.1rem 1.4rem;
}
.phone-top {
  display: flex; align-items: center; gap: 0.65rem;
  padding-bottom: 0.85rem; border-bottom: 1px solid var(--line);
}
.phone-avatar {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.02em;
}
.phone-peer { font-weight: 620; font-size: 0.92rem; line-height: 1.2; }
.phone-peer small { display: block; font-weight: 400; color: var(--muted); font-size: 0.72rem; }
.thread { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 1rem; }
.msg {
  border-radius: 16px; padding: 0.7rem 0.9rem;
  font-size: 0.86rem; line-height: 1.45; max-width: 86%;
}
.msg-in { background: var(--surface); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg-out {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 6px; align-self: flex-end;
}
.msg-otp {
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 640;
  letter-spacing: 0.22em; color: var(--primary);
  background: #fff; border: 1.5px dashed oklch(0.62 0.07 150);
  border-radius: 12px; padding: 0.55rem 0.9rem; align-self: flex-start;
}
.receipt {
  align-self: flex-end; display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 560;
  color: var(--accent-ink);
  background: var(--accent); border-radius: 999px; padding: 0.28rem 0.6rem;
}
.receipt svg { width: 0.75rem; height: 0.75rem; }

/* thread entrance */
@media (prefers-reduced-motion: no-preference) {
  .thread > * { animation: msg-in 0.7s var(--ease-out) backwards; }
  .thread > *:nth-child(1) { animation-delay: 0.25s; }
  .thread > *:nth-child(2) { animation-delay: 0.55s; }
  .thread > *:nth-child(3) { animation-delay: 0.85s; }
  .thread > *:nth-child(4) { animation-delay: 1.2s; }
  @keyframes msg-in {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: none; }
  }
  .hero-copy > * { animation: rise 0.8s var(--ease-out) backwards; }
  .hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
  .hero-copy > *:nth-child(4) { animation-delay: 0.22s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ---------- ticker divider ---------- */
.ticker {
  border-block: 1px solid var(--line);
  overflow: hidden; white-space: nowrap;
  padding-block: 0.8rem;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  color: var(--muted);
}
.ticker-track { display: inline-flex; gap: 3.5rem; padding-right: 3.5rem; }
.ticker-track span { display: inline-flex; align-items: center; gap: 0.6rem; }
.ticker-track .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
@media (prefers-reduced-motion: no-preference) {
  .ticker-inner { display: inline-flex; animation: ticker 36s linear infinite; }
  @keyframes ticker { to { transform: translateX(-50%); } }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(4rem, 10vh, 7.5rem); }
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .lede { margin-top: 1rem; }

/* services — ruled rows, not cards */
.services { border-top: 1px solid var(--line); }
.service-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1rem, 4vw, 4rem);
  padding-block: clamp(1.6rem, 3.5vw, 2.4rem);
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.service-title { display: flex; align-items: center; gap: 1rem; }
.service-glyph {
  flex: none; width: 2.6rem; height: 2.6rem; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--primary);
}
.service-glyph svg { width: 1.25rem; height: 1.25rem; }
.service-row p { color: var(--muted); }
.service-row p strong { color: var(--ink); font-weight: 600; }

/* ---------- talkotp (dark drench) ---------- */
.talkotp {
  background: var(--pine-950);
  color: oklch(0.96 0.008 150);
  border-radius: clamp(18px, 3vw, 32px);
  margin-inline: clamp(0.5rem, 1.5vw, 1.25rem);
  overflow: clip;
  position: relative;
}
.talkotp::after {  /* signal grid */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(oklch(1 0 0 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(85% 70% at 70% 12%, #000 0%, transparent 100%);
}
.talkotp .wrap { position: relative; z-index: 1; padding-block: clamp(4rem, 9vh, 6.5rem); }
.talkotp-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 620;
  padding: 0.35rem 0.75rem; border-radius: 999px;
  margin-bottom: 1.4rem;
}
.talkotp h2 { color: #fff; max-width: 21ch; }
.talkotp .lede { color: oklch(0.82 0.02 150); margin-top: 1.2rem; max-width: 52ch; line-height: 1.6; }
.otp-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(2rem, 4vw, 2.75rem);
  border-top: 1px solid var(--line-dark);
}
.otp-feature h3 { color: #fff; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.6rem; }
.otp-feature h3 svg { width: 1.15rem; height: 1.15rem; color: var(--accent); flex: none; }
.otp-feature p { color: oklch(0.78 0.02 150); font-size: 0.97rem; line-height: 1.6; }
.talkotp-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: clamp(2.5rem, 5vw, 3.25rem); }

/* big otp code art */
.otp-art {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  letter-spacing: 0.28em;
  color: oklch(0.35 0.06 152);
  user-select: none;
  line-height: 1;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  white-space: nowrap;
  overflow: hidden;
  mask-image: linear-gradient(90deg, #000 72%, transparent 98%);
  -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent 98%);
}
.otp-art b { color: var(--accent); font-weight: 700; }

/* ---------- quotes ---------- */
.quotes .wrap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(2rem, 4vw, 3rem);
}
.quote { border-top: 3px solid var(--primary); padding-top: 1.4rem; }
.quote blockquote {
  font-size: 1.08rem; line-height: 1.55; font-weight: 480;
  letter-spacing: -0.005em;
}
.quote figcaption {
  margin-top: 1.1rem; font-family: var(--font-mono);
  font-size: 0.7rem; color: var(--muted);
}
.quote figcaption strong { color: var(--ink); font-weight: 640; display: block; margin-bottom: 0.15rem; }

/* ---------- contact ---------- */
.contact { background: var(--surface); }
.contact .wrap {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  padding-block: clamp(4rem, 9vh, 6.5rem);
  align-items: center;
}
.contact h2 { max-width: 18ch; }
.contact .lede { margin-top: 1.2rem; }
.contact-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  box-shadow: 0 10px 30px oklch(0.2 0.04 150 / 0.06);
}
.contact-card h3 { margin-bottom: 0.4rem; }
.contact-card > p { color: var(--muted); font-size: 0.97rem; margin-bottom: 1.5rem; }
.contact-line {
  display: flex; align-items: center; gap: 0.9rem;
  padding-block: 1rem; border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 0.2s var(--ease-out);
}
.contact-line:hover { background: var(--surface); }
.contact-line .service-glyph { background: var(--surface); }
.contact-line .cl-label { font-family: var(--font-mono); font-size: 0.65rem; color: var(--muted); }
.contact-line .cl-value { font-weight: 620; font-size: 1.02rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 1.5rem 3rem;
  align-items: center; justify-content: space-between;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-legal a, .footer-copy {
  font-size: 0.85rem; color: var(--muted); text-decoration: none;
}
.footer-legal a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 1; transform: none; transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
  .js .reveal:not(.is-visible) { opacity: 0; transform: translateY(18px); }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .phone-stage { order: 2; }
  .service-row { grid-template-columns: 1fr; gap: 0.8rem; }
  .contact .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  body { font-size: 1rem; }
}

/* ============================================================
   AUTH / LOGIN PAGE
   ============================================================ */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.auth-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: stretch;
}
/* left: brand panel (drenched) */
.auth-brand {
  background: var(--pine-950);
  color: oklch(0.96 0.008 150);
  position: relative; overflow: clip;
  padding: clamp(2.5rem, 5vw, 4rem);
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 3rem;
}
.auth-brand::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(oklch(1 0 0 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 60% at 30% 20%, #000 0%, transparent 100%);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .logo text { fill: #fff; }
.auth-brand h2 { color: #fff; max-width: 15ch; }
.auth-brand .lede { color: oklch(0.82 0.02 150); margin-top: 1rem; max-width: 40ch; }
.auth-brand-foot { font-family: var(--font-mono); font-size: 0.7rem; color: oklch(0.7 0.02 150); }
.auth-mini-thread { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 2rem; max-width: 300px; }
.auth-mini-thread .msg { font-size: 0.82rem; }

/* right: form panel */
.auth-panel {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card .back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--muted); text-decoration: none; margin-bottom: 2rem;
  transition: color 0.2s var(--ease-out);
}
.auth-card .back-link:hover { color: var(--ink); }
.auth-card h1 { font-size: clamp(1.7rem, 3vw, 2.1rem); }
.auth-card > p.sub { color: var(--muted); margin-top: 0.5rem; margin-bottom: 2rem; font-size: 0.97rem; }

.field { margin-bottom: 1.15rem; }
.field label {
  display: block; font-family: var(--font-mono); font-size: 0.65rem;
  font-weight: 560; letter-spacing: 0.02em; color: var(--muted);
  margin-bottom: 0.45rem; text-transform: uppercase;
}
.field input {
  width: 100%; font: inherit; font-size: 1rem;
  padding: 0.85rem 1rem; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.field input::placeholder { color: oklch(0.62 0.015 150); }
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px oklch(0.40 0.106 150 / 0.14); }
.field input:user-invalid { border-color: oklch(0.55 0.16 27); }

.field-row { display: flex; align-items: center; justify-content: space-between; }
.field-row a { font-size: 0.8rem; color: var(--primary); font-weight: 560; text-decoration: none; }
.field-row a:hover { text-decoration: underline; }

.auth-card .btn-primary { width: 100%; justify-content: center; margin-top: 0.5rem; }
.auth-card .btn-primary[aria-busy="true"] { opacity: 0.7; pointer-events: none; }

/* error banner */
.auth-error {
  display: none; align-items: flex-start; gap: 0.6rem;
  background: oklch(0.96 0.03 27); border: 1px solid oklch(0.85 0.08 27);
  color: oklch(0.42 0.15 27);
  border-radius: 10px; padding: 0.8rem 0.95rem;
  font-size: 0.88rem; line-height: 1.45; margin-bottom: 1.5rem;
}
.auth-error.is-shown { display: flex; }
.auth-error svg { flex: none; width: 1.05rem; height: 1.05rem; margin-top: 0.1rem; }
@media (prefers-reduced-motion: no-preference) {
  .auth-error.is-shown { animation: shake 0.4s var(--ease-out); }
  @keyframes shake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
  }
}

.auth-foot { text-align: center; margin-top: 2rem; font-size: 0.88rem; color: var(--muted); }
.auth-foot a { color: var(--primary); font-weight: 560; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

.auth-legal {
  text-align: center; padding: 1.5rem; font-size: 0.8rem; color: var(--muted);
  display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap;
}
.auth-legal a { color: var(--muted); text-decoration: none; }
.auth-legal a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 860px) {
  .auth-main { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}
