/* Arlo Retro - baby blue theme */
:root {
  --bg: #f3f9fd;
  --panel: #ffffff;
  --panel-2: #e8f4fb;
  --side: #ffffff;
  --line: #d4e8f4;
  --text: #15324a;
  --muted: #5b7890;
  --blue: #89cff0;
  --blue-2: #5fb6e4;
  --deep: #2f7fb0;
  --deep-2: #1d5f8a;
  --pill-text: #0e3a57;
  --shadow: 0 10px 30px -14px rgba(29, 95, 138, .35);
  --radius: 16px;
  --side-w: 280px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1622; --panel: #12212f; --panel-2: #162a3b; --side: #0e1b28;
    --line: #1f3549; --text: #e6f3fb; --muted: #8fb0c6; --deep: #89cff0; --deep-2: #b5e2f7;
    --pill-text: #0b1622; --shadow: 0 10px 30px -14px rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1622; --panel: #12212f; --panel-2: #162a3b; --side: #0e1b28;
  --line: #1f3549; --text: #e6f3fb; --muted: #8fb0c6; --deep: #89cff0; --deep-2: #b5e2f7;
  --pill-text: #0b1622; --shadow: 0 10px 30px -14px rgba(0, 0, 0, .7); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17.5px; line-height: 1.65; -webkit-font-smoothing: antialiased;
}
a { color: var(--deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }

/* ---------- sidebar ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 18px 14px; z-index: 40; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; color: var(--text); padding: 2px 6px 16px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #0e3a57; font-weight: 900; font-size: 15px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
}
.brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.search { position: relative; margin-bottom: 14px; }
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 12px; padding: 11px 12px 11px 38px; font: inherit; font-size: 16px; outline: none;
}
.search input:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(137, 207, 240, .35); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.results {
  position: fixed; top: 0; left: 0; width: 420px; max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; display: none; z-index: 60;
}
.results.open { display: block; }
.results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); font-size: 16px; line-height: 1.35; }
.results a:hover, .results a.on { background: var(--panel-2); text-decoration: none; }
.results small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.results p { margin: 8px 10px; font-size: 14px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: var(--text); font-weight: 600; font-size: 17px;
}
.nav a svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.active { background: var(--blue); color: #0e3a57; }
.nav a.active svg { color: #0e3a57; }
.sub { display: flex; flex-direction: column; margin: 2px 0 8px 36px; border-left: 2px solid var(--line); }
.sub a { font-weight: 500; font-size: 15.5px; padding: 7px 14px; border-radius: 0 8px 8px 0; color: var(--muted); }
.sub a.active { background: none; color: var(--deep); font-weight: 700; }
.side-label { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 18px 10px 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.dot { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; flex: none; }
.side-foot { margin-top: auto; padding-top: 14px; }
.theme-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--text);
  font: inherit; font-size: 16px; font-weight: 600; padding: 11px 14px; border-radius: 12px; cursor: pointer;
}
.theme-btn:hover { background: var(--panel-2); }
.theme-btn svg { width: 22px; height: 22px; color: var(--muted); }

/* ---------- mobile top bar ---------- */
.topbar { display: none; }
.scrim { display: none; }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(6, 20, 32, .45); z-index: 35; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    background: var(--side); border-bottom: 1px solid var(--line); padding: 10px 16px;
  }
  .topbar .brand { padding: 0; }
  .menu-btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 12px; width: 46px; height: 46px; display: grid; place-items: center; cursor: pointer; }
  .menu-btn svg { width: 24px; height: 24px; }
  .results { width: 100%; }
}

/* ---------- main ---------- */
.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
@media (max-width: 900px) { .main { margin-left: 0; } }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 40px 36px 70px; flex: 1; }
@media (max-width: 600px) { .wrap { padding: 22px 16px 48px; } body { font-size: 17px; } .prose { font-size: 18px; } .section-head h2 { font-size: 28px; } }

