/* Lucerna — lucerna, the oil lamp you read by.
   The page is the product: near-black paper, one warm light above it, and type set for
   reading rather than for scanning. Colours are the app's own (ReaderPalette). */

:root {
  --ink:      #0A0A0B;
  --ink-2:    #101116;
  --ink-3:    #171A24;   /* the icon's charcoal */
  --paper:    #F5F5F5;
  --body:     #DEDEDE;
  --quiet:    #8C8C8C;
  --quieter:  #5E6068;
  --lamp:     #FAD159;
  --edge:     rgba(255, 255, 255, 0.09);
  --edge-soft:rgba(255, 255, 255, 0.055);

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 68ch;
  --page: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--ink);
  color: var(--body);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.94rem + 0.28vw, 1.125rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The lamp: one light source, above and slightly behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: -20vh -10vw auto;
  height: 90vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(58% 42% at 50% 0%, rgba(250, 209, 89, 0.11), rgba(250, 209, 89, 0) 68%),
    radial-gradient(90% 60% at 50% -10%, rgba(120, 140, 190, 0.07), rgba(120, 140, 190, 0) 70%);
}

/* Paper has tooth. A little noise keeps the flat black from looking like a void. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.26'/%3E%3C/svg%3E");
}

.wrap { position: relative; z-index: 1; }

.page {
  width: min(100% - var(--gutter) * 2, var(--page));
  margin-inline: auto;
}

/* ---------------------------------------------------------------- type ---- */

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.012em; color: var(--paper); }

h1 { font-size: clamp(3rem, 1.6rem + 6vw, 6rem); line-height: 0.98; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); line-height: 1.12; }
h3 { font-size: 1.2rem; line-height: 1.3; }

a { color: var(--body); text-decoration-color: rgba(250, 209, 89, 0.45); text-underline-offset: 0.24em; }
a:hover { color: var(--lamp); }

em.lamp { font-style: normal; color: var(--lamp); }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  line-height: 1.42;
  color: var(--paper);
  max-width: 30ch;
  text-wrap: balance;
}

.quiet { color: var(--quiet); }

/* A section's marginal label, the way a printed book numbers its parts. */
.label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--quieter);
  display: flex;
  align-items: center;
  gap: 0.9em;
  margin-bottom: 1.6rem;
}
.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--edge), transparent);
}

kbd {
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 0.12em 0.42em;
  border: 1px solid var(--edge);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--paper);
  white-space: nowrap;
}

/* ------------------------------------------------------------- topbar ---- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 0 0;
  font-size: 0.92rem;
}

.mark { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.mark img { width: 30px; height: 30px; border-radius: 7px; }
.mark span { font-family: var(--serif); font-size: 1.12rem; color: var(--paper); letter-spacing: 0.01em; }

.topbar nav { display: flex; flex-wrap: wrap; gap: clamp(0.9rem, 2.4vw, 2rem); }
.topbar nav a { color: var(--quiet); text-decoration: none; }
.topbar nav a:hover { color: var(--paper); }

/* --------------------------------------------------------------- hero ---- */

.hero { padding: clamp(4rem, 11vh, 8rem) 0 0; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: end;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; }
}

.hero-icon {
  width: clamp(76px, 9vw, 104px);
  height: auto;
  border-radius: 22%;
  margin-bottom: 1.8rem;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.9), 0 0 70px rgba(250, 209, 89, 0.10);
}

.hero h1 { margin-bottom: 0.5rem; }

.hero .subtitle {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lamp);
  margin-bottom: clamp(1.6rem, 4vw, 2.4rem);
}

.hero .lede { margin-bottom: 1.6rem; }

.hero-aside { padding-bottom: 0.4rem; }
.hero-aside p { color: var(--quiet); max-width: 40ch; }
.hero-aside p + p { margin-top: 1rem; }

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.6rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.9rem;
  color: var(--paper);
}
.availability .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 12px var(--lamp);
}

