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

:root {
  --clr-bg:       #f8f9fa;
  --clr-surface:  #ffffff;
  --clr-border:   #e2e8f0;
  --clr-text:     #1a202c;
  --clr-muted:    #64748b;
  --clr-accent:   #2563eb;
  --clr-accent-h: #1d4ed8;
  --clr-tag-bg:   #eff6ff;
  --clr-tag-txt:  #1d4ed8;
  --radius:       8px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --max-w:        1100px;
  --nav-h:        64px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  font-size: 1rem;
}

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

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

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--clr-text);
  letter-spacing: -.3px;
}
.nav-logo:hover { text-decoration: none; }

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

.nav-links a {
  color: var(--clr-muted);
  font-size: .95rem;
  font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--clr-accent); text-decoration: none; }

/* ── Hero ── */
.hero-banner {
  background: url('../img/banner-1.jpg') center center / cover no-repeat;
  position: relative;
}
.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.82);
}
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.15;
  margin-bottom: .75rem;
}

.hero-text .subtitle {
  font-size: 1.2rem;
  color: var(--clr-muted);
  margin-bottom: 1.5rem;
  max-width: 520px;
}

.hero-text .bio {
  color: var(--clr-muted);
  max-width: 520px;
  margin-bottom: 1.25rem;
  font-size: .975rem;
  line-height: 1.7;
}

.hero-text .bio-personal {
  margin-top: 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  max-width: 520px;
  margin-bottom: 1.25rem;
}

.skill-tags span {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border, #e2e8f0);
  color: var(--clr-accent);
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-group { display: flex; gap: .75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  border: none;
}

.btn-primary {
  background: var(--clr-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--clr-accent-h); text-decoration: none; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--clr-accent);
  border: 1.5px solid var(--clr-accent);
}
.btn-outline:hover { background: var(--clr-tag-bg); text-decoration: none; }

.avatar-wrap { position: relative; width: 160px; height: 160px; margin-top: -120px; }

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--clr-border);
  box-shadow: var(--shadow-md);
  background: var(--clr-border);
}

/* ── Section ── */
section { max-width: var(--max-w); margin: 0 auto; padding: 3.5rem 1.5rem; }

.section-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-accent);
  margin-bottom: .5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 2rem;
}

/* ── Skills strip ── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.skill-badge {
  padding: .35rem .85rem;
  background: var(--clr-tag-bg);
  color: var(--clr-tag-txt);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
}

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

.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: #f1f5f9;
}

.card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .6rem; }

.card-title { font-size: 1.1rem; font-weight: 700; color: var(--clr-text); }

.card-desc { font-size: .9rem; color: var(--clr-muted); flex: 1; }

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; }

.tag {
  padding: .2rem .6rem;
  background: var(--clr-tag-bg);
  color: var(--clr-tag-txt);
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 600;
}

.card-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--clr-border);
  display: flex;
  gap: .75rem;
}

.card-footer a {
  font-size: .85rem;
  font-weight: 600;
  color: var(--clr-accent);
}

/* ── Contact ── */
.contact-box {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 540px;
}

.contact-box p { color: var(--clr-muted); font-size: .975rem; }

.contact-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.contact-links a { font-weight: 600; font-size: .95rem; }

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

/* ── Project page ── */
.project-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--clr-muted);
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--clr-accent); text-decoration: none; }

.project-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.4px;
  margin-bottom: .5rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.project-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.project-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 .75rem;
}
.project-content h2:first-child { margin-top: 0; }

.project-content p { color: var(--clr-muted); margin-bottom: 1rem; font-size: .975rem; }

.project-content ul {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--clr-muted);
  font-size: .975rem;
  margin-bottom: 1rem;
}

.project-content ul li { margin-bottom: .4rem; }

/* Map */
#project-map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--clr-border);
  margin: 1.5rem 0;
}

/* Screenshots */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.screenshot-grid img {
  border-radius: var(--radius);
  border: 1px solid var(--clr-border);
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--clr-border);
  cursor: pointer;
  transition: box-shadow .15s;
}
.screenshot-grid img:hover { box-shadow: var(--shadow-md); }

.screenshot-figure {
  margin: 0;
}

.screenshot-figure figcaption {
  font-size: .8rem;
  color: var(--clr-muted);
  margin-top: .35rem;
}

