/* Individual project pages. Same visual language as the portfolio: navy field,
   cyan/violet accents, mono for structure, DM Sans for reading. */

:root {
  --bg: #020817;
  --panel: #070d1e;
  --panel-2: #0b1226;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --emerald: #10b981;
  --accent: #06b6d4;
  --wrap: 1120px;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 70% 45% at 15% -5%, rgba(6, 182, 212, 0.10), transparent 65%),
    radial-gradient(ellipse 60% 45% at 90% 8%, rgba(139, 92, 246, 0.12), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 60;
  background: var(--violet); color: #fff; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

a { color: #67e8f9; }
a:hover { color: #a5f3fc; }

:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------- top bar */

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(2, 8, 23, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 62px;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: 0.06em;
  color: #f1f5f9; text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--cyan); }
.brand:hover { color: #fff; }

.lang-switch { display: flex; gap: 4px; }
.lang-switch a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em;
  padding: 6px 10px; border-radius: 7px; text-decoration: none;
  color: var(--muted); border: 1px solid transparent;
}
.lang-switch a:hover { color: #e2e8f0; border-color: var(--line); }
.lang-switch a.is-active {
  color: #67e8f9; border-color: rgba(6, 182, 212, 0.4); background: rgba(6, 182, 212, 0.08);
}

/* ------------------------------------------------------------- breadcrumb */

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 26px 0 6px; font-family: var(--mono); font-size: 11.5px;
  color: var(--muted); letter-spacing: 0.04em;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: #67e8f9; }
.crumbs [aria-current] { color: #cbd5e1; }

/* ------------------------------------------------------------------ head */

.case { padding-bottom: 64px; }
.case-head { padding: 18px 0 30px; max-width: 860px; }
.kicker {
  margin: 0 0 12px; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}
h1 {
  margin: 0 0 16px;
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(28px, 4.6vw, 46px); line-height: 1.14; letter-spacing: -0.01em;
  background: linear-gradient(112deg, #f8fafc, #67e8f9 65%, #c4b5fd);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lede { margin: 0 0 22px; font-size: clamp(16px, 2vw, 18.5px); color: #cbd5e1; max-width: 70ch; }

.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 24px; }
.facts > div { min-width: 160px; }
.facts dt {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: #64748b; margin-bottom: 2px;
}
.facts dd { margin: 0; font-size: 14px; color: #e2e8f0; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  padding: 10px 16px; border-radius: 9px; text-decoration: none;
  border: 1px solid transparent; transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(120deg, #06b6d4, #8b5cf6); color: #04121f; }
.btn-primary:hover { color: #04121f; }
.btn-ghost { border-color: var(--line); color: #cbd5e1; background: rgba(148, 163, 184, 0.06); }
.btn-ghost:hover { color: #fff; border-color: rgba(148, 163, 184, 0.4); }

/* ----------------------------------------------------------- hero figure */

.hero-figure { margin: 0 0 8px; }
.hero-figure img {
  display: block; width: 100%; height: auto;
  border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel-2);
}
.hero-figure figcaption {
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}

.tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.tag-real_screenshot { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.38); }
.tag-technical_diagram { background: rgba(6, 182, 212, 0.14); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.38); }
.tag-conceptual_illustration { background: rgba(139, 92, 246, 0.14); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.38); }
.tag-render_or_visualization { background: rgba(245, 158, 11, 0.14); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.36); }

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

.section { margin-top: 46px; }
.section h2 {
  margin: 0 0 16px; font-family: var(--mono); font-weight: 600;
  font-size: clamp(18px, 2.4vw, 22px); letter-spacing: -0.01em; color: #f1f5f9;
}
.section h2::before {
  content: ''; display: inline-block; width: 22px; height: 2px; margin-right: 12px;
  vertical-align: middle; background: linear-gradient(90deg, var(--accent), transparent);
}
.section p { margin: 0 0 14px; max-width: 78ch; color: #cbd5e1; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.hint { margin: 0 0 16px !important; font-size: 12.5px; color: #64748b !important; }

.plain-list, .check-list, .decision-list { margin: 0; padding: 0; list-style: none; max-width: 82ch; }
.plain-list li, .check-list li {
  position: relative; padding-left: 24px; margin-bottom: 10px; color: #cbd5e1;
}
.plain-list li::before {
  content: ''; position: absolute; left: 4px; top: 10px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}
.check-list li::before {
  content: '✓'; position: absolute; left: 0; top: -1px; color: var(--emerald);
  font-family: var(--mono); font-size: 13px;
}
.decision-list { display: grid; gap: 12px; }
.decision-list li {
  border: 1px solid var(--line); border-left: 3px solid var(--violet);
  background: linear-gradient(170deg, rgba(16, 23, 48, 0.85), rgba(8, 13, 30, 0.65));
  border-radius: 4px 12px 12px 4px; padding: 14px 16px; color: #cbd5e1;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-family: var(--mono); font-size: 11.5px; color: #cbd5e1;
  border: 1px solid var(--line); background: rgba(148, 163, 184, 0.06);
  border-radius: 999px; padding: 6px 12px;
}

.note-panel {
  margin-top: 46px; padding: 18px 20px; border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.28); background: rgba(245, 158, 11, 0.06);
}
.note-panel h2 { margin: 0 0 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #fcd34d; }
.note-panel p { margin: 0; color: #e2e8f0; font-size: 14.5px; }

/* ---------------------------------------------------------------- gallery */

.gallery {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  /* Each image keeps its own ratio: a 16:9 screenshot and a 2.7:1 diagram must
     not be forced into one box, and nothing may be cropped away. */
  align-items: start;
}
.shot-card { margin: 0; }
.shot {
  position: relative; display: block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel-2);
  text-decoration: none; transition: border-color 0.18s ease, transform 0.18s ease;
}
.shot:hover { border-color: rgba(6, 182, 212, 0.5); transform: translateY(-2px); }
.shot img {
  display: block; width: 100%; height: auto; background: var(--panel-2);
}
/* The category sits in the caption rather than over the image: a badge that
   long would cover the part of a screenshot it is meant to describe. */
.shot-card figcaption {
  margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}

/* A failed image keeps its box: the alt text is shown instead of a collapsed row. */
.shot img.img-missing,
.hero-figure img.img-missing {
  min-height: 150px; height: auto; padding: 22px;
  font-family: var(--mono); font-size: 12px; color: #94a3b8;
  background: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.05) 0 10px, transparent 10px 20px), var(--panel-2);
}

/* --------------------------------------------------------------- related */

.related-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 0; padding: 0; list-style: none; }
.related-card a {
  display: flex; gap: 12px; align-items: center; text-decoration: none;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  background: rgba(11, 18, 38, 0.7); transition: border-color 0.18s ease;
}
.related-card a:hover { border-color: rgba(139, 92, 246, 0.45); }
.related-card img { width: 86px; height: 58px; object-fit: cover; border-radius: 8px; flex: none; }
.related-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.related-name { font-size: 13.5px; color: #f1f5f9; font-weight: 500; }
.related-status { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #64748b; }

/* -------------------------------------------------------------------- CTA */

.cta-panel {
  margin-top: 52px; padding: 24px; border-radius: 16px;
  border: 1px solid rgba(6, 182, 212, 0.24);
  background: linear-gradient(140deg, rgba(6, 182, 212, 0.08), rgba(139, 92, 246, 0.08));
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.cta-panel p { margin: 0; font-family: var(--mono); font-size: 13px; color: #cbd5e1; }

.back-link { margin-top: 28px; font-family: var(--mono); font-size: 12.5px; }
.back-link a { text-decoration: none; color: #67e8f9; }

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

.site-foot {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 40px;
  font-size: 12.5px; color: #64748b;
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-foot p { margin: 0; }
.site-foot a { color: #94a3b8; text-decoration: none; }
.site-foot a:hover { color: #67e8f9; }

/* --------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: rgba(2, 6, 18, 0.95);
  backdrop-filter: blur(6px);
  padding: 14px;
}
.lightbox[hidden] { display: none; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lb-count { margin: 0; font-size: 11.5px; letter-spacing: 0.14em; color: #94a3b8; }
.lb-close {
  background: rgba(148, 163, 184, 0.1); border: 1px solid var(--line); color: #e2e8f0;
  width: 38px; height: 38px; border-radius: 10px; font-size: 15px; cursor: pointer;
}
.lb-close:hover { background: rgba(148, 163, 184, 0.2); }

.lightbox-stage {
  flex: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 10px; min-height: 0; padding: 8px 0 4px;
}
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.lb-figure img {
  max-width: 100%; max-height: min(74vh, 900px); width: auto; height: auto;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
}
#lb-caption { margin: 0; max-width: 82ch; text-align: center; font-size: 13px; color: #cbd5e1; }

.lb-nav {
  background: rgba(148, 163, 184, 0.1); border: 1px solid var(--line); color: #e2e8f0;
  width: 44px; height: 44px; border-radius: 50%; font-size: 17px; cursor: pointer;
}
.lb-nav:hover { background: rgba(6, 182, 212, 0.18); border-color: rgba(6, 182, 212, 0.45); }
.lb-nav[disabled] { opacity: 0.32; cursor: default; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .gallery { grid-template-columns: 1fr; }
  .facts > div { min-width: 0; flex: 1 1 140px; }
  .cta-panel { flex-direction: column; align-items: flex-start; }
  .lightbox-stage { grid-template-columns: 1fr; }
  .lb-nav { position: absolute; bottom: 18px; }
  .lb-prev { left: 16px; }
  .lb-next { right: 16px; }
  .lb-figure img { max-height: 62vh; }
  .crumbs { font-size: 11px; }
}

@media (max-width: 420px) {
  h1 { font-size: 25px; }
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .shot, .related-card a { transition: none; }
  .btn:hover, .shot:hover { transform: none; }
}
