/* Daniel Navas — portfolio design system */
:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-hover: #1d4ed8;
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --text: #111827;
  --text-muted: #4b5563;
  --border: #e5e7eb;
  --shadow: 0 12px 40px rgba(17, 24, 39, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 72px;
  --container: min(1120px, calc(100% - 2rem));
  --transition: 0.22s ease;
}

[data-theme="dark"] {
  --bg: #0c1117;
  --bg-elevated: #151b24;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --border: #2a3344;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  --accent-soft: rgba(96, 165, 250, 0.14);
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-ambient,
  .float-card,
  .hero h1 span,
  .project-thumb::after {
    animation: none !important;
  }
  .hero-visual {
    transform: none !important;
  }
  .code-panel-body {
    animation: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.nav-open,
body.modal-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.section-title {
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-weight: 700;
}

.section-intro {
  max-width: 42rem;
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
}

.text-muted {
  color: var(--text-muted);
}

.accent {
  color: var(--accent);
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

.nav-desktop {
  display: none;
  gap: 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-desktop a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-desktop a:hover,
.nav-desktop a.is-active {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn,
.btn {
  border: none;
  cursor: pointer;
  font: inherit;
  border-radius: 999px;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.icon-btn:hover {
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

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

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

.nav-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text);
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

.nav-panel {
  position: fixed;
  inset: var(--header-h) 0 0;
  background: var(--bg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  border-top: 1px solid var(--border);
}

.nav-panel.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav-panel a {
  padding: 0.85rem 0.5rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.btn-contact-desktop {
  display: none;
}

@media (min-width: 960px) {
  .nav-desktop {
    display: flex;
  }
  .nav-toggle,
  .nav-panel {
    display: none;
  }
  .d-mobile-only {
    display: none !important;
  }
  .btn-contact-desktop {
    display: inline-flex;
  }
}

/* Hero */
.hero {
  position: relative;
  overflow: clip;
  padding-top: calc(var(--header-h) + 3rem);
  padding-bottom: 4rem;
}

.hero-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-ambient .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: orb-drift 16s ease-in-out infinite alternate;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  top: -80px;
  right: -40px;
}

.orb-b {
  width: 260px;
  height: 260px;
  background: #93c5fd66;
  bottom: 10%;
  left: -60px;
  animation-delay: -4s;
}

.orb-c {
  width: 180px;
  height: 180px;
  background: #fde68a55;
  top: 35%;
  left: 45%;
  animation-delay: -8s;
}

@keyframes orb-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(24px, -18px, 0) scale(1.08);
  }
}

.hero-grid {
  position: relative;
  z-index: 1;
}

.hero h1 span {
  display: inline-block;
  background: linear-gradient(120deg, var(--text) 20%, var(--accent) 55%, var(--text) 90%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-shine 7s linear infinite;
}

@keyframes title-shine {
  to {
    background-position: 200% center;
  }
}

.float-card {
  animation: float-y 5.5s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

@keyframes float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 0 0.75rem;
}

.hero-desc {
  max-width: 36rem;
  margin: 0 0 1.75rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
  min-height: 280px;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(145deg, var(--bg-elevated), color-mix(in srgb, var(--accent) 8%, var(--bg-elevated)));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 1.25rem;
}

.hero-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.hero-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.hero-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .hero {
    padding-bottom: 5rem;
  }
}

/* Cards & grids */
.grid-2 {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-2 .span-full {
  grid-column: 1 / -1;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.tag-animated {
  transition: transform 0.25s ease, background 0.25s ease;
}

.tag-animated:hover {
  transform: translateY(-2px) scale(1.04);
}

.card h3,
.card h4 {
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.card p {
  margin: 0;
}

.stack-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Projects */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.pill-accent {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
  background: var(--accent-soft);
}

.project-card dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.project-card dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.project-card dd {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.project-thumb {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-soft), var(--bg));
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 0;
  cursor: default;
}

.project-thumb--photo {
  border-style: solid;
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-thumb--photo:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow);
}

.project-thumb--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.project-thumb--photo::after {
  display: none;
}

.project-mini-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.project-mini-shot {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
  aspect-ratio: 16 / 10;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.project-mini-shot:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.project-mini-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

@media (max-width: 640px) {
  .project-mini-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: thumb-shine 4.5s ease-in-out infinite;
}

@keyframes thumb-shine {
  0%,
  55% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.stack-backend {
  gap: 1.25rem;
}

.code-showcase {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.code-showcase-label {
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.code-showcase-hint {
  font-size: 0.88rem;
  margin: 0 0 1rem;
}

.code-accordion {
  display: grid;
  gap: 0.65rem;
}

.code-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.code-panel[open] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
}

.code-panel--soon {
  opacity: 0.55;
}

.code-panel-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.code-panel-summary::-webkit-details-marker {
  display: none;
}

.code-panel-index {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  min-width: 1.6rem;
}

.code-panel-title {
  flex: 1;
  text-align: left;
}

.code-panel-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  margin-top: -3px;
}

.code-panel[open] .code-panel-chevron {
  transform: rotate(-135deg);
  margin-top: 3px;
}

.code-panel-body {
  padding: 0 1rem 1rem;
  animation: code-panel-in 0.35s ease;
}

@keyframes code-panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.code-panel-desc {
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}

.code-panel-points {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.code-panel-points li + li {
  margin-top: 0.35rem;
}

.code-panel-points code,
.code-panel-desc code {
  font-size: 0.82em;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.code-block-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f172a;
}

.code-block-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.code-block-lang {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.code-copy-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: #e2e8f0;
  border-color: #475569;
}

.code-copy-btn:hover {
  border-color: var(--accent);
  color: #fff;
}

.code-block {
  margin: 0;
  padding: 1rem;
  max-height: min(420px, 55vh);
  overflow: auto;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #e2e8f0;
  tab-size: 2;
}

.code-block code {
  white-space: pre;
  display: block;
}

/* Timeline */
.timeline {
  display: grid;
  gap: 1rem;
  max-width: 820px;
  margin-inline: auto;
}

.timeline .card {
  position: relative;
}

.timeline-period {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.timeline ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.timeline li + li {
  margin-top: 0.35rem;
}

/* CTA band */
.cta-band {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  box-shadow: var(--shadow);
}

.cta-band h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.25;
}

.cta-band p {
  margin: 0;
  color: var(--text-muted);
  max-width: 40rem;
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 2rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.contact-form {
  display: grid;
  gap: 0.75rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.contact-form-status {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-form-status.is-success {
  color: var(--accent);
}

.contact-form-status.is-error {
  color: #dc2626;
}

[data-theme="dark"] .contact-form-status.is-error {
  color: #f87171;
}

.contact-form-privacy {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.contact-form button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Footer */
.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.footer-copy {
  margin: 0;
}

.footer-visits {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.5rem;
}

.footer-visits strong {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.footer-visits-hint {
  font-size: 0.78rem;
  opacity: 0.85;
}

.project-impact-list,
.exp-impact-list {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.project-impact-list li + li,
.exp-impact-list li + li {
  margin-top: 0.35rem;
}

.exp-impact-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Modal */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.gallery-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
}

.modal-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.modal-item figcaption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.modal-shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.25s ease;
}

.modal-shot-btn:hover {
  transform: scale(1.02);
}

.modal-item img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  display: block;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--stagger-index, 0) * 0.07s);
}

.reveal-scale {
  transform: translateY(22px) scale(0.96);
}

.reveal-hero {
  transform: translateY(28px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.hero-visual {
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  position: relative;
  z-index: 1;
  max-width: min(960px, 100%);
  max-height: 85vh;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: lightbox-in 0.35s ease;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.section-alt {
  background: color-mix(in srgb, var(--bg-elevated) 70%, var(--bg));
  border-block: 1px solid var(--border);
}
