/*
  StoaReads, the website. The same Painted Porch as the app (brand/brand.json in stoareads-app):
  lime plaster and marble, Egyptian blue, cinnabar and yellow ochre, Tenor Sans for inscriptions
  and Literata for reading. No build step: plain CSS.
*/

@font-face {
  font-family: 'Tenor Sans';
  src: url('/fonts/tenor-sans.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('/fonts/literata.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('/fonts/literata-italic.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --background: #ecede7;
  --surface: #f8f8f4;
  --ink: #17202f;
  --ink-soft: #4a5263;
  --line: #cdd0c8;
  --primary: #24429b;
  --primary-deep: #192f73;
  --on-primary: #ffffff;
  --accent: #b8321f;
  --highlight: #b9831b;
  --success: #2f6b50;
  --danger: #a3201a;
  --display: 'Tenor Sans', Optima, Candara, 'Gill Sans', sans-serif;
  --body: 'Literata', Charter, 'Iowan Old Style', Georgia, serif;
  --radius: 3px;
  --wash: color-mix(in oklab, var(--primary) 8%, var(--surface));
  --dentils: repeating-linear-gradient(90deg, currentColor 0 9px, transparent 9px 16px);
  --focus: 3px solid color-mix(in srgb, var(--primary) 65%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #10151f;
    --surface: #182030;
    --ink: #e9e7df;
    --ink-soft: #aeb3bf;
    --line: #2e384b;
    --primary: #93a9f2;
    --primary-deep: #b9c8f8;
    --on-primary: #10151f;
    --accent: #ee8a73;
    --highlight: #e2b552;
    --success: #87c3a4;
    --danger: #ff9086;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 7.5vw, 4.1rem);
  letter-spacing: 0.02em;
}
h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
}
h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--primary);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--primary-deep);
}

:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus {
  left: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Frame ----------------------------------------------------------------------------------- */

.wrap {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 0.9rem;
}

.cornice {
  color: var(--primary);
  border-top: 2px solid currentColor;
}
.cornice::after {
  content: '';
  display: block;
  height: 7px;
  margin-top: 3px;
  background: var(--dentils);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  width: 34px;
  height: 34px;
}
.brand span {
  font: 400 1.3rem/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.24em;
}
.brand span b {
  font-weight: 400;
  color: var(--accent);
}
.brand:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-family: var(--display);
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}
.site-nav a.button,
.site-nav a.button:hover {
  color: var(--on-primary);
}
.site-nav .button {
  border-bottom: 0;
  padding: 0.5rem 1rem;
}

.site-nav a {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .site-nav .hide-small {
    display: none;
  }
  .site-nav {
    gap: 0.9rem;
  }
}

@media (max-width: 480px) {
  .site-header .brand span {
    font-size: 1.05rem;
    letter-spacing: 0.14em;
  }
  .site-header .brand img {
    width: 28px;
    height: 28px;
  }
  .site-nav .button {
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .site-nav .signin {
    display: none;
  }
}

main {
  flex: 1;
}

.site-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 1.5rem 2rem;
}
.site-footer h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li {
  margin: 0.25rem 0;
}
.site-footer a {
  color: var(--ink-soft);
}
@media (max-width: 720px) {
  .site-footer .wrap {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer .about {
    grid-column: 1 / -1;
  }
}

/* ---- Pieces ---------------------------------------------------------------------------------- */

.button {
  display: inline-block;
  font: 400 1rem/1.2 var(--display);
  letter-spacing: 0.05em;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
  color: var(--on-primary);
}
.button.secondary {
  background: transparent;
  color: var(--primary);
}
.button.secondary:hover {
  background: var(--wash);
  color: var(--primary-deep);
}
.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 1.8rem;
}

.eyebrow {
  font: 400 0.85rem/1.3 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.8rem;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38rem;
}

.section {
  padding: 4.5rem 0 0;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem;
}

/* ---- Hero ------------------------------------------------------------------------------------ */

.hero {
  padding: 4.5rem 0 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}
.hero .note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.window {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow:
    0 1px 0 var(--line),
    0 24px 48px -28px color-mix(in srgb, var(--ink) 45%, transparent);
  overflow: hidden;
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
  font: 0.75rem/1 var(--display);
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.window-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}
.window-bar span {
  margin-left: 0.6rem;
}
.window img {
  display: block;
  width: 100%;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 3rem;
  }
}

/* ---- The colonnade: three things that hold up the porch -------------------------------------- */

