/*
 * Steading's site, in the app's own look: paper, Pirata One titles with a
 * thin printed drop, the tweed band, solid inks. Boldness comes from the
 * type, never from contrast. No glows, no sparkles.
 */

/* Colours, fonts and textures come from the app (tokens.css, fonts.css and
   textures/ are copied in by build.mjs), so the site always matches it. */
:root {
  --gold: var(--light);
  --gold-hover: var(--light-hover);
  --on-gold: var(--on-light);
  --tweed: var(--side-bg);
  --tweed-ink: var(--side-ink);
  --tweed-muted: var(--side-muted);
  --tweed-label: var(--side-label);
  --wide: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html {
  background-color: var(--ground);
  background-image: var(--tex-paper);
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  color: var(--ink);
  font: 400 19px/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--tex-mottle) 0 0 / 100% 100% no-repeat;
}

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

a {
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--wide) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 50;
  background: var(--surface);
  padding: 8px 12px;
}

/* ------------------------------------------------------------- header */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--tweed);
  background-image: url('textures/tweed.svg'), repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.08) 0 1.5px, transparent 1.5px 4px);
  color: var(--tweed-ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.top .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--tweed-label);
  font: 400 30px/1 var(--font-display);
  letter-spacing: 0.01em;
}

.brand img {
  width: 26px;
  height: 26px;
}

.top nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font: 500 16px var(--font-ui);
}

.top nav a {
  text-decoration: none;
  color: var(--tweed-muted);
}

.top nav a:hover {
  color: var(--tweed-ink);
}

.top .btn {
  margin-left: 6px;
}

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 700 17px var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn-gold {
  background: var(--gold);
  color: var(--on-gold);
}

.btn-gold:hover {
  background: var(--gold-hover);
}

.btn-quiet {
  border-color: var(--rule-strong);
  color: var(--ink);
}

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

.btn-small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 15px;
}

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

.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--title);
  text-shadow: 2px 2px 0 var(--title-drop);
  letter-spacing: 0.005em;
  line-height: 1.02;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin: 0 0 14px;
  font: 700 15px var(--font-label);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--rubric);
}

.label::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--rubric);
  transform: rotate(45deg);
}

.lede {
  font-size: 22px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 34em;
}

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

.hatch {
  height: 7px;
  border: 0;
  margin: 0 auto;
  background-clip: content-box;
  background: repeating-linear-gradient(135deg, var(--rule-strong) 0 1px, transparent 1px 4px);
}

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

.hero {
  padding: clamp(48px, 9vw, 104px) 0 0;
  text-align: center;
}

.hero .title {
  font-size: clamp(56px, 10vw, 124px);
}

.hero .lede {
  margin: 26px auto 0;
  max-width: 31em;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.promises {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 30px auto 0;
  padding: 0;
  list-style: none;
  font: 500 16px var(--font-ui);
  color: var(--muted);
}

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

.promises li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--rubric);
  transform: rotate(45deg);
}

.hero-shot {
  margin: clamp(40px, 6vw, 64px) auto 0;
}

/* ------------------------------------------------------------- shots */

.shot {
  margin: 0;
  padding: 6px;
  background-color: var(--surface);
  background-image: var(--tex-card);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 18px 40px -26px rgba(0, 0, 0, 0.4);
}

.shot img {
  border-radius: 3px;
  border: 1px solid var(--rule);
  width: 100%;
}

.shot figcaption,
.phone figcaption {
  margin-top: 10px;
  font: 500 15px var(--font-ui);
  color: var(--muted);
  text-align: center;
}

.phone {
  margin: 0;
  width: 100%;
  max-width: 290px;
}

.phone-body {
  padding: 9px;
  border-radius: 34px;
  background: #161616;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.55);
}

.phone-body img {
  border-radius: 26px;
  width: 100%;
}

/* ------------------------------------------------------------- clips */

.shot video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--rule);
  background: var(--surface-deep);
}

.clip-wide {
  max-width: 1000px;
  margin: 0 auto;
}

/* Section text fades up once as it scrolls in (motion.js adds .motion). */
.motion .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.motion .reveal.is-in {
  opacity: 1;
  transform: none;
}

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

.feature {
  padding: clamp(64px, 9vw, 112px) 0;
}

.feature + .feature {
  border-top: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.feature.flip .feature-grid {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.feature.flip .feature-text {
  order: 2;
}

.feature h2 {
  font-size: clamp(40px, 5vw, 58px);
  margin-bottom: 18px;
}

.feature p {
  margin: 0 0 14px;
  max-width: 33em;
}

.ticks {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 26px;
  margin: 8px 0;
  font-size: 18px;
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  background: var(--rubric);
  transform: rotate(45deg);
}

.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 32px;
  align-items: center;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  font: 600 0.82em/1.6 var(--font-ui);
  text-align: center;
}

/* Two shots, one feature: what the GM sees and what a player sees. The
   words go above, so both shots can be big enough to read. */
.feature.stack .feature-grid {
  grid-template-columns: 1fr;
  gap: 36px;
}

.feature.stack .feature-text {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 0 clamp(28px, 5vw, 64px);
  align-items: end;
}

.feature.stack .feature-text > :first-child {
  grid-column: 1 / -1;
}

.compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 32px;
  align-items: center;
}

/* ------------------------------------------------------------- not */

