/* site/page.css — the visitor page (SPEC §6). Dark only. One accent. */

:root {
  --bg: #0c0c0b;
  --surf: #151413;
  --surf2: #1d1c1a;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .16);
  --ink: #ecebe7;
  --ink2: #b4b2ac;
  --ink3: #7f7d77;
  --accent: #d9b56a;
  --fdisp: "Iowan Old Style", Charter, "Hoefler Text", Georgia, serif;
  --fbody: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --fmono: "SF Mono", Menlo, monospace;
  --gap: 10px;
  --radius: 18px;
}

* { box-sizing: border-box; }

/* An author rule like `.pill { display: inline-block }` out-ranks the UA's
   [hidden]{display:none}. page.js toggles .hidden, so make it win. */
[hidden] { display: none !important; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fbody);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

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

.wrap { max-width: 1180px; margin: 0 auto; padding: 40px 20px; }

/* owner-only note, shown while the page is not published */
.strip {
  margin: 0 0 22px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surf);
  font-size: 13px;
  color: var(--ink3);
}
.strip a { color: var(--accent); }
.strip a:hover { color: var(--ink); }

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

.head { display: flex; gap: 18px; align-items: flex-start; margin: 0 0 28px; }

.avatar {
  width: 72px; height: 72px; flex: 0 0 72px;
  border-radius: 50%;
  background: var(--surf2);
  border: 1px solid var(--line);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fdisp); font-size: 30px; color: var(--ink2);
  overflow: hidden;
}
img.avatar { display: block; }

.who { min-width: 0; }

.name {
  font-family: var(--fdisp);
  font-size: 34px;
  line-height: 1.15;
  font-weight: 400;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}

.handle {
  font-family: var(--fmono);
  font-size: 14px;
  color: var(--accent);
  margin: 0 0 10px;
  display: block;
}

.bio {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink2);
  max-width: 640px;
  margin: 0;
}

/* -------------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  grid-auto-rows: auto;
  grid-auto-flow: dense;   /* 2x2/2x1 tiles leave holes otherwise */
  align-items: stretch;
}

.tile {
  position: relative;
  min-width: 0;
  border-radius: var(--radius);
  background: var(--surf);
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 1;
}

.s-2x1 { grid-column: span 2; aspect-ratio: 2; }
.s-2x2 { grid-column: span 2; grid-row: span 2; aspect-ratio: 1; }

.tile:hover { border-color: var(--line2); }

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  color: inherit;
  font: inherit;
  text-align: left;
  background: none;
  border: 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
button.card { cursor: pointer; }

/* ------------------------------------------------------------------- media */

.fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: var(--surf2);
}
.fit-cover { object-fit: cover; }
.fit-contain { object-fit: contain; }

/* ------------------------------------------------------------- text pieces */

.t {
  font-family: var(--fdisp);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
  display: block;
}

.s {
  font-family: var(--fbody);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink2);
  margin: 4px 0 0;
  display: block;
}

.meta { margin-top: auto; }

/* caption strip over a picture / video — solid, no shadow, no blur */
.cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px;
  background: var(--surf);
  border-top: 1px solid var(--line);
  display: block;
}
.cap .s { margin-top: 2px; }

/* -------------------------------------------------------------------- pill */

.pill {
  font-family: var(--fmono);
  font-size: 11px;
  line-height: 1;
  color: var(--accent);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 5px 9px;
  display: inline-block;
  align-self: flex-start;
  margin-top: 10px;
  white-space: nowrap;
}

.pill.hdr {
  position: absolute;
  top: 12px; right: 12px;
  margin: 0;
  background: var(--surf);
  z-index: 2;
}

/* -------------------------------------------------------------------- link */

.t-link .icon {
  width: 64px; height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surf2);
  border: 1px solid var(--line);
  display: block;
  flex: 0 0 auto;
}

/* icon at the top, words at the bottom — the same shape whether or not there is
   an icon, so a row of link tiles lines up. */
.t-link .meta { margin-top: auto; min-height: 0; padding-top: 12px; }
.t-link .card { justify-content: flex-start; }

/* out of the flow, so a long subtitle can never push it past the bottom edge */
.t-link .pill {
  position: absolute;
  top: 12px; right: 12px;
  margin: 0;
  background: var(--surf);
}
.t-link .icon + .meta { padding-right: 0; }
.t-link .s {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

/* --------------------------------------------------------------- text tile */

.t-text .card { justify-content: center; }
.t-text .meta { margin: 0; }
.t-text .t { font-size: 22px; }
.t-text .s { font-size: 15px; margin-top: 8px; color: var(--ink2); }

/* ------------------------------------------------------------ youtube gate */

.gate .play {
  position: absolute;
  left: 50%; top: 50%;
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: var(--surf);
  border: 1px solid var(--line2);
  z-index: 2;
}
.gate .play::after {
  content: "";
  position: absolute;
  left: 23px; top: 18px;
  border-style: solid;
  border-width: 11px 0 11px 17px;
  border-color: transparent transparent transparent var(--ink);
}
.gate:hover .play { border-color: var(--ink3); }

.frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  z-index: 3;
}

/* ------------------------------------------------------------------- audio */

.card.audio { justify-content: center; gap: 14px; }
.card.audio .meta { margin: 0; }
.card.audio audio {
  width: 100%;
  height: 36px;
  display: block;
  filter: invert(1) hue-rotate(180deg);
  opacity: .82;
}

/* ------------------------------------------------------------------- embed */

.acts {
  position: absolute;
  left: 16px; bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 2;
}
.t-embed .cap { bottom: 0; padding-bottom: 58px; }

.acts .open,
.acts .out {
  font-family: var(--fmono);
  font-size: 12px;
  line-height: 1;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--surf2);
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.acts .open:hover,
.acts .out:hover { border-color: var(--ink3); }
.acts .out { background: none; color: var(--ink2); }

.t-embed .close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 4;
  font-family: var(--fmono);
  font-size: 12px;
  line-height: 1;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--surf);
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

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

.foot {
  margin: 40px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: 12px;
  color: var(--ink3);
}
.foot p { margin: 0; }
.foot a { color: var(--ink3); }
.foot a:hover { color: var(--ink2); }

/* ------------------------------------------------------------- wider grids */

@media (min-width: 800px) {
  :root { --gap: 12px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------- phone */

@media (max-width: 560px) {
  .wrap { padding: 28px 14px; }
  .head { flex-direction: column; gap: 14px; }
  .name { font-size: 28px; }
  .bio { font-size: 16px; }
  .card { padding: 13px; }
  .cap { padding: 10px 13px; }
  .t { font-size: 15.5px; }
  .s { font-size: 12.5px; }
  .t-link .icon { width: 52px; height: 52px; border-radius: 12px; }
  .t-link .pill { top: 10px; right: 10px; }
  .s-1x1.t-link .s { -webkit-line-clamp: 3; }
  .s-1x1.t-link .icon { width: 44px; height: 44px; border-radius: 11px; }
  .acts { left: 13px; bottom: 13px; }
  .t-embed .cap { padding-bottom: 52px; }
  .gate .play { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .gate .play::after { left: 19px; top: 15px; border-width: 9px 0 9px 14px; }
}

/* ------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
