/*
  Tendshelf site styles. Colours, shadows and the focus ring come from tokens.css
  (the app's design system, unchanged). Dark theme only. Nothing here is below 13 px.
*/

/* ---------- Fonts: self-hosted, SIL Open Font License (see NOTICES.md) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-Italic-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Fira Sans";
  src: url("/fonts/FiraSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Fira Sans";
  src: url("/fonts/FiraSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Fira Sans";
  src: url("/fonts/FiraSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Fira Mono";
  src: url("/fonts/FiraMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Base ---------- */
:root {
  color-scheme: dark;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Fira Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Decision 0004: buttons, chips and fields use 12 px corners, never pills. */
  --radius-control: 12px;
  --wrap: 1240px;
  --gutter: 32px;
  /* Ember tuned for text on the walnut plank colour (4.5:1 or better). */
  --ember-on-walnut: #f6b894;
  /* Cover colours for the faint book spines. These are objects, not UI. */
  --cover-red: #6b2e2e;
  --cover-teal: #2f5d62;
  --cover-gold: #b8893a;
  --cover-blue: #3e4f6b;
  --cover-green: #5d6b3a;
  --cover-plum: #5a3d5c;
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-fill-hover);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[role="tab"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

code,
pre {
  font-family: var(--font-mono);
}

:target {
  scroll-margin-top: 88px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 50;
  padding: 12px 18px;
  border-radius: var(--radius-control);
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 600;
}

.skip:focus {
  top: 12px;
  color: var(--on-accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon {
  flex: none;
  vertical-align: middle;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap-narrow {
  max-width: calc(880px + 2 * var(--gutter));
}

.num {
  font-variant-numeric: tabular-nums;
}

.serif {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
}

/* ---------- Type ---------- */
.ov {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(34px, 3.6vw, 54px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

.lead {
  max-width: 60ch;
  margin: 0;
  color: var(--ink-muted);
  font-size: 19px;
  line-height: 1.6;
  text-wrap: pretty;
}

.body {
  margin: 0;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}

.small {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Buttons and chips ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--radius-control);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
}

.btn-primary {
  background: var(--accent-fill);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-fill-hover);
  color: var(--on-accent);
}

.btn-primary:active {
  background: var(--accent-fill-pressed);
}

.btn-quiet {
  background: var(--raised);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-quiet:hover {
  background: var(--raised-hover);
  color: var(--ink);
}

.btn-sm {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-ok {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
}

.chip-soon {
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  color: var(--warning);
}

.chip-web {
  background: var(--raised);
  color: var(--ink-muted);
}

.chip-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-word {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: 16px;
}

.navlink {
  padding: 12px 14px;
  border-radius: var(--radius-control);
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms, background-color 150ms;
}

.navlink:hover {
  background: var(--raised);
  color: var(--ink);
}

.navlink[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: var(--radius-control) var(--radius-control) 0 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* The phone menu is a native <details>, so it works with JavaScript off. */
.menu {
  display: none;
}

.menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu-sheet {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px var(--gutter) 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
}

.menu-sheet a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
}

.menu-sheet a:hover,
.menu-sheet a[aria-current="page"] {
  background: var(--raised);
}

.menu-open-icon {
  display: none;
}

.menu[open] .menu-open-icon {
  display: inline;
}

.menu[open] .menu-closed-icon {
  display: none;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 0;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}

.release-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
}

.release-pill:hover {
  color: var(--ink);
}

.release-pill b {
  flex: none;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.hero-title {
  font-variant-ligatures: none;
  max-width: 15ch;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(46px, 6.4vw, 92px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.hero-title em {
  color: var(--accent);
  font-style: italic;
}

.hero .lead {
  max-width: 640px;
  font-size: clamp(18px, 1.6vw, 21px);
}

.ticks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  color: var(--ink-subtle);
  font-size: 14px;
  list-style: none;
}

.ticks li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ticks .icon {
  color: var(--success);
}

/* ---------- The stage: app window and phone standing on a walnut plank ---------- */
.stage-wrap {
  padding-top: 64px;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 1140px;
  aspect-ratio: 1140 / 650;
  margin: 0 auto;
}

.stage .win {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 78.9%;
  animation: rise 250ms ease-out;
}

.stage .phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26.3%;
  animation: rise 250ms ease-out 120ms backwards;
}

.plank {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -26px;
  height: 26px;
  border-radius: 4px;
  background: var(--brand-walnut);
  box-shadow: inset 0 2px 0 #ffffff1f, 0 24px 40px #00000099;
}

@keyframes rise {
  from {
    transform: translateY(16px);
  }

  to {
    transform: none;
  }
}

/* App window: the desktop app with its own title bar. */
.win {
  overflow: hidden;
  border-radius: 14px;
  background: var(--ground);
  box-shadow: 0 40px 90px #000000a6, 0 0 0 1px var(--line);
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 13px;
}

.win-bar .brand-mark {
  width: 16px;
  height: 16px;
}

.win-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.win-controls i {
  display: block;
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.win-controls i:first-child {
  height: 0;
  border-width: 0 0 2px;
  border-radius: 0;
}

.win img,
.phone img,
.shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* Phone: a dark body around a real screenshot. */
.phone {
  --b: 10px;
  --r: 46px;
  overflow: hidden;
  border: var(--b) solid #0b0907;
  border-radius: var(--r);
  background: #0b0907;
  box-shadow: 0 40px 80px #000000b3, 0 0 0 1px var(--line);
}

.phone img {
  border-radius: calc(var(--r) - var(--b));
}

.phone-sm {
  --b: 5px;
  --r: 26px;
  box-shadow: 0 24px 44px #000000a6, 0 0 0 1px var(--line);
}

/* Plain screenshot with rounded corners. */
.shot {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-cover), 0 0 0 1px var(--line);
}

@media (max-width: 960px) {
  .stage {
    aspect-ratio: auto;
    max-width: none;
  }

  .stage .win,
  .plank {
    display: none;
  }

  .stage .phone {
    position: relative;
    width: min(300px, 78vw);
    margin: 0 auto;
  }

  .stage-wrap {
    padding-top: 40px;
  }
}

/* ---------- Sections ---------- */
.block {
  padding: 100px 0;
}

.band {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.platforms {
  padding: 120px 0 40px;
}

.platform-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.platform-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.platform-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.platform-list .icon {
  color: var(--accent);
}

.platform-list b {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.platform-list span span {
  display: block;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.3;
}

/* Feature rows */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 64px;
}

.row-text {
  flex: 1 1 420px;
  min-width: 0;
}

.row-visual {
  position: relative;
  flex: 1 1 520px;
  min-width: 0;
}

@media (min-width: 1040px) {
  .row-flip .row-visual {
    order: -1;
  }
}

.ticklist {
  display: grid;
  gap: 14px;
  margin: 8px 0 0;
  padding: 0;
  color: var(--ink);
  font-size: 16px;
  list-style: none;
}

.ticklist li {
  display: flex;
  gap: 12px;
}

.ticklist .icon {
  margin-top: 3px;
  color: var(--accent);
}

.ticklist b {
  font-weight: 600;
}

.ticklist span span {
  color: var(--ink-muted);
}

/* Three phones on a small plank */
.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 16px;
  padding: 0 4px;
}

.phones-plank {
  height: 16px;
  margin: 0 -2% 0;
  border-radius: 4px;
  background: var(--brand-walnut);
  box-shadow: inset 0 2px 0 #ffffff1f, 0 16px 28px #00000080;
}

@media (max-width: 560px) {
  .phones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phones > :nth-child(3) {
    display: none;
  }
}

/* Reader: desktop window with the phone in front */
.reader-visual {
  padding-bottom: 36px;
}

.reader-visual .phone {
  position: absolute;
  right: -14px;
  bottom: 0;
  width: 27%;
}

@media (max-width: 560px) {
  .reader-visual .phone {
    right: 0;
  }
}

/* Family: three screenshots */
.family-shots {
  display: grid;
  gap: 16px;
}

.caption {
  display: block;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Feature grid */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 760px;
  margin-bottom: 44px;
}

.grid8 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--line);
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 26px 32px;
  background: var(--ground);
}

.tile .icon {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .grid8 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .grid8 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.soon-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.soon-box ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  list-style: none;
}

.soon-box li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 10px 2px 0;
  border-radius: 50%;
  background: var(--warning);
}

/* ---------- Self-host ---------- */
.steps {
  display: grid;
  gap: 18px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.steps b {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.step-num {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}

.terminal {
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ground);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-float);
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
}

.terminal pre {
  margin: 0;
  padding: 20px 20px 22px;
  overflow-x: auto;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
  tab-size: 4;
}

.out {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-muted);
}

.prompt {
  color: var(--accent);
  user-select: none;
}

.copy-btn[hidden] {
  display: none;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 18px 0 0;
  padding: 0;
  color: var(--ink-muted);
  font-size: 15px;
  list-style: none;
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.facts .icon {
  color: var(--success);
}

/* ---------- Downloads summary ---------- */
.dl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.dl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.dl-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}

.dl-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 8px;
}

.dl-card-title .icon {
  color: var(--accent);
}

.plat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 150ms;
}

