/* ── Reset & base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #1f1f1f;
  --surface: #404047;
  --border: #27272a;
  --text: #e4e4e7;
  --muted: #71717a;
  --accent: #8486ff;
  --accent-h: #818cf8;

  --max-w: 1000px;
  --section-gap: 120px;
  --radius: 12px;
  font-size: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-h);
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: rgba(15, 15, 17, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

nav .logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav ul a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}
nav ul a:hover {
  color: var(--text);
}

/* ── Shared section layout ── */
section {
  padding: var(--section-gap) 2rem;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.4rem;
  border-radius: 2px;
}

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 80px;
}

.eyebrow {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

#hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.tagline {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 2.5rem;
}

.cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s,
    transform 0.15s;
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0px);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn.primary:hover {
  border-color: var(--accent-h);
  background: var(--accent-h);
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Inline link hover/click ── */
nav ul a,
.card-links a,
.social-links a {
  position: relative;
  transition: color 0.2s;
}
nav ul a::after,
.card-links a::after,
.social-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s;
}
nav ul a:hover::after,
.card-links a:hover::after,
.social-links a:hover::after {
  width: 100%;
}
nav ul a:active,
.card-links a:active,
.social-links a:active {
  opacity: 0.6;
  transform: scale(0.97);
}

/* ── About ── */
#about {
  background: var(--surface);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 1rem;
  max-width: 540px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin-top: 1.5rem;
}

.skills li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Work ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at center,
      transparent 65%,
      rgba(0, 0, 0, 0.15) 100%
    ),
    linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 60%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 60%),
    linear-gradient(to left, rgba(0, 0, 0, 0.35), transparent 60%),
    linear-gradient(to right, rgba(0, 0, 0, 0.35), transparent 60%);
  pointer-events: none;
}

.card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card-body p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.card-tags span {
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.55rem;
  color: var(--muted);
}

.card-links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── Contact ── */
#contact {
  background: var(--surface);
}

.contact-inner {
  text-align: center;
}
.contact-inner h2::after {
  margin: 0.4rem auto 0;
}
.contact-inner > p {
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto 2rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}
.social-links a {
  color: var(--muted);
}
.social-links a:hover {
  color: var(--accent);
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ── More page ── */
.nav-active {
  color: var(--text) !important;
}

.page-header {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 140px 2rem 80px;
}

.alt-bg {
  background: var(--surface);
}

.section-intro {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: -1.5rem;
  margin-bottom: 1.8rem;
}

/* Photos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 220px);
  gap: 0.75rem;
}

/* Explicit placement — fills all 9 cells with no gaps
   Col 1    | Col 2    | Col 3
   photo1   | photo3   | photo2 (tall)
   photo6   | photo4   |   ...
   (tall)   | photo5   | photo7          */
.photo-grid .photo-item:nth-child(1) { grid-column: 1; grid-row: 1; }
.photo-grid .photo-item:nth-child(2) { grid-column: 3; grid-row: 1 / span 2; }
.photo-grid .photo-item:nth-child(3) { grid-column: 2; grid-row: 1; }
.photo-grid .photo-item:nth-child(4) { grid-column: 2; grid-row: 2; }
.photo-grid .photo-item:nth-child(5) { grid-column: 2; grid-row: 3; }
.photo-grid .photo-item:nth-child(6) { grid-column: 1; grid-row: 2 / span 2; }
.photo-grid .photo-item:nth-child(7) { grid-column: 3; grid-row: 3; }

.photo-item {
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition:
    transform 0.3s,
    filter 0.3s;
}

.photo-item img:hover {
  transform: scale(1.04);
  filter: brightness(1.08);
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--radius);
  object-fit: contain;
}

#lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#lightbox-close:hover { opacity: 1; }

#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  padding: 1rem;
  transition: opacity 0.2s;
}
#lightbox-prev { left: 1rem; }
#lightbox-next { right: 1rem; }
#lightbox-prev:hover,
#lightbox-next:hover { opacity: 1; }

/* Interest sections */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}

.interest-block h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.interest-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.interest-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.interest-list li:last-child {
  border-bottom: none;
}

.item-title {
  color: var(--text);
}
.item-sub {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}


/* ── Responsive ── */
@media (max-width: 700px) {
  nav ul {
    gap: 1.2rem;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .about-image {
    order: -1;
    max-width: 200px;
  }
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    grid-auto-rows: 180px;
  }
  .photo-grid .photo-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }
}
