/* ===========================================================
   askRadek — marketing site (askradek.com)
   Standalone static styles. Brand tokens mirror the app's
   design system (apps/web/src/radek.css) so the landing page
   stays visually consistent with the product. No build step.
   =========================================================== */

:root {
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* brand gradient (matches favicon + app accent) */
  --brand-1: #5a4fd0;
  --brand-2: #8a48c8;
  --accent: oklch(0.52 0.18 268);
  --accent-2: oklch(0.55 0.17 296);
  --accent-on: oklch(0.985 0.003 250);
  --logo-ek: oklch(0.70 0.012 260);
  --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
  --accent-ring: color-mix(in oklch, var(--accent) 36%, transparent);

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 18px;
  --maxw: 1140px;
}

/* ---------- LIGHT (default) ---------- */
[data-theme="light"] {
  --bg: oklch(0.989 0.0015 280);
  --bg-grad: oklch(0.975 0.008 280);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.978 0.003 280);
  --surface-3: oklch(0.955 0.006 280);
  --border: oklch(0.92 0.004 280);
  --border-strong: oklch(0.86 0.008 280);
  --text: oklch(0.26 0.018 275);
  --text-muted: oklch(0.5 0.016 275);
  --text-faint: oklch(0.65 0.012 275);
  --btn-fg: oklch(0.98 0.003 255);
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 260 / 0.06), 0 1px 3px oklch(0.2 0.02 260 / 0.05);
  --shadow-md: 0 4px 14px oklch(0.2 0.02 260 / 0.07), 0 2px 5px oklch(0.2 0.02 260 / 0.05);
  --shadow-lg: 0 18px 48px oklch(0.2 0.02 260 / 0.12);
  --ok: oklch(0.55 0.10 155);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 78% -8%, var(--accent-soft), transparent 60%),
    linear-gradient(180deg, var(--bg-grad), var(--bg) 240px);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }

a { color: inherit; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.18rem; font-weight: 600; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.mono { font-family: var(--font-mono); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); padding: 10px 16px; border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius);
  font: inherit; font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }

.btn-primary {
  color: var(--btn-fg);
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); filter: brightness(1.04); }

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in oklch, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }

/* Logo — faithful to the app (apps/web/src/components/icons.tsx + radek.css) */
.logo {
  font-family: var(--font-ui);
  font-weight: 700; font-size: 23px; letter-spacing: -0.025em;
  color: var(--text); display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none; user-select: none;
}
.logo .mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-on);
  display: grid; place-items: center;
  box-shadow: 0 3px 11px color-mix(in oklch, var(--accent) 42%, transparent), inset 0 1px 0 oklch(1 0 0 / 0.28);
}
.logo .mark svg { display: block; overflow: visible; }
.logo .word { display: inline-flex; }
.logo .rad {
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.logo .ek { color: var(--logo-ek); }
.logo-sm { font-size: 19px; }
@media (prefers-reduced-motion: no-preference) {
  .logo .mark .radbot { transform-origin: center; animation: rad-float 4.5s ease-in-out infinite; }
  .logo .mark .atom { transform-box: fill-box; transform-origin: center; animation: rad-orbit 6s linear infinite; }
  @keyframes rad-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.3px); } }
  @keyframes rad-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
}

.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 12px; }
@media (min-width: 721px) { .header-actions { margin-left: 4px; } }

@media (max-width: 720px) {
  .site-nav { display: none; }
}

/* ---------------- Hero ---------------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
}
.hero-copy .lead {
  font-size: 1.15rem; color: var(--text-muted); max-width: 34ch; margin: 18px 0 28px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy .lead { max-width: none; }
}

/* ---------------- Sections ---------------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: color-mix(in oklch, var(--surface-2) 60%, transparent); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(36px, 5vw, 56px); }
.section-head-left { text-align: left; margin-left: 0; }
.section-lead { color: var(--text-muted); font-size: 1.05rem; margin-top: 10px; }

/* ---------------- Steps ---------------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(40px, 6vw, 72px); }
.step { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.step-rev .step-text { order: 2; }
.step-num {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: var(--btn-fg); font-weight: 700; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.step-text h3 { font-size: 1.4rem; margin-bottom: 10px; }
.step-text p { color: var(--text-muted); margin: 0; max-width: 42ch; }
.step-text code {
  font-family: var(--font-mono); font-size: 0.9em;
  background: var(--surface-3); padding: 1px 6px; border-radius: 5px;
}
@media (max-width: 880px) {
  .step { grid-template-columns: 1fr; gap: 22px; }
  .step-rev .step-text { order: 0; }
}

/* ---------------- Demo card shell ---------------- */
.demo-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.demo-cap {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  font-size: 0.82rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.demo-anim { padding: 18px; min-height: 232px; }
.demo-video { display: none; width: 100%; height: auto; }
.demo-card.has-video .demo-anim { display: none; }
.demo-card.has-video .demo-video { display: block; }

/* ---------------- Demo 1: notatki -> opis ---------------- */
.demo-notes { display: grid; grid-template-columns: 1fr auto 1.25fr; gap: 12px; align-items: center; }
.demo-pane { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; min-height: 168px; }
.demo-pane-head { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-in { background: var(--text-faint); }
.dot-out { background: var(--ok); }

.demo-lines { display: flex; flex-direction: column; gap: 7px; font-size: 0.82rem; color: var(--text); }
.demo-lines .ln { opacity: 0; transform: translateY(4px); animation: lineIn .5s ease forwards; }
.demo-lines .ln:nth-child(1) { animation-delay: .3s; }
.demo-lines .ln:nth-child(2) { animation-delay: .7s; }
.demo-lines .ln:nth-child(3) { animation-delay: 1.1s; }
.demo-lines .ln:nth-child(4) { animation-delay: 1.5s; }

.demo-arrow { position: relative; color: var(--accent); display: grid; place-items: center; }
.spark {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-2), transparent 70%);
  opacity: 0; animation: sparkPulse 4s ease-in-out infinite; animation-delay: 1.7s;
}

