/* ==========================================================================
   simonmatthews.ca
   One column, plain text, a dark sky behind it.
   ========================================================================== */

@view-transition { navigation: auto; }

/* between pages the sky and the header stay put; only the words change */
#sky { view-transition-name: sky; }
.top { view-transition-name: top; }
::view-transition-old(root) { animation: vt-out 0.28s var(--ease, ease) both; }
::view-transition-new(root) { animation: vt-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
::view-transition-group(sky), ::view-transition-group(top) { animation-duration: 0s; }
@keyframes vt-out { to { opacity: 0; filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

:root {
  color-scheme: dark;

  --bg: #08080a;
  --fg: #ecebe7;
  --muted: #a3a2a0;
  --dim: #64636a;
  --faint: #34343a;
  --line: rgba(255, 255, 255, 0.085);
  --accent: #ffde00;            /* the yellow dot */
  --tint: var(--accent);        /* per-item hover colour, set inline */

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --col: 37.5rem;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--faint) transparent;
  scroll-padding-top: 2rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--fg);
  font: 400 1.125rem/1.62 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #000; }

img, video, canvas { display: block; max-width: 100%; }

/* ---------- sky ---------- */

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* a faint vignette so the column always reads */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 50% -10%, rgba(255, 222, 0, 0.035), transparent 60%),
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--col) + 2 * clamp(1.25rem, 5vw, 2rem));
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2rem);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.5rem, 5vh, 2.75rem) 0 0;
  font: 400 0.75rem/1 var(--mono);
  letter-spacing: 0.02em;
  color: var(--dim);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--fg);
  text-decoration: none;
}

.dot {
  position: relative;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 222, 0, 0.5), 0 0 14px rgba(255, 222, 0, 0.45);
  flex: none;
  animation: breathe 4.8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 222, 0, 0.0), 0 0 10px rgba(255, 222, 0, 0.35); }
  50%      { box-shadow: 0 0 0 5px rgba(255, 222, 0, 0.06), 0 0 22px rgba(255, 222, 0, 0.55); }
}

.mark:hover .dot { animation-duration: 1.6s; }

.nav { display: flex; gap: 1.4rem; }

.nav a {
  position: relative;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }

.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.65rem;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: var(--accent);
}

main { padding: clamp(4rem, 15vh, 9rem) 0 0; }

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

h1 {
  margin: 0 0 1.4rem;
  font: 400 clamp(2.3rem, 6vw, 2.9rem)/1.04 var(--serif);
  letter-spacing: -0.022em;
}

h1 em, .lede em { font-style: italic; }

.lede {
  margin: 0;
  font-size: clamp(1.18rem, 2.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--fg);
  text-wrap: pretty;
}

.lede + .lede { margin-top: 0.9rem; }

p { margin: 0; text-wrap: pretty; }

code {
  font: 400 0.84em/1 var(--mono);
  padding: 0.12em 0.36em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}

b, strong { font-weight: 500; color: var(--fg); }

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

.meta {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font: 400 0.75rem/1.4 var(--mono);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.meta span { white-space: nowrap; }

.live::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  vertical-align: 0.12em;
  animation: blink 2.4s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0.35; } }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: rgba(255, 255, 255, 0.24);
  transition: text-decoration-color 0.25s var(--ease), color 0.25s var(--ease);
}

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

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

/* the little name hover — the portrait floats up */
.name {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 92%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease-out);
  cursor: default;
}

.name:hover { background-size: 100% 1px; }

/* ---------- sections ---------- */

section { margin-top: clamp(4rem, 11vh, 6rem); }

