/* ==========================================================
   Coderuff — styles
   ========================================================== */

:root {
  --bg: #f7f6f3;
  --bg-alt: #efede8;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #4a4a48;
  --ink-3: #8a8985;
  --line: #e4e2dc;
  --line-strong: #d6d3cb;
  --accent: #3b5bfd;
  --accent-soft: #e8ecff;
  --ok: #22a06b;
  --warn: #f2994a;

  --radius: 16px;
  --radius-lg: 24px;
  --container: 1160px;
  --gutter: 24px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

::selection { background: var(--ink); color: var(--bg); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { left: 8px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 500 15px/1 var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.btn svg { transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.98); }

.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }

.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #2a2a2a; box-shadow: 0 6px 20px -6px rgba(0,0,0,.35); }

.btn--light { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--light:hover { border-color: var(--line-strong); }

.btn--white { background: #fff; color: var(--ink); }
.btn--white:hover { background: #f1f1f1; }

.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.btn--ghost:hover { border-color: rgba(255,255,255,.6); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 243, .72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -.02em;
}
.logo__mark { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--ink-2);
}
.nav__links a { position: relative; transition: color .2s; }
.nav__links a:hover { color: var(--ink); }

.nav__cta { display: flex; align-items: center; gap: 10px; }

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
}
.nav__toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav__toggle span:nth-child(1) { top: 16px; }
.nav__toggle span:nth-child(2) { top: 22px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

.mobile-menu {
  display: flex;
  flex-direction: column;
  padding: 8px var(--gutter) 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a:not(.btn) {
  padding: 14px 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.01em;
  border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { margin-top: 20px; height: 50px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 40px;
  text-align: center;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(59, 91, 253, .08), transparent 70%),
    var(--bg);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 20%, #000 20%, transparent 75%);
  opacity: .55;
  pointer-events: none;
}
.hero__inner { position: relative; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color .2s;
}
.pill:hover { border-color: var(--line-strong); }
.pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero__title {
  margin: 28px auto 0;
  max-width: 1000px;
  font-size: clamp(44px, 7.4vw, 88px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.045em;
}
.hero__title em { letter-spacing: -.02em; }

.hero__sub {
  margin: 24px auto 0;
  max-width: 560px;
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--ink-2);
}

.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ---------- Console (hero visual) ---------- */
.console {
  margin: 72px auto 0;
  max-width: 1040px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 0 rgba(0,0,0,.02),
    0 30px 60px -30px rgba(17, 17, 17, .25),
    0 12px 24px -12px rgba(17, 17, 17, .08);
  overflow: hidden;
  text-align: left;
}

.console__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.console__title { font-family: var(--font-mono); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eaf7f0;
  color: var(--ok);
  font-weight: 500;
}
.live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,160,107,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(34,160,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,160,107,0); }
}

.console__body {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  min-height: 380px;
}

.call {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 18px 18px,
    #fcfcfb;
  min-width: 0;
}
.call__head { display: flex; align-items: center; gap: 14px; }
.avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.avatar svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.call__name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.call__meta { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.call__wave {
  position: relative;
  flex: 1;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.call__wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.call__speaker {
  position: absolute;
  left: 12px;
  top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  transition: background .3s, color .3s;
}
.call__speaker.is-caller { background: var(--bg-alt); color: var(--ink-2); }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chips li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  min-width: 0;
}
.chips span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.chips b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.console__feed { padding: 16px; display: flex; flex-direction: column; min-width: 0; }
.feed__head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.feed { display: flex; flex-direction: column; gap: 8px; overflow: hidden; flex: 1; }
.feed li {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  background: var(--surface);
  animation: feedIn .5s var(--ease) both;
}
.feed li b { color: var(--ink); font-weight: 500; }
.feed time { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.feed li.is-ai { border-color: #d9e0ff; background: #f7f8ff; }
.feed__who { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); display: block; margin-bottom: 2px; }
.feed li.is-ai .feed__who { color: var(--accent); }
.feed li.is-action { border-style: dashed; background: #f3fbf7; border-color: #bfe6d2; }
.feed li.is-action .feed__who { color: var(--ok); }
@keyframes feedIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Strip ---------- */
.strip { padding: 56px 0 24px; }
.strip__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-top: 22px;
  padding-bottom: 22px;
}
.strip__label {
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}
.strip__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 36px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -.01em;
}

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section--alt { background: var(--bg-alt); }

.section__head { max-width: 680px; margin-bottom: 56px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(32px, 4.6vw, 54px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.035em;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
}

.section__lead {
  margin-top: 20px;
  font-size: 18px;
  color: var(--ink-2);
  max-width: 540px;
}

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 40px -24px rgba(17,17,17,.25);
}
.card p { color: var(--ink-2); font-size: 15px; }

.card--wide { grid-column: span 2; }
.card--full {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}
.card__text { display: flex; flex-direction: column; gap: 10px; }

.card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.card__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bars {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 108px;
}
.bars span {
  flex: 1;
  height: 20%;
  border-radius: 99px;
  background: var(--accent);
  opacity: .85;
  animation: bar 1.4s ease-in-out infinite;
}
.bars span:nth-child(3n)   { animation-duration: 1.1s; }
.bars span:nth-child(3n+1) { animation-duration: 1.7s; }
.bars span:nth-child(4n)   { animation-delay: -.6s; }
.bars span:nth-child(5n)   { animation-delay: -.3s; opacity: .5; }
.bars span:nth-child(7n)   { animation-delay: -.9s; }
@keyframes bar {
  0%, 100% { height: 18%; }
  50%      { height: 90%; }
}
.card--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.card--dark p { color: #b5b5b2; }
.card--dark .card__icon { background: #222; border-color: #333; }
.card--dark .card__icon svg { stroke: #fff; }
.card--full .code { margin: 0; font-size: 14px; padding: 20px 22px; }

.code {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #1c1c1c;
  border: 1px solid #2c2c2c;
  font: 12.5px/1.6 var(--font-mono);
  color: #d8d8d5;
  overflow-x: auto;
}
.c-k { color: #8ea2ff; }
.c-s { color: #9fe0bd; }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  counter-reset: step;
}
.step {
  padding: 32px 28px;
  border-top: 1px solid var(--ink);
  background: transparent;
}
.step__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 40px;
}
.step h3 { font-size: 26px; font-weight: 500; letter-spacing: -.03em; margin-bottom: 10px; }
.step p { color: var(--ink-2); }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: start;
}
.about__text h2 { margin-bottom: 28px; }
.about__text p:not(.eyebrow) { color: var(--ink-2); font-size: 17px; max-width: 520px; }
.about__text p + p { margin-top: 16px; }

.values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.values li {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
  justify-content: flex-end;
}
.values li:nth-child(odd) { border-right: 1px solid var(--line); }
.values li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.values__k {
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1;
  letter-spacing: -.01em;
}
.values__v { font-size: 14px; color: var(--ink-3); }

/* ---------- CTA ---------- */
.cta { padding: 24px 0 112px; }
.cta__box {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background: var(--ink);
  color: #fff;
  padding: 96px 48px;
  text-align: center;
  isolation: isolate;
}
.cta__box canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: .9;
}
.cta__content { max-width: 640px; margin: 0 auto; }
.cta__content p { color: #b5b5b2; margin-top: 20px; font-size: 17px; }
.cta__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 32px; }
.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.footer__brand p { margin-top: 8px; color: var(--ink-3); font-size: 14px; }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-size: 14px;
  color: var(--ink-2);
}
.footer__links a:hover { color: var(--ink); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 48px;
  font-size: 13px;
  color: var(--ink-3);
}
.to-top:hover { color: var(--ink); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card--wide { grid-column: span 2; }
  .about { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__cta .btn { display: none; }
  .nav__toggle { display: block; }

  .console__body { grid-template-columns: 1fr; }
  .call { border-right: 0; border-bottom: 1px solid var(--line); }
  .feed { max-height: 248px; }

  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { padding: 28px 0; }
  .step__num { margin-bottom: 16px; }

  .strip__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }

  .hero { padding: 56px 0 24px; }
  .hero__title { margin-top: 22px; }
  .hero__title br { display: none; }
  .hero__actions { flex-direction: column; align-items: stretch; max-width: 360px; margin-left: auto; margin-right: auto; }
  .hero__actions .btn { width: 100%; height: 50px; }

  .console { margin-top: 48px; border-radius: 18px; }
  .call { padding: 16px; gap: 14px; }
  .call__wave { min-height: 120px; }
  .chips { gap: 6px; }
  .chips li { padding: 8px 10px; }
  .chips b { font-size: 12px; }
  .bars { height: 80px; gap: 3px; }
  .bars span:nth-child(n+25) { display: none; }

  .strip { padding-top: 40px; }
  .strip__list { gap: 8px 20px; font-size: 14px; }

  .section { padding: 80px 0; }
  .section__head { margin-bottom: 40px; }
  .section__lead { font-size: 16px; }

  .bento { grid-template-columns: 1fr; gap: 12px; }
  .card--wide { grid-column: auto; }
  .card--full { grid-template-columns: 1fr; gap: 20px; }
  .card--full .code { font-size: 12.5px; padding: 14px 16px; }
  .card { padding: 24px; border-radius: 20px; }

  .values li { padding: 22px 18px; min-height: 120px; }

  .cta { padding-bottom: 80px; }
  .cta__box { padding: 64px 22px; border-radius: 24px; }
  .cta__actions { flex-direction: column; align-items: stretch; }
  .cta__actions .btn { width: 100%; height: 50px; }

  .footer__inner { flex-direction: column; }
  .footer__links { flex-direction: column; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