.kicker { font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--deep); margin: 0 0 2px; }
.section { margin-top: 60px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 34px; font-weight: 800; text-transform: uppercase; margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 16.5px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--blue-2); color: var(--deep);
  border-radius: 999px; padding: 7px 18px; font-size: 13.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.chip-link:hover { background: var(--blue); color: #0e3a57; text-decoration: none; }
.pill {
  display: inline-block; background: var(--blue); color: var(--pill-text); border-radius: 999px; padding: 4px 12px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.pill.ghost { background: var(--panel-2); color: var(--deep); }

/* hero */
.hero {
  display: grid; grid-template-columns: 1fr 1.15fr; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); color: var(--text);
}
.hero:hover { text-decoration: none; border-color: var(--blue-2); }
.hero-text { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.hero-text h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; margin: 4px 0 0; }
.hero-text p { margin: 0; color: var(--muted); }
.hero-text .go { color: var(--deep); font-weight: 700; font-size: 16.5px; }
.hero-img { background: radial-gradient(circle at 30% 30%, var(--blue), var(--deep-2)); min-height: 340px; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: normal; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-img { order: -1; min-height: 200px; max-height: 240px; } .hero-text { padding: 22px 20px; } }

/* cards */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--blue-2); box-shadow: var(--shadow); text-decoration: none; }
.card .thumb { aspect-ratio: 16 / 10; background: #101b26; overflow: hidden; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .pill { position: absolute; left: 10px; top: 10px; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { font-size: 18px; font-weight: 700; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.card .meta { margin-top: auto; padding-top: 8px; font-size: 14px; color: var(--muted); }

.latest { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }
.latest .stack { display: grid; gap: 18px; }
.latest .big .thumb { aspect-ratio: auto; flex: 1; min-height: 240px; }
.latest .big .body { flex: none; }
.latest .big h3 { font-size: 26px; }
@media (max-width: 760px) { .latest { grid-template-columns: 1fr; } }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 210px; gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.strip .card { scroll-snap-align: start; }
.strip .card .thumb { aspect-ratio: 1; }
.strip .card h3 { font-size: 16.5px; }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--text);
  display: flex; flex-direction: column; gap: 4px;
}
.tile:hover { border-color: var(--blue-2); text-decoration: none; box-shadow: var(--shadow); }
.tile b { font-size: 18.5px; }
.tile span { color: var(--muted); font-size: 15px; }

