/* ── SHARED DESIGN SYSTEM ─────────────────────────────────
   Extracted from the main site. Imported by all pages for
   consistent theming, typography, and component styles. */

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

:root {
  --bg: #efefec; --ink: #1a1916; --ink2: #8a8480; --blue: #4a5aff;
  --dot: rgba(100,90,80,0.28);
  --glass-bg: rgba(245,243,240,0.55);
  --glass-border: rgba(255,255,255,0.35);
  --glass-shadow: 0 8px 40px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -1px 0 rgba(255,255,255,0.2);
  --titlebar-bg: rgba(255,255,255,0.25);
  --titlebar-border: rgba(0,0,0,0.06);
  --annot-bg: rgba(239,239,236,0.7);
  --annot-border: rgba(26,25,22,0.18);
  --card-bg: rgba(255,255,255,0.5);
  --card-hover: rgba(222,220,215,0.9);
  --tag-bg: #fff;
  --hint-color: rgba(26,25,22,0.35);
  --panel-bg: rgba(239,239,236,0.97);
  --panel-border: rgba(26,25,22,0.10);
  --panel-text: rgba(26,25,22,0.6);
  --panel-muted: rgba(26,25,22,0.35);
  --panel-subtle: rgba(26,25,22,0.5);
  --panel-strong: rgba(26,25,22,0.75);
  --panel-line: rgba(26,25,22,0.08);
  --panel-btn-border: rgba(26,25,22,0.14);
  --panel-btn-color: rgba(26,25,22,0.4);
  --ff-name: 'Anton', sans-serif;
  --ff-serif: 'DM Serif Display', serif;
  --ff-body: 'DM Sans', sans-serif;
  --ff-mono: 'Space Mono', monospace;
}

[data-theme="dark"] {
  --bg: #141414; --ink: #e8e4df; --ink2: #8a8480; --blue: #7b8aff;
  --dot: rgba(200,190,180,0.12);
  --glass-bg: rgba(30,30,30,0.5);
  --glass-border: rgba(255,255,255,0.08);
  --glass-shadow: 0 8px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(255,255,255,0.02);
  --titlebar-bg: rgba(255,255,255,0.06);
  --titlebar-border: rgba(255,255,255,0.06);
  --annot-bg: rgba(40,38,36,0.8);
  --annot-border: rgba(255,255,255,0.12);
  --card-bg: rgba(255,255,255,0.06);
  --card-hover: rgba(255,255,255,0.12);
  --tag-bg: rgba(255,255,255,0.1);
  --hint-color: rgba(255,255,255,0.25);
  --panel-bg: rgba(30,30,30,0.97);
  --panel-border: rgba(255,255,255,0.08);
  --panel-text: rgba(255,255,255,0.5);
  --panel-muted: rgba(255,255,255,0.3);
  --panel-subtle: rgba(255,255,255,0.4);
  --panel-strong: rgba(255,255,255,0.7);
  --panel-line: rgba(255,255,255,0.08);
  --panel-btn-border: rgba(255,255,255,0.12);
  --panel-btn-color: rgba(255,255,255,0.4);
}

/* ── GLASS PANEL ──────────── */
.glass-panel {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 0;
  width: 880px; max-width: 90vw;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.panel-body { padding: 44px 44px 48px; }
.glass-panel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.07;
  background-repeat: repeat;
  background-size: 150px 150px;
  z-index: 1;
}
.glass-panel--wide { width: 1480px; max-width: 94vw; }

/* ── SECTION HEADER (editorial) ─── */
.section-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--panel-line);
}
.section-eyebrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
  font-family: var(--ff-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink2);
}
.section-eyebrow-left {
  display: flex; align-items: center; gap: 14px;
  min-width: 0;
}
.section-num { color: var(--blue); font-weight: 700; }
.section-rule { flex: 0 0 32px; height: 1px; background: var(--annot-border); }
.section-count { color: var(--ink2); font-size: 10px; }
.section-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--ink2); text-decoration: none;
  padding: 6px 0;
  pointer-events: auto;
  transition: color 0.15s, gap 0.2s;
}
.section-link:hover { color: var(--ink); gap: 12px; }
.section-link .arrow { display: inline-block; transition: transform 0.2s; }
.section-link:hover .arrow { transform: translateX(2px); }

