@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,500&family=Work+Sans:wght@400;500;600&display=swap');

:root{
  --ink: #241521;
  --ink-2: #2e1c2b;
  --paper: #F5EDE4;
  --paper-dim: #d9cdbf;
  --gold: #C9A15A;
  --rose: #D98A93;
  --line: rgba(245,237,228,0.14);
  --radius: 2px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Work Sans', sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: var(--safe-top);
}

h1, h2, h3, .display{
  font-family: 'Fraunces', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

a{ color: inherit; }
img{ max-width: 100%; display: block; }

.wrap{
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- NAV ---------- */
header{
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(36,21,33,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
nav.wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.logo{
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-style: italic;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.logo em{ font-style: normal; color: var(--gold); }

.nav-toggle{
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after{
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--paper);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before{ position: absolute; top: -6px; }
.nav-toggle span::after{ position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span{ background: transparent; }
.nav-toggle[aria-expanded="true"] span::before{ transform: rotate(45deg); top: 0; }
.nav-toggle[aria-expanded="true"] span::after{ transform: rotate(-45deg); top: 0; }

.nav-links{ display:flex; align-items:center; gap: 32px; }
nav ul{
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}
nav ul a{
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
nav ul a:hover, nav ul a:focus-visible{ opacity: 1; }
.nav-cta{
  border: 1px solid var(--gold);
  color: var(--gold) !important;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  opacity: 1 !important;
  white-space: nowrap;
}

@media (max-width: 760px){
  .nav-toggle{ display: flex; }
  .nav-links{
    position: fixed;
    inset: 65px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 24px;
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.open{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  nav ul{ flex-direction: column; gap: 16px; font-size: 1.05rem; }
  .nav-cta{ text-align: center; }
}

/* ---------- BUTTONS ---------- */
.btn{
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
  min-height: 44px;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--gold); color: var(--ink); }
.btn-primary:hover{ opacity: 0.88; }
.btn-ghost{ color: var(--paper); border-color: var(--line); }
.btn-ghost:hover{ border-color: var(--paper); }

input, select, .btn, .dot, a{ }
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, .dot:focus-visible, .nav-toggle:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- HERO ---------- */
.hero{ position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero-grid{ display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.eyebrow{
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--rose);
  margin-bottom: 18px;
}
h1.hero-line{ font-size: clamp(2.2rem, 7vw, 4.1rem); line-height: 1.06; }
h1.hero-line em{ font-style: italic; color: var(--gold); }
.hero-sub{ max-width: 42ch; margin-top: 22px; color: var(--paper-dim); font-size: 1.02rem; }
.hero-actions{ margin-top: 32px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.thread-box{ position: relative; aspect-ratio: 1 / 1; }
.thread-box svg{ width: 100%; height: 100%; }
.thread-a{ fill:none; stroke: var(--rose); stroke-width: 2.5; stroke-dasharray: 620; stroke-dashoffset: 620; animation: draw 2.2s ease forwards 0.3s; }
.thread-b{ fill:none; stroke: var(--gold); stroke-width: 2.5; stroke-dasharray: 620; stroke-dashoffset: 620; animation: draw 2.2s ease forwards 0.6s; }
.thread-knot{ fill: var(--paper); opacity: 0; animation: appear 0.6s ease forwards 2.4s; }
@keyframes draw{ to{ stroke-dashoffset: 0; } }
@keyframes appear{ to{ opacity: 1; } }
@media (prefers-reduced-motion: reduce){
  .thread-a, .thread-b, .thread-knot{ animation: none; stroke-dashoffset: 0; opacity: 1; }
}

/* ---------- SECTIONS ---------- */
section{ padding: 64px 0; }
.section-head{ max-width: 48ch; margin-bottom: 44px; }
.section-head .eyebrow{ margin-bottom: 12px; }
h2.section-title{ font-size: clamp(1.7rem, 5vw, 2.6rem); }
.divider{ border: none; border-top: 1px solid var(--line); margin: 0; }

.steps{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step{ border-top: 1px solid var(--line); padding-top: 20px; }
.step-num{ font-family: 'Fraunces', serif; font-style: italic; color: var(--rose); font-size: 1.1rem; display: block; margin-bottom: 12px; }
.step h3{ font-size: 1.2rem; margin-bottom: 8px; font-weight: 600; }
.step p{ color: var(--paper-dim); font-size: 0.95rem; margin: 0; }

.stories{ background: var(--ink-2); border-radius: 4px; padding: 44px 28px; }
.story-quote{ font-family: 'Fraunces', serif; font-style: italic; font-size: clamp(1.2rem, 4vw, 1.7rem); line-height: 1.4; max-width: 62ch; }
.story-attrib{ margin-top: 20px; color: var(--gold); font-size: 0.9rem; letter-spacing: 0.02em; }
.story-nav{ display: flex; gap: 10px; margin-top: 32px; }
.dot{ width: 10px; height: 10px; border-radius: 50%; background: var(--line); border: none; cursor: pointer; padding: 0; min-height: unset; }
.dot.active{ background: var(--gold); }

.cta{ display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.cta-copy p{ color: var(--paper-dim); margin-top: 14px; max-width: 40ch; }
form.signup{ display: flex; flex-direction: column; gap: 14px; }
.field{ display: flex; flex-direction: column; gap: 6px; }
label{ font-size: 0.82rem; color: var(--paper-dim); }
input, select{
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 13px 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  min-height: 44px;
}
.form-msg{ font-size: 0.88rem; color: var(--rose); min-height: 1.2em; }
.form-msg.ok{ color: var(--gold); }

.install-banner{
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 18px;
  margin-top: 20px;
}
.install-banner.show{ display: flex; }
.install-banner p{ margin: 0; font-size: 0.88rem; color: var(--paper-dim); }

/* ---------- Simple content page (about) ---------- */
.prose{ max-width: 68ch; }
.prose p{ color: var(--paper-dim); margin-bottom: 1.1em; font-size: 1.02rem; }
.prose h3{ margin-top: 2em; margin-bottom: 0.6em; font-size: 1.3rem; }

/* ---------- FOOTER ---------- */
footer{
  border-top: 1px solid var(--line);
  padding: 32px 0 calc(32px + var(--safe-bottom));
  font-size: 0.85rem;
  color: var(--paper-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 800px){
  .hero-grid, .cta, .steps{ grid-template-columns: 1fr; }
  .thread-box{ max-width: 280px; margin: 0 auto; }
  section{ padding: 48px 0; }
}
