/* Codewithdeep. Colors come from the logo's four bubbles. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --line: #e9e5dc;
  --ink: #17161a;
  --muted: #5d5a63;
  --faint: #8b8892;
  --red: #d63a43;
  --red-ink: #b42a33;
  --yellow: #f4c542;
  --green: #8cc98b;
  --blue: #7cc3e6;
  --code-bg: #17161a;
  --code-ink: #f4f1ea;
  --radius: 18px;
  --wrap: 1080px;
  --head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121115;
    --surface: #1b1a1f;
    --line: #2c2a31;
    --ink: #f2f0ec;
    --muted: #b3afb9;
    --faint: #85818c;
    --red-ink: #ff7b82;
    --code-bg: #0b0a0d;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: 0.92em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

/* Four-color rule, the logo's bubbles laid flat. */
.stripe { height: 4px; display: grid; grid-template-columns: repeat(4, 1fr); }
.stripe span:nth-child(1) { background: var(--yellow); }
.stripe span:nth-child(2) { background: var(--green); }
.stripe span:nth-child(3) { background: var(--blue); }
.stripe span:nth-child(4) { background: var(--red); }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand img { width: auto; height: 36px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* Buttons */
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.98rem; border: 1px solid transparent; transition: transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn svg { width: 20px; height: 20px; flex: none; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 0.85rem; color: var(--red-ink); margin-bottom: 14px; display: inline-block; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 36em; margin-bottom: 28px; }
.hero-art { justify-self: center; position: relative; }

/* Animated hero mark. Bubbles are dealt in back to front, the </> draws itself, then the stack floats.
   Hover (or tap) fans the deck apart along its depth axis. .bub carries the fan, .deal the intro, so
   the intro's held end state never blocks the fan transform. */
.cwd-mark { width: min(320px, 70vw); height: auto; overflow: visible; cursor: pointer; filter: drop-shadow(0 24px 36px rgba(214, 58, 67, 0.16)); -webkit-tap-highlight-color: transparent; }
.cwd-mark .bub { transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.15); }
.cwd-mark .deal { animation: cwd-deal 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.12) both; }
.cwd-mark .c1 .deal { animation-delay: 0.1s; }
.cwd-mark .c2 .deal { animation-delay: 0.24s; }
.cwd-mark .c3 .deal { animation-delay: 0.38s; }
.cwd-mark .c4 .deal { animation-delay: 0.52s; }
.cwd-mark .gl { stroke-dasharray: 1; stroke-dashoffset: 1; animation: cwd-draw 0.35s ease-out forwards; }
.cwd-mark .gl1 { animation-delay: 1.05s; }
.cwd-mark .gl2 { animation-delay: 1.25s; }
.cwd-mark .gl3 { animation-delay: 1.45s; }
.cwd-mark .float { animation: cwd-float 6s ease-in-out 2s infinite; }
.cwd-mark.is-fanned .c1 { transform: translate(-40px, -32px); }
.cwd-mark.is-fanned .c2 { transform: translate(-26px, -21px); }
.cwd-mark.is-fanned .c3 { transform: translate(-12px, -10px); }
.cwd-mark.is-fanned .c4 { transform: translate(4px, 2px); }
@media (hover: hover) {
  .cwd-mark:hover .c1 { transform: translate(-40px, -32px); }
  .cwd-mark:hover .c2 { transform: translate(-26px, -21px); }
  .cwd-mark:hover .c3 { transform: translate(-12px, -10px); }
  .cwd-mark:hover .c4 { transform: translate(4px, 2px); }
}
@keyframes cwd-deal {
  from { opacity: 0; transform: translate(90px, -45px); }
  40% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@keyframes cwd-draw { to { stroke-dashoffset: 0; } }
@keyframes cwd-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Sections */
section { padding: 56px 0; }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head p { color: var(--muted); }
.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.alt .card { background: var(--bg); }
.card p { color: var(--muted); margin: 0; font-size: 0.98rem; }
/* Topic cards: isometric icon (tools/build-icons.mjs) beside the copy. */
.topics { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
.topic { display: grid; grid-template-columns: 88px 1fr; gap: 20px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.alt .topic { background: var(--bg); }
.topic img { width: 88px; height: 88px; transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.topic:hover img { transform: translateY(-4px); }
.topic h3 { margin-bottom: 6px; }
.topic p { color: var(--muted); margin: 0; font-size: 0.98rem; }
.chips { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.after-term { margin: 24px 0 0; }

/* App card */
.app { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.app img { width: 96px; height: 96px; border-radius: 22px; }
.app h3 { font-size: 1.5rem; margin-bottom: 4px; }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--yellow) 30%, transparent); margin-bottom: 12px; }
.app ul { margin: 0 0 20px; padding-left: 1.2em; color: var(--muted); }

/* Terminal-style block for the "coming soon" video state */
.term { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); padding: 22px 24px; font-family: var(--mono); font-size: 0.92rem; line-height: 1.8; overflow-x: auto; }
.term .c { color: #8b8892; } .term .k { color: var(--yellow); } .term .s { color: var(--green); } .term .r { color: #ff7b82; }

.page-head { padding: 64px 0 24px; }
.page-head + section { padding-top: 24px; }
.page-head p { font-size: 1.15rem; color: var(--muted); max-width: 38em; }
.prose { max-width: 42em; }
.prose h2 { margin-top: 1.6em; font-size: 1.6rem; }
.crumbs { font-size: 0.88rem; color: var(--faint); margin-bottom: 16px; }
.crumbs a { color: var(--faint); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--muted); font-size: 0.95rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 760px) {
  .hero { padding: 40px 0 32px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero-art { order: -1; justify-self: start; }
  .cwd-mark { width: 150px; }
  .app { grid-template-columns: 1fr; }
  .topics { grid-template-columns: 1fr; }
  .topic { grid-template-columns: 64px 1fr; gap: 16px; padding: 20px; }
  .topic img { width: 64px; height: 64px; }
  .wrap { padding: 0 16px; }
  section { padding: 44px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover { transform: none; }
  .cwd-mark .deal, .cwd-mark .float { animation: none; }
  .cwd-mark .gl { animation: none; stroke-dashoffset: 0; }
  .cwd-mark .bub { transition: none; }
  .topic img { transition: none; }
  .topic:hover img { transform: none; }
}