.section-title-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.section-title {
  font-family: var(--ff-serif); font-style: italic; font-weight: 400;
  font-size: clamp(44px, 5vw, 72px); line-height: 1.0;
  color: var(--ink); letter-spacing: -0.02em;
}
.section-subtitle {
  font-family: var(--ff-body); font-size: 14px; line-height: 1.55;
  color: var(--ink2);
  max-width: 360px;
  margin-bottom: 6px;
}
@media (max-width: 700px) {
  .section-subtitle { display: none; }
}

/* ── PROJECT CARDS ────────── */
.projects-grid { display: flex; flex-wrap: wrap; gap: 20px; }
.project-card {
  flex: 1 1 calc(33.333% - 14px); max-width: calc(33.333% - 14px);
  background: var(--card-bg); border-radius: 14px;
  overflow: hidden; cursor: pointer;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  display: flex; flex-direction: column;
  border: 1px solid var(--panel-line);
  text-decoration: none;
}
.project-card:hover {
  background: var(--card-hover);
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.10);
  border-color: rgba(74, 90, 255, 0.35);
}
.project-card .project-cover {
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project-card:hover .project-cover {
  transform: scale(1.015);
}
.project-card:hover .project-num {
  color: rgba(255, 255, 255, 0.95);
}
/* Cover: gradient or logo, with a subtle radial highlight giving
   even plain gradient blocks a sense of depth. */
.project-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 24px;
  position: relative;
  text-align: center;
  overflow: hidden;
}
.project-cover::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.16) 0%, transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.10) 100%);
  pointer-events: none;
  z-index: 1;
}
.project-cover--logo::after {
  background: none;
}
.project-title {
  position: relative; z-index: 2;
  font-family: var(--ff-serif); font-style: italic; font-weight: 400;
  font-size: clamp(26px, 2.4vw, 38px); line-height: 1.0;
  letter-spacing: -0.015em;
  color: rgba(255,255,255,0.98);
  text-shadow: 0 2px 14px rgba(0,0,0,0.22);
  pointer-events: none;
}
/* Big editorial folio number in the corner */
.project-num {
  position: absolute; top: 16px; left: 18px; z-index: 3;
  font-family: var(--ff-mono); font-size: 13px; letter-spacing: 0.16em;
  font-weight: 700;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 1px 3px rgba(0,0,0,0.28);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s;
}
.project-cover-label { display: none; }
.project-cover--photo { padding: 28px 24px; }

/* Logo cover: pure white background, centered brand mark, dark
   index in the corner. Title moves into the body for these. */
.project-cover--logo {
  background: #ffffff;
  padding: 28px 24px;
  display: flex; align-items: center; justify-content: center;
}
.project-cover--logo .project-num {
  color: rgba(0, 0, 0, 0.42);
  text-shadow: none;
}
/* Dark-bg logo cover (custom logoBg color) — flip num back to light */
.project-cover--logo-dark .project-num {
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

/* Logo + UI cover: small logo band on top, UI screenshot occupies
   the majority of the cover at the bottom. */
.project-cover--logo-ui {
  background: #ffffff;
  padding: 0;
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-start;
  overflow: hidden;
}
.project-cover--logo-ui::after { background: none; }
.project-cover--logo-ui .project-num {
  color: rgba(0, 0, 0, 0.42);
  text-shadow: none;
}
.project-cover--logo-ui.project-cover--logo-dark .project-num {
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}
.project-cover--logo-ui .logo-band {
  height: 28%;
  min-height: 0;
  flex: 0 0 28%;
  display: flex; align-items: center; justify-content: center;
  padding: 6px 14px;
  position: relative; z-index: 2;
  overflow: hidden;
}
.project-cover--logo-ui .project-logo {
  height: 70%;
  max-height: 100%;
  width: auto;
  max-width: 45%;
  object-fit: contain;
  display: block;
  filter: none;
}
.project-cover--logo-ui .ui-band {
  height: 72%;
  flex: 0 0 72%;
  position: relative;
  overflow: hidden;
  padding: 0 12px;
  display: flex; align-items: stretch;
}
.project-cover--logo-ui .project-ui {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: none;
  box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.08);
  object-fit: cover;
  object-position: top left;
  filter: none;
}
.project-cover--logo .project-logo {
  /* Height-anchored sizing keeps logos with different aspect ratios at
     the same visual height across cards. */
  height: 50%;
  width: auto;
  max-width: 60%;
  object-fit: contain;
  display: block;
  filter: none;
}
.project-title-body {
  font-family: var(--ff-serif); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 1.6vw, 26px); line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

