/* Beaverly / Chilla V3 homepage
   One atmosphere. Typography first. Minimal surfaces. */

:root {
  color-scheme: light;
  --page: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #f0f0ed;
  --text: #111214;
  --muted: #66686d;
  --faint: #919398;
  --line: rgba(17, 18, 20, 0.12);
  --line-strong: rgba(17, 18, 20, 0.22);
  --accent: #8b6d4e;
  --accent-soft: rgba(139, 109, 78, 0.12);
  --button: #111214;
  --button-text: #ffffff;
  --max: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(88px, 12vw, 156px);
  --font-display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #101112;
  --surface: #151617;
  --surface-soft: #1b1c1e;
  --text: #f5f5f2;
  --muted: #aaaeb3;
  --faint: #777b80;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #c1a17c;
  --accent-soft: rgba(193, 161, 124, 0.12);
  --button: #f5f5f2;
  --button-text: #111214;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--page);
}

body.v3-page {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 220ms ease, color 220ms ease;
}

body.v3-page a,
body.v3-page a:visited {
  color: inherit;
}

body.v3-page button,
body.v3-page input,
body.v3-page select,
body.v3-page textarea {
  font: inherit;
}

body.v3-page :where(a[href], button, input, select, textarea, summary, [role="button"]) {
  -webkit-tap-highlight-color: transparent;
}

body.v3-page :where(a[href], button:not(:disabled), summary, [role="button"]) {
  touch-action: manipulation;
}

body.v3-page :where(a[href], button, input, select, textarea, summary, [role="button"]):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--text) 72%, transparent);
  outline-offset: 3px;
}

body.v3-page :where(a[href], button:not(:disabled), summary, [role="button"]):active {
  opacity: 0.72;
}

.v3-shell {
  width: min(100%, calc(var(--max) + (var(--gutter) * 2)));
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.v3-kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v3-section-title {
  margin: 0;
  max-width: 820px;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 6vw, 5rem);
  font-weight: 520;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.v3-section-copy {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.17rem);
  line-height: 1.65;
}

/* Header */
.v3-site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.v3-site-header.is-scrolled {
  background: color-mix(in srgb, var(--page) 88%, transparent);
  border-bottom-color: var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.v3-nav {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.v3-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  transition: opacity 150ms ease;
}

.v3-brand-mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
}

.v3-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.v3-nav-links a,
.v3-mobile-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 150ms ease, opacity 150ms ease;
}

.v3-nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.v3-theme-toggle,
.v3-menu-toggle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 150ms ease, opacity 150ms ease;
}

.v3-theme-toggle:active,
.v3-menu-toggle:active {
  background: var(--surface-soft);
}

.v3-theme-toggle svg,
.v3-menu-toggle svg {
  width: 18px;
  height: 18px;
}

.v3-icon-sun,
html[data-theme="dark"] .v3-icon-moon {
  display: none;
}

html[data-theme="dark"] .v3-icon-sun,
.v3-icon-moon {
  display: block;
}

.v3-nav-cta,
.v3-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text) !important;
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition: opacity 150ms ease;
}

.v3-menu-toggle {
  display: none;
}

.v3-mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--page);
}

.v3-mobile-menu.is-open {
  display: block;
}

.v3-mobile-links {
  display: grid;
  gap: 2px;
  padding-block: 10px 20px;
}

.v3-mobile-links a {
  padding: 12px 0;
  font-size: 1rem;
}

/* Hero */
.v3-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(150px, 17vh, 210px) 0 72px;
}

.v3-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.v3-hero h1 {
  margin: 0;
  max-width: 760px;
  font-family: var(--font-display);
  font-size: clamp(3.75rem, 9.5vw, 7.9rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.068em;
  text-wrap: balance;
}

.v3-hero-sub {
  max-width: 560px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.23rem);
  line-height: 1.62;
  letter-spacing: -0.012em;
}

.v3-signature {
  margin: 24px 0 0;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 580;
  letter-spacing: -0.02em;
}

.v3-signature span {
  color: var(--accent);
}

.v3-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
}

.v3-text-link {
  color: var(--muted);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  font-size: 0.92rem;
  transition: color 150ms ease, opacity 150ms ease;
}

.v3-wave {
  position: absolute;
  z-index: 1;
  right: -12vw;
  top: 28%;
  width: min(52vw, 760px);
  aspect-ratio: 1.4 / 1;
  opacity: 0.72;
  pointer-events: none;
}

