/* ============================================================
   SpryWorx — styles.css
   Dark theme · Sora display / Manrope body
   Futuristic frame, human core.
   ============================================================ */

:root {
  /* Color tokens */
  --bg:            #0e131e;
  --surface-low:   #171b27;
  --surface:       #1b1f2b;
  --surface-high:  #252a36;
  --footer-bg:     #090e19;

  --primary:       #96cbff;   /* icy blue */
  --primary-light: #cee5ff;
  --primary-deep:  #002c48;
  --headline-blue: #0073a2;   /* avatar blue */

  --accent:        #ffb693;   /* peach / terracotta */
  --accent-strong: #ea6b1e;
  --accent-fg:     #3a1600;

  --fg:            #dee2f2;
  --fg-muted:      #c3c6cf;
  --outline:       #8d9199;
  --hairline:      rgba(141, 145, 153, 0.22);

  /* Type */
  --font-display:  'Sora', sans-serif;
  --font-body:     'Manrope', sans-serif;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  --glow-blue:   0 0 60px -12px rgba(150, 203, 255, 0.35);

  --nav-h: 72px;
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  text-wrap: pretty;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

::selection { background: rgba(150, 203, 255, 0.28); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--fg);
}

p { color: var(--fg-muted); }

.container { width: min(1120px, 92vw); margin-inline: auto; }

/* Accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-fg);
  padding: 10px 18px; border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: var(--accent-fg); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.clause-blue { color: var(--headline-blue); }

.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 14px 26px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: #ffc5a8; color: var(--accent-fg); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--outline);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-light); }

/* ---------- Nav ---------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: rgba(14, 19, 30, 0.6);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-brand .mark { height: 32px; width: auto; }
.nav-brand .wordmark { height: 17px; width: auto; }

.nav-links {
  display: flex; align-items: center; gap: 30px;
  list-style: none;
}
.nav-links a {
  font-size: 0.9375rem; font-weight: 500;
  color: rgba(222, 226, 242, 0.75);
}
.nav-links a:hover { color: var(--fg); }
.nav-cta { white-space: nowrap; padding: 11px 20px; font-size: 0.875rem; }
.nav-links a.nav-cta,
.nav-links a.nav-cta:hover { color: var(--accent-fg); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  width: 42px; height: 38px;
  color: var(--fg); cursor: pointer;
  font-size: 1.15rem; line-height: 1;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(14, 19, 30, 0.96);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--hairline);
    display: none;
    padding: 8px 0 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 0 6vw; }
  .nav-links a { display: block; padding: 13px 0; font-size: 1.05rem; }
  .nav-links .nav-cta { margin-top: 10px; text-align: center; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 72px;
  overflow: hidden;
}
#refraction {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero-inner {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}
.hero-copy h1 {
  font-size: clamp(2.35rem, 5vw, 4.15rem);
  letter-spacing: -0.03em;
  line-height: 1.06;
  max-width: 17ch;
}
.hero-copy h1 .clause-blue { color: var(--headline-blue); }
.hero-sub {
  font-size: clamp(1.02rem, 1.35vw, 1.2rem);
  line-height: 1.65;
  max-width: 52ch;
  margin: 26px 0 34px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-portrait { display: flex; justify-content: center; }
.hero-portrait img {
  width: min(380px, 78vw);
  border-radius: 50%;
  box-shadow: var(--glow-blue), var(--shadow-card);
  border: 1px solid rgba(150, 203, 255, 0.25);
}

@media (max-width: 860px) {
  .hero { min-height: auto; padding-bottom: 64px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; }
  .hero-portrait img { width: min(240px, 60vw); }
}

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 10vw, 120px) 0; }

.section-head { max-width: 62ch; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin-bottom: 16px; }
.section-head p  { font-size: 1.0625rem; }

/* What I do */
#what-i-do { border-top: 1px solid var(--hairline); }

.assessment-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-deep) 160%);
  border: 1px solid rgba(150, 203, 255, 0.28);
  border-radius: var(--radius-xl);
  padding: clamp(26px, 4vw, 42px);
  margin-bottom: clamp(28px, 4vw, 44px);
  box-shadow: var(--shadow-card);
}
.assessment-card .tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--primary);
  border: 1px solid rgba(150, 203, 255, 0.4);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 16px;
}
.assessment-card h3 { font-size: 1.35rem; margin-bottom: 12px; }
.assessment-card p { max-width: 68ch; }
.assessment-card .btn { margin-top: 22px; }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.pillar {
  background: var(--surface-low);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.pillar:hover { border-color: rgba(150, 203, 255, 0.4); transform: translateY(-3px); }
.pillar-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: rgba(150, 203, 255, 0.1);
  border: 1px solid rgba(150, 203, 255, 0.25);
  margin-bottom: 18px;
}
.pillar-icon svg { width: 22px; height: 22px; stroke: var(--primary); }
.pillar h3 { font-size: 1.13rem; margin-bottom: 10px; }
.pillar p { font-size: 0.98rem; line-height: 1.65; }

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

/* How it works */
#how-it-works { background: var(--surface-low); border-block: 1px solid var(--hairline); }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
}
.step-num {
  font-family: var(--font-display);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  display: block; margin-bottom: 14px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step p { font-size: 0.95rem; line-height: 1.6; }

@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* Why me */
.why-me-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.why-me-photo img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hairline);
}
.why-me-copy h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin-bottom: 18px; }
.why-me-copy p { font-size: 1.0625rem; max-width: 58ch; }
.why-me-copy .btn { margin-top: 26px; }