.plat:hover {
  background: var(--raised);
  color: var(--ink);
}

.plat-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plat-top b {
  font-weight: 600;
}

/* ---------- Walnut band ---------- */
.walnut {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px);
  border-radius: 28px;
  background: var(--brand-walnut);
  box-shadow: inset 0 1px 0 #ffffff1f;
}

.walnut .ov {
  color: var(--ember-on-walnut);
}

.walnut .h2 {
  color: var(--ink);
}

.walnut .lead {
  color: #e9e0d0;
}

.walnut-text {
  position: relative;
  display: flex;
  flex: 1 1 460px;
  flex-direction: column;
  gap: 18px;
}

.walnut-actions {
  position: relative;
  display: flex;
  flex: 0 1 360px;
  flex-direction: column;
  gap: 12px;
}

.walnut .btn-quiet {
  background: #14110e55;
  box-shadow: inset 0 0 0 1px #f1e8da40;
}

.walnut .btn-quiet:hover {
  background: #14110e88;
}

.walnut-link {
  color: #f4eee3;
  font-size: 15px;
}

.walnut-link:hover {
  color: #fff;
}

.spines {
  position: absolute;
  right: -20px;
  bottom: -30px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  opacity: 0.3;
  pointer-events: none;
}

.spines i {
  display: block;
  border-radius: 4px;
}

