/* Cairn Linux site.
   Layout: a dusk-sky hero that ends in the wallpaper's ridges, then one calm reading
   column on the "ground" colour, with the four logo stones marking the four reasons.
   Every colour below is taken from branding/*.svg. */

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo.woff2") format("woff2-variations"),
       url("assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono.woff2") format("woff2-variations"),
       url("assets/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* sky gradient, ridges and ground (wallpaper.svg) */
  --night: #0E1318;
  --dusk: #1C2730;
  --horizon: #2A3640;
  --ridge: #26323B;
  --ground: #151C22;
  --well: #12181E;          /* splash.svg background: code and recessed panels */
  --line: #2C3943;

  /* the four stones (logo.svg), top to bottom */
  --amber: #E8A33D;
  --stone-2: #A2B0BA;
  --stone-3: #788A96;
  --stone-4: #56656F;

  /* text (splash.svg) */
  --text: #E6EAEE;
  --muted: #9AA7B1;
  --on-amber: #12181E;

  --sans: "Archivo", "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "DejaVu Sans Mono", ui-monospace, "Cascadia Mono", monospace;

  /* type scale, 1.25 from 18px */
  --fs-sm: 0.889rem;
  --fs-base: 1.125rem;
  --fs-md: 1.406rem;
  --fs-lg: 1.758rem;
  --fs-xl: 2.197rem;

  --measure: 66ch;
  --page: 72rem;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-stretch: 100%;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--amber); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--amber); color: var(--on-amber); padding: 0.5rem 1rem; z-index: 20;
}
.skip:focus { left: var(--gutter-l); top: max(8px, env(safe-area-inset-top, 0px)); }

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

