/* Vicaya Studio website
   Layout: a canvas-like site. Pages sit on a faint dot grid like the app's flow canvas;
   content runs in one 1120px column with a 20px gutter. Indigo is the brand accent (from
   AccentColor), amber is the single highlight (the lit tile in the app icon), and the six
   role colours are used only where they mean what they mean in the app. */

:root {
  --bg: #f4f4f9;
  --surface: #ffffff;
  --sunken: #eaeaf3;
  --fg: #16152d;
  --muted: #595873;
  --hairline: rgba(22, 21, 45, 0.11);
  --dot: rgba(36, 34, 104, 0.13);
  --accent: #2c2a82;
  --accent-soft: rgba(44, 42, 130, 0.08);
  --on-accent: #ffffff;
  --amber: #f0a33c;
  --on-amber: #241a08;

  --role-input: #23945a;
  --role-agent: #8247d6;
  --role-knowledge: #13919a;
  --role-tool: #d23b78;
  --role-branch: #d9711a;
  --role-output: #2f6ad8;

  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.6vw, 4.25rem);

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e1b;
    --surface: #17172a;
    --sunken: #1e1e34;
    --fg: #ecebfa;
    --muted: #a5a4c2;
    --hairline: rgba(236, 235, 250, 0.12);
    --dot: rgba(141, 136, 242, 0.16);
    --accent: #8d88f2;
    --accent-soft: rgba(141, 136, 242, 0.12);
    --on-accent: #0e0e1b;
    --amber: #f3ad4e;
    --on-amber: #241a08;
    --role-input: #4cc785;
    --role-agent: #ad80f0;
    --role-knowledge: #45c3cb;
    --role-tool: #f0679f;
    --role-branch: #f29a4a;
    --role-output: #6c9cf2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e1b;
  --surface: #17172a;
  --sunken: #1e1e34;
  --fg: #ecebfa;
  --muted: #a5a4c2;
  --hairline: rgba(236, 235, 250, 0.12);
  --dot: rgba(141, 136, 242, 0.16);
  --accent: #8d88f2;
  --accent-soft: rgba(141, 136, 242, 0.12);
  --on-accent: #0e0e1b;
  --amber: #f3ad4e;
  --on-amber: #241a08;
  --role-input: #4cc785;
  --role-agent: #ad80f0;
  --role-knowledge: #45c3cb;
  --role-tool: #f0679f;
  --role-branch: #f29a4a;
  --role-output: #6c9cf2;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: var(--step-4); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 0.9em; }

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.prose { max-width: 62ch; }
.muted { color: var(--muted); }
.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--fg);
  text-decoration: none;
  margin-right: auto;
}
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-s);
}
.nav a:hover { color: var(--fg); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--fg); background: var(--accent-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 20px;
  border-radius: var(--radius-m);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-download { background: var(--amber); color: var(--on-amber); }
.btn-download:hover { background: color-mix(in srgb, var(--amber) 88%, #ffffff); }
.btn-quiet { color: var(--fg); border-color: var(--hairline); background: var(--surface); }
.btn-quiet:hover { border-color: var(--accent); }
.btn small { font-weight: 400; opacity: 0.8; font-size: 0.8125rem; }
.btn svg { width: 18px; height: 18px; flex: none; }
.nav-download { padding: 7px 14px; font-size: 0.9375rem; }

/* ---------- Sections ---------- */
section { padding-block: 72px; }
.section-head { display: grid; gap: 12px; margin-bottom: 36px; }
.section-head p { color: var(--muted); max-width: 60ch; font-size: var(--step-1); line-height: 1.5; }
.page-head { padding-block: 64px 24px; display: grid; gap: 16px; }
.page-head p { color: var(--muted); font-size: var(--step-1); max-width: 58ch; line-height: 1.5; }

/* ---------- Hero ---------- */
.hero { padding-block: 64px 48px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px;
  align-items: center;
}
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero-copy h1 em { font-style: normal; color: var(--accent); }
.hero-copy .lede { font-size: var(--step-1); color: var(--muted); max-width: 46ch; line-height: 1.5; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: var(--step--1); color: var(--muted); }

/* Flow canvas illustration */
.canvas {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  box-shadow: 0 1px 0 var(--hairline), 0 24px 60px -30px rgba(20, 18, 70, 0.35);
  overflow: hidden;
  min-width: 0;
}
.canvas-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--step--1);
  color: var(--muted);
}
.canvas-bar .dots { display: flex; gap: 6px; margin-right: 8px; }
.canvas-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--sunken); border: 1px solid var(--hairline); }
.canvas-bar .run {
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--role-input);
}
.canvas-body {
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 18px 18px;
  padding: 12px;
}
.flow svg { width: 100%; height: auto; display: block; }
.flow .node { fill: var(--surface); stroke-width: 1.5; }
.flow .kind { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; font-weight: 500; }
.flow .name { font-family: var(--font-display); font-size: 15px; font-weight: 600; fill: var(--fg); }
.flow .sub { font-family: var(--font-mono); font-size: 10.5px; fill: var(--muted); }
.flow .edge { fill: none; stroke: var(--muted); stroke-opacity: 0.55; stroke-width: 1.5; }
.flow .edge.live { stroke: var(--accent); stroke-opacity: 1; stroke-width: 2; stroke-dasharray: 6 6; animation: flowdash 1.2s linear infinite; }
.flow .port { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }
.flow .chip { stroke-width: 1; }
@keyframes flowdash { to { stroke-dashoffset: -12; } }

