/* ChaOS's site: the device's own colours (tools/genlogo.py) and font. */
@font-face {
  font-family: "Josefin Sans";
  src: url("josefin-sans.ttf") format("truetype");
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --ground: #17151c;
  --ground-2: #1e1b25;
  --panel: #23202b;
  --line: #34303f;
  --cream: #f4ead5;
  --text: #ddd6c8;
  --muted: #9a93a6;
  --orange: #ff7a2f;
  --cyan: #39c5d6;
  --radius: 14px;
  --max: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 18px/1.55 "Josefin Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { color: var(--cream); font-weight: 600; }
code {
  font: 0.86em ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--panel); border: 1px solid var(--line);
  padding: 0.05em 0.35em; border-radius: 5px; color: var(--cream);
  overflow-wrap: anywhere;
}
kbd {
  display: inline-block; min-width: 1.7em; text-align: center;
  font: 600 0.72em/1 "Josefin Sans", system-ui, sans-serif; letter-spacing: 0.04em;
  padding: 0.42em 0.5em 0.3em; border-radius: 6px;
  background: #2c2836; color: var(--cream);
  border: 1px solid #45405a; border-bottom-width: 3px;
  vertical-align: 0.08em;
}
h1, h2, h3, h4 { color: var(--cream); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }
h2 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.01em; }
h3 { font-size: 24px; }
h4 { font-size: 19px; }
ul, ol { padding-left: 1.2em; margin: 0 0 1em; }
li { margin: 0.35em 0; }
li::marker { color: var(--orange); }

/* ---- the little boot: the header's mark flies in, pixel by pixel ---- */
#mark-boot { position: fixed; z-index: 60; pointer-events: none; }
.brand.booting > img { visibility: hidden; }
.brand.booting span { opacity: 0; transition: none; }
.brand span { transition: opacity 1.6s ease; }

/* ---- header -------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 8px max(16px, calc((100vw - var(--max)) / 2));
  background: rgba(23, 21, 28, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); font-size: 24px; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--orange); }
.brand img { image-rendering: pixelated; }
.brand span { display: flex; }
.brand .word { width: 87px; height: 21px; }
.links { display: flex; gap: 22px; margin-left: auto; }
.links a, .gh { color: var(--text); font-size: 16px; }
.links a:hover, .gh:hover { color: var(--orange); text-decoration: none; }
.gh { border: 1px solid var(--line); padding: 6px 14px 4px; border-radius: 999px; }
.gh + .gh { margin-left: -14px; }
.jump { display: none; }
/* Phones and small tablets: GitHub and Discord become round icons, and the
 * sections fold into one button that opens them as a list under the header
 * (app.js). */
@media (max-width: 940px) {
  .top { gap: 8px; }
  .gh { flex: none; margin-left: auto; font-size: 15px; padding: 6px 11px 4px; }
  .gh + .gh { margin-left: 0; }
  .jump {
    display: block; flex: none; order: 3;
    font: inherit; font-size: 16px; color: var(--text); cursor: pointer;
    background: var(--panel); border: 1px solid var(--line);
    padding: 7px 14px 5px; border-radius: 999px;
  }
  .top.open .jump { color: #1b1208; background: var(--orange); border-color: var(--orange); }
  .links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    padding: 6px max(16px, calc((100vw - var(--max)) / 2)) 12px;
    background: rgba(23, 21, 28, 0.97); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 70px); overflow-y: auto;
  }
  .top.open .links { display: flex; }
  .links a { padding: 12px 2px; font-size: 18px; border-bottom: 1px solid var(--line); }
  .links a:last-child { border-bottom: 0; }
}
/* Nothing wider than the screen shifts the page sideways */
html, body { overflow-x: clip; }
.feature-text { min-width: 0; }
pre.tree { max-width: 100%; }

