/* drmred.com — shared styles. Follows the system light/dark setting. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1a1d21;
  --muted: #646b75;
  --line: #dde1e6;
  --accent: #2563eb;
  --accent-soft: #e0eaff;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1e222a;
    --text: #e8eaed;
    --muted: #9aa1ab;
    --line: #2b3039;
    --accent: #6ea0ff;
    --accent-soft: #1c2a47;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}
a { color: var(--accent); }

/* Top bar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.topbar a { color: inherit; text-decoration: none; }
.topbar .crumb-sep { color: var(--muted); font-weight: 400; }
.topbar .crumb-here { font-weight: 600; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* Intro strip: avatar, name, and an "About me" pop-out */
.intro {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
  position: relative;
}
.intro-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #10101c; /* matches the avatar image's background */
  object-fit: cover;
  flex: none;
}
.intro-text { flex: 1; min-width: 0; }
.intro h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; }
.intro .handle { color: var(--muted); }

.about summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  user-select: none;
}
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: " ›"; display: inline-block; transition: transform .2s; }
.about[open] summary::after { transform: rotate(90deg); }
.about summary:hover, .about[open] summary { border-color: var(--accent); color: var(--accent); }
.about-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 10;
  width: min(340px, 100%);
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgb(0 0 0 / .18);
  animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.about-panel .bio { margin: 0 0 12px; }
.facts { list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 0.92rem; }
.facts li { padding: 3px 0; }
.facts strong { color: var(--text); font-weight: 600; }

/* Section headings */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-title .count {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
}
.section + .section { margin-top: 40px; }

/* Project tiles: a bento grid. "size" in projects.json picks the shape. */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 250px;
  grid-auto-flow: dense;
  gap: 14px;
}
.tile-big  { grid-column: span 2; grid-row: span 2; }
.tile-tall { grid-row: span 2; }
.tile-wide { grid-column: span 2; }

.tile {
  --c: var(--accent);
  --mx: 50%; --my: 0%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--c) 13%, var(--surface)), var(--surface) 55%);
  color: inherit;
  text-decoration: none;
  transition: transform .25s ease-out, border-color .2s, box-shadow .25s;
  will-change: transform;
}
/* Glow that follows the pointer */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--c) 30%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity .3s;
}
.tile:hover, .tile:focus-visible {
  border-color: color-mix(in srgb, var(--c) 60%, var(--line));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--c) 22%, transparent);
  outline: none;
}
.tile:hover::before, .tile:focus-visible::before { opacity: 1; }
.tile:focus-visible { transform: translateY(-2px); }

.tile-shot {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: .22;
  transition: opacity .3s, transform .4s;
}
.tile:hover .tile-shot { opacity: .32; transform: scale(1.03); }

.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tile-art { transition: transform .3s ease-out; }
.tile:hover .tile-art { transform: scale(1.06) rotate(-3deg); }