.spines i:nth-child(1) { width: 46px; height: 170px; background: var(--accent-fill); }
.spines i:nth-child(2) { width: 38px; height: 140px; background: var(--brand-paper); }
.spines i:nth-child(3) { width: 54px; height: 190px; background: var(--cover-teal); }
.spines i:nth-child(4) { width: 34px; height: 120px; background: var(--cover-gold); }
.spines i:nth-child(5) { width: 44px; height: 160px; background: var(--cover-red); }

/* ---------- FAQ ---------- */
.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 20px 4px;
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq .plus {
  flex: none;
  color: var(--accent);
  transition: transform 200ms;
}

.faq details[open] .plus {
  transform: rotate(45deg);
}

.faq details p {
  max-width: 68ch;
  margin: 0 0 24px;
  padding: 0 4px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  padding: 56px 0 40px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
}

.footer-about {
  flex: 1 1 280px;
  max-width: 380px;
}

.footer-about p {
  margin: 12px 0 0;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-col .ov {
  margin-bottom: 8px;
}

.flink {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-muted);
  font-size: 15px;
  text-decoration: none;
}

.flink:hover {
  color: var(--ink);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 14px;
}

/* ---------- Download page ---------- */
.page-hero {
  padding: 72px 0 32px;
}

.page-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 820px;
}

.page-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(40px, 5vw, 68px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.version-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
}

.version-line b {
  color: var(--ink);
  font-weight: 600;
}

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-top: 12px;
  padding: 4px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.tablist[hidden] {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.tab:hover {
  color: var(--ink);
}

.tab-on {
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--accent);
}

.detected {
  min-height: 24px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
}

.detected[hidden] {
  display: none;
}

.panels {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 24px 0 64px;
}

.panel[hidden] {
  display: none;
}

.panel-title {
  margin: 0 0 20px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.js .panel-title {
  display: none;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.os-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
}

.os-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.os-card h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.1;
}

.os-card-head .body {
  margin-top: 6px;
}

.stores {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--raised);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.file-name {
  color: var(--ink-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

code.inline,
.os-card code,
.body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--raised);
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--ground);
  box-shadow: inset 0 0 0 1px var(--line);
}

.file-row > span {
  display: flex;
  flex: 1 1 260px;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mini-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.mini-title .icon {
  color: var(--accent);
}

.os-card pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--ground);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.note-bar {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.note-bar .icon {
  margin-top: 2px;
  color: var(--accent);
}

.note-bar p + p {
  margin-top: 4px;
}

/* ---------- Help page ---------- */
.help-hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 150px;
  background: var(--brand-walnut);
  box-shadow: inset 0 1px 0 #ffffff1f;
}

.help-hero .wrap {
  position: relative;
}

.help-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 760px;
}

.help-hero .h2 {
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.02;
}

.help-hero .lead {
  color: #e9e0d0;
}

.help-hero .icon-heart {
  color: var(--ember-on-walnut);
}

