:root {
  --paper: #f4eee2;
  --ink: #3b2f23;
  --ink-soft: #6b5a46;
  --line: #b9a280;
  --rust: #8c3b1f;
  --serif: "Cormorant Garamond", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* the fonts are Latin-only subsets, each under the SIL Open Font License (its
   text beside it). one file serves every weight of a variable font, and Roboto
   Mono holds only the timers' digits and colon */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 500 600;
  font-display: block;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 500;
  font-display: block;
}
@font-face {
  font-family: Figtree;
  src: url("fonts/figtree.woff2") format("woff2");
  font-weight: 400 650;
  font-display: block;
}
@font-face {
  font-family: Inter;
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 700 800;
  font-display: block;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: Lato;
  src: url("fonts/lato-400.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: Lato;
  src: url("fonts/lato-700.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("fonts/roboto-mono-digits.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}

/* the page stays hidden until its fonts load (index.html, script.js) */
html.waiting body { visibility: hidden; }

* { box-sizing: border-box; }

html { background: var(--paper); }

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

/* iPhones get no gray tap box, since each element shows its own press the way
   it shows a hover (script.js turns on :active) */
html { -webkit-tap-highlight-color: transparent; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 252, 244, 0.9), transparent 70%),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
}

/* the background is a faint grid of random letters hiding AREPO (script.js) */
#cipher {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}