.tile-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; line-height: 1.25; }
.tile-blurb {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.tile-go { display: inline-block; margin-top: 10px; font-size: 0.85rem; font-weight: 600; color: var(--c); }
@media (prefers-color-scheme: dark) {
  .tile-go { color: color-mix(in srgb, var(--c) 55%, #fff); }
}

/* Tags and the "See the project" link slide in on hover */
.tile-more {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .3s ease-out, opacity .25s;
}
.tile-more > div { overflow: hidden; }
.tile:hover .tile-more, .tile:focus-visible .tile-more { grid-template-rows: 1fr; opacity: 1; }
.tile-more .tags { margin-top: 10px; }

/* Featured tiles get more of everything, and show it all up front */
.tile-big, .tile-tall { padding: 24px; }
.tile-big .tile-name { font-size: 1.7rem; }
.tile-tall .tile-name { font-size: 1.35rem; }
.tile-big .tile-blurb { font-size: 1.05rem; -webkit-line-clamp: 5; }
.tile-tall .tile-blurb, .tile-wide .tile-blurb { -webkit-line-clamp: 4; }
.tile-big .tile-more, .tile-tall .tile-more { grid-template-rows: 1fr; opacity: 1; }
.tile-big .tile-art { width: 112px; height: 112px; font-size: 3.6rem; border-radius: 26px; }
.tile-tall .tile-art { width: 88px; height: 88px; font-size: 2.8rem; border-radius: 22px; }
/* Big art bleeds off the corner as a soft watermark */
.tile-big::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 70%; aspect-ratio: 1;
  right: -18%; bottom: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
}

/* Phones and touch: no hover, so show everything */
@media (hover: none) {
  .tile-more { grid-template-rows: 1fr; opacity: 1; }
}
@media (max-width: 820px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tile-big, .tile-tall, .tile-wide { grid-column: auto; grid-row: auto; }
  .tile { min-height: 200px; }
  .tile-big { min-height: 320px; }
  .tile-more { grid-template-rows: 1fr; opacity: 1; }
  .tile-blurb { -webkit-line-clamp: unset; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile-art, .tile-more, .tile-shot { transition: none; }
}

/* Project art: icon image, emoji or letter. One size per context so every tile matches. */
.tile-art, .hero-icon {
  flex: none;
  display: grid; place-items: center;
  object-fit: contain;
  border-radius: 18px;
}
.tile-art { width: 60px; height: 60px; font-size: 2rem; border-radius: 16px; }
.hero-icon { width: 88px; height: 88px; font-size: 2.8rem; border-radius: 22px; }
.tile-art.emoji, .hero-icon.emoji {
  background: var(--surface);
  border: 1px solid var(--line);
}
.tile-art.letter, .hero-icon.letter { color: #fff; font-weight: 700; }


.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  font-size: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 9px;
}

/* Status badge */
.status {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 1px 8px;
  border: 1px solid currentColor;
  white-space: nowrap;
  vertical-align: middle;
}
.status-live     { color: #16a34a; }
.status-building { color: #2563eb; }
.status-retired  { color: var(--muted); }
.status-other    { color: #b45309; }
@media (prefers-color-scheme: dark) {
  .status-live     { color: #4ade80; }
  .status-building { color: #6ea0ff; }
  .status-other    { color: #fbbf24; }
}

/* ── Project page ─────────────────────────────────────────── */
.wrap.narrow { max-width: 880px; }

.hero {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 16px 0 36px;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.hero h1 .status { font-size: 0.8rem; letter-spacing: 0; }
.hero .blurb { color: var(--muted); margin: 0 0 10px; font-size: 1.08rem; }
@media (max-width: 560px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-icon { width: 68px; height: 68px; font-size: 2.2rem; border-radius: 18px; }
}

.lede {
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 40px 0 8px;
}
.lede p { margin: 0 0 12px; }

.story code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 5px;
}

/* Feature blocks: text beside a screenshot, alternating sides */
.feature {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: center;
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
}
.feature.flip { grid-template-columns: 260px 1fr; }
.feature.flip .feature-text { order: 2; }
.feature.plain, .feature.wide { grid-template-columns: 1fr; gap: 24px; }
.feature-text h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.feature-text p { margin: 0 0 12px; color: var(--muted); font-size: 1.05rem; }
.feature-text strong { color: var(--text); }
@media (max-width: 680px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
  .feature.flip .feature-text { order: 0; }
  .shot:not(.wide) { max-width: 260px; margin: 0 auto; }
}

/* A bullet list in a section with no screenshot becomes a tile grid */
.feature.plain ul, .feature.wide ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.feature.plain li, .feature.wide li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.95rem;
}
.feature.plain li strong, .feature.wide li strong { display: block; color: var(--text); margin-bottom: 2px; }

/* Screenshots: phone-shaped by default, full width when "wide" */
.shot { margin: 0; }
.shot img, .shot-placeholder {
  display: block;
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgb(0 0 0 / .18);
}
.shot.wide img, .shot.wide .shot-placeholder { border-radius: 12px; }
.shot-placeholder {
  aspect-ratio: 9 / 19.5;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%),
    var(--surface-2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  box-shadow: none;
  border-style: dashed;
}
.shot.wide .shot-placeholder { aspect-ratio: 16 / 9; }
.shot-placeholder span { font-weight: 600; font-size: 0.9rem; }
.shot-placeholder small { font-size: 0.8rem; opacity: .8; }

/* Status callout */
.status-callout {
  margin: 44px 0 0;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
}
.status-callout h2 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.status-callout p { margin: 0 0 8px; }
.status-callout p:last-child { margin-bottom: 0; }

/* ── Cool links ───────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-head .section-title { margin: 0; }
.link-search {
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  width: 220px;
  max-width: 100%;
}
.link-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.link-group + .link-group { margin-top: 18px; }
.link-group h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.link-list li { padding: 12px 16px; }
.link-list li + li { border-top: 1px solid var(--line); }
.link-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}
.link-list a:hover .link-title { text-decoration: underline; }
.link-title { font-weight: 600; }
.link-host { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.link-note { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

.back { display: inline-block; margin-top: 24px; }
.notice { color: var(--muted); }

footer.site {
  margin-top: 56px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Click-to-enlarge screenshots */
.shot img { cursor: zoom-in; }
.shot figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); text-align: center; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgb(0 0 0 / .85);
  display: grid;
  place-items: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgb(0 0 0 / .5);
}
