/* Page layout on top of the Wolf Cloud Style System. Colours, type and
   radii come from its tokens only; don't add new colour values here. */

.su-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
}

.su-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 28px);
}

/* Screenshots carry the app's own GNOME look; the frame stays quiet. */
.su-shot { margin: 0; }
.su-shot img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

/* Hero */

.su-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding-block: clamp(48px, 8vw, 96px) var(--rhythm);
}
.su-hero .wc-eyebrow { margin-bottom: 18px; }
.su-lede {
  max-width: 46ch;
  margin-top: 24px;
  font-size: 1.125rem;
}
.su-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}
.su-actions .wc-btn { height: 48px; padding-inline: 22px; }

/* The run: a real sequence, so the steps are numbered. */

.su-run {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: su-run;
}
.su-run li { counter-increment: su-run; min-width: 0; }
/* The summary screenshot is taller than the others; subgrid rows keep the
   three headings on one line anyway. */
@media (min-width: 901px) {
  .su-run { grid-template-rows: auto auto auto; row-gap: 0; }
  .su-run li {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    align-items: end;
  }
  .su-run li > h3, .su-run li > p { align-self: start; }
}
.su-run .su-shot { margin-bottom: 24px; }
.su-run h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 600;
}
.su-run h3::before {
  content: counter(su-run, decimal-leading-zero);
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: 0;
}
.su-run p { color: var(--muted); line-height: 1.65; }

/* Two-column sections */

.su-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.su-facts { margin: 0; max-width: 60ch; }
.su-facts dt {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.su-facts dd {
  margin: 6px 0 28px;
  color: var(--muted);
  line-height: 1.65;
}
.su-facts dd:last-child { margin-bottom: 0; }

.su-side-shot { max-width: 420px; }
.su-side-shot figcaption {
  margin-top: 14px;
  font-size: .875rem;
  color: var(--subtle);
}

/* Install */

.su-fpr { max-width: 34rem; margin-bottom: 40px; }
.su-fpr pre { white-space: pre-wrap; }
.su-distro { margin-bottom: 36px; }
/* .wc-segmented sets a display that beats the browser's [hidden] rule, and
   without JavaScript the picker can't do anything. */
.su-distro[hidden] { display: none; }
.su-install { max-width: 760px; }
.su-install + .su-install { margin-top: 56px; }
.su-install-title {
  margin-bottom: 8px;
  font-size: 1.25rem;
  font-weight: 600;
}
.su-install-note,
.su-step-note {
  margin-bottom: 24px;
  max-width: 60ch;
  color: var(--muted);
}
.su-step-note { margin-bottom: 12px; }

/* With the distribution picker working, show one panel at a time and let
   the picker name it. */
.is-picking .su-install + .su-install { margin-top: 0; }
.is-picking .su-install-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.su-aside {
  max-width: 64ch;
  margin-top: 40px;
  font-size: .9rem;
  color: var(--subtle);
}

/* Terminal and limits */

.su-comment { color: var(--subtle); }

.su-limits h3 {
  margin-bottom: 16px;
  font-size: 1.2rem;
  font-weight: 600;
}
.su-limits ul { margin: 0 0 24px; padding-left: 1.1rem; }
.su-limits li {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.su-limits strong { color: var(--text); font-weight: 600; }

/* Polish */

/* The version reads as a status: a release that's out. */
.su-version {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.su-version::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok-dot);
  box-shadow: 0 0 0 4px var(--ok-bg);
}

/* A soft glow and a faint grid behind the hero screenshot. The glow
   reaches past the screen edge on phones; clip rather than hide, so main
   doesn't become a scroll container. */
main { overflow-x: clip; }
.su-hero-shot { position: relative; isolation: isolate; }
.su-hero-shot::before,
.su-hero-shot::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
.su-hero-shot::before {
  inset: -12% -16%;
  background: radial-gradient(closest-side, var(--brand-glow), transparent);
}
.su-hero-shot::after {
  inset: -10%;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
  mask-image: radial-gradient(closest-side, #000 30%, transparent);
}

/* Screenshots lift a little under the pointer. */
.su-shot img {
  transition: transform var(--dur-slow) var(--su-ease-out),
              box-shadow var(--dur-slow) var(--su-ease-out);
}
@media (hover: hover) {
  .su-run .su-shot img:hover,
  .su-side-shot img:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card), 0 28px 48px -28px var(--brand-glow);
  }
}

