/* ============================================================
   Diagrapho marketing site
   Palette drawn from the app icon (Resources/AppIcon.svg):
   violet #8B5CF6 → #5B21B6, lavender #C4B5FD, ink #0B0B0F,
   white nodes with dark outlines.
   ============================================================ */

:root {
  --bg: #0B0B0F;
  --bg-alt: #101017;
  --panel: #15151E;
  --panel-2: #1A1A25;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #F2F2F7;
  --muted: #9D9DAF;
  --violet: #8B5CF6;
  --violet-deep: #5B21B6;
  --violet-light: #C4B5FD;
  --green: #34D399;
  --grad: linear-gradient(135deg, #C4B5FD 0%, #8B5CF6 55%, #5B21B6 100%);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
          Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--violet-light); }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: rgba(139, 92, 246, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 780px; }
.center { text-align: center; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--violet); color: #fff; padding: 10px 18px;
  border-radius: 0 0 10px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- typography ---------- */

h1, h2, h3 { line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.02em; }

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 750; }
h3 { font-size: 1.25rem; font-weight: 650; }

h1 em { font-style: normal; }

.eyebrow {
  display: block;
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 14px;
}

.grad, h1 em {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 34em; }
.section-lede { color: var(--muted); font-size: 1.1rem; max-width: 40em; margin-bottom: 2.2em; }
.center .section-lede, .narrow .section-lede { margin-left: auto; margin-right: auto; }

.link { color: var(--violet-light); text-decoration-color: rgba(196, 181, 253, 0.4); }
.fineprint { font-size: 0.82rem; color: var(--muted); }

/* ---------- header / nav ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 15, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 750; font-size: 1.12rem; color: var(--text);
  text-decoration: none; letter-spacing: -0.01em;
}
.brand img { border-radius: 8px; }

.nav-menu {
  display: flex; align-items: center; gap: 26px;
  list-style: none; margin: 0 0 0 auto; padding: 0;
}
.nav-menu a {
  color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500;
}
.nav-menu a:hover, .nav-menu a:focus { color: var(--text); }
.nav-cta a { color: #fff; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px; height: 42px;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; position: relative;
}
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.25s ease, top 0.25s ease;
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 24px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 20px; transform: rotate(-45deg); }

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: rgba(11, 11, 15, 0.97);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px;
    display: none;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a { display: block; padding: 9px 0; font-size: 1.05rem; }
}

/* ---------- buttons & badges ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  color: #fff; background: var(--grad);
  border: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(139, 92, 246, 0.35); }
.btn-small { padding: 8px 16px; font-size: 0.9rem; border-radius: 10px; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { box-shadow: none; border-color: var(--violet); }

.badge-appstore {
  display: inline-flex; align-items: center; gap: 11px;
  background: #000; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 13px;
  padding: 9px 20px 10px;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.badge-appstore:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 32px rgba(139, 92, 246, 0.25);
}
.badge-text { display: flex; flex-direction: column; line-height: 1.18; text-align: left; }
.badge-sub { font-size: 0.68rem; opacity: 0.85; letter-spacing: 0.01em; }
.badge-main { font-size: 1.12rem; font-weight: 650; letter-spacing: -0.01em; }
.badge-large { padding: 11px 26px 12px; border-radius: 15px; }
.badge-large .badge-main { font-size: 1.28rem; }

.badge-appstore.is-soon { opacity: 0.9; }
.badge-appstore.is-soon .badge-sub { visibility: hidden; position: relative; }
.badge-appstore.is-soon .badge-sub::after {
  content: "Coming soon to the";
  visibility: visible; position: absolute; left: 0; top: 0; white-space: nowrap;
}
.soon-note { color: var(--violet-light); font-size: 0.9rem; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 110px) 0 clamp(48px, 7vw, 90px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -40% -20% auto;
  height: 130%;
  background:
    radial-gradient(42% 55% at 72% 30%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(34% 45% at 18% 12%, rgba(91, 33, 182, 0.28), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 26px; }
.hero-meta { margin-top: 18px; font-size: 0.88rem; color: var(--muted); }

/* --- the animated app mock --- */