.v3-wave span {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 100%;
  height: 42%;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 50%;
  transform-origin: 0 50%;
}

.v3-wave span:nth-child(1) { transform: translate(-24%, -50%) rotate(-14deg) scale(0.82); }
.v3-wave span:nth-child(2) { transform: translate(-24%, -50%) rotate(-10deg) scale(0.92); }
.v3-wave span:nth-child(3) { transform: translate(-24%, -50%) rotate(-6deg) scale(1.02); }
.v3-wave span:nth-child(4) { transform: translate(-24%, -50%) rotate(-2deg) scale(1.12); }
.v3-wave span:nth-child(5) { transform: translate(-24%, -50%) rotate(2deg) scale(1.22); }
.v3-wave span:nth-child(6) { transform: translate(-24%, -50%) rotate(6deg) scale(1.32); }

.v3-composer-wrap {
  position: relative;
  z-index: 3;
  margin-top: clamp(62px, 10vh, 110px);
  max-width: 900px;
}

.v3-composer {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 9px 8px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.v3-composer-text {
  flex: 1;
  min-width: 0;
  color: var(--faint);
  font-size: 0.98rem;
}

.v3-composer-go {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-text);
  cursor: pointer;
  transition: opacity 150ms ease;
}

.v3-composer-go svg {
  width: 18px;
  height: 18px;
}

.v3-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.v3-prompt {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 9px 13px;
  cursor: pointer;
  font-size: 0.79rem;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.v3-prompt.is-active {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

/* Core story */
.v3-story,
.v3-example,
.v3-live,
.v3-mii,
.v3-final {
  padding: var(--section) 0;
  border-top: 1px solid var(--line);
}

.v3-story-list {
  margin-top: clamp(58px, 8vw, 96px);
  border-top: 1px solid var(--line);
}

.v3-story-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 32px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.v3-story-index {
  color: var(--faint);
  font-size: 0.78rem;
}

.v3-story-row h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.75rem);
  font-weight: 520;
  letter-spacing: -0.045em;
}

.v3-story-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.58;
}

/* Goal to report proof */
.v3-example-grid {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(360px, .9fr);
  gap: clamp(56px, 9vw, 128px);
  align-items: center;
}

.v3-example-stage {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  overflow: hidden;
}

