/* turnside.karano.me: Turnside's support and privacy pages, as the app's first screen looks. A dark room with one lamp
   at the upper left, the record's violet pooling behind it and hanging in the air as haze, fine grain so the dark
   doesn't band; the record itself is the app icon's photograph (assets/record.*, from tools/site/assets.py), its edges
   melting into the room. White type in three inks, SF Pro with titles heavy and wide, glass for the panels.
   No build step, no scripts, no web fonts: edit this file as it is. */

:root {
  color-scheme: dark;
  --night: #07070a;
  --ink: #f4f4f5;
  /* Turnside's inks: soft and faint read at 4.5:1 or better on the glass and the room. */
  --ink-soft: rgb(244 244 245 / 0.72);
  --ink-faint: rgb(244 244 245 / 0.6);
  --line: rgb(255 255 255 / 0.12);
  --violet: 90 60 255;
  --lamp: rgb(255 196 140 / 0.11);
  --glass: rgb(16 14 30 / 0.58);
  --glass-solid: #121020;
  --glass-rim: rgb(255 255 255 / 0.14);
  --link-line: rgb(196 181 253 / 0.7);
  --focus: #c4b5fd;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 62ch;
  --gutter: clamp(1rem, 4vw, 3rem);
}

@media (prefers-contrast: more) {
  :root {
    --ink-soft: rgb(244 244 245 / 0.86);
    --ink-faint: rgb(244 244 245 / 0.78);
    --line: rgb(255 255 255 / 0.32);
    --glass-rim: rgb(255 255 255 / 0.4);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--night);
}

/* The room: the lamp's warmth at the upper left, the record's violet pooled behind the hero and drifting lower as
   haze, an elliptical vignette, and grain over all of it. */
body {
  margin: 0;
  min-block-size: 100dvh;
  overflow-x: clip;
  background-color: var(--night);
  background-image:
    url("/assets/grain.png"),
    radial-gradient(ellipse 60% 50% at 0% 0%, var(--lamp), transparent 72%),
    radial-gradient(ellipse 55% 45% at 74% 22%, rgb(var(--violet) / 0.2), transparent 70%),
    radial-gradient(ellipse 70% 40% at 30% 70%, rgb(var(--violet) / 0.07), transparent 75%),
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgb(0 0 0 / 0.55));
  background-image:
    image-set(url("/assets/grain.webp") type("image/webp"), url("/assets/grain.png") type("image/png")),
    radial-gradient(ellipse 60% 50% at 0% 0%, var(--lamp), transparent 72%),
    radial-gradient(ellipse 55% 45% at 74% 22%, rgb(var(--violet) / 0.2), transparent 70%),
    radial-gradient(ellipse 70% 40% at 30% 70%, rgb(var(--violet) / 0.07), transparent 75%),
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgb(0 0 0 / 0.55));
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 64px 64px, auto, auto, auto, auto;
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-inline-size: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The record reaches past the column; its edges have faded out by then, so clip there rather than widen the page. */
main.page {
  overflow-x: clip;
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--link-line);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: currentColor;
}

:where(a:any-link):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

/* The bar: the icon and the name, the way home, and what matters most in one line. */
.bar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 44px;
  font-size: 1.125rem;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  inline-size: 28px;
  block-size: 28px;
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--glass-rim), 0 4px 18px rgb(var(--violet) / 0.35);
}

.glass {
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 0 var(--glass-rim);
}

.pill {
  margin: 0;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* The title, large, with the record beside it on a wide screen and above it on a phone. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0 2rem;
  padding-block: clamp(0.5rem, 4vw, 3rem) clamp(2rem, 6vw, 4rem);
}

@media (min-width: 56rem) {
  .hero--record {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
}

/* The words sit over the record's haze: the record's mask gives it a layer of its own, so the words take one above. */
.hero__words {
  position: relative;
  z-index: 1;
}

.hero__title {
  margin: 0;
  font-size: clamp(2.75rem, 11vw, 7rem);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 30px rgb(0 0 0 / 0.5);
}

.hero__line {
  margin: 0.85rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.2;
}

.hero__intro {
  max-inline-size: var(--measure);
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
}

.hero__needs {
  max-inline-size: var(--measure);
  margin: 0.75rem 0 0;
  color: var(--ink-faint);
  font-size: 0.9375rem;
}

/* The record: the icon's photograph, its square edges faded into the room so only the record, its haze and the lit
   arm remain. Wider than the column on a phone, so the haze runs off both sides. */
.record {
  order: -1;
  justify-self: start;
  inline-size: min(118vw, 34rem);
  margin-block: -6vw -10vw;
  /* Centred on the column, however far past it the record reaches. */
  margin-inline: calc(50% - min(59vw, 17rem));
  pointer-events: none;
}

.record img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  -webkit-mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
}

.record--small {
  inline-size: min(70vw, 18rem);
  margin-block: -2rem -1.25rem;
  margin-inline: calc(50% - min(35vw, 9rem));
}

@media (min-width: 56rem) {
  /* The first screen: the title and the record fill the window before the panels begin. */
  .hero--first {
    min-block-size: min(54rem, calc(100svh - 5.5rem));
    padding-block: 0 2rem;
  }

  .record {
    order: 0;
    justify-self: center;
    inline-size: min(118%, 48rem);
    margin-block: -4rem;
    margin-inline: 0 -9%;
  }

  .record--small {
    inline-size: min(100%, 22rem);
    margin-block: -2.5rem;
    margin-inline: 0;
  }
}

/* The panels: each question, or each part of the policy, on its own glass. */
.panels {
  display: grid;
  gap: 1rem;
  padding-block-end: 4rem;
}

@media (min-width: 46rem) {
  .panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.panel {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 1.5rem;
}

.panel--wide {
  grid-column: 1 / -1;
}

.panel h2 {
  margin: 0 0 0.6rem;
  font-size: 1.1875rem;
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.25;
}

.panel p,
.panel li {
  max-inline-size: var(--measure);
  color: var(--ink-soft);
}

.panel p {
  margin: 0;
}

.panel p + p,
.panel ol + p {
  margin-top: 0.75rem;
}

.panel ol {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-inline-start: 1.35rem;
}

.panel li::marker {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.mail {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 800;
  font-stretch: 112%;
}

.panel .when {
  color: var(--ink-faint);
  font-size: 0.9375rem;
}

/* The footer: who made it, and the same three links on every page. */
.foot {
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.9375rem;
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem 2.5rem;
}

.foot p {
  margin: 0;
}

.foot a {
  color: var(--ink-soft);
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot__links a {
  display: inline-block;
  min-block-size: 24px;
  padding-block: 0.15rem;
}

.foot a[aria-current="page"] {
  color: var(--ink);
  text-decoration-color: currentColor;
}

@media (pointer: coarse) {
  .foot__links a {
    min-block-size: 44px;
    padding-block: 0.7rem;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .glass {
    border-color: CanvasText;
  }

  .record {
    display: none;
  }

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

  :where(a:any-link):focus-visible {
    outline-color: Highlight;
  }
}