.demo-report { display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; }
.rep-h { font-weight: 700; letter-spacing: 0.02em; margin: 0 0 2px; }
.rep-l { margin: 0; color: var(--text-muted); opacity: 0; transform: translateY(4px); animation: lineIn .5s ease forwards; }
.rep-l b { color: var(--text); font-weight: 600; }
.demo-report .r1 { animation-delay: 2.0s; }
.demo-report .r2 { animation-delay: 2.3s; }
.demo-report .r3 { animation-delay: 2.6s; }
.demo-report .r4 { animation-delay: 2.9s; }
.demo-report .rep-h { opacity: 0; animation: lineIn .5s ease forwards; animation-delay: 1.8s; }

/* The whole notes demo loops */
.demo-notes .demo-lines .ln,
.demo-notes .demo-report .rep-l,
.demo-notes .demo-report .rep-h { animation-iteration-count: infinite; animation-duration: 4s; }

/* ---------------- Demo 2: dodaj szablon (formularz wgrania) ---------------- */
.demo-upload { display: flex; flex-direction: column; gap: 13px; }
.cmp-selects.two { grid-template-columns: 1fr 1fr; }
.cmp-field .opt { color: var(--text-faint); font-weight: 400; }
.upl-input {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 8px 11px; font-size: 0.82rem; color: var(--text);
}
.upl-drop {
  display: flex; align-items: center; gap: 9px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 11px 13px;
}
.upl-drop .upl-ic { color: var(--accent); flex-shrink: 0; }
.upl-file { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); animation: drop 4s ease-in-out infinite; }

/* ---------------- Demo 3: compose (badanie + szablon + model + koszt) ---------------- */
.demo-compose { display: flex; flex-direction: column; gap: 13px; }
.cmp-selects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cmp-pick { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cmp-pick-lab { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-pick-val {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  font-size: 0.78rem; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 6px 8px;
}
.cmp-pick-val .cmp-caret { color: var(--text-faint); flex-shrink: 0; }
.cmp-field label { display: block; font-size: 0.74rem; color: var(--text-muted); margin-bottom: 6px; }
.cmp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 0.8rem; padding: 6px 13px; border-radius: 100px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted);
}
/* Sonnet (chip-a) starts selected, then the demo switches to GPT-5.5 (chip-b) */
.chip-a { animation: chipOn 4s ease-in-out infinite; }
.chip-b { animation: chipOff 4s ease-in-out infinite; }
.cmp-notes {
  min-height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); padding: 9px 11px; font-size: 0.8rem; color: var(--text);
  position: relative;
}
.cmp-notes::before {
  content: "niewielki zanik korowy";
  white-space: nowrap; overflow: hidden; display: inline-block;
  width: 0; vertical-align: bottom;
  animation: typing 1.4s steps(22) 0.3s forwards;
}
.caret { display: inline-block; width: 2px; height: 1em; background: var(--accent); vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }
.cmp-cost { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); }
.cmp-cost .rc {
  color: var(--text); font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 100px;
  animation: costFlash 4s ease-in-out infinite;
}
.cmp-cost .coin-glyph { display: block; color: var(--accent); }
.rc-num { position: relative; display: inline-block; min-width: 0.7em; text-align: right; font-variant-numeric: tabular-nums; }
.rc-num .v { font-style: normal; }
.rc-num .v-b { position: absolute; right: 0; top: 0; }
.rc-num .v-a { animation: vFadeOut 4s ease-in-out infinite; }
.rc-num .v-b { animation: vFadeIn 4s ease-in-out infinite; }
.cmp-run {
  align-self: flex-start; border: none; cursor: default;
  color: var(--btn-fg); background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  padding: 9px 16px; border-radius: var(--radius); font: inherit; font-weight: 600; font-size: 0.85rem;
  animation: pressPulse 4s ease-in-out infinite;
}