.hero-demo { position: relative; min-width: 0; }
.hero-glow {
  position: absolute; inset: 8% -6% -10%;
  background: radial-gradient(50% 60% at 50% 60%, rgba(139, 92, 246, 0.30), transparent 70%);
  filter: blur(8px);
  z-index: -1;
}

.mock-window {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.mock-titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #FF5F57; } .dot.yellow { background: #FEBC2E; } .dot.green { background: #28C840; }
.mock-title { margin-left: 10px; font-size: 0.78rem; color: var(--muted); }

.mock-prompt {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.86rem;
}
.prompt-icon { color: var(--violet-light); }
.prompt-text {
  overflow: hidden; white-space: nowrap;
  width: 38ch;
  /* min-width:0 lets the nowrap text shrink below its intrinsic width, so the
     fixed 38ch can't force the page wider than a narrow viewport (which
     clipped the layout and pushed the nav toggle off-screen). */
  min-width: 0;
  max-width: 100%;
  animation: type 12s steps(38, end) infinite;
}
.prompt-caret {
  width: 8px; height: 17px; background: var(--violet-light);
  animation: blink 1.1s steps(1) infinite;
}

.mock-canvas { width: 100%; height: auto; display: block; background: #111118; }

.mock-canvas text {
  font-family: var(--font); font-size: 13px; font-weight: 600;
  fill: #0B0B0F; text-anchor: middle;
}
.mock-canvas .elabel {
  font-size: 11px; font-weight: 600; fill: var(--violet-light); text-anchor: middle;
}

.mock-status {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--muted);
  animation: status-in 12s linear infinite;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
}

/* nodes fade in, in build order (timeline percentages over a 12s loop).
   Opacity-only — SVG transform animations are flaky across renderers. */
.n1 { animation: n1 12s ease infinite; }
.n2 { animation: n2 12s ease infinite; }
.n3 { animation: n3 12s ease infinite; }
.n4 { animation: n4 12s ease infinite; }
.n5 { animation: n5 12s ease infinite; }

@keyframes n1 { 0%, 17% { opacity: 0; } 20%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes n2 { 0%, 27% { opacity: 0; } 30%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes n3 { 0%, 37% { opacity: 0; } 40%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes n4 { 0%, 53% { opacity: 0; } 56%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes n5 { 0%, 65% { opacity: 0; } 68%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }

/* edges draw via normalized dash (paths carry pathLength="1") */
.e { stroke-dasharray: 1; stroke-dashoffset: 1; }
.e1  { animation: e1 12s linear infinite; }
.e2  { animation: e2 12s linear infinite; }
.e3  { animation: e3 12s linear infinite; }
.e4  { animation: e4 12s linear infinite; }
.eno { animation: eno 12s linear infinite; stroke-dasharray: 0.06 0.04; }

@keyframes e1  { 0%, 21% { opacity: 0; stroke-dashoffset: 1; } 22% { opacity: 1; } 27%, 94% { opacity: 1; stroke-dashoffset: 0; } 98%, 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes e2  { 0%, 31% { opacity: 0; stroke-dashoffset: 1; } 32% { opacity: 1; } 37%, 94% { opacity: 1; stroke-dashoffset: 0; } 98%, 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes e3  { 0%, 45% { opacity: 0; stroke-dashoffset: 1; } 46% { opacity: 1; } 53%, 94% { opacity: 1; stroke-dashoffset: 0; } 98%, 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes e4  { 0%, 59% { opacity: 0; stroke-dashoffset: 1; } 60% { opacity: 1; } 65%, 94% { opacity: 1; stroke-dashoffset: 0; } 98%, 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes eno { 0%, 43% { opacity: 0; } 47%, 94% { opacity: 0.9; } 98%, 100% { opacity: 0; } }

.lyes { opacity: 0; animation: label-yes 12s linear infinite; }
.lno  { opacity: 0; animation: label-no  12s linear infinite; }
@keyframes label-yes { 0%, 48% { opacity: 0; } 52%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes label-no  { 0%, 45% { opacity: 0; } 49%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }

@keyframes type  { 0%, 2% { width: 0; } 16%, 100% { width: 38ch; } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes status-in { 0%, 68% { opacity: 0; } 72%, 100% { opacity: 1; } }

/* ---------- sections ---------- */

.section { padding: clamp(64px, 9vw, 116px) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- cards / features ---------- */

.grid { display: grid; gap: 20px; }
.features-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 940px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .features-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(139, 92, 246, 0.45); }
.card p { color: var(--muted); margin-bottom: 0; font-size: 0.97rem; }

.card-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 1.3rem;
  color: var(--violet-light);
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  margin-bottom: 16px;
}

/* ---------- split (AI) ---------- */

.split {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 72px); align-items: center;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }

.split-copy p { color: var(--muted); }
.split-copy p em { color: var(--violet-light); font-style: normal; }

.checks { list-style: none; padding: 0; margin: 22px 0 0; }
.checks li {
  position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--muted);
}
.checks li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--green); font-weight: 700;
}
.checks strong { color: var(--text); font-weight: 600; }

.activity-mock {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  font-family: var(--mono);
  font-size: 0.84rem;
}
.activity-head {
  padding: 10px 16px; font-weight: 600; color: var(--muted);
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  font-family: var(--font); font-size: 0.82rem;
}
.activity-mock ul { list-style: none; margin: 0; padding: 10px 0; }
.activity-mock li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 16px;
}
.activity-mock li:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }
.activity-mock code { background: none; padding: 0; color: var(--text); }
.activity-mock .dim { color: var(--muted); margin-left: auto; font-size: 0.78rem; }
.activity-mock .ok { color: var(--green); }
.activity-mock .run { color: var(--violet-light); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- templates gallery ---------- */

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 940px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .gallery { grid-template-columns: 1fr; } }

.gallery figure {
  margin: 0;
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery figure:hover { transform: translateY(-4px); box-shadow: 0 18px 50px rgba(139, 92, 246, 0.2); }
.gallery img { width: 100%; height: 190px; object-fit: contain; padding: 12px; background: #fff; }
.gallery figcaption {
  padding: 10px 14px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  font-size: 0.88rem; font-weight: 600;
}

/* ---------- privacy pills ---------- */

.pill-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px 0; }
.pill {
  padding: 8px 18px;
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.1);
  color: var(--violet-light);
  border-radius: 999px;
  font-size: 0.9rem; font-weight: 600;
}

/* ---------- buy ---------- */

.buy-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; margin-top: 12px;
}
@media (max-width: 820px) { .buy-grid { grid-template-columns: 1fr; } }

.buy-card { padding: 34px 32px; }
.buy-card .badge-appstore { margin-top: 20px; }
.buy-card .btn-ghost { margin-top: 18px; }
.buy-card p { color: var(--muted); }

.price {
  font-size: 1.3rem; font-weight: 700; color: var(--text);
  margin: 6px 0 14px;
}

.steps { color: var(--muted); padding-left: 22px; margin: 14px 0 6px; }
.steps li { margin-bottom: 9px; }
.steps strong { color: var(--text); }

/* ---------- FAQ ---------- */

.faq details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 52px 18px 22px;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--violet-light);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--muted); }