.v3-example-top {
  min-height: 50px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.v3-example-state {
  color: var(--accent);
}

.v3-example-body {
  min-height: 410px;
  padding: 28px 24px;
}

.v3-example-goal,
.v3-example-working,
.v3-example-report {
  transition: opacity .55s ease, transform .55s ease;
}

.v3-example-goal {
  max-width: 88%;
  margin-left: auto;
  padding: 16px 18px;
  border-radius: 20px 20px 6px 20px;
  background: var(--text);
  color: var(--page);
}

.v3-example-goal span,
.v3-example-report > span {
  display: block;
  margin-bottom: 7px;
  font-size: .69rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.v3-example-goal span {
  color: color-mix(in srgb, var(--page) 62%, transparent);
}

.v3-example-goal p,
.v3-example-working p,
.v3-example-report p {
  margin: 0;
}

.v3-example-goal p {
  font-size: clamp(.98rem, 1.7vw, 1.08rem);
  line-height: 1.55;
}

.v3-example-working {
  min-height: 64px;
  margin: 30px 0 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-size: .88rem;
}

.v3-example-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.v3-example-dots i {
  width: 6px;
  height: 6px;
  display: block;
  border-radius: 50%;
  background: var(--accent);
  animation: v3ExampleDot 1.2s infinite ease-in-out;
}

.v3-example-dots i:nth-child(2) { animation-delay: .14s; }
.v3-example-dots i:nth-child(3) { animation-delay: .28s; }

@keyframes v3ExampleDot {
  0%, 60%, 100% { opacity: .28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.v3-example-report {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.v3-example-report > span {
  color: var(--faint);
}

.v3-example-report p {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.28;
  letter-spacing: -.028em;
}

.v3-example-report small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
}

.v3-example-stage.is-animated .v3-example-goal,
.v3-example-stage.is-animated .v3-example-working,
.v3-example-stage.is-animated .v3-example-report {
  opacity: 0;
  transform: translateY(10px);
}

.v3-example-stage.is-goal .v3-example-goal {
  opacity: 1;
  transform: none;
}

.v3-example-stage.is-working .v3-example-goal {
  opacity: .42;
  transform: translateY(-4px);
}

.v3-example-stage.is-working .v3-example-working {
  opacity: 1;
  transform: none;
}

.v3-example-stage.is-report .v3-example-goal {
  opacity: .18;
  transform: translateY(-8px);
}

.v3-example-stage.is-report .v3-example-report {
  opacity: 1;
  transform: none;
}

.v3-example-stage.is-resetting .v3-example-goal,
.v3-example-stage.is-resetting .v3-example-working,
.v3-example-stage.is-resetting .v3-example-report {
  opacity: 0;
  transform: translateY(6px);
}

/* Start in demo */
.v3-live-grid,
.v3-mii-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.75fr);
  gap: clamp(56px, 10vw, 140px);
  align-items: end;
}

.v3-proof {
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.v3-proof strong {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.v3-proof p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.62;
}

.v3-inline-link {
  display: inline-flex;
  margin-top: 24px;
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 3px;
  transition: border-color 150ms ease, opacity 150ms ease;
}

/* Final */
.v3-final-inner {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.v3-final h2 {
  margin: 0;
  max-width: 820px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.v3-final p {
  margin: 24px 0 34px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Footer */
.v3-footer {
  padding: 36px 0 30px;
  border-top: 1px solid var(--line);
}

.v3-footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.v3-footer-brand p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.v3-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px 24px;
}

.v3-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.4;
  transition: color 150ms ease, opacity 150ms ease;
}

.v3-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.74rem;
  line-height: 1.55;
}

.v3-footer-bottom p {
  margin: 0;
}

@media (hover: hover) and (pointer: fine) {
  .v3-brand:hover {
    opacity: 0.78;
  }

  .v3-nav-links a:hover,
  .v3-mobile-links a:hover,
  .v3-text-link:hover,
  .v3-footer-links a:hover {
    color: var(--text);
  }

  .v3-theme-toggle:hover,
  .v3-menu-toggle:hover,
  .v3-prompt:hover {
    background: var(--surface-soft);
  }

  .v3-prompt:hover {
    color: var(--text);
    border-color: var(--line-strong);
  }

  .v3-nav-cta:hover,
  .v3-primary-link:hover,
  .v3-composer-go:hover {
    opacity: 0.86;
  }

  .v3-inline-link:hover {
    border-bottom-color: var(--text);
  }
}

/* Entrance motion */
.v3-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.v3-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .v3-reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 900px) {
  .v3-nav {
    grid-template-columns: 1fr auto;
  }

  .v3-nav-links {
    display: none;
  }

  .v3-menu-toggle {
    display: inline-flex;
  }

  .v3-nav-cta {
    display: none;
  }

  .v3-wave {
    right: -34vw;
    top: 36%;
    width: 86vw;
    opacity: 0.42;
  }

  .v3-story-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .v3-story-row p {
    grid-column: 2;
  }

  .v3-example-grid,
  .v3-live-grid,
  .v3-mii-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .v3-example-stage {
    max-width: 660px;
  }
}

@media (max-width: 620px) {
  .v3-nav {
    min-height: 68px;
  }

  .v3-brand span:last-child {
    font-size: 0.92rem;
  }

  .v3-hero {
    min-height: auto;
    padding-top: 132px;
    padding-bottom: 64px;
  }

  .v3-hero h1 {
    font-size: clamp(3.45rem, 17vw, 5.25rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
  }

  .v3-hero-sub {
    margin-top: 26px;
  }

  .v3-composer-wrap {
    margin-top: 60px;
  }

  .v3-composer {
    min-height: 62px;
    padding-left: 17px;
    border-radius: 16px;
  }

  .v3-composer-go {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .v3-prompts {
    display: grid;
    grid-template-columns: 1fr;
  }

  .v3-prompt {
    text-align: left;
    border-radius: 12px;
    padding: 10px 12px;
  }

  .v3-story-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 16px;
    padding: 22px 0;
  }

  .v3-example-grid {
    gap: 52px;
  }

  .v3-example-stage {
    border-radius: 22px;
  }

  .v3-example-body {
    min-height: 430px;
    padding: 24px 18px;
  }

  .v3-example-goal {
    max-width: 94%;
  }

  .v3-footer-top,
  .v3-footer-bottom {
    flex-direction: column;
  }

  .v3-footer-links {
    justify-content: flex-start;
  }
}
