/* --- Tokens ------------------------------------------------------------ */
:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --fg: #1d1d1f;
  --fg-muted: #6e6e73;
  --fg-faint: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --accent: #ff9f43;
  --accent-deep: #f08c2c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.12);
  --note-yellow: #fff1a8;
  --note-blue: #b8d8ff;
  --note-pink: #ffc4d0;
  --note-green: #c5f0c5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --bg-elevated: #161618;
    --bg-glass: rgba(28, 28, 30, 0.6);
    --fg: #f5f5f7;
    --fg-muted: #a1a1a6;
    --fg-faint: #6e6e73;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --note-yellow: #d4b94a;
    --note-blue: #5d8ec9;
    --note-pink: #c97a8c;
    --note-green: #6fa86f;
  }
}

/* --- Reset / base ------------------------------------------------------ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

a { color: inherit; }

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

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

/* --- Nav --------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: url("web-app-manifest-512x512.png") center/cover no-repeat;
}

.brand-mark.small {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 6px;
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  color: var(--fg-muted);
  transition: color 120ms ease;
}

.nav-links a:hover { color: var(--fg); }

/* --- Hero -------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 600px;
  background: radial-gradient(60% 70% at 50% 0%, rgba(255, 159, 67, 0.18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  text-transform: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 24px;
}

.lede {
  font-size: clamp(17px, 1.8vw, 21px);
  color: var(--fg-muted);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

.cta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 200ms ease, background 200ms ease;
  border: 1px solid transparent;
}

.cta.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.2);
}

.cta.primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.2);
}

.cta.primary.large {
  padding: 16px 28px;
  font-size: 16px;
  border-radius: 14px;
}

.cta.ghost {
  background: var(--bg-elevated);
  color: var(--fg);
  border-color: var(--border-strong);
}

.cta.ghost:hover {
  background: var(--bg);
}

.meta {
  font-size: 13px;
  color: var(--fg-faint);
  margin: 0;
}

/* Hero visual. Floating notes with connecting lines. */
.hero-visual {
  position: relative;
  margin: 64px auto 0;
  max-width: 820px;
  height: 360px;
}

.note {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: rotate(var(--r));
  width: 180px;
  height: 130px;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  background: var(--note-yellow);
}

.note-yellow { background: var(--note-yellow); }
.note-blue   { background: var(--note-blue); }
.note-pink   { background: var(--note-pink); }
.note-green  { background: var(--note-green); }

.note-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,0.15);
  margin-bottom: 12px;
  width: 30%;
}

.note-line {
  height: 6px;
  border-radius: 3px;
  background: rgba(0,0,0,0.18);
  margin-bottom: 8px;
}

.w-40 { width: 40%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }

.hero-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-lines path {
  fill: none;
  stroke: var(--fg-faint);
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0.5;
  stroke-dasharray: 4 6;
}

/* --- Features ---------------------------------------------------------- */
.features {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 12px;
}

.section-sub {
  text-align: center;
  color: var(--fg-muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 56px;
}

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

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 159, 67, 0.15), rgba(255, 159, 67, 0.05));
  color: var(--accent-deep);
  margin-bottom: 16px;
}

@media (prefers-color-scheme: dark) {
  .feature-icon { color: var(--accent); }
}

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

.feature h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.feature p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* --- Canvas section ---------------------------------------------------- */
.canvas-section {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}

.canvas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 800px) {
  .canvas-grid { grid-template-columns: 1fr; }
}

.canvas-copy h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
}

.canvas-copy .lede {
  margin: 0 0 24px;
  text-align: left;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--fg);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: inset 0 0 0 4px var(--bg);
}

/* Canvas visual */
.canvas-visual {
  position: relative;
  aspect-ratio: 5 / 4;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background-image:
    radial-gradient(circle, var(--border-strong) 1px, transparent 1px);
  background-size: 20px 20px;
}

.cv-tile {
  position: absolute;
  width: 84px;
  height: 64px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.08);
}

.cv-1 { top: 12%; left: 12%; background: var(--note-yellow); transform: rotate(-3deg); }
.cv-2 { top: 16%; left: 52%; background: var(--note-blue);   transform: rotate(2deg); }
.cv-3 { top: 56%; left: 8%;  background: var(--note-pink);   transform: rotate(4deg); }
.cv-4 { top: 60%; left: 64%; background: var(--note-green);  transform: rotate(-2deg); }
.cv-5 { top: 38%; left: 38%; background: var(--note-yellow); transform: rotate(1deg); width: 96px; height: 72px; }

.cv-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.cv-lines path {
  fill: none;
  stroke: var(--fg-faint);
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0.55;
}

/* --- Download ---------------------------------------------------------- */
.download {
  padding: 120px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.download::before {
  content: "";
  position: absolute;
  inset: auto -10% -40% -10%;
  height: 400px;
  background: radial-gradient(50% 60% at 50% 100%, rgba(255, 159, 67, 0.18), transparent 60%);
  pointer-events: none;
}

.download-inner {
  position: relative;
}

.download h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.download .lede {
  margin: 0 auto 32px;
}

/* --- Footer ------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg-elevated);
}

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

.brand-line {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 22px;
}

.footer-links a {
  text-decoration: none;
  font-size: 13px;
  color: var(--fg-muted);
  transition: color 120ms ease;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--fg);
}

.copyright {
  margin: 0;
  color: var(--fg-faint);
  font-size: 13px;
}

/* --- Legal / prose pages ----------------------------------------------- */
.legal {
  padding: 80px 0 96px;
  border-top: 1px solid var(--border);
}

.prose {
  max-width: 720px;
}

.prose h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
  line-height: 1.1;
}

.prose h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}

.prose .lede {
  margin: 0 0 24px;
  text-align: left;
  max-width: none;
}

.prose p,
.prose ul {
  font-size: 16px;
  color: var(--fg);
  line-height: 1.6;
  margin: 0 0 16px;
}

.prose ul {
  padding-left: 20px;
}

.prose li { margin-bottom: 6px; }

.prose a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--accent); }

@media (prefers-color-scheme: dark) {
  .prose a { color: var(--accent); }
  .prose a:hover { color: #ffb877; }
}

/* --- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