/* Facts hang off a rail, each marked where it starts. */
.su-facts {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.su-facts dt { position: relative; }
.su-facts dt::before {
  content: "";
  position: absolute;
  top: .45em;
  left: -33px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}

/* Every other split section puts its screenshot first, so the page
   alternates. The screenshot is narrower than its column, so it sits
   against the outer edge, in line with the headings and the hero. */
@media (min-width: 901px) {
  .su-split > .su-side-shot { justify-self: end; }
  .su-split-flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .su-split-flip > .su-side-shot { order: -1; justify-self: start; }
}

/* Motion. Nothing moves for people who asked for less motion, and without
   JavaScript nothing waits to be revealed. */

:root { --su-ease-out: cubic-bezier(.16, 1, .3, 1); }

@keyframes su-rise {
  from { opacity: 0; transform: translateY(18px); }
}
@keyframes su-settle {
  from { opacity: 0; transform: perspective(1200px) rotateX(10deg) translateY(36px) scale(.96); }
}
@keyframes su-fade {
  from { opacity: 0; }
}
@keyframes su-ping {
  0% { box-shadow: 0 0 0 0 var(--ok-dot); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* On load: the hero, piece by piece. */
  .su-hero-text > * {
    animation: su-rise 800ms var(--su-ease-out) both;
  }
  .su-hero-text > :nth-child(2) { animation-delay: 80ms; }
  .su-hero-text > :nth-child(3) { animation-delay: 180ms; }
  .su-hero-text > :nth-child(4) { animation-delay: 280ms; }
  .su-hero-shot img {
    animation: su-settle 1100ms var(--su-ease-out) 200ms both;
    transform-origin: 50% 100%;
  }
  .su-hero-shot::before { animation: su-fade 1600ms var(--ease-standard) 400ms both; }
  .su-hero-shot::after { animation: su-fade 1600ms var(--ease-standard) 600ms both; }
  .su-version::before { animation: su-ping 2.4s var(--ease-standard) 1.2s 3; }

  /* On scroll: site.js marks what to reveal and when it comes into view. */
  .su-motion [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms var(--su-ease-out), transform 900ms var(--su-ease-out);
    transition-delay: calc(var(--su-i, 0) * 90ms);
  }
  .su-motion [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
  }
}

/* Narrow screens */

@media (max-width: 900px) {
  .su-hero, .su-split { grid-template-columns: minmax(0, 1fr); }
  .su-hero-shot { max-width: 440px; }
  .su-run {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(78vw, 320px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
  }
  .su-run li { scroll-snap-align: start; }
}

@media (max-width: 640px) {
  .su-nav .wc-link-ghost:not(.su-nav-keep) { display: none; }
  .wc-display { max-width: none; }
}

/* The footer, tighter than the design system's: it carries little, so
   the generous padding read as empty space. */
.wc-footer { padding: clamp(28px, 4vw, 40px) 0 clamp(20px, 2.5vw, 28px); }
.wc-footer-bottom {
  margin-top: clamp(24px, 3vw, 32px);
  padding-top: clamp(14px, 2vw, 18px);
}

/* Documentation pages (docs.html, filled in by ci/build-docs.py): the
   list of pages left of the text and this page's headings right of it. */

.su-docs {
  display: grid;
  grid-template-columns: 190px minmax(0, 72ch) 170px;
  grid-template-areas: "nav doc toc";
  gap: clamp(32px, 4vw, 40px);
  align-items: start;
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(32px, 5vw, 56px); /* the section rhythm leaves a gap above the footer */
}

.su-doc-nav { grid-area: nav; }
.su-doc { grid-area: doc; }
.su-doc-toc-nav { grid-area: toc; }
.su-doc-nav,
.su-doc-toc-nav {
  position: sticky;
  top: 88px; /* below the 64px site header */
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  font-size: .9rem;
}
.su-doc-nav ul,
.su-doc-toc-nav ul { list-style: none; margin-bottom: 28px; }
.su-doc-nav li,
.su-doc-toc-nav li { margin-bottom: 2px; }
.su-doc-nav a,
.su-doc-toc-nav a {
  display: block;
  padding: 4px 10px;
  border-left: 2px solid transparent;
  color: var(--muted);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.su-doc-nav a:hover,
.su-doc-toc-nav a:hover { color: var(--text); }
.su-doc-nav a[aria-current="page"] {
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}
.su-doc-toc-sub a { padding-left: 24px; font-size: .85rem; }
/* The overview's parts, as headings over their chapters. */
.su-doc-part {
  margin: 14px 0 4px;
  padding-left: 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
}
.su-doc-nav-label {
  margin-bottom: 10px;
  padding-left: 12px;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.su-doc { line-height: 1.7; }
.su-doc h1 {
  margin-bottom: 28px;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
}
.su-doc h2,
.su-doc h3 { scroll-margin-top: 88px; }
.su-doc h2 {
  margin: 56px 0 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-size: 1.6rem;
  font-weight: 600;
}
.su-doc h3 {
  margin: 36px 0 12px;
  font-size: 1.2rem;
  font-weight: 600;
}
.su-doc h1 + h2 { margin-top: 0; }
.su-doc p,
.su-doc ul,
.su-doc ol,
.su-doc .wc-code,
.su-doc .wc-table-wrap { margin-bottom: 18px; }
.su-doc ul,
.su-doc ol { padding-left: 1.4rem; }
.su-doc li { margin-bottom: 8px; }
.su-doc li > ul,
.su-doc li > ol { margin: 8px 0 0; }
.su-doc li > p { margin-bottom: 8px; }
.su-doc p, .su-doc li { color: var(--text-soft); }
.su-doc strong { color: var(--text); font-weight: 600; }
.su-doc a:not(.su-anchor, .wc-btn) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-bdr);
  text-underline-offset: .2em;
}
.su-doc kbd {
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: .8em;
}
.su-doc .wc-table th,
.su-doc .wc-table td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.55;
}
.su-doc .wc-table td:first-child { white-space: nowrap; }
.su-doc .wc-code pre { white-space: pre; }

/* Screenshots in the text: framed like the main page's. The app window
   stays readable at 480 pixels; wider ones, such as the terminal's, have
   smaller text and take the text's width. */
.su-doc .su-doc-shot { margin: 28px 0; }
.su-doc-shot img {
  display: block;
  width: 480px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.su-doc-shot img.su-doc-shot-wide { width: 100%; }

/* A link to each heading, shown when pointing at it. */
.su-anchor {
  margin-left: .4em;
  color: var(--subtle);
  font-weight: 400;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.su-doc h2:hover .su-anchor,
.su-doc h3:hover .su-anchor,
.su-anchor:focus-visible { opacity: 1; }

/* Previous and next chapter. */
.su-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
}
.su-doc .su-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--dur-fast);
}
.su-doc .su-pager a:hover { border-color: var(--accent-bdr); }
.su-pager span {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.su-pager-next { grid-column: 2; text-align: right; }

/* The releases page: each version's date and packages under its number,
   and the versions listed left of the text. */
.su-release-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.su-release-list time { color: var(--subtle); font-size: .8rem; }
.su-doc .su-release-date { margin-top: -6px; color: var(--subtle); font-size: .875rem; }
.su-release-newest { color: var(--accent); font-weight: 600; }
.su-release-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.su-release-downloads .wc-btn span {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: .8em;
}

.su-doc-edit {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}
.su-doc .su-doc-edit { margin-bottom: 0; color: var(--subtle); }

/* Medium screens: no room for three columns, so the headings go under
   the list of pages; the text spans both rows. */
@media (max-width: 1240px) {
  .su-docs {
    grid-template-columns: 190px minmax(0, 72ch);
    gap: clamp(32px, 5vw, 72px);
    grid-template-rows: auto 1fr;
    grid-template-areas: "nav doc" "toc doc";
  }
  .su-doc-nav { position: static; max-height: none; }
}

/* Narrow screens: a trail of the overview and this chapter above the text;
   the overview lists the rest, and the pager below leads on. */
@media (max-width: 900px) {
  .su-docs {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "nav" "doc";
    gap: 8px;
  }
  .su-doc-nav ul.su-doc-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-bottom: 0;
  }
  .su-doc-pages a { padding-inline: 0; border-left: 0; }
  .su-doc-pages a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: .35em;
  }
  .su-doc-toc-nav { display: none; }
  .su-release-list { display: none; }
  .su-doc-pages .su-doc-part,
  .su-doc-pages li:not(:first-child):not(:has(a[aria-current])) { display: none; }
  .su-doc-nav-label:first-child { display: none; }
  .su-doc .wc-table td:first-child { white-space: normal; }
  .su-doc .wc-table th,
  .su-doc .wc-table td { padding: .7rem .75rem; }
  .su-pager { grid-template-columns: minmax(0, 1fr); }
  .su-pager-next { grid-column: 1; }
}