.colonnade .entablature {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.75rem 1.4rem 0;
  font: 400 0.85rem/1 var(--display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 0;
}
.colonnade .entablature::after {
  content: '';
  display: block;
  height: 8px;
  margin: 0.75rem -1.4rem 0;
  color: color-mix(in oklab, var(--on-primary) 55%, var(--primary));
  background: var(--dentils);
}

.pillars {
  list-style: none;
  margin: 0;
  padding: 1.2rem 1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}
.pillars li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  padding: 1.9rem 1.5rem 1.6rem;
  box-shadow:
    inset 9px 0 0 -8px var(--line),
    inset -9px 0 0 -8px var(--line);
}
.pillars li::before {
  content: '';
  position: absolute;
  inset: 0 -0.5rem auto;
  height: 12px;
  background: var(--primary-deep);
}
.pillars h3 {
  margin-bottom: 0.5rem;
}
.pillars p {
  margin: 0;
  color: var(--ink-soft);
}
.stylobate {
  height: 14px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line);
}

/* ---- Steps ----------------------------------------------------------------------------------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.steps li {
  counter-increment: step;
  border-top: 2px solid var(--primary);
  padding-top: 1rem;
}
.steps li::before {
  content: counter(step, upper-roman);
  display: block;
  font: 400 1.6rem/1 var(--display);
  color: var(--accent);
  margin-bottom: 0.8rem;
  letter-spacing: 0.08em;
}
.steps p {
  color: var(--ink-soft);
  margin: 0;
}

/* ---- Feature rows with a screenshot ---------------------------------------------------------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 3rem;
  align-items: center;
  padding-top: 4rem;
}
.feature.flip > :first-child {
  order: 2;
}
.feature ul {
  padding-left: 1.1rem;
  color: var(--ink-soft);
}
.feature li {
  margin: 0.35rem 0;
}
.feature li::marker {
  color: var(--accent);
}
@media (max-width: 860px) {
  .feature,
  .feature.flip {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .feature.flip > :first-child {
    order: 0;
  }
}

/* ---- Free, for real -------------------------------------------------------------------------- */

.free {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.price {
  text-align: center;
  border-top: 12px solid var(--primary);
}
.price .amount {
  font: 400 4.5rem/1 var(--display);
  margin: 0.4rem 0 0.2rem;
}
.price .per {
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}
.ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 1.6rem;
  text-align: left;
}
.ticks li {
  padding: 0.5rem 0 0.5rem 1.8rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.ticks li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.95rem;
  width: 0.7rem;
  height: 0.35rem;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.compare th,
.compare td {
  text-align: left;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare th {
  font: 400 0.85rem/1.3 var(--display);
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.compare td:last-child {
  color: var(--ink);
}
@media (max-width: 860px) {
  .free {
    grid-template-columns: 1fr;
  }
}

/* ---- Origin ---------------------------------------------------------------------------------- */

.origin {
  max-width: 44rem;
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
}
.origin p {
  color: var(--ink-soft);
}

.band {
  margin-top: 5rem;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius);
  padding: 2.6rem 2.4rem 0;
  overflow: hidden;
}
.band h2 {
  margin-bottom: 0.4rem;
}
.band p {
  color: color-mix(in oklab, var(--on-primary) 85%, var(--primary));
  max-width: 34rem;
}
.band .button {
  background: var(--on-primary);
  color: var(--primary);
  border-color: var(--on-primary);
}
.band .button:hover {
  background: var(--surface);
}
.band::after {
  content: '';
  display: block;
  height: 8px;
  margin: 2.4rem -2.4rem 0;
  color: color-mix(in oklab, var(--on-primary) 55%, var(--primary));
  background: var(--dentils);
}

/* ---- Forms ----------------------------------------------------------------------------------- */

.narrow {
  max-width: 40rem;
}

.form-page {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 3rem;
  padding-top: 3.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .form-page {
    grid-template-columns: 1fr;
  }
}

.field {
  display: block;
  margin-bottom: 1.2rem;
}
.field > span {
  display: block;
  font-family: var(--display);
  margin-bottom: 0.3rem;
}
.field small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}
input,
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
}
input:focus {
  outline: var(--focus);
  border-color: var(--primary);
}
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.status {
  margin: 1rem 0 0;
  min-height: 1.6em;
}
.status.error {
  color: var(--danger);
}
.aside h2 {
  font-size: 1.3rem;
}
.aside ol {
  padding-left: 1.2rem;
  color: var(--ink-soft);
}
.aside li {
  margin: 0.5rem 0;
}

.prose {
  max-width: 42rem;
}
.prose h2 {
  margin-top: 2.6rem;
}
.prose li {
  margin: 0.35rem 0;
}
code,
pre {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
}
pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  line-height: 1.5;
}

.site-footer .tagline {
  margin-top: 0.8rem;
}
.site-footer .brand span {
  font-size: 1.05rem;
}

.small {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---- Continue with Google on the start form ---------------------------------------------------- */

.providers {
  display: grid;
  gap: 0.6rem;
  margin: 0.4rem 0 1.2rem;
}
.providers[hidden] {
  display: none;
}
.button.provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.button.provider:hover {
  background: var(--wash);
  border-color: var(--primary);
  color: var(--ink);
}
.providers .or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.providers .or::before,
.providers .or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}
.site-footer .legal {
  margin-top: 0.6rem;
}