/* the window that holds a screenshot */
.window {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 1px var(--edge),
    0 50px 110px -40px rgba(0, 0, 0, 0.95),
    0 0 90px -20px rgba(250, 209, 89, 0.10);
}
.window img { display: block; width: 100%; height: auto; }
.window::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 7%);
}

.hero-shot {
  margin-top: clamp(3rem, 8vw, 5.5rem);
  /* wider than the text column: the page is the thing being sold */
  width: min(100% - var(--gutter) * 2, 1440px);
  margin-inline: auto;
}

/* ------------------------------------------------------------ sections ---- */

section { padding: clamp(4.5rem, 12vh, 9rem) 0; }
section + section { border-top: 1px solid var(--edge-soft); }

/* Widths are set on the children, in their own type sizes — a single width on the block
   would give the headline eleven characters a line and the paragraph seventy. */
.section-head { margin-bottom: clamp(2.4rem, 6vw, 4rem); }
.section-head h2 { max-width: 22ch; text-wrap: balance; }
.section-head p { margin-top: 1.2rem; color: var(--quiet); max-width: 56ch; }

/* -------------------------------------------------------------- proof ---- */

.compare {
  display: grid;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) { .compare { grid-template-columns: 1fr 1fr; } }

figure { margin: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--edge);
}
figcaption {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--quiet);
}
figcaption b {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--quieter);
  margin-bottom: 0.35rem;
}
figure.mine figcaption b { color: var(--lamp); }
figure.mine img { border-color: rgba(250, 209, 89, 0.28); }

.aside-note {
  margin-top: 2.6rem;
  padding-left: 1.2rem;
  border-left: 2px solid rgba(250, 209, 89, 0.35);
  color: var(--quiet);
  max-width: var(--measure);
  font-size: 0.95rem;
}

/* ----------------------------------------------------------- features ---- */

.features {
  display: grid;
  gap: clamp(1.8rem, 4vw, 3.2rem) clamp(2rem, 5vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  counter-reset: feature;
}

.feature { position: relative; padding-top: 1.4rem; border-top: 1px solid var(--edge-soft); }
.feature::before {
  counter-increment: feature;
  content: counter(feature, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--quieter);
  display: block;
  margin-bottom: 0.9rem;
}
.feature h3 { margin-bottom: 0.5rem; }
.feature p { font-size: 0.97rem; color: var(--quiet); }

/* ----------------------------------------------------------- gallery ---- */

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(86vw, 900px);
  gap: clamp(1rem, 2.5vw, 2rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-3) transparent;
}
.gallery > * { scroll-snap-align: center; }
.gallery figcaption { text-align: left; }

/* ------------------------------------------------------------- price ---- */

.price-grid {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.6rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 800px) { .price-grid { grid-template-columns: 1fr 1fr; } }

.card {
  padding: clamp(1.6rem, 3.4vw, 2.4rem);
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.008));
}
.card h3 { margin-bottom: 0.8rem; }
.card p { color: var(--quiet); font-size: 0.97rem; }
.card.lit { border-color: rgba(250, 209, 89, 0.24); box-shadow: 0 0 70px -30px rgba(250, 209, 89, 0.5); }

.checks { list-style: none; margin-top: 1.2rem; display: grid; gap: 0.7rem; }
.checks li { display: flex; gap: 0.8rem; font-size: 0.97rem; color: var(--body); }
.checks li::before { content: "—"; color: var(--lamp); flex: none; }

/* -------------------------------------------------------------- story ---- */

.story {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
@media (min-width: 900px) { .story { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }

.story-text { max-width: 60ch; }
.story-text p { color: var(--body); }
.story-text p + p { margin-top: 1.1rem; }
.story-text em { font-style: normal; color: var(--paper); }

.signature {
  margin-top: 1.8rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--quieter);
}

.story-quote {
  position: relative;
  padding: 1.6rem 0 0 1.4rem;
  border-left: 2px solid rgba(250, 209, 89, 0.35);
}
.story-quote blockquote {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1rem + 1.1vw, 1.75rem);
  line-height: 1.28;
  letter-spacing: -0.012em;
  color: var(--paper);
  text-wrap: balance;
}