/* ---- layout -------------------------------------------------------- */
section { padding: 0 16px; }
.band { padding: 88px max(16px, calc((100vw - var(--max)) / 2)); }
.band.alt { background: var(--ground-2); border-block: 1px solid var(--line); }
.intro { color: var(--muted); margin: -4px 0 36px; max-width: 46em; }
.note { color: var(--muted); font-size: 16px; }

/* ---- hero ---------------------------------------------------------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
  padding: 72px max(16px, calc((100vw - var(--max)) / 2)) 56px;
  background: radial-gradient(ellipse 70% 60% at 75% 45%, rgba(255, 122, 47, 0.12), transparent 70%);
}
.lockup { width: min(100%, 420px); height: auto; display: block; margin-bottom: 20px; cursor: pointer; }
.hero-cap {
  margin-top: 14px; text-align: center; color: var(--cream); font-size: 18px; font-weight: 600;
  min-height: 1.5em; transition: opacity 0.45s ease;
}
.hero-device .bezel { position: relative; }
.hero-device .bezel img { transition: none; }
.hero-device .bezel .hero-next {
  position: absolute; left: 14px; top: 14px; width: calc(100% - 28px);
  opacity: 0; transition: opacity 0s;
}
.hero-device .bezel .hero-next.in { opacity: 1; transition: opacity 0.9s ease; }
.lede { font-size: 21px; color: var(--text); margin: 0 0 28px; }
.small { color: var(--muted); font-size: 15px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.btn {
  display: inline-block; padding: 13px 22px 10px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--cream); font-weight: 600; background: var(--panel);
}
.btn:hover { text-decoration: none; border-color: var(--orange); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #1b1208; }
.btn.primary:hover { filter: brightness(1.08); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-device { order: -1; max-width: 520px; }
}

.glance {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding: 8px max(16px, calc((100vw - var(--max)) / 2)) 72px;
}
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 14px; }
.tile h3 { font-size: 19px; margin-bottom: 6px; }
.tile p { margin: 0 0 8px; color: var(--muted); font-size: 16px; }
.tile:nth-child(3n+1) h3 { color: var(--orange); }
.tile:nth-child(3n+2) h3 { color: var(--cyan); }
@media (max-width: 860px) { .glance { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .glance { grid-template-columns: 1fr; } }

/* ---- the device ---------------------------------------------------- */
.device { margin: 0; }
.bezel {
  background: linear-gradient(160deg, #2d2935, #1f1c26);
  border-radius: 22px; padding: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 24px 60px rgba(0,0,0,0.45);
  border: 1px solid #3a3546;
}
.bezel img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 6px; background: #000;
  transition: opacity 0.18s ease;
}
.device.browser .bezel img { object-fit: contain; background: #0f0e13; }
.device.small { max-width: 360px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: center; }
.chips button {
  font: 500 14px/1 "Josefin Sans", system-ui, sans-serif; color: var(--muted);
  background: transparent; border: 1px solid var(--line);
  padding: 8px 12px 6px; border-radius: 999px; cursor: pointer;
}
.chips button:hover { color: var(--cream); }
.chips button[aria-pressed="true"] { color: #1b1208; background: var(--orange); border-color: var(--orange); }
.chips:empty { display: none; }

/* ---- steps --------------------------------------------------------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 18px; }
.steps > li {
  counter-increment: step; position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 26px 18px 84px; margin: 0;
  display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center;
}
.steps > li.with-screen { grid-template-columns: 1fr 300px; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 24px; top: 24px;
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; padding-top: 4px;
  background: var(--orange); color: #1b1208; font-weight: 700; font-size: 20px;
}
.steps h3 { font-size: 22px; }
.steps p { margin: 0 0 8px; }
.steps details { color: var(--muted); font-size: 16px; }
.steps summary { cursor: pointer; color: var(--text); }
@media (max-width: 760px) {
  .steps > li, .steps > li.with-screen { grid-template-columns: 1fr; padding: 74px 18px 18px; }
  .steps > li::before { left: 18px; top: 18px; }
  .device.small { max-width: 100%; }
}

/* ---- buttons tabs --------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs button {
  font: 600 16px/1 "Josefin Sans", system-ui, sans-serif;
  color: var(--text); background: var(--panel); border: 1px solid var(--line);
  padding: 11px 16px 8px; border-radius: 10px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--cyan); border-color: var(--cyan); color: #0b2226; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px; }
table.keys { width: 100%; border-collapse: collapse; }
.keys td { padding: 13px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.keys tr:last-child td { border-bottom: 0; }
.keys td:first-child { width: 34%; padding-right: 16px; white-space: nowrap; color: var(--muted); }
@media (max-width: 600px) { .keys td { display: block; width: auto !important; padding: 4px 0; border: 0; } .keys tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); } .keys td:first-child { white-space: normal; } }

/* ---- features ------------------------------------------------------- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
  padding: 44px 0; border-top: 1px solid var(--line);
}
.band > .feature:first-of-type, #updates .feature { border-top: 0; }
.feature.flip > :first-child { order: 2; }
.feature-text h3 { font-size: 30px; margin-bottom: 14px; }
.feature-text p { margin-top: 0; }
.aside-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 24px 10px; }
.aside-card h4 { color: var(--cyan); }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 24px; }
  .feature.flip > :first-child { order: 0; }
}

/* ---- tables --------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: 16px; }
.data th, .data td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.data th { color: var(--cream); font-weight: 600; background: #29253a; }
.data tr:last-child td { border-bottom: 0; }
.data td:first-child { color: var(--cream); }
.msgs { margin-top: 28px; }
.msgs > summary, .faq summary {
  cursor: pointer; color: var(--cream); font-weight: 600; font-size: 19px;
  padding: 16px 20px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  list-style: none;
}
.msgs > summary::before, .faq summary::before { content: "+"; color: var(--orange); display: inline-block; width: 1.2em; font-weight: 700; }
.msgs[open] > summary::before, .faq details[open] summary::before { content: "−"; }
.msgs > summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.msgs[open] > summary { margin-bottom: 16px; }
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq p { padding: 4px 20px 0; margin: 10px 0 6px; }

/* ---- footer --------------------------------------------------------- */
.foot { padding: 40px max(16px, calc((100vw - var(--max)) / 2)) 56px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
.foot p { margin: 0 0 8px; }

/* ---- ChaOS tag, sub-nav, tips, callouts, readings, swatches ---------- */
.tag {
  display: inline-block; vertical-align: 0.12em; margin-left: 4px;
  font: 700 11px/1 "Josefin Sans", system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--orange); border: 1px solid rgba(255, 122, 47, 0.55); background: rgba(255, 122, 47, 0.08);
  padding: 4px 6px 2px; border-radius: 4px;
}
h3 .tag, h4 .tag { vertical-align: 0.3em; }
.subnav {
  position: sticky; top: 61px; z-index: 40;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px 8px; padding: 10px 16px;
  background: linear-gradient(var(--ground) 70%, transparent);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; color: var(--text); font-size: 15px;
  border: 1px solid var(--line); background: var(--panel);
  padding: 8px 13px 6px; border-radius: 999px;
}
.subnav a:hover, .subnav a.on { color: #1b1208; background: var(--orange); border-color: var(--orange); text-decoration: none; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 4px 0 44px; }
.cards3.tight { margin-top: 18px; }
.mini, .tip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 10px; }
.mini h4, .tip h4 { font-size: 18px; margin-bottom: 8px; }
.mini p, .tip p { font-size: 16px; color: var(--text); margin: 0 0 10px; }
.tip { border-left: 4px solid var(--cyan); }
.tip h4 { color: var(--cyan); }
@media (max-width: 860px) { .cards3 { grid-template-columns: 1fr; } }

.callout {
  display: grid; grid-template-columns: 52px 1fr; gap: 18px;
  background: linear-gradient(135deg, rgba(255,122,47,0.12), rgba(255,122,47,0.03));
  border: 1px solid rgba(255, 122, 47, 0.45); border-radius: var(--radius);
  padding: 26px 28px 14px; margin: 0 0 48px;
}
.callout-icon {
  width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; padding-top: 4px;
  background: var(--orange); color: #1b1208; font-weight: 700; font-size: 24px;
  box-shadow: 6px -6px 0 -2px var(--cyan);
}
.callout h4 { font-size: 21px; color: var(--orange); }
.callout p, .callout li { font-size: 17px; }
@media (max-width: 600px) { .callout { grid-template-columns: 1fr; padding: 22px 18px 10px; } }

.readings { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0 0 18px; font-size: 16px; }
.readings dt { font-weight: 600; color: var(--cream); padding: 5px 10px 3px; border-radius: 6px; background: #2b2734; border: 1px solid var(--line); text-align: center; align-self: start; }
.readings dt.ok { color: #9be15d; border-color: rgba(155,225,93,0.4); }
.readings dt.warn { color: #ffc23d; border-color: rgba(255,194,61,0.4); }
.readings dt.bad { color: #ff4f5a; border-color: rgba(255,79,90,0.4); }
.readings dd { margin: 0; align-self: center; }

.swatch-head { margin-top: 22px; font-size: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches span {
  font-size: 14px; color: var(--text); display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px 4px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
}
.swatches span::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--c); margin-top: -2px; }

/* pixels scattered behind section headings, as the logo's */
.band > h2 { position: relative; display: inline-block; }
.band > h2::after {
  content: ""; position: absolute; right: -26px; top: -6px; width: 8px; height: 8px;
  background: var(--orange); box-shadow: 10px -8px 0 var(--cyan), 4px -18px 0 var(--orange), 16px 4px 0 var(--cyan);
}

.credits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.credit { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 8px; }
.credit h4 { font-size: 18px; color: var(--cyan); }
.credit p { font-size: 16px; margin: 0 0 12px; }
.credit.lead { grid-column: 1 / -1; border-color: rgba(57, 197, 214, 0.45); background: linear-gradient(135deg, rgba(57,197,214,0.10), var(--panel) 60%); }
.credit.lead h4 { font-size: 21px; }
@media (max-width: 860px) { .credits { grid-template-columns: 1fr; } }

/* ---- recent releases -------------------------------------------------- */
.releases { margin: 8px 0 28px; }
.releases h3 { font-size: 24px; margin-bottom: 14px; }
.rel { display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: baseline;
  padding: 14px 0; border-top: 1px solid var(--line); }
.rel:last-of-type { border-bottom: 1px solid var(--line); }
.rel p { margin: 0; font-size: 17px; }
.ver { font-weight: 700; color: var(--orange); font-size: 18px; }
.rel:nth-of-type(even) .ver { color: var(--cyan); }

/* ChaOS: a folder laid out, as on the card (Changing discs) */
pre.tree {
  font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; overflow-x: auto; white-space: pre;
}
/* The narrowest phones: the header's pieces a little smaller, to fit */
.brand, .brand .word { flex: none; }
@media (max-width: 400px) {
  .top { gap: 5px; }
  .brand { gap: 5px; }
  .brand > img { width: 36px; height: 36px; }
  .brand .word { width: 64px; height: 15px; }
}
/* The narrowest phones: the console alone, without its name */
@media (max-width: 360px) {
  .brand span { display: none; }
  .gh { font-size: 14px; padding: 5px 9px 3px; }
  .jump { font-size: 14px; padding: 5px 10px 3px; }
}
/* A laptop-sized screen: the section links a little closer, so GitHub and
 * Discord fit beside them */
@media (min-width: 941px) and (max-width: 1180px) {
  .top { gap: 14px; }
  .links { gap: 14px; }
  .links a, .gh { font-size: 15px; }
  .gh { padding: 5px 11px 3px; }
  .gh + .gh { margin-left: -6px; }
}