/* ---------- final CTA / footer ---------- */

.final-cta { padding-bottom: clamp(80px, 11vw, 140px); }
.cta-logo { margin: 0 auto 22px; border-radius: 16px; }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 48px 0 56px;
}
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 40px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand p { color: var(--muted); margin: 14px 0 0; font-size: 0.95rem; }
.site-footer nav { display: flex; gap: 56px; justify-content: flex-end; }
@media (max-width: 700px) { .site-footer nav { justify-content: flex-start; } }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; }
.site-footer nav li { margin-bottom: 10px; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-footer nav a:hover { color: var(--text); }

/* ---------- prose pages (privacy / support) ---------- */

.prose { padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 110px); }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); }
.prose h2 { font-size: 1.4rem; margin-top: 2.2em; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose .updated { font-size: 0.88rem; color: var(--muted); }
/* Markdown-rendered links (Hugo content) don't carry the .link class. */
.prose a { color: var(--violet-light); text-decoration-color: rgba(196, 181, 253, 0.4); }

/* ---------- reveal-on-scroll ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
  .n, .e, .eno, .lyes, .lno, .mock-status { opacity: 1 !important; }
  .e { stroke-dashoffset: 0 !important; }
  .prompt-text { width: 38ch !important; }
  .prompt-caret { display: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}