.label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 0.6rem;
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.label::after {
  content: "";
  order: 1;
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.label .count { order: 2; letter-spacing: 0.04em; color: var(--faint); }

/* ---------- list rows ---------- */

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

.row {
  --mx: 50%;
  position: relative;
  border-bottom: 1px solid var(--line);
}

.row:last-child { border-bottom: 0; }

.row-head {
  position: relative;
  display: grid;
  grid-template-columns: 8.75rem 1fr auto;
  align-items: baseline;
  gap: 1.1rem;
  width: 100%;
  padding: 0.95rem 0;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
}

/* spotlight that follows the pointer along the row */
.row-head::before {
  content: "";
  position: absolute;
  inset: 0 -1rem;
  z-index: -1;
  border-radius: 0.6rem;
  background: radial-gradient(14rem 5rem at var(--mx) 50%, color-mix(in srgb, var(--tint) 9%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.row-head:hover::before, .row.open .row-head::before { opacity: 1; }

.row-name {
  font-size: 1.125rem;
  color: var(--fg);
  white-space: nowrap;
  transition: color 0.3s var(--ease), transform 0.45s var(--ease-out);
}

.row-desc {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.45;
  transition: color 0.3s var(--ease);
}

.row-date {
  font: 400 0.72rem/1 var(--mono);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.row-date .pm {
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  opacity: 0.55;
  transition: transform 0.5s var(--ease-out), opacity 0.3s;
}

.row-date .pm::before, .row-date .pm::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  margin-top: -0.5px;
  background: currentColor;
}

.row-date .pm::after { transform: rotate(90deg); transition: transform 0.5s var(--ease-out); }

.row-date .arrow { transition: transform 0.35s var(--ease-out); opacity: 0.7; }

.row-head:hover .row-name { color: var(--tint); transform: translateX(3px); }
.row-head:hover .row-desc { color: var(--fg); }
.row-head:hover .pm { opacity: 1; }
.row-head:hover .arrow { transform: translate(2px, -2px); opacity: 1; }

.row.open .row-name { color: var(--tint); }
.row.open .pm { transform: rotate(180deg); opacity: 1; }
.row.open .pm::after { transform: rotate(0deg); }

/* ---------- expanding detail ---------- */

.detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease-out);
}

.row.open .detail { grid-template-rows: 1fr; }

.detail-inner {
  min-height: 0;
  overflow: hidden;
}

.detail-body {
  padding: 0.35rem 0 1.9rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.35s var(--ease), transform 0.6s var(--ease-out);
}

.row.open .detail-body {
  opacity: 1;
  transform: none;
  transition-delay: 0.12s;
}

.detail-body > * + * { margin-top: 1rem; }

/* the frame irises open as the row expands */
.row .detail .frame {
  clip-path: inset(6% 4% 6% 4% round 0.6rem);
  transform: scale(0.985);
  transition: clip-path 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.row.open .detail .frame {
  clip-path: inset(0 0 0 0 round 0.6rem);
  transform: none;
}

/* without JavaScript, everything is simply open */
html:not(.js) .detail { grid-template-rows: 1fr; }
html:not(.js) .detail-body { opacity: 1; transform: none; }
html:not(.js) .row .detail .frame { clip-path: none; transform: none; }
html:not(.js) .row-date .pm { display: none; }

.detail-body p { color: #d6d5d1; font-size: 1.06rem; }

.frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #0c0c0f;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 30px 60px -30px rgba(0, 0, 0, 0.9),
    0 0 80px -40px color-mix(in srgb, var(--tint) 50%, transparent);
}

.frame > img, .frame > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.25rem;
  font: 400 0.72rem/1.5 var(--mono);
  color: var(--dim);
  letter-spacing: 0.01em;
}

.facts b { font-weight: 500; color: var(--muted); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font: 400 0.8rem/1.4 var(--mono);
}

.links a { text-decoration-color: color-mix(in srgb, var(--tint) 45%, transparent); }
.links a:hover { color: var(--tint); text-decoration-color: var(--tint); }

/* ---------- floating preview (fine pointers only) ---------- */

.peek {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  width: 19rem;
  aspect-ratio: 16 / 10;
  border-radius: 0.6rem;
  overflow: hidden;
  pointer-events: none;
  background: #0c0c0f;
  opacity: 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 24px 60px -12px rgba(0, 0, 0, 0.85),
    0 0 90px -30px color-mix(in srgb, var(--tint) 70%, transparent);
  transform-origin: 0 50%;
  transition: opacity 0.25s var(--ease), box-shadow 0.4s var(--ease);
  will-change: transform, opacity;
}

.peek.on { opacity: 1; }

.peek > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.peek > .on { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .peek { display: none; }
}

/* ---------- mini crossword (PS Puzzles) ---------- */

.xw-host { container-type: size; }

.xw {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6cqw;
  padding: 0 7cqw;
  height: 100%;
  background:
    radial-gradient(circle at 85% 10%, rgba(191, 219, 254, 0.55), transparent 45%),
    radial-gradient(circle at 10% 100%, rgba(251, 207, 232, 0.5), transparent 45%),
    #fbfaf7;
  color: #111;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.xw-grid {
  --c: 10.6cqh;
  display: grid;
  grid-template-columns: repeat(6, var(--c));
  grid-template-rows: repeat(7, var(--c));
  outline: none;
}

.xw-cell {
  position: relative;
  display: grid;
  place-items: center;
  margin: -0.5px;
  border: 1px solid #c9c9c9;
  background: #fff;
  font-size: calc(var(--c) * 0.52);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  transition: background-color 0.18s;
  cursor: text;
}

.xw-cell.blank { visibility: hidden; }

.xw-cell sup {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: calc(var(--c) * 0.24);
  font-weight: 500;
  color: #555;
  line-height: 1;
}

.xw-cell.word { background: #dbeafe; }
.xw-cell.cur { background: #fde047; }
.xw-cell.ok { color: #1d4ed8; }
.xw-cell.pop { animation: pop 0.32s var(--ease-out); }

@keyframes pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.xw.solved .xw-cell:not(.blank) {
  animation: solve 0.9s var(--ease-out) both;
  animation-delay: calc(var(--i) * 28ms);
}

@keyframes solve {
  0% { background: #fff; }
  40% { background: #bbf7d0; transform: translateY(-8%); }
  100% { background: #f0fdf4; transform: none; }
}

.xw-side {
  display: flex;
  flex-direction: column;
  gap: 3.4cqh;
  min-width: 0;
}

.xw-logo {
  display: flex;
  align-items: center;
  gap: 2.2cqw;
  font-weight: 700;
  font-size: 5.6cqh;
  letter-spacing: -0.02em;
}

.xw-logo img { width: 8.4cqh; height: 8.4cqh; }

.xw-clues {
  display: grid;
  gap: 3.4cqh;
  font-size: 4cqh;
  line-height: 1.3;
  color: #333;
}

.xw-group { display: grid; gap: 1.2cqh; align-content: start; }

.xw-clues b {
  display: block;
  margin-bottom: 0.4cqh;
  font-size: 3.1cqh;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
}

.xw-clues [data-n] { transition: color 0.2s, background-color 0.2s; border-radius: 3px; padding: 0 0.8cqw; margin: 0 -0.8cqw; }
.xw-clues [data-n].act { background: #dbeafe; color: #000; }
.xw-clues [data-n].done { color: #9a9a9a; text-decoration: line-through; text-decoration-color: #bbb; }
.xw-clues span { font-weight: 600; margin-right: 0.35em; }

.xw-status {
  font-size: 3.4cqh;
  color: #777;
  font-variant-numeric: tabular-nums;
  min-height: 1.3em;
}

.xw-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  font-size: 16px;   /* keep iOS from zooming */
}

/* ---------- photo strip ---------- */

.strip {
  display: flex;
  gap: 0.4rem;
  height: 10.5rem;
  margin-top: 0.9rem;
}

.strip a {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 0.4rem;
  transition: flex-grow 0.7s var(--ease-out);
  background: #111;
  text-decoration: none;
}

.strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.75) brightness(0.7) contrast(1.05);
  transform: scale(1.06);
  transition: filter 0.6s var(--ease), transform 1.2s var(--ease-out);
}

.strip a::after {
  content: attr(data-cap);
  position: absolute;
  left: 0.7rem;
  bottom: 0.6rem;
  font: 400 0.66rem/1.2 var(--mono);
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease-out);
}

.strip a:hover::after, .strip a:focus-visible::after {
  opacity: 1;
  transform: none;
  transition-delay: 0.25s;
}

.strip:hover a { flex-grow: 0.7; }
.strip a:hover, .strip a:focus-visible { flex-grow: 4.2; }
.strip a:hover img, .strip a:focus-visible img { filter: none; transform: scale(1); }

@media (hover: none) {
  .strip {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-right: calc(-1 * clamp(1.25rem, 5vw, 2rem));
    padding-right: clamp(1.25rem, 5vw, 2rem);
  }
  .strip::-webkit-scrollbar { display: none; }
  .strip a { flex: 0 0 62%; scroll-snap-align: start; }
  .strip img { filter: none; transform: none; }
}

.more {
  display: inline-block;
  margin-top: 0.9rem;
  font: 400 0.8rem/1.4 var(--mono);
  color: var(--muted);
}

.more:hover { color: var(--fg); }

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

.elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-top: 0.9rem;
}

.copy {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  color: var(--dim);
  font: 400 0.72rem/1 var(--mono);
  cursor: pointer;
  vertical-align: 0.1em;
  margin-left: 0.35rem;
  transition: color 0.2s;
}

.copy:hover { color: var(--fg); }

footer {
  margin-top: clamp(5rem, 14vh, 8rem);
  padding: 1.4rem 0 2.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font: 400 0.6875rem/1.5 var(--mono);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

footer .sat { color: var(--faint); transition: color 0.3s; }
footer .sat.seen { color: var(--muted); }

/* ---------- long-form pages (work, media) ---------- */

.page-head p { color: var(--muted); }

.entry { margin-top: clamp(3.5rem, 9vh, 5rem); scroll-margin-top: 2rem; }

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.entry h2 {
  margin: 0;
  font: 400 1.6rem/1.15 var(--serif);
  letter-spacing: -0.012em;
}

.entry h2 a { text-decoration: none; }
.entry h2 a:hover { color: var(--tint); }

.entry-date {
  font: 400 0.72rem/1 var(--mono);
  color: var(--dim);
  white-space: nowrap;
}

.entry > * + * { margin-top: 1rem; }
.entry .entry-head + * { margin-top: 0; }
.entry p { color: #d6d5d1; }
.entry p.sub { color: var(--muted); font-style: italic; }

.reel {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin-right: calc(-1 * clamp(1.25rem, 5vw, 2rem));
  padding-right: clamp(1.25rem, 5vw, 2rem);
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.reel::-webkit-scrollbar { display: none; }

.reel img {
  height: 12rem;
  width: auto;
  max-width: none;
  border-radius: 0.4rem;
  scroll-snap-align: start;
  background: #111;
}

/* gallery (media page) */

.gallery {
  columns: 3 10rem;
  column-gap: 0.5rem;
}

.gallery button {
  display: block;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  overflow: hidden;
  background: #111;
  cursor: zoom-in;
  break-inside: avoid;
}

.gallery img {
  width: 100%;
  height: auto;
  transition: transform 0.9s var(--ease-out), filter 0.5s var(--ease);
  filter: brightness(0.86);
}

.gallery button:hover img { transform: scale(1.035); filter: none; }

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(5, 5, 7, 0.94);
  color: var(--fg);
  opacity: 0;
  transition: opacity 0.3s var(--ease), overlay 0.3s allow-discrete, display 0.3s allow-discrete;
}

.lightbox[open] { display: grid; place-items: center; opacity: 1; }

@starting-style { .lightbox[open] { opacity: 0; } }

.lightbox::backdrop { background: transparent; }

.lightbox img {
  max-width: min(92vw, 1200px);
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 0.4rem;
  box-shadow: 0 40px 100px -20px #000;
  animation: lb-in 0.45s var(--ease-out);
}

@keyframes lb-in { from { opacity: 0; transform: scale(0.97); } }

.lb-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem clamp(1rem, 4vw, 2rem);
  font: 400 0.72rem/1 var(--mono);
  color: var(--dim);
}

.lb-bar button {
  border: 0;
  padding: 0.5rem 0.25rem;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.lb-bar button:hover { color: var(--fg); }

/* ---------- reveal ---------- */

.js [data-r] {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(5px);
  transition:
    opacity 0.9s var(--ease),
    transform 1.1s var(--ease-out),
    filter 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 1ms);
}

.js [data-r].in { opacity: 1; transform: none; filter: none; }

/* ---------- 404 ---------- */

.lost main { min-height: 60svh; }

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

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }

  .row-head {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name date" "desc desc";
    gap: 0.15rem 1rem;
    padding: 0.9rem 0;
  }

  .row-name { grid-area: name; }
  .row-desc { grid-area: desc; font-size: 0.98rem; }
  .row-date { grid-area: date; }

  .row-head::before { inset: 0 -0.6rem; }

  .strip { height: 12rem; }
  .gallery { columns: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-r] { opacity: 1; transform: none; filter: none; }
}

/* ---------- crossword on phones: stack it, make the squares tappable ---------- */

@media (max-width: 40rem) {
  .frame[data-xw] { aspect-ratio: 4 / 5; }
}

@container (orientation: portrait) {
  .xw {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    justify-items: center;
    gap: 5cqh;
    padding: 0 7cqw;
  }
  .xw-grid { --c: min(11.5cqw, 7cqh); }
  .xw-side { width: 100%; gap: 3cqw; }
  .xw-logo { font-size: 5cqw; gap: 2.4cqw; }
  .xw-logo img { width: 7cqw; height: 7cqw; }
  .xw-clues { font-size: 3.9cqw; gap: 1.4cqw; grid-template-columns: 1fr 1fr; column-gap: 5cqw; }
  .xw-clues b { font-size: 2.9cqw; }
  .xw-status { font-size: 3.4cqw; }
}

/* ---------- visually hidden, still read by screen readers and search engines ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