h1, h2, h3 { text-wrap: balance; margin: 0; }
h2 {
  font-size: var(--fs-xl);
  font-stretch: 125%;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h3 {
  font-size: var(--fs-md);
  font-stretch: 112%;
  font-weight: 620;
  line-height: 1.25;
}
p { margin: 0; }
p + p { margin-top: 0.9em; }

code, pre, kbd { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code {
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.35em;
  white-space: nowrap;
}

/* ---------- header ---------- */

.site-header {
  background: var(--night);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--text); text-decoration: none;
  font-stretch: 125%; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;
}
.brand img { width: 2.1rem; height: 2.1rem; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem;
  font-size: var(--fs-sm);
}
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }
@media (max-width: 720px) {
  .site-nav .optional { display: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  background: linear-gradient(180deg, var(--night) 0%, var(--dusk) 70%, var(--horizon) 100%);
  overflow: hidden;
}
.hero-copy {
  position: relative;
  z-index: 1;
  padding-block: clamp(2.5rem, 7vw, 6rem) 0;
}
.hero h1 { display: grid; gap: 0.9rem; }
.hero .name {
  font-size: var(--fs-md);
  font-stretch: 112%;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.hero .tagline {
  font-size: clamp(2.7rem, 8.4vw, 6.4rem);
  font-stretch: 125%;
  font-weight: 760;
  line-height: 0.95;
  letter-spacing: -0.035em;
  max-width: 11ch;
}
.lede {
  margin-top: 1.6rem;
  max-width: 38rem;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
}
.hero-actions {
  margin-top: 2rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.4rem;
}
.hero-note { margin-top: 0.9rem; font-size: var(--fs-sm); color: var(--muted); }

.button {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--amber); color: var(--on-amber);
  font-weight: 650; font-stretch: 110%;
  text-decoration: none;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  line-height: 1.2;
}
.button:hover { background: #F0B357; text-decoration: none; }
.button svg { width: 1.1em; height: 1.1em; }
.text-link { color: var(--text); font-weight: 550; }

.hero-scene {
  width: 100%;
  height: clamp(200px, 27vw, 410px);
  margin-top: clamp(-9rem, -10vw, -2rem);
}
@media (max-width: 640px) {
  .hero-scene { margin-top: 1.5rem; }
}
.cap-stone { transform-box: fill-box; transform-origin: center; }
.cap-glow { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .cap-stone { animation: settle 1.5s cubic-bezier(.2,.7,.2,1) 0.2s both; }
  .cap-glow { animation: kindle 2.4s ease-out 0.6s both; }
}
@keyframes settle {
  from { transform: translateY(-38px) rotate(-7deg); }
  70%  { transform: translateY(2px) rotate(-7deg); }
  to   { transform: translateY(0) rotate(-7deg); }
}
@keyframes kindle {
  from { opacity: 0.35; }
  to   { opacity: 1; }
}

/* ---------- sections ---------- */

main > section { padding-block: clamp(3.5rem, 8vw, 6rem); }
main > section + section { border-top: 1px solid var(--line); }
.section-intro { max-width: var(--measure); display: grid; gap: 0.9rem; margin-bottom: 2.75rem; }
.section-intro p { color: var(--muted); }

/* why: four stones, four reasons */
.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 3rem; }
.stack > li {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0.5rem 2.5rem;
  align-items: start;
}
.stone { justify-self: center; padding-top: 0.2rem; }
.stone svg { width: 12rem; height: auto; }
.reason { max-width: var(--measure); display: grid; gap: 0.75rem; }
.reason p { color: var(--muted); }
.reason p strong { color: var(--text); font-weight: 600; }
.points { margin: 0.2rem 0 0; padding-left: 1.1rem; color: var(--text); display: grid; gap: 0.35rem; }
.points li::marker { color: var(--stone-3); }
@media (max-width: 720px) {
  .stack > li { grid-template-columns: minmax(0, 1fr); }
  .stone { justify-self: start; }
  .stone svg { width: 7rem; }
}

details.more { margin-top: 0.4rem; }
details.more summary {
  cursor: pointer; color: var(--text); font-weight: 550; width: fit-content;
}
details.more summary:hover { color: var(--amber); }
details.more[open] summary { margin-bottom: 0.75rem; }
details.more .body { display: grid; gap: 0.75rem; color: var(--muted); }

pre {
  margin: 0;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  line-height: 1.55;
  color: var(--text);
  font-size: 0.84rem;
}
pre .c { color: var(--muted); }
.code { position: relative; min-width: 0; }
.copy {
  position: absolute; top: 0.45rem; right: 0.45rem;
  font: 600 0.72rem/1 var(--sans);
  color: var(--muted);
  background: var(--dusk);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.38rem 0.55rem;
  cursor: pointer;
}
.copy:hover { color: var(--text); border-color: var(--stone-4); }

/* inside: spec list */
.inside {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 0 3rem;
}
.inside div { border-top: 1px solid var(--line); padding-block: 1rem 1.2rem; }
.inside dt { font-weight: 620; font-stretch: 110%; }
.inside dd { margin: 0.3rem 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.inside .figure { color: var(--text); font-variant-numeric: tabular-nums; }

/* screenshots */
.shots { display: grid; gap: 1.5rem; }
.shots figure { margin: 0; display: grid; gap: 0.6rem; min-width: 0; }
.shots figcaption { color: var(--muted); font-size: var(--fs-sm); max-width: var(--measure); }
.shots img {
  border-radius: 8px;
  border: 1px solid var(--line);
  width: 100%;
  background: var(--well);
}
.shots .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.shots .strip img { image-rendering: auto; }
@media (max-width: 720px) { .shots .pair { grid-template-columns: minmax(0, 1fr); } }

/* desktops */
.desktops { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; align-items: start; }
.default-desk {
  background: var(--dusk);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  display: grid; gap: 0.6rem;
}
.default-desk .tag { color: var(--amber); font-size: var(--fs-sm); font-weight: 600; }
.default-desk p { color: var(--muted); }
.desk-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem;
}
.desk-list li { border-top: 1px solid var(--line); padding-block: 0.8rem 0.9rem; }
.desk-list b { display: block; font-weight: 620; font-stretch: 110%; }
.desk-list span { color: var(--muted); font-size: var(--fs-sm); }
.desk-note { margin-top: 1rem; color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 820px) { .desktops { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .desk-list { grid-template-columns: minmax(0, 1fr); } }

/* download */
.release {
  background: linear-gradient(180deg, var(--dusk), var(--ground));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 2rem;
  align-items: center;
}
.release .file { font-family: var(--mono); font-size: 0.95rem; word-break: break-all; }
.release dl { margin: 0.8rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; font-size: var(--fs-sm); }
.release dt { color: var(--muted); }
.release dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.release dl div { display: flex; gap: 0.5rem; }
.release .checksum { grid-column: 1 / -1; display: grid; gap: 0.45rem; min-width: 0; }
.release .checksum .label { font-size: var(--fs-sm); color: var(--muted); }
.release .checksum pre { white-space: pre-wrap; word-break: break-all; padding-right: 4.5rem; }
.release .actions { display: grid; gap: 0.6rem; justify-items: center; }
.release .actions a.small { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 640px) {
  .release { grid-template-columns: minmax(0, 1fr); }
  .release .actions { justify-items: start; }
}

.writers { margin-top: 3rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
.writers > div { display: grid; gap: 0.9rem; align-content: start; min-width: 0; }
.writers ol { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.55rem; color: var(--muted); }
.writers ol strong { color: var(--text); font-weight: 600; }
.writers .warn { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 820px) { .writers { grid-template-columns: minmax(0, 1fr); } }

.callout {
  margin-top: 2.5rem;
  border-left: 3px solid var(--amber);
  padding: 0.2rem 0 0.2rem 1.1rem;
  max-width: var(--measure);
  color: var(--muted);
}
.callout strong { color: var(--text); }

/* getting started: a real sequence */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 2.75rem; }
.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0 1.25rem;
}
.steps > li::before {
  content: counter(step);
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--stone-4);
  color: var(--text);
  font-weight: 650; font-stretch: 110%;
  font-variant-numeric: tabular-nums;
}
.steps .step-body { display: grid; gap: 0.8rem; max-width: var(--measure); min-width: 0; }
.steps .step-body > p { color: var(--muted); }
.steps .step-body ol { margin: 0; padding-left: 1.2rem; color: var(--muted); display: grid; gap: 0.35rem; }

/* faq */
.faq { display: grid; max-width: 52rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding-block: 1.15rem;
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  font-size: var(--fs-md); font-weight: 600; font-stretch: 108%;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: var(--stone-3); font-weight: 400; font-size: 1.4em; line-height: 0.8;
}
.faq details[open] summary::after { content: "\2212"; color: var(--amber); }
.faq summary:hover { color: var(--amber); }
.faq .answer { padding-bottom: 1.6rem; display: grid; gap: 0.9rem; color: var(--muted); min-width: 0; }
.faq .answer strong { color: var(--text); font-weight: 600; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: var(--fs-sm); line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); }
tr:last-child > * { border-bottom: 0; }
thead th { background: var(--well); color: var(--text); font-weight: 620; }
tbody th { color: var(--text); font-weight: 600; white-space: nowrap; }
td.cairn { color: var(--text); }

/* footer */
.site-footer { background: var(--well); border-top: 1px solid var(--line); }
.site-footer .wrap {
  padding-block: 2.5rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: flex-start;
  font-size: var(--fs-sm); color: var(--muted);
}
.site-footer .brand { font-size: 1.05rem; }
.site-footer .foot-tag { margin-top: 0.35rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.site-footer a { color: var(--text); }
.site-footer .legal { flex-basis: 100%; }
