:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --border: #334155;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #172554 0%, var(--bg) 45%);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

.hero {
  padding: 4rem 0 2.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent-2);
  margin: 0 0 0.75rem;
}

.hero h1,
.title-lockup {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.title-lockup {
  display: flex;
  align-items: center;
  gap: 0.08em;
}

.title-mark {
  width: 0.92em;
  height: 0.92em;
  border-radius: 0.2em;
  flex-shrink: 0;
}

.nav-site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.05em;
}

.nav-mark {
  width: 1.15em;
  height: 1.15em;
  border-radius: 4px;
  flex-shrink: 0;
}

.tagline {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 52ch;
  margin: 0;
}

.about {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}

.about p {
  margin: 0 0 1rem;
  color: #cbd5e1;
}

.contact-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-links a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 1.75rem;
  padding-bottom: 3rem;
}

.portfolio-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-media {
  background: #020617;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  min-height: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  padding: 0.5rem;
  border-top: 1px solid var(--border);
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 120px;
}

.gallery-thumb {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-thumb img {
  min-height: 120px;
}

.card-body {
  padding: 1.25rem 1.25rem 1.25rem 0;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.problem-class {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.live-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

.portfolio-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.summary {
  color: #cbd5e1;
  margin: 0 0 0.75rem;
}

.built-for {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.highlights {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: #cbd5e1;
}

.highlights li {
  margin-bottom: 0.35rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  color: #cbd5e1;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 2rem;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: min(1200px, 96vw);
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

/* --- Index card: clickable preview --- */

.media-link {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  text-decoration: none;
}

.media-link .hero-img {
  transition: transform 0.35s ease;
}

.media-link:hover .hero-img {
  transform: scale(1.03);
}

.media-cta {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  background: rgba(2, 6, 23, 0.78);
  border: 1px solid var(--border);
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.media-link:hover .media-cta,
.media-link:focus-visible .media-cta {
  opacity: 1;
  transform: translateY(0);
}

.story-link {
  display: inline-block;
  margin-top: 0.9rem;
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.story-link:hover {
  text-decoration: underline;
}

/* --- Detail pages --- */

.detail-nav {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.detail-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
}

.back-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.nav-site-title {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-hero {
  padding: 3.5rem 0 2.5rem;
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.detail-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin: 0 0 0.75rem;
  line-height: 1.12;
}

.detail-headline {
  font-size: 1.35rem;
  color: var(--accent-2);
  font-weight: 600;
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.detail-essence {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
  max-width: 56ch;
}

.detail-hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-ghost {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.12);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.detail-hero-media {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #020617;
  aspect-ratio: 16 / 10;
}

.detail-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-main {
  padding-bottom: 3rem;
}

.detail-intro {
  max-width: none;
  margin-bottom: 2.4rem;
}

.detail-intro p {
  font-size: 1.15rem;
  color: #d7dee9;
  line-height: 1.75;
  margin: 0 0 1.15rem;
}

.detail-main h2 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
  color: var(--text);
}

.detail-gallery {
  margin-bottom: 3rem;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.shot {
  margin: 0;
}

.shot .gallery-thumb {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #020617;
  box-shadow: var(--shadow);
}

.shot .gallery-thumb img {
  width: 100%;
  display: block;
  min-height: 0;
  max-height: 420px;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s ease;
}

.shot-mobile .gallery-thumb img {
  max-height: 460px;
}

.shot .gallery-thumb:hover img {
  transform: scale(1.02);
}

.shot figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.shot-row-mobile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 220px));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.story-section {
  max-width: none;
  margin-bottom: 2.4rem;
}

.story-flow {
  overflow: hidden;
}

.story-section p {
  color: #cbd5e1;
  line-height: 1.75;
  margin: 0 0 1rem;
}

.wrap-shot {
  width: min(46%, 460px);
  margin: 0.15rem 0 1.1rem;
}

.wrap-shot.wrap-right {
  float: right;
  margin-left: 1.6rem;
}

.wrap-shot.wrap-left {
  float: left;
  margin-right: 1.6rem;
}

.wrap-shot .gallery-thumb {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #020617;
  box-shadow: var(--shadow);
}

.wrap-shot .gallery-thumb img {
  width: 100%;
  display: block;
  max-height: 280px;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s ease;
}

.wrap-shot .gallery-thumb:hover img {
  transform: scale(1.02);
}

.wrap-shot figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.shot-placeholder {
  min-height: 220px;
  border: 1px dashed #64748b;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 40%),
    repeating-linear-gradient(
      -12deg,
      rgba(148, 163, 184, 0.08) 0 10px,
      transparent 10px 20px
    ),
    #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.2rem 1.15rem;
}

.ph-kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  color: var(--accent-2);
}

.shot-placeholder strong {
  font-size: 1.05rem;
  color: #f8fafc;
}

.shot-placeholder code {
  font-size: 0.72rem;
  color: #cbd5e1;
  word-break: break-all;
}

.concepts {
  margin-bottom: 3rem;
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}

.concept-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.concept-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  color: var(--accent-2);
}

.concept-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.6;
}

.outcomes {
  margin-bottom: 2.5rem;
}

.outcome-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 68ch;
}

.outcome-list li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.65rem;
  color: #cbd5e1;
}

.outcome-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.detail-tags {
  margin-bottom: 1rem;
}

.detail-closing {
  border-top: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.6);
  padding: 3rem 0;
  text-align: center;
}

.detail-closing p {
  color: #d7dee9;
  font-size: 1.1rem;
  max-width: 60ch;
  margin: 0 auto 1rem;
  line-height: 1.7;
}

.detail-closing .detail-hero-actions {
  justify-content: center;
  margin-top: 1.5rem;
}

@media (max-width: 860px) {
  .portfolio-card {
    grid-template-columns: 1fr;
  }

  .card-body {
    padding: 0 1.25rem 1.25rem;
  }

  .detail-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .detail-hero-media {
    order: -1;
  }

  .wrap-shot,
  .wrap-shot.wrap-left,
  .wrap-shot.wrap-right {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}
