:root {
  color-scheme: dark;
  --bg: #060a15;
  --bg2: #101b36;
  --text: #eaf1ff;
  --muted: #9eb4e4;
  --line: rgba(120, 157, 255, 0.28);
  --glass: rgba(14, 24, 48, 0.64);
  --chip: rgba(255,255,255,.03);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 700px at 0% -10%, #1e2f65 0%, transparent 50%),
              radial-gradient(1200px 700px at 100% 0%, #263972 0%, transparent 48%),
              linear-gradient(140deg, var(--bg), var(--bg2));
  min-height: 100vh;
}

#bg-canvas { position: fixed; inset: 0; z-index: 0; opacity: .55; pointer-events: none; }
.container { width: min(1120px, 92vw); margin-inline: auto; position: relative; z-index: 2; }
.glass { background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); border-radius: 14px; }

#nav-reveal-zone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  z-index: 25;
}

.site-header {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: min(1120px, 92vw);
  z-index: 20;
  transition: transform .28s ease, opacity .28s ease;
}

body.nav-hidden .site-header {
  transform: translate(-50%, -140%);
  opacity: 0;
  pointer-events: none;
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.brand { font-weight: 800; letter-spacing: 0.5px; color: var(--text); text-decoration: none; }
nav a { color: var(--text); text-decoration: none; margin-left: 18px; opacity: .9; }
nav a:hover { opacity: 1; }
.theme-toggle {
  margin-left: 12px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}
#theme-icon { line-height: 1; display:inline-flex; align-items:center; justify-content:center; }
#icon-moon { display: none; }
:root[data-theme='dark'] #icon-sun { display:none; }
:root[data-theme='dark'] #icon-moon { display:block; }
:root[data-theme='light'] #icon-sun { display:block; }
:root[data-theme='light'] #icon-moon { display:none; }

.hero { padding: 0; }
.hero-image-blend {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}
.hero-fullscreen {
  width: 100%;
}
.hero-image-layer {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to bottom, rgba(6,10,21,0.10) 0%, rgba(6,10,21,0.24) 55%, rgba(6,10,21,0.82) 82%, rgba(6,10,21,1) 100%),
    url('../assets/hero-start.jpg');
  background-size: cover;
  background-position: center center;
  z-index: 0;
}
:root[data-theme='light'] .hero-image-layer {
  background-image:
    linear-gradient(to bottom, rgba(238,243,255,0.08) 0%, rgba(238,243,255,0.20) 55%, rgba(238,243,255,0.86) 82%, rgba(238,243,255,1) 100%),
    url('../assets/hero-start.jpg');
}
.hero-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.4rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 6vh, 4rem);
  max-width: 1120px;
}
.eyebrow { color: var(--muted); font-weight: 700; letter-spacing: .12em; font-size: .78rem; }
h1 { font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 1.02; margin: .4rem 0 .8rem; text-wrap: balance; }
.lead { color: var(--muted); max-width: 62ch; font-size: clamp(1rem, 2.2vw, 1.25rem); }
.hero-actions { display: flex; gap: 10px; margin-top: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 10px 14px; border: 1px solid var(--line); text-decoration: none; color: var(--text); cursor: pointer; }
.btn-primary { background: linear-gradient(135deg, #4b8dff, #6bc6ff); color: #071427; font-weight: 700; border: 0; }
.btn-ghost { background: var(--chip); }

.section { padding: 3.2rem 0; }
.section h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 1rem; }

.grid.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card { padding: 1.1rem; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.card h3 { margin-top: 0; }
.card p { color: var(--muted); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.muted { color: var(--muted); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.project-item {
  border: 1px solid var(--line);
  background: rgba(10, 18, 34, .45);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.project-item img { width: 100%; height: 220px; object-fit: cover; display:block; transition: transform .3s ease; }
.project-item:hover img { transform: scale(1.05); }
.project-card-meta { padding: 10px 12px; border-top: 1px solid var(--line); background: rgba(8, 14, 28, .45); }
.project-card-title { font-weight: 700; margin-bottom: 4px; }
.project-card-sub { font-size: 12px; color: var(--muted); }
.project-title { font-weight: 700; margin-bottom: 6px; }
.project-line { font-size: 12px; color: var(--muted); margin: 2px 0; line-height: 1.35; }
.project-line strong { color: var(--text); font-weight: 600; }

.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; align-items: stretch; }
.contact-card { padding: 16px; }
.contact-expanded { padding: 24px; min-height: 220px; }
.contact-card a { color: #d3e3ff; }
.metric { display: grid; place-items: center; min-height: 220px; }
.num { font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 800; }
.label { color: var(--muted); }

.footer { color: var(--muted); padding: 2rem 0 3rem; }

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(92vw, 1200px);
}
.lightbox::backdrop { background: rgba(0,0,0,.75); }
#lightbox-img { width: 100%; max-height: 78vh; object-fit: contain; border-radius: 12px; }
.lightbox-meta {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(6, 10, 18, .55);
  color: #dbe7ff;
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 980px) {
  .grid.cards, .project-grid, .split { grid-template-columns: 1fr; }
  nav { display: none; }
  .project-item img { height: 240px; }
}