@media (max-width: 860px) {
  .why-me-inner { grid-template-columns: 1fr; }
  .why-me-photo { max-width: 420px; }
}

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-deep) 150%);
  border-block: 1px solid rgba(150, 203, 255, 0.22);
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); max-width: 24ch; margin-inline: auto; }
.cta-band p { max-width: 52ch; margin: 18px auto 30px; font-size: 1.0625rem; }

/* ---------- Footer ---------- */

.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--hairline);
  padding: 56px 0 40px;
}
.footer-inner {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: flex-start;
  gap: 32px;
}
.footer-brand img { height: 15px; width: auto; margin-bottom: 16px; }
.footer-tagline {
  font-size: 0.95rem;
  color: rgba(222, 226, 242, 0.55);
  max-width: 44ch;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  font-size: 0.95rem;
  color: rgba(222, 226, 242, 0.62);
}
.footer-links a:hover { color: var(--primary-light); }
.footer-meta {
  margin-top: 40px;
  font-size: 0.85rem;
  color: rgba(222, 226, 242, 0.4);
}

/* ============================================================
   About page
   ============================================================ */

.about-hero {
  padding: calc(var(--nav-h) + clamp(48px, 8vw, 88px)) 0 clamp(40px, 6vw, 64px);
}
.about-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.about-hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -0.03em;
  max-width: 16ch;
}
.about-hero h1 .clause-blue { color: var(--headline-blue); }
.about-hero .lede { font-size: 1.15rem; margin-top: 22px; max-width: 50ch; }
.about-hero-photo img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hairline);
}

@media (max-width: 860px) {
  .about-hero-inner { grid-template-columns: 1fr; }
  .about-hero-photo { max-width: 440px; }
}

.about-story { padding-bottom: clamp(64px, 9vw, 110px); }

.story-block {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(28px, 5vw, 48px) 0;
}
.story-block.flip { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); }
.story-block p {
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 58ch;
}
.story-photo img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hairline);
}

@media (max-width: 860px) {
  .story-block, .story-block.flip { grid-template-columns: 1fr; }
  .story-block.flip .story-photo { order: -1; }
  .story-photo { max-width: 420px; }
}

.about-signoff {
  max-width: 58ch;
  padding-top: clamp(20px, 4vw, 36px);
}
.about-signoff p { font-size: 1.1rem; line-height: 1.8; }
.signature {
  margin-top: 34px;
  width: min(320px, 70vw);
  filter: invert(0.9);
  opacity: 0.92;
}
.about-cta { margin-top: 44px; }

/* ============================================================
   Reveal-on-scroll animations
   Elements with .reveal fade up as they enter the viewport.
   Only active when JS is running (html.js); reduced-motion
   users see everything immediately.
   ============================================================ */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Stagger helpers for sibling groups */
.js .reveal-d1 { transition-delay: 0.1s; }
.js .reveal-d2 { transition-delay: 0.2s; }
.js .reveal-d3 { transition-delay: 0.3s; }
.js .reveal-d4 { transition-delay: 0.4s; }

/* Nav appears on load */
.js .nav {
  animation: navAppear 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes navAppear {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .nav { animation: none; }
}

/* ============================================================
   Photo captions (About)
   ============================================================ */

figure { margin: 0; }
figcaption {
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(222, 226, 242, 0.5);
  font-style: italic;
  margin-top: 12px;
  padding-left: 2px;
}

/* ============================================================
   Contact form
   ============================================================ */

#contact { border-top: 1px solid var(--hairline); }
.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.contact-copy h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin-bottom: 16px; }
.contact-copy p { max-width: 46ch; }

.contact-form {
  background: var(--surface-low);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: var(--shadow-card);
}
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 7px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 0.18s ease;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-field textarea { min-height: 140px; resize: vertical; }

/* Honeypot — hidden from humans, visible to bots */
.form-field.hp {
  position: absolute !important;
  left: -9999px !important;
  height: 1px; overflow: hidden;
}

.form-status {
  font-size: 0.95rem;
  margin-top: 14px;
  min-height: 1.4em;
}
.form-status.ok { color: var(--primary-light); }
.form-status.err { color: #ffb4ab; }

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

/* ============================================================
   Voice widget — "Talk to SpryWorx"
   ============================================================ */

.voice-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.voice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s ease, background 0.18s ease;
}
.voice-btn:hover { background: #ffc5a8; }
.voice-btn:active { transform: translateY(1px); }
.voice-btn svg { width: 19px; height: 19px; }

.voice-widget[data-state="connecting"] .voice-btn { opacity: 0.85; }

.voice-widget[data-state="listening"] .voice-btn,
.voice-widget[data-state="speaking"] .voice-btn {
  background: var(--primary-deep);
  border-color: rgba(150, 203, 255, 0.5);
  color: var(--primary-light);
}
.voice-widget[data-state="listening"] .voice-btn svg {
  animation: voicePulse 1.6s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-widget[data-state="listening"] .voice-btn svg { animation: none; }
}

.voice-status {
  max-width: 260px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--fg-muted);
  background: var(--surface-low);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-card);
}

@media (max-width: 560px) {
  .voice-widget { right: 14px; bottom: 14px; }
  .voice-btn { padding: 12px 16px; font-size: 0.875rem; }
}