.trace {
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 12px;
  display: grid;
  gap: 2px;
  padding: 10px 14px 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.trace div { display: grid; grid-template-columns: 54px 92px minmax(0, 1fr); gap: 8px; }
.trace b { font-weight: 500; }
.trace .t { color: var(--muted); opacity: 0.8; }

/* ---------- Facts strip ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--hairline);
  background: var(--surface);
}
.fact { padding: 22px 20px; display: grid; gap: 4px; border-right: 1px solid var(--hairline); min-width: 0; }
.fact:last-child { border-right: 0; }
.fact strong { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fact span { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }

/* ---------- Role cards ---------- */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.role {
  --c: var(--accent);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  padding: 22px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}
.role .tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c);
  font-weight: 500;
}
.role .tag::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.role p { color: var(--muted); font-size: 0.9688rem; }
.role.input { --c: var(--role-input); }
.role.agent { --c: var(--role-agent); }
.role.knowledge { --c: var(--role-knowledge); }
.role.tool { --c: var(--role-tool); }
.role.branch { --c: var(--role-branch); }
.role.output { --c: var(--role-output); }

/* ---------- Workflow steps (a real sequence) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.step { padding: 0 20px 0 0; display: grid; gap: 10px; align-content: start; min-width: 0; position: relative; }
.step .n {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.step .n::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.step p { color: var(--muted); font-size: 0.9688rem; }

/* ---------- Feature rows ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
  padding-block: 48px;
  border-top: 1px solid var(--hairline);
}
.feature:first-of-type { border-top: 0; }
.feature.flip > :first-child { order: 2; }
.feature-copy { display: grid; gap: 14px; min-width: 0; }
.feature-copy > p { color: var(--muted); }
.feature-copy ul { margin: 0; padding-left: 1.1em; color: var(--muted); display: grid; gap: 6px; }
.feature-copy li::marker { color: var(--accent); }

/* ---------- Screenshot frames ---------- */
.shot { margin: 0; display: grid; gap: 10px; min-width: 0; }
.shot-frame {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  position: relative;
  box-shadow: 0 18px 40px -28px rgba(20, 18, 70, 0.4);
}
.shot-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shot-frame .placeholder {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  text-align: center;
  gap: 6px;
  padding: 20px;
  color: var(--muted);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 16px 16px;
  background-color: var(--sunken);
}
.shot-frame .placeholder strong { color: var(--fg); font-family: var(--font-display); font-size: 1.0625rem; }
.shot-frame .placeholder code { font-size: 0.8125rem; }
.shot-frame.missing img { display: none; }
.shot-frame.missing .placeholder { display: grid; }
.shot figcaption { font-size: 0.9375rem; color: var(--muted); }
.shot figcaption b { color: var(--fg); font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 28px; }
.gallery .wide { grid-column: 1 / -1; }

/* ---------- Download ---------- */
.download-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  padding: 32px;
}
.download-card img { width: 112px; height: 112px; }
.download-card .meta { display: grid; gap: 14px; min-width: 0; }
.download-card .meta .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.two-col > div { display: grid; gap: 16px; align-content: start; min-width: 0; }
ol.install { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; color: var(--muted); }
ol.install li::marker { color: var(--accent); font-family: var(--font-mono); }
ol.install b { color: var(--fg); font-weight: 600; }
.release { border-left: 2px solid var(--accent); padding-left: 18px; display: grid; gap: 10px; }
.release ul { margin: 0; padding-left: 1.1em; color: var(--muted); display: grid; gap: 6px; }

/* ---------- CTA band ---------- */
.cta {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-l);
  padding: 44px 40px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cta h2 { color: var(--on-accent); }
.cta p { opacity: 0.85; margin-top: 8px; max-width: 48ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding-block: 32px 40px; margin-top: 40px; background: var(--bg); }
.site-footer .wrap { display: flex; gap: 16px 32px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 0.9375rem; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .feature, .two-col { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature.flip > :first-child { order: 0; }
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 0; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(2) { border-right: 0; }
  .fact:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
}
@media (max-width: 600px) {
  section { padding-block: 52px; }
  .roles, .steps, .gallery { grid-template-columns: minmax(0, 1fr); }
  .download-card { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .download-card img { width: 80px; height: 80px; }
  .cta { padding: 32px 24px; }
  .nav a { padding: 6px 8px; }
  .trace div { grid-template-columns: 46px 80px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .flow .edge.live { animation: none; }
  .btn { transition: none; }
}