/* Metadata strip under the poster */
.project-body {
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
/* Title bar: project title (italic serif) on the left, role tag on
   the right. Wraps to a second line on narrow cards. */
.project-titlebar {
  display: flex; align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.project-titlebar .project-title-body {
  flex: 0 1 auto;
}
.project-role {
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--blue);
  text-transform: uppercase;
  line-height: 1.4;
  background: rgba(74, 90, 255, 0.08);
  border: 1px solid rgba(74, 90, 255, 0.22);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.project-card:hover .project-role {
  background: rgba(74, 90, 255, 0.14);
  border-color: rgba(74, 90, 255, 0.35);
}
[data-theme="dark"] .project-role {
  background: rgba(123, 138, 255, 0.12);
  border-color: rgba(123, 138, 255, 0.28);
}
.project-submeta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--panel-muted);
  text-transform: uppercase;
  line-height: 1.55;
  margin: 0;
}
.project-desc {
  font-family: var(--ff-body); font-size: 13px; line-height: 1.55;
  color: var(--ink); margin: 0;
}
.project-tags {
  display: flex; align-items: center; gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-line);
  margin-top: auto;
  min-width: 0;
}
.project-tag {
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.18em;
  color: var(--ink2);
  text-transform: uppercase;
  line-height: 1.4;
}

/* ── PHOTO FILTER (halftone) ─── */
.photo-filtered { position: relative; overflow: hidden; }
.photo-filtered img {
  width: 100%; height: 100%; display: block; object-fit: cover;
  filter: grayscale(1) contrast(1.45) brightness(1.05);
  transition: filter 0.45s ease;
}
.photo-filtered::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(0,0,0,0.55) 0.55px, transparent 1.05px),
    radial-gradient(circle, rgba(0,0,0,0.20) 0.4px, transparent 0.85px);
  background-size: 2.6px 2.6px, 1.7px 1.7px;
  background-position: 0 0, 1.3px 0.85px;
  mix-blend-mode: multiply;
  opacity: 1;
  transition: opacity 0.45s ease;
}
.photo-filtered:hover img { filter: none; }
.photo-filtered:hover::after { opacity: 0; }
[data-theme="dark"] .photo-filtered::after {
  background-image:
    radial-gradient(circle, rgba(0,0,0,0.7) 0.55px, transparent 1.05px),
    radial-gradient(circle, rgba(0,0,0,0.3) 0.4px, transparent 0.85px);
}

/* ── STATS (detail pages) ────── */
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--panel-line); border-radius: 8px; overflow: hidden; }
.stat-cell { padding: 16px 20px; border-right: 1px solid var(--panel-line); }
.stat-cell:last-child { border-right: none; }
.stat-label { display: block; font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.10em; color: var(--panel-muted); margin-bottom: 6px; }
.stat-value { display: block; font-family: var(--ff-mono); font-size: 14px; font-weight: 700; color: var(--panel-strong); }

/* ── CTA BUTTON ──────────────── */
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--panel-btn-color); border: 1px solid var(--panel-btn-border);
  padding: 10px 20px; border-radius: 6px;
  text-decoration: none; align-self: flex-start;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cta-btn:hover { color: var(--ink); border-color: var(--panel-btn-color); background: var(--card-bg); }

/* ── NAV ──────────────────── */
.h-nav {
  position: fixed; top: 0; right: 0; z-index: 1000;
  padding: 22px 36px; display: flex; gap: 2px;
}
.h-nav a {
  font-family: var(--ff-mono); font-size: 12px; color: var(--ink2);
  letter-spacing: 0.04em; padding: 4px 6px;
  text-decoration: none; transition: color 0.15s;
}
.h-nav a:hover { color: var(--ink); }

/* ── BODY GRAIN ──────────────── */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-repeat: repeat;
  background-size: 150px 150px;
  z-index: 10001;
}

/* ── RESPONSIVE ──────────────── */
@media (max-width: 900px) {
  .project-card { flex: 1 1 calc(50% - 10px); max-width: calc(50% - 10px); }
  .glass-panel--wide { width: 92vw; }
  .section-title { font-size: clamp(32px, 5vw, 44px); }
}
@media (max-width: 600px) {
  .panel-body { padding: 28px 24px 32px; }
  .project-card { flex: 1 1 100%; max-width: 100%; }
  .detail-stats { grid-template-columns: 1fr; }
  .stat-cell { border-right: none; border-bottom: 1px solid var(--panel-line); }
  .stat-cell:last-child { border-bottom: none; }
  .h-nav { padding: 18px 22px; }
}