.sketches {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.sketch {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  color: var(--line);
}

.sketch.main {
  left: 50%;
  top: 40px;
  width: min(1100px, 150vw);
  transform: translateX(-50%);
  opacity: 0.55;
}

.sketch.corner-tr {
  right: -60px;
  top: -40px;
  width: 320px;
  opacity: 0.5;
}

.sketch.corner-bl {
  left: -70px;
  bottom: -30px;
  width: 300px;
  opacity: 0.45;
}

.page {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

header {
  display: flex;
  justify-content: center;
  padding-top: 44px;
}

/* the title isn't a link on the home page, since there's nowhere else to go; on
   the 404 page it links home */
.wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: var(--ink);
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

.wordmark svg { width: 64px; height: 64px; flex: none; }

a.wordmark { text-decoration: none; }

a.wordmark:active { opacity: 0.7; }

@media (hover: hover) {
  a.wordmark:hover { opacity: 0.7; }
}

.contact {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 13px;
}

.contact a,
.lost .intro a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.contact a { padding-bottom: 2px; }

.contact a:active,
.lost .intro a:active { border-bottom-color: var(--ink); }

@media (hover: hover) {
  .contact a:hover,
  .lost .intro a:hover { border-bottom-color: var(--ink); }
}

.copy {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.copy:active { color: var(--ink); }

@media (hover: hover) {
  .copy:hover { color: var(--ink); }
}

.copy svg { width: 17px; height: 17px; }

.copy .done { display: none; color: var(--rust); }
.copy.copied .idle { display: none; }
.copy.copied .done { display: block; }

/* the note is only for screen readers, since the check shows it */
.copy-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.intro {
  text-align: center;
  margin: 22px auto 72px;
  max-width: 720px;
}

.intro p {
  margin: 0;
  font-size: 24px;
  font-style: italic;
  color: var(--ink-soft);
  text-wrap: balance;
}

.figures {
  --col: min(460px, calc((100% - 48px) / 2));
  --half: calc(var(--col) / 2);
  display: grid;
  grid-template-columns:
    calc(var(--half) + 24px) calc(var(--half) - 24px) 48px
    calc(var(--half) - 24px) calc(var(--half) + 24px);
  grid-template-rows: auto auto 60px auto auto;
  justify-content: center;
}

figure { display: contents; }
figure > .app,
figure > figcaption { position: relative; z-index: 1; min-width: 0; }
figure > .app { margin: 14px 14px 0; }
figure > .frame { grid-row-end: span 2; }

@media (min-width: 761px) {
  figure:nth-child(1) > * { grid-column: 1 / 3; }
  figure:nth-child(2) > * { grid-column: 4 / 6; }
  figure:nth-child(3) > * { grid-column: 2 / 5; }
  figure:nth-child(-n+2) > .frame,
  figure:nth-child(-n+2) > .app { grid-row-start: 1; }
  figure:nth-child(-n+2) > figcaption { grid-row: 2; }
  figure:nth-child(3) > .frame,
  figure:nth-child(3) > .app { grid-row-start: 4; }
  figure:nth-child(3) > figcaption { grid-row: 5; }
}

/* on a wide screen, the page widens so the three cards fit in one row, each
   with room for its name on one line */
@media (min-width: 1360px) {
  .page { max-width: 1480px; }
  .figures {
    grid-template-columns: repeat(3, minmax(0, 440px));
    grid-template-rows: auto auto;
    column-gap: 40px;
  }
  figure:nth-child(1) > * { grid-column: 1; }
  figure:nth-child(2) > * { grid-column: 2; }
  figure:nth-child(3) > * { grid-column: 3; }
  figure:nth-child(n) > .frame,
  figure:nth-child(n) > .app { grid-row-start: 1; }
  figure:nth-child(n) > figcaption { grid-row: 2; font-size: 16px; }
}

/* each card's frame is a shade lighter than the page, so the background letters
   stay out of its words */
.frame {
  position: relative;
  z-index: 0;
  border: 1px solid var(--line);
  background: #fbf8f1;
}

.frame::before,
.frame::after,
.frame > .tick-a,
.frame > .tick-b {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--ink);
  border-style: solid;
  border-width: 0;
}

.frame::before { left: -7px; top: -7px; border-left-width: 1px; border-top-width: 1px; }
.frame::after { right: -7px; bottom: -7px; border-right-width: 1px; border-bottom-width: 1px; }
.frame > .tick-a { right: -7px; top: -7px; border-right-width: 1px; border-top-width: 1px; }
.frame > .tick-b { left: -7px; bottom: -7px; border-left-width: 1px; border-bottom-width: 1px; }

figcaption {
  margin: 0 14px 14px;
  padding: 16px var(--text-in, 18px) 10px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
}

/* on a narrower window, captions shrink a little so side-by-side ones still
   take the same number of lines */
@media (min-width: 761px) and (max-width: 1040px) {
  figcaption { font-size: 16px; --text-in: 12px; }
}

/* hyphenated words and a caption's last two words stay together, so no line
   ends on one word alone */
.whole { white-space: nowrap; }

.app {
  --pad: 26px;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: var(--pad);
  text-decoration: none;
  /* holding a card does nothing: no link preview, menu, text selection, or drag
     (a linked card also sets draggable="false" for Firefox). a tap still opens
     it */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.frame,
.frame::before,
.frame::after,
.frame > i { transition: border-color 0.2s, width 0.2s, height 0.2s; }

/* only a linked card darkens its frame when hovered or pressed. hover applies
   only with a pointer, so a tap on a phone doesn't leave it dark */
figure:has(a.app:active) > .frame { border-color: var(--ink); }
figure:has(a.app:active) > .frame::before,
figure:has(a.app:active) > .frame::after,
figure:has(a.app:active) > .frame > i { width: 28px; height: 28px; }

@media (hover: hover) {
  figure:has(a.app:hover) > .frame { border-color: var(--ink); }
  figure:has(a.app:hover) > .frame::before,
  figure:has(a.app:hover) > .frame::after,
  figure:has(a.app:hover) > .frame > i { width: 28px; height: 28px; }
}

a.app:active .go { opacity: 0.7; }

.app-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-head svg { flex: none; }

.app-name { margin: 0; line-height: 1; }

.app-tag { margin: 6px 0 0; }

.go {
  margin-top: auto;
  align-self: flex-start;
}

/* Tempo's card */
.tempo {
  background: #000;
  border-radius: 26px;
  color: #fff;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
}

.tempo .app-name { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.tempo .app-tag { color: #ff3d99; font-size: 15px; font-weight: 600; }

/* the app's chat at 15/17 scale, measured on its screenshots: 17pt text in
   40pt bubbles, each timer's middle 8.8pt under its bubble and 11.8pt over
   the next */
.chat { display: flex; flex-direction: column; }

/* the app keeps 48pt clear on a bubble's far side */
.bubble {
  max-width: calc(100% - 42px);
  text-wrap: pretty;
  padding: 9px 14px;
  border-radius: 17px;
  font-size: 15px;
  line-height: 18px;
}

.bubble.in { background: #2b2b2b; align-self: flex-start; }
.bubble.out { background: #ff3d99; color: #000; align-self: flex-end; }

/* Roboto Mono stands in for the app's SF Mono (both slash the zero) where
   Apple's fonts are missing, a little bigger than the app's 11pt would scale
   to */
.timer {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 13px;
  margin: 2px 6px 4px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #999;
}

.timer.mine { align-self: flex-end; }

.timer svg { width: 10px; height: 10px; overflow: visible; }

/* coming soon is a status, not a button, so it's outlined (as on
   tempomessenger.com), padded to a filled button's size, and square-cornered so
   it never reads as a message bubble */
.tempo .go {
  padding: 9.5px 18.5px;
  border: 1.5px solid #ff3d99;
  border-radius: 12px;
  color: #ff3d99;
  font-size: 15px;
  font-weight: 600;
  /* on a narrow phone, its words wrap into two even, centered lines */
  text-wrap: balance;
  text-align: center;
}

/* TimeMatch's card */
.timematch {
  background: #fff;
  border-radius: 20px;
  color: #0b1b3f;
  font-family: Lato, sans-serif;
  box-shadow: 0 1px 3px rgba(59, 47, 35, 0.1);
}

.timematch .app-name {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.timematch .app-name b { color: #0a78f8; font-weight: 700; }
/* the ® is small and raised, as on timematch.us, without changing the line
   height */
.timematch .app-name sup {
  position: relative;
  top: -0.8em;
  margin-left: 1px;
  color: #4a5568;
  font-size: 0.5em;
  line-height: 0;
  vertical-align: baseline;
}
.timematch .app-tag { color: #4a5568; font-size: 15px; }

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-size: 13px;
}

.days .dow { color: #8a94a6; font-weight: 700; font-size: 11px; }

.days .d {
  padding: 8px 0;
  border-radius: 9px;
  background: #f1f4f9;
  font-weight: 700;
}

.days .d.on { background: #0a78f8; color: #fff; }

/* side by side, the week grows a little and sits midway between the title
   and the button, so this card is as tall as Tempo's */
@media (min-width: 761px) {
  .timematch .days { margin: auto 0; gap: 10px 8px; font-size: 15px; }
  .timematch .days .dow { font-size: 12px; }
  .timematch .days .d { padding: 12px 0; border-radius: 11px; }
  .timematch .go { margin-top: 0; }
}

.timematch .go {
  padding: 11px 20px;
  border-radius: 12px;
  background: #0a78f8;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

/* Cadence8's card */
.cadence8 {
  background: #1b1b1d;
  border-radius: 20px;
  color: #ecebe8;
  font-family: Figtree, sans-serif;
}

.cadence8 .app-name { font-size: 30px; font-weight: 650; letter-spacing: -0.01em; }
.cadence8 .app-tag { color: #8a8a90; font-size: 15px; }

/* the logo's dots touch its edges, so overflow stays visible and clipping
   can't shave them */
.cadence8 .app-head svg { overflow: visible; }

.board { display: block; width: 100%; height: auto; }

.board text {
  font-size: 20.8px;
  font-weight: 650;
  text-anchor: middle;
  dominant-baseline: central;
}

/* side by side, the board is centered between the title and the button, like
   TimeMatch's week */
@media (min-width: 761px) {
  .cadence8 .board { margin: auto 0; }
  .cadence8 .go { margin-top: 0; }
}

/* coming soon is outlined in the game's pill shape and padded to a filled
   button's size */
.cadence8 .go {
  padding: 9.5px 18.5px;
  border: 1.5px solid #ecebe8;
  border-radius: 999px;
  color: #ecebe8;
  font-size: 15px;
  font-weight: 600;
}

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 96px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 17px;
  color: var(--ink-soft);
}

/* the copy icon itself, not its button, lines up with the rule's end */
footer .contact { margin-right: -11px; }

.legal { margin: 0; }

/* 404 page */
.lost {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.lost main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lost .intro { margin: 48px auto; }

.lost h1 {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
}

.lost footer { margin-top: 0; }

@media (max-width: 760px) {
  .page { padding: 20px 16px 32px; }
  header { padding-top: 28px; }
  .wordmark { font-size: 36px; gap: 12px; }
  .wordmark svg { width: 52px; height: 52px; }
  .intro { margin: 18px auto 52px; }
  .intro p { font-size: 21px; }
  .lost h1 { font-size: 29px; }
  /* stacked cards */
  .figures {
    --col: 100%;
    grid-template-columns: 100%;
    grid-template-rows: auto auto 56px auto auto 56px auto auto;
  }
  figure > * { grid-column: 1; }
  figure:nth-child(1) > .frame, figure:nth-child(1) > .app { grid-row-start: 1; }
  figure:nth-child(1) > figcaption { grid-row: 2; }
  figure:nth-child(2) > .frame, figure:nth-child(2) > .app { grid-row-start: 4; }
  figure:nth-child(2) > figcaption { grid-row: 5; }
  figure:nth-child(3) > .frame, figure:nth-child(3) > .app { grid-row-start: 7; }
  figure:nth-child(3) > figcaption { grid-row: 8; }
  figcaption { --text-in: 16px; font-size: 18px; }
  .app { min-height: 0; --pad: 22px; }
  /* "Tempo Messenger" stays on one line on a phone */
  .tempo .app-name { font-size: min(24px, 5.9vw); }
  /* 176px covers the margins, padding, icon, and gap beside the name, so
     "TimeMatch®" (about 5.7em) fits on a narrow phone */
  .timematch .app-name { font-size: min(31px, calc((100vw - 176px) * 0.17)); }
  /* each subtitle gets its own line at the card's full width, without wrapping:
     15px wherever TimeMatch's (the longest) fits, and a little smaller below
     that */
  .app-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
  }
  .app-head > div { display: contents; }
  .app-head .app-tag {
    grid-column: 1 / -1;
    margin: 0;
    white-space: nowrap;
    font-size: min(15px, calc((100vw - 104px) * 0.0639));
  }
  .sketch.corner-tr { width: 220px; }
  .sketch.corner-bl { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .frame, .frame::before, .frame::after, .frame > i { transition: none; }
}