.banner {
  margin-top: 48px; border-radius: 20px; padding: 28px 30px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, #89cff0, #5fb6e4 55%, #3c8fc4); color: #0b2b42; box-shadow: var(--shadow);
}
.banner .icon { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.55); display: grid; place-items: center; flex: none; }
.banner .icon svg { width: 30px; height: 30px; color: #c4302b; }
.banner h2 { font-size: 28px; font-weight: 800; margin: 0; }
.banner p { margin: 2px 0 0; font-size: 16.5px; }
.banner .btn { margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #0e3a57; border-radius: 999px;
  padding: 13px 26px; font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 4px 0 rgba(0,0,0,.12);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.blue { background: var(--deep); color: #fff; }
:root[data-theme="dark"] .btn.blue { color: #0b1622; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.blue { color: #0b1622; } }

/* page header */
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 800; margin: 2px 0 6px; }
.page-head p { margin: 0; color: var(--muted); font-size: 18.5px; max-width: 760px; }
.crumbs { font-size: 15px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }

/* article */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 40px; align-items: start; }
@media (max-width: 1100px) { .article { grid-template-columns: 1fr; } .toc { display: none; } }
.article-hero { border-radius: var(--radius); overflow: hidden; background: #101b26; aspect-ratio: 16 / 8; margin: 18px 0 26px; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.byline { display: flex; align-items: center; gap: 10px; font-size: 15.5px; color: var(--muted); flex-wrap: wrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--deep)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.prose { font-size: 19px; max-width: 800px; }
.prose h2 { font-size: 29px; font-weight: 800; margin: 1.8em 0 .5em; scroll-margin-top: 80px; }
.prose h3 { font-size: 22px; font-weight: 700; margin: 1.5em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05em; }
.prose li { margin: .3em 0; }
.prose strong { color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 16.5px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--panel-2); font-weight: 700; }
.prose blockquote { margin: 0 0 1.2em; padding: 12px 16px; border-left: 4px solid var(--blue-2); background: var(--panel-2); border-radius: 0 12px 12px 0; }
.prose blockquote p:last-child { margin: 0; }
.prose code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.toc { position: sticky; top: 24px; font-size: 15.5px; border-left: 2px solid var(--line); padding-left: 14px; }
.toc b { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.toc a { display: block; color: var(--muted); padding: 3px 0; line-height: 1.4; }
.toc a:hover { color: var(--deep); }
.author-box { display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 40px; max-width: 800px; }
.author-box .avatar { width: 46px; height: 46px; font-size: 18px; flex: none; }
.author-box p { margin: 2px 0 0; color: var(--muted); font-size: 16px; }

.facts { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px; margin: 0 0 30px; max-width: 800px; }
.facts dl { display: grid; grid-template-columns: 180px 1fr; margin: 0; }
.facts dt, .facts dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; font-size: 16.5px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dl > :nth-last-child(-n+2) { border-bottom: 0; }

.info-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.info { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.info h2 { font-size: 19px; font-weight: 800; }
.info p { color: var(--muted); margin: 0 0 .6em; font-size: 15px; }

.timeline { display: grid; gap: 10px; }
.tl-row { display: grid; grid-template-columns: 84px 1fr; gap: 18px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; color: var(--text); }
.tl-row:hover { border-color: var(--blue-2); text-decoration: none; }
.tl-row .yr { font-weight: 800; color: var(--deep); font-size: 22px; }
.tl-row span { color: var(--muted); font-size: 15.5px; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 30px 36px; font-size: 15px; color: var(--muted); }
.foot-in { max-width: 1240px; margin: 0 auto; display: flex; gap: 14px 26px; flex-wrap: wrap; justify-content: space-between; }
.foot nav { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--deep); }
.disclaimer { width: 100%; font-size: 13.5px; }

.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--deep); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .to-top { color: #0b1622; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--deep); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- home wave banner ---------- */
.wave-hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background: linear-gradient(160deg, #a6dcf5 0%, #6cbfe8 45%, #3d93c9 100%);
  padding: 54px 20px 170px;
}
:root[data-theme="dark"] .wave-hero { background: linear-gradient(160deg, #2b78a8 0%, #1d5f8a 50%, #123b57 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wave-hero { background: linear-gradient(160deg, #2b78a8 0%, #1d5f8a 50%, #123b57 100%); } }
.wh-pattern { position: absolute; inset: -220px 0 0 -320px; background-image: var(--pattern); background-size: 320px 220px; animation: wh-drift 40s linear infinite; }
@keyframes wh-drift { to { transform: translate(320px, 220px); } }
.wh-inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }
.wh-logo { margin: 0; line-height: .88; font-weight: 900; text-transform: uppercase; letter-spacing: -.02em; text-shadow: 0 5px 0 rgba(14, 58, 87, .35), 0 10px 26px rgba(14, 58, 87, .35); }
.wh-small { display: block; font-size: clamp(34px, 5.5vw, 62px); }
.wh-big { display: inline-flex; align-items: center; gap: .12em; font-size: clamp(64px, 11vw, 136px); }
.wh-pad { width: .95em; height: .66em; color: #fff; filter: drop-shadow(0 5px 0 rgba(14, 58, 87, .35)); animation: wh-bob 3s ease-in-out infinite; }
@keyframes wh-bob { 50% { transform: translateY(-6px) rotate(-6deg); } }
.wh-tag { margin: 20px auto 24px; max-width: 520px; font-weight: 700; font-size: 21px; text-shadow: 0 2px 8px rgba(14, 58, 87, .35); }
.wh-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn.ghost { background: transparent; color: #fff; border: 2px solid #fff; box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, .15); }
.wh-waves { position: absolute; left: 0; bottom: -1px; width: 100%; height: 150px; z-index: 1; }
.wh-layers use { animation: wh-wave 22s cubic-bezier(.55, .5, .45, .5) infinite; fill: var(--bg); }
.wh-layers use:nth-child(1) { opacity: .25; animation-delay: -2s; animation-duration: 9s; }
.wh-layers use:nth-child(2) { opacity: .4; animation-delay: -3s; animation-duration: 12s; }
.wh-layers use:nth-child(3) { opacity: .6; animation-delay: -4s; animation-duration: 15s; }
.wh-layers use:nth-child(4) { opacity: 1; animation-delay: -5s; animation-duration: 22s; }
@keyframes wh-wave { 0% { transform: translate3d(-90px, 0, 0); } 100% { transform: translate3d(85px, 0, 0); } }
.wave-hero + .wrap { padding-top: 0; margin-top: -30px; position: relative; z-index: 3; }
.hero-text h2 { font-size: clamp(26px, 3.2vw, 40px); font-weight: 800; margin: 4px 0 0; }
@media (max-width: 600px) { .wave-hero { padding: 36px 16px 120px; } .wh-waves { height: 90px; } .wave-hero + .wrap { margin-top: -24px; } }
@media (prefers-reduced-motion: reduce) { .wh-pattern, .wh-pad, .wh-layers use { animation: none; } }

.credit { font-size: 13px; color: var(--muted); margin: 0 0 24px; }