/* ---------------- Demo 4: result (copy) ---------------- */
.demo-result { display: flex; flex-direction: column; gap: 10px; }
.res-head { display: flex; align-items: center; justify-content: space-between; }
.res-done { color: var(--ok); font-weight: 600; font-size: 0.85rem; }
.res-copy {
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 6px 13px; font: inherit; font-size: 0.8rem; cursor: default;
}
.res-copy .copy-label::after { content: ""; }
.res-copy { animation: copyFlash 4s ease-in-out infinite; }
.res-body { font-size: 0.8rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 3px; }
.res-body p { margin: 0; }
.res-body .rep-h { color: var(--text); }

/* ---------------- Features ---------------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-ic {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border-radius: 11px; margin-bottom: 14px;
  color: var(--accent); background: var(--accent-soft);
}
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text-muted); margin: 0; font-size: 0.95rem; }
@media (max-width: 880px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ---------------- CTA band ---------------- */
.cta-band { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: var(--btn-fg); padding: clamp(48px, 7vw, 80px) 0; }
.cta-inner { text-align: center; }
.cta-inner h2 { color: var(--btn-fg); }
.cta-inner p { color: oklch(0.97 0.01 280 / 0.9); margin: 12px 0 26px; font-size: 1.08rem; }
.cta-band .btn-primary { background: var(--surface); color: var(--text); }
.cta-band .btn-primary:hover { filter: none; background: var(--surface-2); }

/* ---------------- Disclaimer ---------------- */
.disclaimer {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 16px 18px;
  font-size: 0.92rem; color: var(--text-muted);
  max-width: 760px; margin: clamp(36px, 5vw, 52px) auto 0; text-align: center;
}
.disclaimer b { color: var(--text); }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 36px 0 28px; margin-top: 20px; }
.site-footer .disclaimer { margin-top: 0; }
.footer-legal {
  display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-faint);
}
.footer-legal > span { display: inline-flex; align-items: center; gap: 6px; }
.footer-legal .logo { font-size: 15px; line-height: 1; transform: translateY(-2px); }
.footer-legal .logo .word { line-height: 1; }
.logo-sm .mark { width: 20px; height: 20px; border-radius: 7px; }

/* ---------------- Keyframes ---------------- */
@keyframes lineIn {
  0% { opacity: 0; transform: translateY(4px); }
  8%, 78% { opacity: 1; transform: translateY(0); }
  92%, 100% { opacity: 0; transform: translateY(4px); }
}
@keyframes sparkPulse {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.6); }
}
@keyframes drop {
  0% { transform: translateY(-8px); opacity: 0.4; }
  20%, 100% { transform: translateY(0); opacity: 1; }
}
@keyframes typing {
  0% { width: 0; }
  100% { width: 22ch; }
}
@keyframes blink { 0% { opacity: 1; } 100% { opacity: 0; } }
/* Model chips swap selection at ~50% (gradient toggles discretely). */
@keyframes chipOn {
  0%, 48% { color: var(--btn-fg); background-image: linear-gradient(135deg, var(--brand-1), var(--brand-2)); background-color: transparent; border-color: transparent; }
  55%, 100% { color: var(--text-muted); background-image: none; background-color: var(--surface-2); border-color: var(--border-strong); }
}
@keyframes chipOff {
  0%, 48% { color: var(--text-muted); background-image: none; background-color: var(--surface-2); border-color: var(--border-strong); }
  55%, 100% { color: var(--btn-fg); background-image: linear-gradient(135deg, var(--brand-1), var(--brand-2)); background-color: transparent; border-color: transparent; }
}
@keyframes pressPulse {
  0%, 70% { box-shadow: 0 0 0 0 transparent; transform: none; }
  80% { box-shadow: 0 0 0 5px var(--accent-ring); transform: translateY(1px); }
  90%, 100% { box-shadow: 0 0 0 0 transparent; transform: none; }
}
@keyframes copyFlash {
  0%, 60% { background: var(--surface-2); color: var(--text); }
  72%, 92% { background: color-mix(in oklch, var(--ok) 16%, transparent); color: var(--ok); }
  100% { background: var(--surface-2); color: var(--text); }
}
/* Szacowany koszt re-prices when the model switches (3 -> 5) at ~52% */
@keyframes vFadeOut { 0%, 48% { opacity: 1; } 55%, 100% { opacity: 0; } }
@keyframes vFadeIn  { 0%, 48% { opacity: 0; } 55%, 100% { opacity: 1; } }
@keyframes costFlash {
  0%, 48% { background: transparent; }
  56% { background: var(--accent-soft); }
  70%, 100% { background: transparent; }
}

/* Respect reduced-motion: freeze demos on their final, readable frame */
@media (prefers-reduced-motion: reduce) {
  .demo-anim *, .demo-anim { animation: none !important; }
  .demo-lines .ln, .rep-l, .rep-h { opacity: 1 !important; transform: none !important; }
  .cmp-notes::before { width: 22ch !important; }
  .rc-num .v-a { opacity: 0; }
  .feature:hover { transform: none; }
}