.help-hero .btn-quiet {
  background: #14110e55;
  box-shadow: inset 0 0 0 1px #f1e8da40;
}

.help-spines {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 112px;
  padding: 0 8px;
  overflow: hidden;
  opacity: 0.28;
  pointer-events: none;
}

.help-spines i {
  display: block;
  flex: none;
  border-radius: 4px 4px 0 0;
  width: 34px;
  height: 80px;
}

.help-spines i:nth-child(8n + 1) { background: var(--accent-fill); }
.help-spines i:nth-child(8n + 2) { background: var(--brand-paper); }
.help-spines i:nth-child(8n + 3) { background: var(--cover-teal); }
.help-spines i:nth-child(8n + 4) { background: var(--cover-gold); }
.help-spines i:nth-child(8n + 5) { background: var(--cover-red); }
.help-spines i:nth-child(8n + 6) { background: var(--cover-blue); }
.help-spines i:nth-child(8n + 7) { background: var(--cover-green); }
.help-spines i:nth-child(8n + 8) { background: var(--cover-plum); }
.help-spines i:nth-child(5n + 2) { height: 98px; width: 44px; }
.help-spines i:nth-child(5n + 4) { height: 64px; width: 30px; }
.help-spines i:nth-child(7n + 3) { height: 108px; }

.ways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.give {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 150ms;
}

a.give:hover {
  background: var(--raised);
  color: var(--ink);
}

.give .icon {
  color: var(--accent);
}

.give-cta {
  margin-top: auto;
  padding-top: 8px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
}

.plain-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.plain-note .icon {
  margin-top: 2px;
  color: var(--accent);
}

/* ---------- 404 ---------- */
.lost {
  padding: 120px 0 80px;
}

.lost-shelf {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  max-width: 20rem;
  height: 104px;
  margin-bottom: 40px;
  padding: 0 12px;
  border-bottom: 8px solid var(--brand-walnut);
}

.lost-shelf i {
  flex: 1;
  border-radius: 3px 3px 0 0;
}

.lost-shelf i:nth-child(1) { height: 82%; background: var(--cover-red); }
.lost-shelf i:nth-child(2) { height: 96%; background: var(--accent-fill); }
.lost-shelf i:nth-child(3) { height: 74%; background: var(--cover-teal); }
.lost-shelf i:nth-child(4) { height: 0; }
.lost-shelf i:nth-child(5) { height: 100%; background: var(--cover-green); }
.lost-shelf i:nth-child(6) { height: 78%; background: var(--cover-plum); }
.lost-shelf i:nth-child(7) { height: 88%; background: var(--cover-gold); }

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
  :root {
    --gutter: 20px;
  }

  .nav-links,
  .nav-star {
    display: none;
  }

  .menu {
    display: block;
  }

  .block {
    padding: 72px 0;
  }

  .platforms {
    padding: 72px 0 24px;
  }

  .row {
    gap: 40px;
  }

  .hero {
    padding-top: 56px;
  }

  .os-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .nav {
    gap: 12px;
  }

  .brand-word {
    font-size: 21px;
  }

  .menu-label {
    display: none;
  }

  .panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tab {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 12px;
  }

  .faq summary {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .stage .win,
  .stage .phone {
    animation: none;
  }
}

/* ---------- Additions ---------- */
.band-pad {
  padding: 0 0 80px;
}

.phones-two {
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto;
}

.phones-two > :nth-child(3) {
  display: block;
}

.phones-plank + .phones-plank {
  display: none;
}

.code-wrap {
  position: relative;
}

.code-wrap pre {
  padding-right: 100px;
}

.copy-btn-corner {
  position: absolute;
  top: 6px;
  right: 6px;
}

.give-head {
  margin-top: 72px;
}

.panel-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

@media (max-width: 480px) {
  .panel-grid-wide {
    grid-template-columns: minmax(0, 1fr);
  }
}

.phones-set {
  margin: 0 auto;
}

.phones-set-two {
  max-width: 580px;
}

.phones-set-two .phones {
  max-width: none;
}

.faq .h2 {
  margin-bottom: 28px;
}

@media (max-width: 600px) {
  .platform-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-inner .btn-row {
    width: 100%;
  }

  .hero-inner .btn-row .btn {
    flex: 1 1 100%;
  }
}

/* Targets of at least 44 px */
.brand,
.release-pill {
  min-height: 44px;
}

.os-card .code-wrap pre {
  padding-right: 100px;
}

/* Wider picture column for rows whose screenshots carry small text. */
.row-visual-wide {
  flex: 1.3 1 560px;
}
