/* Homa landing page. Colours and fonts come from tokens.css (copied from brand/ at build). */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--homa-bg);
  color: var(--homa-text);
  font-family: var(--homa-font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--homa-font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.005em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--homa-primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--homa-primary-hover);
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 8px 14px;
  background: var(--homa-primary);
  color: var(--homa-on-primary);
  border-radius: 8px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--homa-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--homa-border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  color: var(--homa-text);
}

.brand svg {
  height: 30px;
  width: auto;
}

.logo-mark {
  fill: var(--homa-mark);
}

.logo-word {
  fill: currentColor;
}

.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  align-items: center;
}

.nav-links a:not(.btn) {
  color: var(--homa-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:not(.btn):hover {
  color: var(--homa-text);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--homa-border);
  border-radius: 10px;
  background: transparent;
  color: var(--homa-text);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--homa-border-strong);
}

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

.theme-toggle .moon,
:root[data-theme='dark'] .theme-toggle .sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .sun {
    display: none;
  }

  :root:not([data-theme='light']) .theme-toggle .moon {
    display: block;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--homa-primary);
  color: var(--homa-on-primary);
  border: 1px solid var(--homa-primary);
}

.btn-primary:hover {
  background: var(--homa-primary-hover);
  border-color: var(--homa-primary-hover);
  color: var(--homa-on-primary);
}

.btn-ghost {
  border: 1px solid var(--homa-border-strong);
  color: var(--homa-text);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--homa-surface);
  color: var(--homa-text);
}

.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.92rem;
}

/* Hero */

.hero {
  padding: clamp(56px, 9vw, 112px) 0 clamp(56px, 8vw, 96px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--homa-text-muted);
  border: 1px solid var(--homa-border);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  margin-bottom: 24px;
}

.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--homa-accent);
  margin-left: 4px;
}

.hero h1 {
  font-size: clamp(2.8rem, 6.4vw, 5rem);
}

.hero h1 em {
  font-style: normal;
  color: var(--homa-primary);
}

.lede {
  margin-top: 22px;
  font-size: clamp(1.08rem, 1.6vw, 1.22rem);
  color: var(--homa-text-muted);
  max-width: 34rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.fa {
  font-family: 'Vazirmatn', var(--homa-font-body);
}

/* Poll preview: the hero picture, built in HTML */

.poll {
  margin: 0;
  background: var(--homa-surface);
  border: 1px solid var(--homa-border);
  border-radius: 20px;
  padding: 22px;
}

.poll-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 18px;
}

.poll-title {
  font-family: var(--homa-font-display);
  font-weight: 700;
  font-size: 1.35rem;
}

.poll-meta {
  font-size: 0.82rem;
  color: var(--homa-text-muted);
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 88px repeat(14, 1fr);
  gap: 4px;
  align-items: center;
}

.grid .day {
  font-size: 0.68rem;
  color: var(--homa-text-muted);
  text-align: center;
  line-height: 1.2;
}

.grid .day b {
  display: block;
  font-size: 0.8rem;
  color: var(--homa-text);
  font-weight: 700;
}

.grid .who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--homa-dusty-grape);
  color: var(--homa-parchment);
}

.cell {
  height: 26px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--homa-lilac-ash) 16%, transparent);
}

.cell.free {
  background: color-mix(in srgb, var(--homa-lilac-ash) 55%, transparent);
}

.cell.free.all {
  background: var(--homa-accent);
}

.overlap {
  grid-column: 2 / -1;
  position: relative;
  height: 0;
}

.pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--homa-accent) 30%, transparent);
  border: 1px solid var(--homa-accent);
  font-size: 0.9rem;
}

.pick strong {
  font-weight: 700;
}

.pick span {
  color: var(--homa-text-muted);
  font-size: 0.82rem;
}

@media (prefers-reduced-motion: no-preference) {
  .cell.free.all {
    animation: glow 2.8s ease-in-out infinite;
  }

  @keyframes glow {
    50% {
      background: color-mix(in srgb, var(--homa-accent) 70%, var(--homa-parchment));
    }
  }
}

/* Sources strip */

.sources {
  border-block: 1px solid var(--homa-border);
  padding: 22px 0;
}

.sources .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}

