/* rain's site, drawn from the plugin's own palette: the palest tint of water for the
   ground, a deep navy ink at a few opacities, one family of blues from deep to shallow,
   Roboto Mono throughout, lowercase, rounded ends, no shadows. */

@font-face {
  font-family: "Roboto Mono";
  src: url("fonts/RobotoMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: url("fonts/RobotoMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ground-top: #f5f8fc;
  --ground-bottom: #e9eff6;
  --card: #fafcfe;

  --ink: #122540;
  --text-strong: rgba(18, 37, 64, 0.78);
  --text: rgba(18, 37, 64, 0.56);
  --text-dim: rgba(18, 37, 64, 0.38);
  --text-faint: rgba(18, 37, 64, 0.24);
  --hairline: rgba(18, 37, 64, 0.08);

  --deep: #1c4596;
  --mid: #2372cc;
  --shallow: #3a9ee0;

  --column: 760px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  background: linear-gradient(var(--ground-top), var(--ground-bottom)) fixed;
  color: var(--text-strong);
  font: 400 14px/1.6 "Roboto Mono", ui-monospace, monospace;
  letter-spacing: 0.01em;
}

a { color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--column);
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}

.wordmark {
  color: var(--ink);
  font-weight: 500;
  font-size: 17px;
  text-decoration: none;
}

.by {
  color: var(--text-faint);
  font-size: 11.5px;
}

.top .buy { margin-left: auto; }

/* --- buttons: a capsule of deep water, like the plugin's own controls ----------------- */

.buy {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--deep);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.buy:hover { background: var(--mid); }
.buy:focus-visible { outline: 2px solid var(--shallow); outline-offset: 3px; }

.buy.small {
  padding: 6px 14px;
  font-size: 12px;
  background: rgba(18, 37, 64, 0.06);
  color: var(--ink);
}

.buy.small:hover { background: rgba(18, 37, 64, 0.1); }

/* No fade into it: it's set as the page loads, and a fade showed as a flash of blue. */
.buy[aria-disabled="true"] {
  background: rgba(18, 37, 64, 0.06);
  color: var(--text-dim);
  cursor: default;
  transition: none;
}

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

main {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}

section { padding: 56px 0 0; }

h1 {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.005em;
}

h2 {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}

p { margin: 0; }

.hero { padding-top: 64px; }

.lede {
  margin-top: 10px;
  color: var(--text);
}

/* The live display: the plugin's spectrum, in miniature. */
.stage {
  position: relative;
  margin-top: 36px;
}

#spectrum {
  display: block;
  width: 100%;
  height: 230px;
  touch-action: pan-y;   /* scrolling still works; sideways drags move the curve */
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#spectrum.held { cursor: grabbing; }

.hint {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  color: var(--text-faint);
  font-size: 10.5px;
  pointer-events: none;
}

/* The demo's controls, under the display: listen, filled with deep water while it plays,
   then the weather, each tinted while it's on. Capsules like the plugin's own controls; on
   one row while they fit, and on a phone listen across the top and the weather in a row of
   even columns under it (see below). */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.listen,
.weather {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 37, 64, 0.06);
  color: var(--ink);
  font: 500 12px/1 "Roboto Mono", ui-monospace, monospace;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease;
}

.listen { padding-left: 12px; margin-right: 6px; }
.weather { gap: 6px; padding-left: 12px; }
.emoji { font-size: 15px; line-height: 1; }
.listen svg { width: 13px; height: 13px; }
.listen:hover, .weather:hover { background: rgba(18, 37, 64, 0.1); }
.listen:focus-visible, .weather:focus-visible { outline: 2px solid var(--shallow); outline-offset: 3px; }
.listen[data-playing="true"] { background: var(--deep); color: #fff; }
.listen[data-playing="true"]:hover { background: var(--mid); }
.listen:disabled { color: var(--text-dim); cursor: default; }
.weather[aria-pressed="true"] { background: rgba(35, 114, 204, 0.16); color: var(--deep); }
.weather[aria-pressed="true"]:hover { background: rgba(35, 114, 204, 0.22); }

.price {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

.was {
  color: var(--text-faint);
  font-size: 16px;
}

.was s { text-decoration-thickness: 1px; }

.now {
  color: var(--ink);
  font-weight: 500;
  font-size: 30px;
  line-height: 1;
}

.price .buy { margin-left: 8px; }

/* What's in the box, under the price: two short, quiet lines, the same on any screen. */
.terms {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 11.5px;
}

/* --- screenshot: the plugin as it is, edged with a hairline rather than lifted on a shadow */

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1520 / 950;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--ground-bottom);
}

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

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  max-width: var(--column);
  margin: 64px auto 0;
  padding: 24px max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  border-top: 1px solid var(--hairline);
  color: var(--text-faint);
  font-size: 11.5px;
}

footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

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

.legal section { padding-top: 40px; }
.legal p, .legal li { color: var(--text); font-size: 13px; }
.legal p + p { margin-top: 10px; }
.legal ul { margin: 10px 0 0; padding-left: 18px; }

/* --- narrow screens ----------------------------------------------------------------- */

@media (max-width: 620px) {
  .by { display: none; }
  .hero { padding-top: 36px; }
  .stage { margin-top: 26px; }
  #spectrum { height: 190px; }
  .price { gap: 12px; flex-wrap: wrap; margin-top: 32px; }
  .price .buy { margin-left: 0; }
}

/* Fingers, not pointers: controls big enough to hit without looking (44px, Apple's
   guide). */
@media (pointer: coarse) {
  .listen, .weather { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .listen { padding-left: 13px; margin-right: 0; }
  .weather { padding: 0 13px 0 11px; }
  .controls { gap: 7px; }
}

/* A small phone: a little tighter, so each still fits its column. */
@media (pointer: coarse) and (max-width: 380px) {
  .listen, .weather { font-size: 12.5px; }
  .listen { padding: 0 11px; }
  .weather { padding: 0 11px 0 9px; gap: 5px; }
  .controls { gap: 6px; }
}

/* Too narrow for listen and the weather on one row: listen across the top, and the four
   kinds of weather under it in even columns, rather than a row and a ragged remainder.
   After the rules above, so its tighter padding wins: each column centres its own. */
@media (max-width: 560px) {
  .controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .listen { grid-column: 1 / -1; margin-right: 0; }
  .weather { padding-left: 4px; padding-right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .buy, .listen, .weather { transition: none; }
}
