:root {
  --accent: #6c54e8;
  --accent-2: #c9922f;
  --bg: #ffffff;
  --surface: #f7f5fb;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1a1a1a;
  --success-bg: #e3f6ec;
  --success-text: #1a6b3f;
  --error-bg: #fce4e4;
  --error-text: #a12525;

  --hero-wash: linear-gradient(135deg, rgba(108, 84, 232, 0.07), rgba(201, 146, 47, 0.05));
  --shadow-card: 0 1px 2px rgba(108, 84, 232, 0.06), 0 10px 28px rgba(108, 84, 232, 0.1);

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;
  --text-3xl: clamp(2.25rem, 5vw + 1rem, 3.5rem);

  --radius-sm: 8px;
  --radius-md: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8b7cf6;
    --accent-2: #e8b563;
    --bg: #121212;
    --surface: #1a1a24;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f2f2f2;
    --success-bg: #16311f;
    --success-text: #7fd8a3;
    --error-bg: #3a1a1a;
    --error-text: #f0a3a3;

    --hero-wash: linear-gradient(135deg, rgba(139, 124, 246, 0.12), rgba(232, 181, 99, 0.06));
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 30px rgba(0, 0, 0, 0.45);
  }
}

/* Fraunces (SIL OFL 1.1) — self-hosted variable font, latin subset. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/fraunces-variable.woff2") format("woff2");
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
}

header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
}

header nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  text-decoration: none;
}

.brand-mark {
  width: auto;
  height: 1.55em;
  flex: none;
  filter: drop-shadow(0 1.5px 2px rgba(74, 55, 176, 0.3)) drop-shadow(0 7px 12px rgba(58, 42, 148, 0.34));
}

.brand-word {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.5rem;
  line-height: 1;
}

.brand-cubit {
  color: #8b7cf6;
}

.brand-vault {
  color: #3f2e9e;
}

@media (prefers-color-scheme: dark) {
  .brand-cubit {
    color: #c9bcff;
  }

  .brand-vault {
    color: #8b7cf6;
  }
}

#nav-links {
  display: flex;
  gap: 1.5rem;
}

/* Mobile-nav toggle: CSS-only, hidden checkbox drives the label + dropdown. */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text);
  user-select: none;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem;
}

/* Typography */
h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

h1 {
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--space-2);
}

p {
  font-size: var(--text-base);
  line-height: 1.6;
  margin: 0 0 var(--space-3);
}

.prose {
  max-width: 42rem;
  margin-inline: auto;
}

/* Body links (main only — nav/footer keep their own rules). */
main a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

main a:hover {
  color: var(--accent-2);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Vertical rhythm for bare sections; only .hero/.cta/.card get boundaries. */
main section {
  padding: var(--space-6) 0;
}

/* Faint horizon-echo divider between consecutive sections. */
main section + section::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: var(--space-6);
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: 0.25;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-7) var(--space-6);
  border-radius: var(--radius-md);
  background: var(--hero-wash);
}

.hero-note {
  font-size: var(--text-sm);
  opacity: 0.7;
}

/* Heroes with no horizon graphic (e.g. contact): shrink the box to the
   content instead of stretching a solo column across the full width. */
.hero:has(> .hero-copy:only-child) {
  max-width: 46rem;
  margin-inline: auto;
}

@media (min-width: 641px) {
  .hero {
    grid-template-columns: 1.5fr 1fr;
  }
}

.cta {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-7) var(--space-6);
  text-align: center;
}

.cta form {
  align-items: center;
  margin-inline: auto;
}

/* Horizon-line hero visual. */
.horizon {
  width: 100%;
  max-width: 320px;
  height: auto;
  justify-self: center;
}

/* Product screenshot in the hero's second grid column. */
.hero-visual {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 300px;
  opacity: 0;
  animation: hero-rise 0.6s ease-out 0.3s forwards;
}

/* Phone device frame — bezel + Dynamic Island + home indicator, CSS-only so
   it needs no separate mockup asset and stays theme-independent (real
   phones don't flip color with the page). Used for both the hero shot and
   card shots. */
