/* ericdamassa.com, house standard (~/.claude/design/Design-Standard.md).
   Accent "Dusk": OKLCH hue 8, chroma 0.035, a muted rose-taupe. The hue wheel is full at chroma 0.05,
   so this sits between Rosewood and the alarm red by low chroma; nearest existing color Plum at
   OKLab ΔE 0.036 (Slate–Denim, the closest accepted pair, is 0.037).
   Measured: dark #AB8E93 ≥5:1 on bg/panel/card/tile and ≥4.5:1 on its own tint; light #6D5357 ≥6:1. */
:root, :root[data-theme="dark"] { --acc-site: #AB8E93; color-scheme: dark; }
:root[data-theme="light"] { --acc-site: #6D5357; color-scheme: light; }
:root { --app-accent: var(--acc-site); }

@media (prefers-contrast: more) {
  :root { --text-muted: var(--text-2); --line: var(--line-strong); --line-faint: var(--line-strong); }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 13px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--r-micro);
}
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
@media (hover: none) { a:hover { text-decoration: none; } }
@media (forced-colors: active) { a:focus-visible, button:focus-visible { outline-color: Highlight; } }

.phrase { white-space: nowrap; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Home: one card ---------- */
.home { display: grid; place-items: center; padding: 56px 16px; min-height: 100vh; }
.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}
.card .photo { display: block; width: 100%; height: auto; background: var(--tile); }
.card .body { padding: 20px 24px 22px; }
h1 { margin: 0; font-size: 22px; font-weight: 600; line-height: 26px; letter-spacing: -0.015em; text-wrap: balance; }
.role { margin: 6px 0 0; color: var(--text-2); text-wrap: balance; }
.role a { font-weight: 400; }
.links {
  display: flex; flex-wrap: wrap; gap: 0 20px;
  margin: 14px 0 0; padding: 14px 0 0;
  border-top: 1px solid var(--line-faint);
  list-style: none;
}
.links a, .back { display: inline-block; position: relative; padding: 4px 0; white-space: nowrap; }
.links a::after, .back::after { content: ""; position: absolute; inset: -10px -8px; }

.galleries { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line-faint); }
.galleries li + li { border-top: 1px solid var(--line-faint); }
.galleries a {
  display: flex; justify-content: space-between; align-items: baseline;
  min-height: 44px; padding: 12px 0;
  color: var(--text); font-weight: 400;
}
.galleries a:hover { text-decoration: none; color: var(--accent); }
.galleries .num { font-size: 11px; color: var(--text-muted); }

/* ---------- Gallery pages ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }
.back { font-size: 13px; }
.page header { margin: 16px 0 28px; }
.meta { margin: 6px 0 0; font-family: var(--mono); font-size: 11px; color: var(--text-muted); }

section + section { margin-top: 36px; }
h2 {
  display: flex; gap: 8px; align-items: baseline;
  margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2);
}
h2 .num { font-size: 11px; font-weight: 400; color: var(--text-2); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
  list-style: none; margin: 0; padding: 0;
}
.grid button {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: var(--tile); border-radius: var(--r-small); overflow: hidden;
}
.grid img {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover;
  transition: opacity var(--ease);
}
.grid button:hover img { opacity: 0.86; }
@media (hover: none) { .grid button:hover img { opacity: 1; } }
.cap { display: block; margin-top: 6px; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 760px) {
  .page { padding: 24px 16px 64px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
}

/* ---------- Viewer (dialog) ---------- */
dialog.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--text);
}
dialog.viewer::backdrop { background: var(--modal-scrim); }
.viewer-inner { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.viewer-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; gap: 12px;
}
.viewer-pos { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 56px; }
/* width/height attributes give the browser the aspect ratio; auto lets max-* fit the photo to the stage */
.viewer-stage img {
  width: auto; height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 128px); /* bar (60) + caption (56) + breathing room; % heights don't resolve in this grid */
  border-radius: var(--r-small);
}
.viewer-cap { min-height: 40px; padding: 10px 16px 16px; text-align: center; font-size: 12px; color: var(--text-2); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--card); color: var(--text); cursor: pointer;
  font: 400 18px/1 var(--font);
}
.icon-btn:hover { background: var(--hover); }
.viewer-prev, .viewer-next { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-prev { left: 6px; }
.viewer-next { right: 6px; }
@media (max-width: 760px) { .viewer-stage { padding: 0 8px; } .viewer-prev, .viewer-next { top: auto; bottom: 8px; transform: none; } }
