/* Habit Skyline — landing page styles. Self-contained; mirrors the app's design tokens. */

:root {
  --bg: #f5efe2;
  --bg-2: #ebe2cf;
  --ink: #2a2418;
  --ink-2: #5a5142;
  --ink-3: #8a8170;
  --line: rgba(42, 36, 24, 0.12);
  --card: #fbf6e9;
  --accent: #c47e5a;
  --accent-2: #b56a45;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 50% -100px, rgba(196, 126, 90, 0.10), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(42, 36, 24, 0.025) 39px 40px);
  line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-2); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 6px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 10; }

/* HEADER */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.brand-mark { color: var(--accent); flex-shrink: 0; }
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }

/* HERO */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 44px;
  align-items: center;
  padding: 24px 0 48px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.hero-title em {
  color: var(--accent);
  font-style: italic;
}
.hero-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 22px;
  max-width: 52ch;
}
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--accent-2); color: white; transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: transparent;
}
.btn-ghost:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }
.hero-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin: 0;
}
.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(42, 36, 24, 0.18), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  background: var(--card);
  border: 1px solid var(--line);
}

/* Live hero city — interactive React island. */
.hero-city-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(42, 36, 24, 0.18), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.hero-city-frame:active { cursor: grabbing; }
.hero-city {
  position: absolute;
  inset: 0;
  /* Match the frame's border-radius so the SVG sky doesn't overflow corners */
  border-radius: inherit;
  overflow: hidden;
}
.hero-city svg { width: 100%; height: 100%; display: block; }
.hero-city-hint {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(42, 36, 24, 0.62);
  background: rgba(251, 246, 233, 0.78);
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
}

/* SECTIONS */
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 40px;
}
.section-title em {
  color: var(--accent);
  font-style: italic;
}
.section-sub {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-2);
  margin: 12px 0 8px;
}

/* FEATURES */
.features { padding: 48px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(196, 126, 90, 0.14);
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.feature-card p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

/* HOW */
.how { padding: 48px 0; }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  position: relative;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.steps h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.steps p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

/* SCREENSHOTS */
.screenshots { padding: 64px 0; }
.screenshots figure {
  margin: 0 0 32px;
}
.screenshots img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 16px 48px rgba(42, 36, 24, 0.12);
}
.screenshots figcaption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 12px;
  letter-spacing: 0.02em;
}

/* Auto-cycling demo: one frame cross-fades through the four art styles. */
.style-cycle {
  position: relative;
  width: 100%;
  max-width: 880px;
  aspect-ratio: 1308 / 846;
  margin: 24px auto 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 16px 48px rgba(42, 36, 24, 0.12);
}
.style-cycle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: style-cycle 16s ease-in-out infinite;
}
.style-cycle img:nth-child(1) { animation-delay: 0s; }
.style-cycle img:nth-child(2) { animation-delay: 4s; }
.style-cycle img:nth-child(3) { animation-delay: 8s; }
.style-cycle img:nth-child(4) { animation-delay: 12s; }
@keyframes style-cycle {
  0%, 1% { opacity: 0; }
  6%, 25% { opacity: 1; }
  31%, 100% { opacity: 0; }
}
.style-cycle-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.style-cycle-name span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  position: absolute;
  opacity: 0;
  animation: style-cycle 16s ease-in-out infinite;
}
.style-cycle-name span:nth-child(1) { animation-delay: 0s; }
.style-cycle-name span:nth-child(2) { animation-delay: 4s; }
.style-cycle-name span:nth-child(3) { animation-delay: 8s; }
.style-cycle-name span:nth-child(4) { animation-delay: 12s; }
@media (prefers-reduced-motion: reduce) {
  .style-cycle img { animation: none; opacity: 1; }
  .style-cycle img:nth-child(n+2) { display: none; }
  .style-cycle-name span { animation: none; opacity: 0; }
  .style-cycle-name span:first-child { opacity: 1; }
}

/* Four-up grid showing each art style */
.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 32px 0;
}
.style-grid figure {
  margin: 0;
}
.style-grid img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  display: block;
}
.style-grid figcaption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* FAQ */
.faq {
  padding: 64px 0;
  max-width: 720px;
  margin: 0 auto;
}
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
}
.faq details[open] {
  background: var(--bg-2);
}
.faq summary {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: var(--mono);
  font-size: 22px;
  color: var(--ink-3);
  margin-left: 12px;
  transition: transform 0.15s;
}
.faq details[open] summary::after { content: '−'; }
.faq details p {
  margin: 12px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* BOTTOM CTA */
.cta-bottom {
  text-align: center;
  padding: 80px 24px;
  margin: 40px 0 0;
}
.cta-bottom h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 24px;
  max-width: var(--maxw);
  margin: 60px auto 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 18px;
}
.footer-brand .brand-mark { color: var(--accent); }
.footer-links {
  display: flex;
  gap: 18px;
  justify-self: center;
}
.footer-links a {
  font-size: 13px;
  color: var(--ink-2);
}
.footer-links a:hover { color: var(--accent-2); }
.footer-fine {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin: 0;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* RESPONSIVE */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px 0 36px;
  }
  /* Text first on mobile so the CTA is visible above the fold. */
  .hero-text { order: 0; }
  .hero-visual { order: 1; }
  .features,
  .how,
  .screenshots,
  .faq { padding: 40px 0; }
  .feature-grid,
  .steps,
  .style-grid {
    grid-template-columns: 1fr;
  }
  .site-nav a { display: none; }
  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-brand,
  .footer-links { justify-self: center; }
  .footer-fine { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-primary:hover { transform: none; }
}
