/*
 * CodeNut marketing landing page.
 *
 * Self-contained design system recreated from the Claude Design handoff
 * (Showcase / split direction). Loaded only by layouts/marketing.html.erb,
 * so the global body/element rules here never touch the signed-in app. No
 * dark mode and no direction switcher — those were design-exploration
 * scaffolding we deliberately dropped on the way to production.
 */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --fg: #16161a;
  --muted: #6b6b73;
  --faint: #97979e;
  --line: #e8e7e3;
  --line-strong: #d9d8d3;
  --card: #ffffff;
  --inset: #f4f3f0;
  --accent: #2f6df0;
  --accent-fg: #ffffff;
  --accent-soft: color-mix(in oklch, var(--accent) 12%, white);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, serif;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --maxw: 1180px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 26, .05), 0 1px 1px rgba(20, 20, 26, .04);
  --shadow: 0 4px 14px rgba(20, 20, 26, .06), 0 1px 3px rgba(20, 20, 26, .05);
  --shadow-lg: 0 24px 60px -18px rgba(20, 20, 26, .22), 0 8px 24px -12px rgba(20, 20, 26, .12);
}

.cn * { box-sizing: border-box; }
.cn h1, .cn h2, .cn h3, .cn h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
.cn p { margin: 0; text-wrap: pretty; }
.cn a { color: inherit; text-decoration: none; }
.cn button { font-family: inherit; cursor: pointer; }

