/* sferics.co.uk: the page is an unlit LCD; the watches are the only colour on it. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --page: #cdd3c6;      /* unlit LCD (also PAGE in tools/make_assets.py) */
  --ink: #1d231b;       /* LCD ink (also INK in tools/make_assets.py) */
  --muted: #4a5446;     /* secondary text, 6:1 on --page */
  --red: #821e26;       /* the Red LCD theme: keyboard focus */
  --bezel: #1d231b;
  --measure: 38rem;
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.55 "Atkinson Hyperlegible Next", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1.25rem, 5vw, 3rem) 3rem;
  max-width: 60rem;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

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

p { margin: 0 0 1em; max-width: var(--measure); }

/* ---------- header ---------- */
.masthead {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 4vw, 2.5rem);
  align-items: center;
  margin-bottom: clamp(3rem, 9vw, 6rem);
}
.masthead h1 { margin: 0; line-height: 0; }
.logo { width: clamp(6.5rem, 20vw, 11rem); }
.lede {
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.3;
  font-weight: 500;
  max-width: 26em;
}

/* ---------- a watch face ---------- */
.face h2, .variant h3 { margin: 0 0 1.5rem; line-height: 0; }
/* Watch-face names in the watch's dot font: --w is the SVG's width in dots, so every title has the same dot size. */
.dot-title { --dot: 6px; width: min(100%, calc(var(--w) * var(--dot))); }
.dot-title.small { --dot: 4px; }

.showcase {
  margin: 0 0 2.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem 2.5rem;
  align-items: center;
}

.watch {
  width: min(100%, 390px);
  border-radius: 50%;
  box-shadow: 0 0 0 0.6rem var(--bezel);
  margin: 0.6rem;                 /* room for the bezel */
  image-rendering: pixelated;
}

.themes { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.themes[hidden] { display: none; }
.themes button {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 1rem 0.35rem 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}
.themes button:hover { border-color: var(--muted); }
.themes button[aria-pressed="true"] { border-color: var(--ink); font-weight: 700; }
.swatch {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bezel);
}
.swatch.red { background: #821e26; }
.swatch.grey { background: #8c9684; }
.swatch.black { background: #000; }

.prose { margin-bottom: 3.5rem; }

.variant { margin: 0 0 3.5rem; }
.variant h3 { font-size: 1.25rem; line-height: 1.3; font-weight: 700; }
.variant h3:has(img) { line-height: 0; }

.pair {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  align-items: center;
  margin-top: 1.5rem;
}
.pair img { image-rendering: pixelated; }   /* native size (width/height attributes): every dot stays even */
.pair img[src^="/img/ride"] { border-radius: 50%; box-shadow: 0 0 0 0.5rem var(--bezel); margin: 0.5rem; }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.75rem 2rem;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);   /* closes this watch face's entry */
  max-width: calc(var(--measure) + 10rem);
}
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }

/* ---------- contact ---------- */
.contact { margin-top: clamp(4rem, 10vw, 7rem); }
.contact h2 { font-size: 1.25rem; margin: 0 0 0.5rem; }
.contact a { font-weight: 700; }
.small { font-size: 0.875rem; color: var(--muted); margin-top: 2.5rem; }

/* ---------- narrow screens ---------- */
@media (max-width: 40rem) {
  .masthead { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: 1fr; }
  .themes { flex-direction: row; flex-wrap: wrap; }
  .facts { grid-template-columns: 1fr; gap: 0.25rem; }
  .facts dd + dt { margin-top: 0.75rem; }
}
