/*
 * Knodal's website. Colours are variables, light by default and dark with the system's choice.
 * The violet is the app's own accent; coral and mint are the website's extra fun.
 */
:root {
  --bg: #fbf9ff;
  --bg2: #f1ecfd;
  --card: #ffffff;
  --line: #e2dcf3;
  --fg: #1f1b33;
  --muted: #6c6784;
  --violet: #6a4be0;
  --violet-soft: #e7e1fb;
  --coral: #ff7a59;
  --mint: #1fbf8f;
  --shadow: 0 24px 60px -24px rgba(58, 34, 140, 0.35);
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0d17;
    --bg2: #171325;
    --card: #19162a;
    --line: #2b2642;
    --fg: #ece9f7;
    --muted: #9d97b8;
    --violet: #a78bfa;
    --violet-soft: #2b2349;
    --coral: #ff8f73;
    --mint: #49dcae;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: var(--violet); }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; letter-spacing: -0.025em; margin: 0; }
h1 { font-size: clamp(48px, 8vw, 96px); font-weight: 800; }
h2 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; }
h3 { font-size: 24px; font-weight: 700; }
p { margin: 0; }
kbd { font: 600 14px var(--mono); padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; background: var(--card); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }

/* ── Buttons, small things ─────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 999px; border: 0;
  background: var(--violet); color: #fff; font: 600 16px var(--body); text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 24px -10px var(--violet); transition: transform 0.15s, box-shadow 0.15s;
}
@media (prefers-color-scheme: dark) { .button { color: #120e1f; } }
.button:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 14px 30px -12px var(--violet); }
.button.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 2px var(--line); }
.button.ghost:hover { box-shadow: inset 0 0 0 2px var(--violet); }
.button.small { padding: 9px 16px; font-size: 14px; }
.kicker { font: 600 14px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--coral); margin-bottom: 12px; }
/* How to say the name, next to it: quieter than the kicker. */
.kicker .silent { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); margin-left: 6px; }
.lead { font-size: 20px; color: var(--muted); max-width: 640px; }
.fine { font-size: 14px; color: var(--muted); }

/* ── Navigation ────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 28px;
  padding: 14px max(20px, calc((100% - 1180px) / 2)); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.logo { display: inline-flex; align-items: center; gap: 9px; font: 800 22px var(--display); letter-spacing: 0.02em; color: var(--fg); text-decoration: none; }
.logo svg { width: 26px; height: 26px; color: var(--violet); }
.logo.small { font-size: 16px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--fg); }

main { overflow-x: clip; }
section { padding: 0 max(20px, calc((100% - 1180px) / 2)); }

/* ── Front page ────────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 72px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -120px -10% auto auto; width: 720px; height: 720px; z-index: -1; filter: blur(40px); opacity: 0.55;
  background: radial-gradient(circle at 30% 30%, var(--violet-soft), transparent 60%), radial-gradient(circle at 70% 60%, color-mix(in srgb, var(--coral) 25%, transparent), transparent 55%);
}
.hero-text { display: flex; flex-direction: column; gap: 22px; }
.squiggle { color: var(--violet); position: relative; white-space: nowrap; }
.squiggle::after {
  content: ""; position: absolute; left: 2%; right: 4%; bottom: -0.08em; height: 0.22em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M2 8 Q 15 0 30 7 T 60 7 T 90 7 T 118 5' fill='none' stroke='%23ff7a59' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* A fake app window around pictures and videos. */
.window { margin: 0; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.window > video, .window > img { border-radius: 0 0 var(--radius) var(--radius); width: 100%; height: auto; }
.window-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.window-bar i:nth-child(1) { background: var(--coral); }
.window-bar i:nth-child(2) { background: #ffc857; }
.window-bar i:nth-child(3) { background: var(--mint); }
.window-bar span { margin-left: 8px; }
.hero-video { transform: rotate(1.2deg); transition: transform 0.3s; }
.hero-video:hover { transform: rotate(0deg) scale(1.01); }

/* Hand-written notes next to the pictures. */
.note { position: absolute; font: 600 15px var(--display); color: var(--coral); white-space: nowrap; transform: rotate(-3deg); }
.note-left { left: -12px; bottom: -34px; }
.note-right { right: 8px; bottom: -34px; transform: rotate(2deg); }

.speaks { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; padding-top: 24px; padding-bottom: 56px; color: var(--muted); }
.speaks b { font: 600 15px var(--mono); color: var(--fg); padding: 5px 12px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }

/* ── What it does ──────────────────────────────────────────────────────── */
.what { padding-top: 64px; padding-bottom: 64px; }
.what h2 { max-width: 760px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; transition: transform 0.2s; }
.card:nth-child(1) { transform: rotate(-0.8deg); }
.card:nth-child(3) { transform: rotate(0.8deg); }
.card:hover { transform: translateY(-4px) rotate(0deg); }
.card-icon { font-size: 30px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--violet-soft); }
.card p { color: var(--muted); }

/* ── Features: text beside a picture, every other one flipped ─────────── */
.feature { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 64px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.feature.flip .feature-text { order: 2; }
.feature-text { display: flex; flex-direction: column; gap: 18px; }
.feature-text p:not(.kicker) { color: var(--muted); font-size: 18px; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ticks li::before { content: "✓"; color: var(--mint); font-weight: 700; margin-right: 10px; }
.code { margin: 0; border-radius: var(--radius); background: #15121f; color: #e9e6f5; box-shadow: var(--shadow); padding: 26px 28px; overflow-x: auto; }
.code pre { margin: 0; font: 14px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.code .dim { color: #8e89a5; }
.code .minus { color: #ff8da8; }
.code .plus { color: #6fdc9c; }

/* ── Gallery ───────────────────────────────────────────────────────────── */
.gallery { padding-top: 56px; padding-bottom: 56px; text-align: center; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.shots img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform 0.2s; }
.shots a:nth-child(odd) img { transform: rotate(-1deg); }
.shots a:nth-child(even) img { transform: rotate(1deg) translateY(12px); }
.shots a:hover img { transform: scale(1.03); }

/* ── Where it runs ─────────────────────────────────────────────────────── */
.yours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-top: 72px; padding-bottom: 72px; }
.yours-card { background: var(--bg2); border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.yours-card p:not(.kicker) { color: var(--muted); }
.yours-card .kicker { margin: 0; }
.yours-card pre { margin: 0; padding: 10px 16px; border-radius: 10px; background: #15121f; color: #6fdc9c; font: 15px var(--mono); }

/* ── Demo ──────────────────────────────────────────────────────────────── */
.demo { padding-top: 80px; padding-bottom: 96px; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.demo-frame { width: 100%; height: min(78vh, 820px); display: flex; flex-direction: column; overflow: hidden; }
.demo-frame iframe { flex: 1; width: 100%; border: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--bg); }
.demo-start {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: url("media/editor-light.webp") center / cover; position: relative;
}
@media (prefers-color-scheme: dark) { .demo-start { background-image: url("media/editor-dark.webp"); } }
.demo-start::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(3px); }
.demo-start > * { position: relative; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 28px max(20px, calc((100% - 1180px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.footer a { margin-left: auto; }

/* ── Small screens ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero, .feature { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; padding-bottom: 48px; }
  .feature.flip .feature-text { order: 0; }
  .cards, .yours, .shots { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav .button { margin-left: auto; }
  .hero-video { transform: none; }
  .note { position: static; display: block; margin-top: 14px; }
  .demo-frame { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
