/* CodeTeamsHere showcase — dark "night lab" first, with a light theme.
   Every color is a token; components never use literal colors. */
:root {
  --bg: #0b1020; --bg2: #0f1630; --panel: #131b38; --panel2: #18224a; --line: #263161;
  --ink: #e8ecf8; --muted: #9aa5c4; --soft: #c6cde3;
  --mint: #5eead4; --violet: #a78bfa; --gold: #fbbf24; --rose: #fb7185;
  --tag-study: #5eead4; --tag-chess: #a78bfa; --tag-robotics: #fbbf24;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .7);
  --grad: linear-gradient(100deg, #5eead4 0%, #8b9cff 50%, #c084fc 100%);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7fb; --bg2: #eef1f8; --panel: #ffffff; --panel2: #f2f4fb; --line: #dfe3ef;
  --ink: #12172b; --muted: #5b6380; --soft: #3a4260;
  --mint: #0f9e8a; --violet: #6d4fd8; --gold: #b7791f; --rose: #e11d48;
  --tag-study: #0f9e8a; --tag-chess: #6d4fd8; --tag-robotics: #b7791f;
  --shadow: 0 18px 40px -22px rgba(20, 30, 70, .35);
  --grad: linear-gradient(100deg, #0f9e8a 0%, #4f63e0 50%, #8b3fd8 100%);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fb; --bg2: #eef1f8; --panel: #ffffff; --panel2: #f2f4fb; --line: #dfe3ef;
    --ink: #12172b; --muted: #5b6380; --soft: #3a4260;
    --mint: #0f9e8a; --violet: #6d4fd8; --gold: #b7791f; --rose: #e11d48;
    --tag-study: #0f9e8a; --tag-chess: #6d4fd8; --tag-robotics: #b7791f;
    --shadow: 0 18px 40px -22px rgba(20, 30, 70, .35);
    --grad: linear-gradient(100deg, #0f9e8a 0%, #4f63e0 50%, #8b3fd8 100%);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: "Space Grotesk", Inter, system-ui, sans-serif; line-height: 1.15; text-wrap: balance; margin: 0; }
a { color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 6px; }

/* ---------------- nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.nav-in { max-width: 1160px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand-mark { font-family: "Space Grotesk", monospace; font-size: 14px; padding: 4px 7px; border-radius: 8px; background: var(--grad); color: #0b1020; }
.brand-name { font-family: "Space Grotesk", sans-serif; font-size: 18px; letter-spacing: .2px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--soft); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-guide { color: var(--mint) !important; }
.nav-actions { display: flex; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.icon-btn:hover { border-color: var(--mint); }
.menu-btn { display: none; }

/* ---------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; font: 600 15px Inter, sans-serif; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-main { background: var(--grad); color: #0b1020; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--mint); }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.linkish { background: none; border: 0; padding: 0; color: var(--mint); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------------- hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 26px 26px; opacity: .55; mask-image: linear-gradient(180deg, #000 30%, transparent 95%); }
.hero-glow { position: absolute; width: 760px; height: 760px; right: -220px; top: -260px; background: radial-gradient(closest-side, color-mix(in srgb, var(--violet) 35%, transparent), transparent 70%); filter: blur(10px); }
.hero-in { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; color: var(--mint); margin: 0 0 14px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--soft); font-size: 18px; max-width: 58ch; margin: 18px 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stack { position: relative; height: 420px; min-width: 0; }
.device { position: absolute; margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--panel); }
.device img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.laptop { aspect-ratio: 16 / 10; }
.phone { aspect-ratio: 9 / 19; border-radius: 22px; border-width: 5px; border-color: var(--panel2); }
.d1 { width: 74%; left: 0; top: 10px; transform: rotate(-3deg); }
.d2 { width: 70%; right: 0; top: 150px; transform: rotate(2.5deg); }
.d3 { width: 23%; left: 8%; top: 230px; transform: rotate(-6deg); }
.d4 { width: 21%; right: 4%; top: -10px; transform: rotate(7deg); }
@media (prefers-reduced-motion: no-preference) {
  .device { animation: float 9s ease-in-out infinite; }
  .d2 { animation-delay: -3s; } .d3 { animation-delay: -5s; } .d4 { animation-delay: -7s; }
  @keyframes float { 50% { translate: 0 -8px; } }
}

/* ---------------- sections */
.sec { padding: 72px 0; }
.sec-alt { background: var(--bg2); border-block: 1px solid var(--line); }
.sec-head { margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.sec-head p { color: var(--muted); margin: 8px 0 0; }

/* filters */
.tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--soft); font: 500 14px Inter, sans-serif; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; min-width: 0; flex: 1 1 260px; max-width: 380px; color: var(--muted); }
.search input { border: 0; background: transparent; color: var(--ink); padding: 11px 0; width: 100%; font: inherit; outline: none; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .2s, border-color .2s; min-width: 0; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--mint) 55%, var(--line)); }
.shot { position: relative; aspect-ratio: 16 / 10; background: var(--panel2); overflow: hidden; border-bottom: 1px solid var(--line); }
.shot > img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot .mini { position: absolute; right: 12px; bottom: -28px; width: 22%; aspect-ratio: 9/19; border-radius: 12px; border: 3px solid var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.shot .mini img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 21px; }
.card p { margin: 0; color: var(--soft); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; }
.tag.study { color: var(--tag-study); } .tag.chess { color: var(--tag-chess); } .tag.robotics { color: var(--tag-robotics); }
.tag.plain { color: var(--muted); }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.empty { color: var(--muted); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat b { display: block; font: 700 34px "Space Grotesk", sans-serif; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.stat:nth-child(3n+1) b { color: var(--mint); } .stat:nth-child(3n+2) b { color: var(--violet); } .stat:nth-child(3n) b { color: var(--gold); }

/* details */
.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; padding: 32px 0; border-top: 1px solid var(--line); align-items: start; }
.detail:first-child { border-top: 0; padding-top: 0; }
.detail-shots { position: relative; min-width: 0; }
.detail-shots .big img, .detail-shots .ph img { width: 100%; height: auto; }
.detail-shots .big { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.detail-shots .ph { position: absolute; right: -6px; bottom: -22px; width: 26%; border-radius: 16px; overflow: hidden; border: 4px solid var(--panel2); box-shadow: var(--shadow); }
.detail-copy { min-width: 0; }
.detail-copy h3 { font-size: 28px; margin-bottom: 6px; }
.detail-copy .for { color: var(--muted); margin: 0 0 14px; }
.detail-copy ul { margin: 0 0 16px; padding-left: 20px; color: var(--soft); }
.detail-copy li { margin: 4px 0; }
.detail-copy li::marker { color: var(--mint); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 18px; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin: 8px 0; color: var(--soft); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; font: 600 12px Inter; color: var(--mint); }
.mini-h { font: 600 13px Inter; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 0 6px; }

/* how */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.how-item { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.how-ico { font-size: 26px; }
.how-item h3 { font-size: 18px; margin: 8px 0 6px; }
.how-item p { margin: 0; color: var(--soft); font-size: 15px; }

/* footer */
.foot { padding: 36px 0 calc(90px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; color: var(--muted); }
.foot-in p { margin: 0; }
.to-top { color: var(--muted); }

/* guide (chatbot) */
.guide-fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; border: 0; background: var(--grad); color: #0b1020; font: 600 15px Inter, sans-serif; cursor: pointer; box-shadow: var(--shadow); }
.guide { position: fixed; right: 18px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 70; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100dvh - 120px)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.guide[hidden] { display: none; }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.guide-head span { display: block; color: var(--muted); font-size: 13px; }
.guide-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.msg.bot { background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--grad); color: #0b1020; border-bottom-right-radius: 4px; }
.msg a { color: var(--mint); font-weight: 600; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.guide-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 8px; }
.guide-quick button { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--soft); font: 500 13px Inter; cursor: pointer; }
.guide-quick button:hover { border-color: var(--mint); color: var(--ink); }
.guide-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.guide-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.guide-form .btn { padding: 10px 14px; }

/* ---------------- small screens */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-stack { height: 300px; }
  .detail { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--panel); border-bottom: 1px solid var(--line); padding: 6px 16px 12px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
  .hero { padding: 44px 0 36px; }
  .cards { grid-template-columns: 1fr; }
  .guide-fab span { display: none; }
  .wrap, .nav-in { padding-inline: 16px; }
}