.sources p {
  font-size: 0.9rem;
  color: var(--homa-text-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 0.86rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--homa-border);
}

/* Sections */

section {
  scroll-margin-top: 80px;
}

.section {
  padding: clamp(64px, 9vw, 120px) 0;
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.kicker {
  font-family: var(--homa-font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.86rem;
  color: var(--homa-text-muted);
  margin-bottom: 12px;
}

.section h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.3rem);
}

.section-head p {
  margin-top: 16px;
  color: var(--homa-text-muted);
  font-size: 1.1rem;
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature {
  padding: 26px;
  border-radius: 18px;
  background: var(--homa-surface);
  border: 1px solid var(--homa-border);
}

.feature.wide {
  grid-column: span 2;
}

.icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--homa-accent) 35%, transparent);
  color: var(--homa-text);
  margin-bottom: 18px;
}

.icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.feature p {
  color: var(--homa-text-muted);
}

/* Steps */

.band {
  background: var(--homa-space-indigo);
  color: var(--homa-parchment);
}

.band .kicker,
.band .section-head p,
.band .step p {
  color: #a99ca7;
}

.band a {
  color: var(--homa-almond-silk);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.step {
  padding: 26px;
  border-radius: 18px;
  border: 1px solid var(--homa-dusty-grape);
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--homa-font-display);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--homa-almond-silk);
  line-height: 1;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 1.45rem;
  margin-bottom: 8px;
}

/* Self-host */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}

.checks li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.checks svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--homa-primary);
}

.terminal {
  border-radius: 18px;
  background: var(--homa-space-indigo);
  color: var(--homa-parchment);
  border: 1px solid var(--homa-dusty-grape);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.8rem;
  color: #a99ca7;
  border-bottom: 1px solid var(--homa-dusty-grape);
}

.terminal pre {
  margin: 0;
  padding: 20px;
  font-family: var(--homa-font-mono);
  font-size: 0.9rem;
  line-height: 1.75;
  overflow-x: auto;
}

.terminal .c {
  color: #a99ca7;
}

.terminal .p {
  color: var(--homa-almond-silk);
}

/* Story */

.story {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 24px;
  border: 1px solid var(--homa-border);
  background: var(--homa-surface);
}

.story-mark {
  width: clamp(96px, 14vw, 160px);
  height: auto;
}

.story h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
}

.story p {
  margin-top: 14px;
  color: var(--homa-text-muted);
  max-width: 44rem;
}

/* Final CTA + footer */

.final {
  text-align: center;
}

.final h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.final p {
  margin: 16px auto 0;
  max-width: 34rem;
  color: var(--homa-text-muted);
}

.final .cta-row {
  justify-content: center;
}

footer {
  border-top: 1px solid var(--homa-border);
  padding: 28px 0 40px;
  font-size: 0.9rem;
  color: var(--homa-text-muted);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
}

footer nav {
  display: flex;
  gap: 20px;
}

footer a {
  color: var(--homa-text-muted);
}

/* Responsive */

@media (max-width: 960px) {
  .hero .wrap,
  .split {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 640px) {
  .nav-links a:not(.btn) {
    display: none;
  }

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

  .feature.wide {
    grid-column: auto;
  }

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

  .grid {
    grid-template-columns: 26px repeat(14, 1fr);
    gap: 3px;
  }

  .grid .day {
    font-size: 0.6rem;
  }

  .grid .who span:last-child {
    display: none;
  }

  .cell {
    height: 22px;
  }

  .pick {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Depth: girih line pattern on the indigo band, soft glow behind the hero poll */

.band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.band::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('girih.svg') center / 120px 120px;
  opacity: 0.12;
  mask-image: radial-gradient(ellipse 80% 90% at 85% 0%, #000 0%, transparent 70%);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 720px;
  height: 720px;
  right: -120px;
  top: 50%;
  translate: 0 -50%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--homa-accent) 45%, transparent) 0%, transparent 65%);
}

.poll {
  margin: 0;
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--homa-space-indigo) 45%, transparent);
}

.final {
  position: relative;
  isolation: isolate;
}

.final::before {
  content: '';
  position: absolute;
  inset: 10% 0;
  z-index: -1;
  background: url('girih.svg') center / 120px 120px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 50% 60% at 50% 50%, #000 0%, transparent 75%);
}