.phone-frame {
  position: relative;
  background: linear-gradient(155deg, #3a3a3d 0%, #1e1e20 25%, #0c0c0d 62%, #000 100%);
  border-radius: 2.5rem;
  padding: 0.55rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px rgba(0, 0, 0, 0.65),
    var(--shadow-card);
}

.phone-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.95rem;
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  width: 5.75rem;
  height: 1.7rem;
  background: #050505;
  border-radius: 0.85rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 2;
}

.phone-frame::after {
  content: "";
  position: absolute;
  bottom: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 0.25rem;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0.15rem;
  z-index: 2;
}

.horizon-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: horizon-draw 1.3s ease-out forwards;
}

.horizon-node {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: horizon-node-in 0.4s ease-out forwards;
}

.horizon-today {
  animation-delay: 1s;
}

.horizon-proj {
  animation-delay: 1.25s;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
}

.card svg {
  width: 2rem;
  height: 2rem;
  margin-bottom: var(--space-2);
  color: var(--accent);
}

/* Screenshot variant: a card can show a full phone mockup instead of an
   icon, shown whole (not cropped) so it reads as a real device, not a strip. */
.card .phone-frame {
  max-width: 11rem;
  margin: 0 auto var(--space-4);
  border-radius: 1.5rem;
  padding: 0.4rem;
}

.card .phone-frame img {
  border-radius: 1.1rem;
}

.card .phone-frame::before {
  top: 0.35rem;
  width: 3.4rem;
  height: 1rem;
  border-radius: 0.5rem;
}

.card .phone-frame::after {
  bottom: 0.45rem;
  height: 0.18rem;
}

.card h3 {
  font-size: var(--text-lg);
}

.card p:last-child {
  margin-bottom: 0;
}

input,
textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(128, 128, 128, 0.4);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}

textarea {
  resize: vertical;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 28rem;
}

@media (min-width: 641px) {
  .contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3) var(--space-4);
    align-items: start;
    max-width: 36rem;
  }

  .contact-form textarea,
  .contact-form button {
    grid-column: 1 / -1;
  }

  .waitlist-form {
    flex-direction: row;
  }

  .waitlist-form input {
    flex: 1;
  }
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.waitlist-success {
  color: var(--accent);
  font-weight: 500;
}

footer {
  display: flex;
  gap: 1rem;
  padding: 1rem 2rem;
  opacity: 0.6;
  font-size: 0.85rem;
}

footer a {
  color: inherit;
  text-decoration: none;
}

/* Motion */
@keyframes horizon-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes horizon-node-in {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-copy > * {
  opacity: 0;
  animation: hero-rise 0.6s ease-out forwards;
}

.hero-copy > :nth-child(1) {
  animation-delay: 0.05s;
}

.hero-copy > :nth-child(2) {
  animation-delay: 0.15s;
}

.hero-copy > :nth-child(3) {
  animation-delay: 0.25s;
}

.hero-copy > :nth-child(4) {
  animation-delay: 0.35s;
}

@media (prefers-reduced-motion: reduce) {
  .horizon-path {
    animation: none;
    stroke-dashoffset: 0;
  }

  .horizon-node {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .hero-copy > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .nav-toggle-label {
    display: block;
  }

  #nav-links {
    display: none;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
  }

  .nav-toggle:checked ~ #nav-links {
    display: flex;
  }

  header nav {
    flex-wrap: wrap;
  }

  main {
    padding: 1.5rem 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  form {
    max-width: none;
    width: 100%;
  }

  input,
  textarea,
  button {
    width: 100%;
    box-sizing: border-box;
  }

  footer {
    flex-wrap: wrap;
  }
}

.cv-consent-banner[hidden] {
  display: none;
}

.cv-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: none;
  border-top: 2px solid var(--accent);
  border-radius: 0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15), 0 -20px 40px rgba(0, 0, 0, 0.1);
}

.cv-consent-banner p {
  max-width: 640px;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text);
}

.cv-consent-banner a {
  color: var(--accent);
}

.cv-consent-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.cv-consent-decline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

@media (max-width: 640px) {
  .cv-consent-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}
