/* onevalidword.com: the app's paper-and-crossword look, from Colours.xcassets. */

:root {
  color-scheme: light dark;

  --eggshell: #F4F1E1;
  --parchment: #EADFC5;
  --burlywood: #D9BC82;
  --linen: #EFE6CF;
  --wenge: #54494B;
  --tile-letter: #F4F1E1;
  --earth-yellow: #DBAD6A;
  --ink: #3B3434;
  --graphite: #5A5252;
  --pewter: #6B6363;
  --rust: #B84E08;
  --frame: #3B3434;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: clamp(16px, 5vw, 48px);
  --measure: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --eggshell: #54494B;
    --parchment: #63575A;
    --burlywood: #78657B;
    --linen: #5D5154;
    --wenge: #F4F1E1;
    --tile-letter: #54494B;
    --earth-yellow: #78657B;
    --ink: #F6F1E3;
    --graphite: #DDD5C7;
    --pewter: #CFC6B8;
    --rust: #FFB366;
    --frame: #2A2525;
  }
}

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

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

body {
  margin: 0;
  background: var(--eggshell);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration-color: var(--burlywood);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

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

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip:focus {
  left: var(--gutter);
  top: 12px;
  padding: 8px 14px;
  background: var(--parchment);
  border: 1.5px solid var(--burlywood);
  border-radius: 12px;
  z-index: 10;
}

/* Letter tiles, drawn like LetterView: corners 16% of the width, letter about half the height. */

.tiles {
  --tile: clamp(34px, 9.2vw, 64px);
  --gap: calc(var(--tile) * 0.14);
  display: grid;
  grid-template-columns: repeat(7, var(--tile));
  gap: var(--gap);
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
}

.tile {
  display: grid;
  place-items: center;
  width: var(--tile);
  height: calc(var(--tile) * 1.12);
  border-radius: calc(var(--tile) * 0.16);
  background: var(--wenge);
  color: var(--tile-letter);
  font-size: calc(var(--tile) * 0.52);
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.tile.in-place {
  background: var(--earth-yellow);
  color: var(--ink);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tile:hover {
    transform: translateY(-6px) rotate(-3deg);
  }
}

/* Site header on the inner pages. */

.site-header {
  padding: 20px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 0.9375rem;
  color: var(--graphite);
}

/* Home: hero. */

.hero {
  padding: clamp(32px, 7vw, 88px) 0 clamp(40px, 6vw, 72px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}

/* Seven columns and their gaps fill the hero's text column, up to 64 px a tile. */
.hero-text {
  container-type: inline-size;
}

.hero .tiles {
  --tile: clamp(30px, calc(100cqi / 7.9), 64px);
}

.hero .tiles .r2 {
  grid-column-start: 2;
}

.hero .tiles .r3 {
  grid-column-start: 4;
}

.lede {
  margin: clamp(28px, 4vw, 44px) 0 0;
  max-width: 22ch;
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.6vw, 2.625rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.sub {
  margin: 18px 0 0;
  max-width: 34ch;
  color: var(--graphite);
  font-size: 1.1875rem;
}

.cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 28px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--wenge);
  color: var(--tile-letter);
  font-weight: 600;
  text-decoration: none;
}

/* Not a button yet: a dashed outline, like a streak badge before the day's puzzle. */
.pill.soon {
  margin: 0;
  border: 1.5px dashed var(--pewter);
  background: transparent;
  color: var(--ink);
}

.pill svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.cta-note {
  color: var(--pewter);
  font-size: 0.9375rem;
}

/* A phone-shaped frame for the 9:16 clips. */

.phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 10px;
  border-radius: 44px;
  background: var(--frame);
  box-shadow: 0 24px 48px -24px rgba(59, 52, 52, 0.45);
}

.phone video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 34px;
  background: var(--eggshell);
}

/* Sections. */

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

h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.625rem, 3vw, 2.125rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section-intro {
  margin: 0 0 28px;
  max-width: 52ch;
  color: var(--graphite);
}

.rule {
  height: 1.5px;
  border: 0;
  margin: 0;
  background: var(--burlywood);
}

/* Cards: Parchment with a 1.5 pt Burlywood edge, like surface(in:). */

.card {
  padding: 24px;
  border: 1.5px solid var(--burlywood);
  border-radius: 20px;
  background: var(--parchment);
}

.card h3 {
  margin: 14px 0 6px;
  font-family: var(--display);
  font-size: 1.3125rem;
  line-height: 1.25;
}

.card p {
  margin: 0;
  color: var(--graphite);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card .mini-tiles {
  display: flex;
  gap: 5px;
}

.card .mini-tiles span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 34px;
  border-radius: 5px;
  background: var(--wenge);
  color: var(--tile-letter);
  font-weight: 700;
  font-size: 1rem;
}

.card .mini-tiles span.in-place {
  background: var(--earth-yellow);
  color: var(--ink);
}

.demos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.demo {
  margin: 0;
}

.demo .phone {
  max-width: 260px;
  padding: 8px;
  border-radius: 36px;
}

.demo .phone video {
  border-radius: 28px;
}

.demo figcaption {
  max-width: 30ch;
  margin: 16px auto 0;
  color: var(--graphite);
  text-align: center;
}

.demo figcaption strong {
  display: block;
  color: var(--ink);
}

.quiet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

/* Read-only, so plain text rather than chips that would look tappable. */
.nots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
}

.nots li:not(:last-child)::after {
  content: "·";
  margin: 0 12px;
  color: var(--burlywood);
}

.quiet p {
  margin: 0 0 14px;
  color: var(--graphite);
}

/* Inner pages: running text. */

.page {
  padding: clamp(16px, 4vw, 40px) 0 clamp(48px, 7vw, 88px);
}

.prose {
  max-width: 68ch;
}

.prose h1 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.prose .updated {
  margin: 0 0 32px;
  color: var(--pewter);
  font-size: 0.9375rem;
}

.prose h2 {
  margin-top: 40px;
  font-size: 1.5rem;
}

.prose h3 {
  margin: 28px 0 4px;
  font-size: 1.125rem;
}

.prose p,
.prose li {
  color: var(--graphite);
}

.prose strong {
  color: var(--ink);
}

.prose ul {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: 6px;
}

.callout {
  margin: 24px 0;
}

.callout p {
  margin: 0;
}

.facts {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 0;
}

.facts th,
.facts td {
  padding: 10px 0;
  border-bottom: 1.5px solid var(--burlywood);
  text-align: left;
  vertical-align: top;
}

.facts th {
  width: 34%;
  padding-right: 16px;
  color: var(--ink);
  font-weight: 600;
}

.facts td {
  color: var(--graphite);
}

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.downloads a {
  display: block;
  padding: 14px;
  border: 1.5px solid var(--burlywood);
  border-radius: 16px;
  background: var(--parchment);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

.downloads img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 10px;
  border-radius: 22%;
}

.downloads small {
  display: block;
  color: var(--pewter);
  font-weight: 400;
}

/* Footer. */

.site-footer {
  padding: 28px 0 40px;
  color: var(--pewter);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  /* The rule spans the text, not the gutters. */
  background: linear-gradient(var(--burlywood), var(--burlywood)) center top / calc(100% - 2 * var(--gutter)) 1.5px no-repeat;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* Narrow windows: one column. */

@media (max-width: 820px) {
  .hero .wrap,
  .quiet {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero .phone {
    max-width: 280px;
  }

  .pillars,
  .demos {
    grid-template-columns: minmax(0, 1fr);
  }

  .demos {
    gap: 40px;
  }
}

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