/* ------------------------------------------------------------ footer ---- */

footer {
  border-top: 1px solid var(--edge-soft);
  padding: clamp(3rem, 7vh, 5rem) 0 clamp(2.5rem, 6vh, 4rem);
  font-size: 0.9rem;
  color: var(--quieter);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.4rem;
  align-items: baseline;
  justify-content: space-between;
}
footer nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
footer a { color: var(--quiet); text-decoration: none; }
footer a:hover { color: var(--lamp); }
.colophon { font-family: var(--serif); font-style: italic; color: var(--quieter); }

/* -------------------------------------------------------------- prose ---- */

.prose { max-width: var(--measure); padding-top: clamp(3rem, 8vh, 5rem); }
.prose h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); margin-bottom: 1.6rem; }
.prose h2 { font-size: 1.4rem; margin: 2.6rem 0 0.8rem; }
.prose p, .prose li { color: var(--body); }
.prose p + p { margin-top: 1rem; }
.prose ul { margin: 0.8rem 0 0 1.2rem; display: grid; gap: 0.5rem; }
.prose .updated { color: var(--quieter); font-size: 0.88rem; margin-top: 2.6rem; }

/* --------------------------------------------------------------- form ---- */

.form { margin: 2rem 0 3rem; display: grid; gap: 1.1rem; }
.form[hidden] { display: none; }
/* The form's rows are <p>s, and .prose stacks adjacent <p>s. Here the grid gap does it. */
.prose .form p { margin-top: 0; }

.field-row { display: grid; gap: 1.1rem; }
@media (min-width: 620px) { .field-row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 0.45rem; }
.field label {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--quiet);
}
.field .opt { text-transform: none; letter-spacing: 0; color: var(--quieter); }
.field .hint { font-size: 0.88rem; color: var(--quieter); }

.form input,
.form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  width: 100%;
  transition: border-color 160ms ease, background 160ms ease;
}
.form textarea { resize: vertical; min-height: 8rem; line-height: 1.55; }
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: rgba(250, 209, 89, 0.55);
  background: rgba(255, 255, 255, 0.055);
}

/* Off-screen rather than display:none, which some form-fillers skip. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
  margin-top: 0.4rem;
}

.form button {
  font: inherit;
  font-size: 0.97rem;
  color: var(--ink);
  background: var(--lamp);
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1.7rem;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease;
}
.form button:hover:not(:disabled) { transform: translateY(-1px); }
.form button:disabled { opacity: 0.45; cursor: default; }
.form button:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }

.form-status { font-size: 0.93rem; color: var(--quiet); }
.form-status.is-good { color: var(--lamp); }
.form-status.is-bad { color: #F0907A; }

.form-note { font-size: 0.88rem; color: var(--quieter); max-width: 60ch; }
.form-note b { color: var(--quiet); font-weight: 500; }

/* --------------------------------------------------------------- legal ---- */

.legal { line-height: 1.75; }
.todo {
  color: #F0907A;
  background: rgba(240, 144, 122, 0.09);
  border-bottom: 1px dashed rgba(240, 144, 122, 0.5);
  padding: 0 0.25em;
  font-family: var(--mono);
  font-size: 0.85em;
}

/* -------------------------------------------------------------- motion ---- */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--d, 0ms);
  }
  /* The hero arrives in three parts. These were style attributes until the site got a
     Content-Security-Policy, which blocks them — and a class says the same thing. */
  .rise-1 { --d: 60ms; }
  .rise-2 { --d: 220ms; }
  .rise-3 { --d: 380ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
  }

  /* Sections arrive as they are scrolled to, where the browser can do it without script. */
  @supports (animation-timeline: view()) {
    .onscroll {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
  }
}