/* Sidebar */
.project-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.sidebar-card h3 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--clr-muted);
  margin-bottom: .75rem;
}

.sidebar-card .tag-row { margin-bottom: 0; }

.sidebar-links { display: flex; flex-direction: column; gap: .5rem; }
.sidebar-links a {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  font-weight: 600;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
  font-weight: 300;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 3rem 1.25rem 2.5rem; }
  .avatar { width: 100px; height: 100px; }
  .hero { gap: 1.5rem; }
  .hero-text { order: 2; }
  .avatar-wrap { order: 1; margin-top: 0; }
  .project-body { grid-template-columns: 1fr; }
  .project-sidebar { position: static; }
}

/* ── Story Map ── */
.story-cover {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0d1f2d;
}
.story-cover img.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .45;
}
.story-cover-content {
  position: relative;
  max-width: 760px;
  padding: 3rem 2.5rem 4rem;
  color: #fff;
  text-align: center;
}
.story-cover-content .back-link {
  color: rgba(255,255,255,.7);
  font-size: .85rem;
  display: inline-block;
  margin-bottom: 1.5rem;
}
.story-cover-content .back-link:hover { color: #fff; }
.story-cover-content .story-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: .75rem;
}
.story-cover-content h1 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #fff;
}
.story-cover-content .story-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,.8);
  font-style: italic;
  margin-bottom: 1.25rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.story-cover-content .story-byline {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
}
.story-cover-content .story-byline strong { color: rgba(255,255,255,.85); }

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  text-align: center;
  animation: bounce 2s infinite;
}
.scroll-cue::after { content: '↓'; display: block; font-size: 1.2rem; }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

.story-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.story-section.wide { max-width: 1000px; }
.story-section h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #0d1f2d;
  margin-bottom: 1rem;
  line-height: 1.3;
}
.story-section p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #374151;
  margin-bottom: 1.2rem;
}
.story-section p:last-child { margin-bottom: 0; }

.pull-quote {
  border-left: 4px solid #2563eb;
  margin: 2.5rem 0;
  padding: .75rem 1.5rem;
  background: #f0f6ff;
  border-radius: 0 8px 8px 0;
}
.pull-quote p {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.15rem;
  font-style: italic;
  color: #1e3a5f;
  margin: 0;
}

.story-img-full {
  display: block;
  max-width: 624px;
  width: 100%;
  margin: 0 auto;
  cursor: pointer;
  transition: opacity .2s;
}
.story-img-full:hover { opacity: .92; }

.story-img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 auto;
  max-width: 1000px;
  padding: 0 1.5rem;
}
.story-img-pair figure { margin: 0; }
.story-img-pair img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .2s;
}
.story-img-pair img:hover { opacity: .9; }

.story-img-contained {
  display: block;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.story-img-contained img {
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .2s;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.story-img-contained img:hover { opacity: .9; }

.story-caption {
  text-align: center;
  font-size: .82rem;
  color: #6b7280;
  margin-top: .6rem;
  padding: 0 1.5rem;
  font-style: italic;
}

.story-divider {
  width: 60px;
  height: 3px;
  background: #2563eb;
  margin: 0 auto 3rem;
  border-radius: 2px;
}

.story-interlude {
  background: #0d1f2d;
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
}
.story-interlude h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 1rem;
}
.story-interlude p {
  font-size: 1.05rem;
  color: rgba(255,255,255,.75);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

.story-conclusion {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 5rem 1.5rem;
  text-align: center;
}
.story-conclusion h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.8rem;
  color: #0d1f2d;
  margin-bottom: 1rem;
}
.story-conclusion p {
  font-size: 1.1rem;
  color: #374151;
  max-width: 600px;
  margin: 0 auto 1rem;
  line-height: 1.8;
}
.story-conclusion .closing-line {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: #2563eb;
  margin-top: 2rem;
}

.story-meta-strip {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 2rem 1.5rem;
}
.story-meta-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}
.story-meta-group h4 {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .5rem;
}
.story-meta-group .tag-row { gap: .4rem; }

@media (max-width: 640px) {
  .story-img-pair { grid-template-columns: 1fr; }
  .story-cover-content { padding: 2rem 1.25rem 3rem; }
}