/* The marketing layout owns the page chrome; reset the host body for it. */
body.cn-body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.cn-body ::selection { background: var(--accent); color: var(--accent-fg); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 11px 20px;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-fg); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: 0 6px 18px -6px color-mix(in oklch, var(--accent) 55%, transparent); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--inset); }
.btn-plain { background: transparent; color: var(--fg); padding: 11px 8px; }
.btn-plain:hover { color: var(--accent); }
.btn-lg { padding: 14px 26px; font-size: 16px; }
/* button_to renders a <form>; keep it inline so CTA rows lay out like links. */
.cn-cta-form { display: inline-flex; margin: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead { color: var(--muted); font-size: 19px; line-height: 1.55; }

/* striped image placeholder */
.ph {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--inset) 0 11px, transparent 11px 22px), var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph > span {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--faint);
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.16, .84, .44, 1), transform .7s cubic-bezier(.16, .84, .44, 1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

@keyframes cn-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes cn-spin { to { transform: rotate(360deg); } }
@keyframes cn-pop { 0% { opacity: 0; transform: translateY(8px) scale(.98); } 100% { opacity: 1; transform: none; } }

/* ── nav ─────────────────────────────────────────────────────────────── */
.cn-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}
.cn-nav.is-scrolled {
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.cn-nav-inner { height: 70px; display: flex; align-items: center; justify-content: space-between; }
.cn-logo { display: inline-flex; align-items: center; gap: 9px; }
.cn-logo span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.cn-navlinks { display: flex; align-items: center; gap: 4px; }
.cn-navlinks a {
  padding: 8px 14px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .15s ease;
}
.cn-navlinks a:hover { color: var(--fg); }
.cn-nav-actions { display: flex; align-items: center; gap: 6px; }

/* ── hero (centred pitch + real examples front and centre) ─────────── */
.cn-hero { padding-top: 48px; padding-bottom: 44px; }
.cn-hero-lead { max-width: 720px; margin: 0 auto; text-align: center; }
/* "Powered by AI" pill — lives in the footer bottom bar */
.cn-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.cn-hero h1 { font-size: clamp(40px, 5vw, 64px); }
.cn-hero .lead { margin: 20px auto 0; max-width: 580px; }
.cn-hero-ctas { display: flex; gap: 10px; margin-top: 36px; flex-wrap: wrap; justify-content: center; }

/* real generated sites, front and centre above the fold */
.cn-hero-showcase { margin-top: 44px; }
.cn-hero-showcase-cap { text-align: center; margin-top: 16px; color: var(--faint); font-size: 14px; }

/* ── section header ──────────────────────────────────────────────────── */
.cn-section { padding: 70px 0; }
.cn-section--bordered { border-top: 1px solid var(--line); }
.cn-section--inset { background: var(--inset); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cn-head { max-width: 720px; margin-bottom: 48px; }
.cn-head--center { max-width: 640px; margin-left: auto; margin-right: auto; text-align: center; }
.cn-head h2 { font-size: clamp(30px, 4vw, 46px); }
.cn-head .eyebrow { display: block; margin-bottom: 14px; }
.cn-head .lead { margin-top: 16px; max-width: 760px; }
.cn-head--center .lead { margin-left: auto; margin-right: auto; }
/* keep this heading on a single line (wraps again only when too narrow) */
.cn-head--nowrap { max-width: none; }
.cn-head--nowrap h2 { white-space: nowrap; }
@media (max-width: 720px) { .cn-head--nowrap h2 { white-space: normal; } }

/* ── how it works ────────────────────────────────────────────────────── */
.cn-steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cn-step-card { padding: 28px 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.cn-step-card .cn-step-n { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: .1em; margin-bottom: 18px; }
.cn-step-card h3 { font-size: 23px; margin-bottom: 10px; }
.cn-step-card p { color: var(--muted); font-size: 16px; }

/* ── features grid ───────────────────────────────────────────────────── */
.cn-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cn-feature { background: var(--card); padding: 30px 28px; }
.cn-feature-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 18px; }
.cn-feature h3 { font-size: 20px; margin-bottom: 9px; }
.cn-feature p { color: var(--muted); font-size: 15.5px; }

/* ── chat-edit band ──────────────────────────────────────────────────── */
.cn-chatedit { padding: 78px 0; }
.cn-chatedit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.cn-chatedit h2 { font-size: clamp(30px, 3.6vw, 44px); }
.cn-chatedit .eyebrow { display: block; margin-bottom: 14px; }
.cn-chatedit .lead { margin-top: 16px; max-width: 480px; }
.cn-chatedit-list { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.cn-chatedit-list > div { display: flex; align-items: center; gap: 11px; font-size: 16px; }
.cn-chat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cn-msg { max-width: 82%; }
.cn-msg-bubble { font-size: 14.5px; line-height: 1.45; padding: 11px 15px; border-radius: 16px; }
.cn-msg.you { align-self: flex-end; }
.cn-msg.you .cn-msg-bubble { background: var(--accent); color: var(--accent-fg); border-bottom-right-radius: 5px; }
.cn-msg.cn { align-self: flex-start; }
.cn-msg.cn .cn-msg-bubble { background: var(--inset); color: var(--fg); border-bottom-left-radius: 5px; }
.cn-msg.cn .cn-msg-bubble svg { vertical-align: -2px; margin-right: 6px; }
.cn-chat-input {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 14px;
  margin-top: 4px;
  color: var(--faint);
  font-size: 14px;
}
.cn-chat-input i { margin-left: auto; width: 26px; height: 26px; border-radius: 999px; background: var(--accent); display: grid; place-items: center; }

/* ── examples (real sandboxed thumbnails, restyled) ──────────────────── */
/* Centered carousel: one card mid-panel, neighbours peeking; scrollbar hidden,
   navigated via the arrow buttons (or swipe). The track stays scrollable. */
.cn-examples { position: relative; }
.cn-examples-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 15% 16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.cn-examples-track::-webkit-scrollbar { display: none; }
.cn-examples-arrow {
  position: absolute;
  top: calc(50% - 8px);
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: color-mix(in oklch, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--muted);
  box-shadow: var(--shadow);
  transition: color .15s ease, background .15s ease;
}
.cn-examples-arrow:hover { color: var(--accent); background: var(--surface); }
.cn-examples-arrow.prev { left: 8px; }
.cn-examples-arrow.next { right: 8px; }
.cn-example {
  flex: 0 0 70%;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}
@media (max-width: 760px) { .cn-example { flex-basis: 86%; } }
.cn-example:hover { border-color: color-mix(in oklch, var(--accent) 35%, var(--line)); box-shadow: var(--shadow); }
.cn-example-frame { position: relative; height: 300px; overflow: hidden; background: var(--inset); }
.cn-example-frame iframe { position: absolute; left: 0; top: 0; width: 200%; height: 200%; transform: scale(0.5); transform-origin: top left; border: 0; pointer-events: none; }
.cn-example-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.cn-example-meta p { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-example:hover .cn-example-meta p { color: var(--fg); }
.cn-example-visit { font-size: 13px; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* ── quote ───────────────────────────────────────────────────────────── */
.cn-quote { padding: 84px 0; }
.cn-quote-inner { max-width: 860px; margin: 0 auto; text-align: center; }
.cn-quote-text { font-family: var(--font-serif); font-style: italic; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.3; letter-spacing: -.01em; }
.cn-quote-by { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 30px; }
.cn-quote-by .cn-avatar { width: 44px; height: 44px; border-radius: 99px; background: var(--inset); border: 1px solid var(--line); }
.cn-quote-by .cn-name { font-weight: 600; }
.cn-quote-by .cn-role { font-size: 14px; color: var(--muted); }

/* ── pricing ─────────────────────────────────────────────────────────── */
.cn-pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.cn-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.cn-plan.featured { background: var(--fg); color: var(--bg); border-color: var(--fg); box-shadow: var(--shadow-lg); transform: translateY(-8px); }
.cn-plan-popular {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 999px;
}
.cn-plan-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.cn-plan-price { display: flex; align-items: baseline; gap: 7px; margin-top: 14px; }
.cn-plan-price b { font-family: var(--font-display); font-size: 42px; font-weight: 700; letter-spacing: -.03em; }
.cn-plan-price span { font-size: 14px; opacity: .65; }
.cn-plan-blurb { font-size: 14.5px; opacity: .72; margin-top: 12px; min-height: 44px; }
/* The plan CTA is a button_to form; stretch it full-width within the card. */
.cn-plan .cn-cta-form { display: flex; width: 100%; margin: 20px 0 22px; }
.cn-plan .cn-cta-form .btn { flex: 1; }
.cn-plan-feats { display: flex; flex-direction: column; gap: 11px; }
.cn-plan-feats > div { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.cn-plan.featured .cn-plan-feats > div { opacity: .92; }
/* "Coming soon" plan: dimmed card with a non-interactive CTA. */
.cn-plan.is-coming-soon { opacity: .65; }
.cn-plan .btn[disabled] { cursor: not-allowed; opacity: .6; }
.cn-plan .btn[disabled]:hover { background: transparent; box-shadow: none; }

/* ── faq ─────────────────────────────────────────────────────────────── */
.cn-faq-grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 48px; }
.cn-faq-grid .eyebrow { display: block; margin-bottom: 14px; }
.cn-faq-grid h2 { font-size: clamp(28px, 3.4vw, 40px); }
.cn-faq-list { display: flex; flex-direction: column; }
.cn-faq-item { border-top: 1px solid var(--line-strong); padding: 6px 0; }
.cn-faq-q {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  text-align: left;
  color: var(--fg);
}
.cn-faq-q span:first-child { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.cn-faq-plus {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  transition: transform .25s;
  font-size: 18px;
  color: var(--muted);
}
.cn-faq-item.open .cn-faq-plus { transform: rotate(45deg); }
.cn-faq-a { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.cn-faq-item.open .cn-faq-a { max-height: 240px; }
.cn-faq-a p { color: var(--muted); font-size: 16px; padding-bottom: 18px; max-width: 580px; }

/* ── final CTA ───────────────────────────────────────────────────────── */
.cn-final { padding: 92px 0; }
.cn-final-panel {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 76px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cn-final-mark { position: absolute; top: -40px; right: -20px; opacity: .07; }
.cn-final h2 { font-size: clamp(32px, 4.6vw, 56px); position: relative; }
.cn-final p { font-size: 19px; opacity: .72; margin-top: 18px; max-width: 520px; margin-left: auto; margin-right: auto; position: relative; }
.cn-final-ctas { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; position: relative; }
.cn-final-ctas .btn-soft { background: color-mix(in oklch, var(--bg) 14%, transparent); color: var(--bg); }

/* ── footer ──────────────────────────────────────────────────────────── */
.cn-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; }
.cn-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.cn-footer-blurb { color: var(--muted); font-size: 15px; margin-top: 16px; max-width: 260px; }
.cn-footer-col h4 { font-family: var(--font-body); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.cn-footer-col div { display: flex; flex-direction: column; gap: 10px; }
.cn-footer-col a { font-size: 14.5px; color: var(--muted); }
.cn-footer-col a:hover { color: var(--fg); }
.cn-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13.5px;
  flex-wrap: wrap;
  gap: 12px;
}
.cn-footer-email { color: var(--accent); text-decoration: none; }
.cn-footer-email:hover { text-decoration: underline; }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .cn-chatedit-grid { grid-template-columns: 1fr; gap: 36px; }
  .cn-faq-grid { grid-template-columns: 1fr; gap: 28px; }
  .cn-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .cn-footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .cn-navlinks { display: none; }
}
@media (max-width: 760px) {
  .cn-steps-grid,
  .cn-features,
  .cn-pricing { grid-template-columns: 1fr; }
  .cn-plan.featured { transform: none; }
  .wrap { padding: 0 20px; }
}
