/* Steady's web pages. Steady is dark only, and the colours come from the app's palette
   (Palette in steady-cocoa's SteadyKit/Sources/SteadyDesign). */

:root {
  color-scheme: dark;

  /* Palette.background, .surfaceRaised, .textPrimary, .textSecondary and .green */
  --paper: #0a0a0c;
  --paper-2: #16161a;
  --ink: #f2f2f2;
  --ink-2: #888888;
  --green: #5ea687;
  /* White on the green is too faint (2.9:1), so filled buttons use the background colour (6.8:1). */
  --on-green: #0a0a0c;
  /* The app's dividers (Palette.surfaceSubtle, #111115) vanish as a 1px line on a web page, so rules are a step lighter. */
  --rule: #26262b;

  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --page-width: 64rem;
  --prose-width: 40rem;
  --gutter: 1rem;
}

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

main {
  flex: 1;
  /* The glow behind the home screen reaches past the edges on a phone: clip it rather than scroll sideways. */
  overflow-x: clip;
}

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

a {
  color: var(--green);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper-2);
  border-radius: 8px;
  z-index: 1;
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* Long-form pages keep the header, text and footer in one readable column. */
.doc .wrap {
  max-width: calc(var(--prose-width) + 2 * var(--gutter));
}

/* Header: the icon and name, linking home */

.site-header {
  padding-block: 1.25rem;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
}

.lockup img {
  width: 36px;
  height: 36px;
}

/* Landing */

.hero {
  display: grid;
  gap: 3rem;
  padding-block: 2rem 3.5rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: 1.3fr 1fr;
    gap: 4rem;
    padding-block: 3.5rem 5rem;
  }
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.4rem + 4.2vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* "the noise" in the headline: the scattered daily readings, grey like the chart's dots */
.hero h1 .noise {
  color: var(--ink-2);
}

.hero h1 .trend {
  color: var(--green);
}

.lede {
  max-width: 32rem;
  margin: 1.25rem 0 0;
  font-size: 1.1875rem;
  color: var(--ink-2);
}

.get {
  margin-top: 2rem;
}

.get img {
  width: 144px;
  height: 48px;
}

.get p {
  max-width: 30rem;
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* The home screen, in a phone-shaped frame with a faint glow of the trend's green behind it */

.shot {
  justify-self: center;
  width: min(100%, 18.5rem);
  margin: 0;
  position: relative;
  /* Keeps the glow above the page's background and below the screenshot */
  isolation: isolate;
}

.shot::before {
  content: "";
  position: absolute;
  inset: 10% -25% 0;
  background: radial-gradient(closest-side, rgb(94 166 135 / 0.18), transparent);
  z-index: -1;
}

.shot img {
  width: 100%;
  border-radius: 2.75rem;
  border: 1px solid var(--rule);
  box-shadow: 0 0 0 6px #050506, 0 0 0 7px var(--rule), 0 2rem 4rem rgb(0 0 0 / 0.6);
}

/* Features */

.features {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 2.5rem 0 2.5rem;
  list-style: none;
  border-top: 1px solid var(--rule);
}

@media (min-width: 40rem) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 3rem;
  }
}

.features h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.625rem;
  margin: 0 0 0.375rem;
  font-size: 1.3125rem;
  font-weight: 700;
}

.features p {
  margin: 0;
  color: var(--ink-2);
  max-width: 30rem;
}

/* Marks the features that need Steady Premium */
.tag {
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

.fineprint {
  margin: 0;
  padding-bottom: 4rem;
  max-width: 40rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* Long-form pages: privacy, support, 404 */

.prose {
  padding-block: 1.5rem 4rem;
}

.prose .lede {
  margin: 0.75rem 0 1.5rem;
}

.prose h1 {
  margin: 0;
  font-size: clamp(2rem, 1.5rem + 2.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.prose h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 700;
  scroll-margin-top: 1.5rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.25rem;
}

.prose li + li {
  margin-top: 0.375rem;
}

.prose strong {
  font-weight: 600;
}

.updated {
  margin: 0.5rem 0 2rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* The plain-language summary at the top of the Privacy Policy */

.summary {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  background: var(--paper-2);
}

.summary h2 {
  margin: 0 0 0.625rem;
  font-size: 1.125rem;
}

.summary ul {
  margin: 0;
}

.contents {
  margin: 0 0 1rem;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.contents h2 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.contents ol {
  margin: 0;
  columns: 2 14rem;
  column-gap: 2rem;
}

.contents li {
  break-inside: avoid;
}

.contents li + li {
  margin-top: 0.25rem;
}

/* Support */

.button {
  display: inline-block;
  padding: 0.75rem 1.375rem;
  border-radius: 999px;
  background: var(--green);
  color: var(--on-green);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.08);
}

.faq {
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--green);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .faq summary::after {
    transition: none;
  }
}

.faq .answer {
  padding-bottom: 0.5rem;
}

/* Footer */

.site-footer {
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

.site-footer a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