.not {
  padding: clamp(64px, 9vw, 104px) 0;
}

.not-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--rule-strong);
}

.not-item {
  padding: 18px 18px 18px 0;
  border-bottom: 1px solid var(--rule);
}

.not-item h3 {
  margin: 0 0 4px;
  font: 700 19px var(--font-text);
}

.not-item p {
  margin: 0;
  font-size: 17px;
  color: var(--muted);
}

/* ------------------------------------------------------------- pricing */

.pricing {
  padding: clamp(64px, 9vw, 112px) 0;
  background-color: var(--tweed);
  background-image: url('textures/tweed.svg'), repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.08) 0 1.5px, transparent 1.5px 4px);
  color: var(--tweed-ink);
}

.pricing .title {
  color: var(--tweed-label);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.28);
  font-size: clamp(44px, 6vw, 72px);
}

.pricing .label {
  color: var(--tweed-label);
}

.pricing .label::before {
  background: var(--tweed-label);
}

.price-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.price-intro p {
  color: var(--tweed-ink);
  max-width: 30em;
}

.price-card {
  padding: 32px;
  background-color: var(--plate);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(239, 201, 85, 0.3);
}

.price-name {
  margin: 0;
  font: 700 15px var(--font-label);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--tweed-label);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 6px 0 4px;
}

.price-now {
  font: 800 72px/1 var(--font-text);
  color: #fff7e8;
}

.price-was {
  font: 500 22px var(--font-ui);
  color: var(--tweed-muted);
  text-decoration: line-through;
}

.price-note {
  margin: 0 0 22px;
  font: 500 16px var(--font-ui);
  color: var(--tweed-muted);
}

.price-card .ticks li {
  font: 500 17px var(--font-ui);
  color: var(--tweed-ink);
}

.price-card .ticks li::before {
  background: var(--tweed-label);
}

.price-card .btn {
  width: 100%;
  margin-top: 24px;
}

.price-small {
  margin: 14px 0 0;
  font: 500 14px var(--font-ui);
  color: var(--tweed-muted);
  text-align: center;
}

/* ------------------------------------------------------------- faq */

.faq {
  padding: clamp(64px, 9vw, 112px) 0;
}

.faq-list {
  margin-top: 28px;
  border-top: 1px solid var(--rule-strong);
  max-width: 820px;
}

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

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 32px 16px 0;
  position: relative;
  font: 700 20px var(--font-text);
}

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

.faq summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--rubric);
  border-bottom: 2px solid var(--rubric);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 150ms ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq details p {
  margin: 0 0 18px;
  max-width: 40em;
  color: var(--ink);
}

/* ------------------------------------------------------------- closing */

.closing {
  padding: clamp(64px, 9vw, 104px) 0;
  text-align: center;
}

.closing .title {
  font-size: clamp(44px, 7vw, 84px);
}

.closing p {
  margin: 18px auto 30px;
  max-width: 30em;
}

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

.foot {
  padding: 40px 0 56px;
  border-top: 1px solid var(--rule-strong);
  font: 400 15px/1.55 var(--font-ui);
  color: var(--muted);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.foot .brand {
  color: var(--title);
  font-size: 26px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.foot nav a {
  text-decoration: none;
  color: var(--ink);
}

.foot nav a:hover {
  text-decoration: underline;
}

.foot p {
  margin: 0 0 8px;
  max-width: 62em;
}

/* ------------------------------------------------------------- plugins page */

.page-hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(28px, 4vw, 48px);
}

.page-hero .title {
  font-size: clamp(52px, 8vw, 96px);
}

.page-hero .lede {
  margin-top: 22px;
}

.prose-section {
  padding: clamp(40px, 6vw, 72px) 0;
}

.prose-section h2 {
  font-size: clamp(34px, 4.4vw, 48px);
  margin-bottom: 16px;
}

.prose-section p {
  max-width: 38em;
  margin: 0 0 14px;
}

.perm-table {
  width: 100%;
  max-width: 820px;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 18px;
}

.perm-table th,
.perm-table td {
  text-align: left;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.perm-table th {
  font: 700 15px var(--font-label);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--rubric);
  border-bottom-color: var(--rule-strong);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.card {
  padding: 20px 22px;
  background-color: var(--surface);
  background-image: var(--tex-card);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px var(--rule);
}

.card h3 {
  margin: 0 0 6px;
  font: 400 26px/1.1 var(--font-display);
  color: var(--title);
}

.card p {
  margin: 0;
  font-size: 17px;
  color: var(--muted);
}

/* ------------------------------------------------------------- small screens */

@media (max-width: 900px) {
  .top nav a:not(.btn) {
    display: none;
  }

  .feature-grid,
  .feature.flip .feature-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .feature.flip .feature-text {
    order: 0;
  }

  .feature.stack .feature-text {
    grid-template-columns: 1fr;
  }

  .compare {
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 14px;
  }

  .pair .phone {
    width: 150px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 18px;
  }

  .lede {
    font-size: 20px;
  }

  .compare,
  .pair {
    grid-template-columns: 1fr;
  }

  .compare .phone,
  .pair .phone {
    width: 230px;
    margin: 0 auto;
  }

  .promises {
    gap: 6px 18px;
    font-size: 15px;
  }

  .price-card {
    padding: 24px;
  }

  .price-now {
    font-size: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
