/* ===== HeipDesing portfolio — design tokens ===== */
:root {
  --bg: #08090d;
  --bg-alt: #0d0f16;
  --surface: #12141c;
  --surface-2: #171a24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f5;
  --text-dim: #a7adba;
  --text-faint: #6b7180;
  --accent: #7c6cf3;
  --accent-2: #21d4c0;
  --accent-warm: #f5a623;
  --accent-grad: linear-gradient(135deg, #8b7bff 0%, #5b6ef0 45%, #21d4c0 100%);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f6fb;
  --bg-alt: #eef0f7;
  --surface: #ffffff;
  --surface-2: #f8f8fd;
  --border: rgba(20, 20, 40, 0.08);
  --border-strong: rgba(20, 20, 40, 0.14);
  --text: #14151f;
  --text-dim: #565b6b;
  --text-faint: #8a8fa0;
  --shadow: 0 20px 60px -25px rgba(30, 30, 60, 0.25);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f6fb;
    --bg-alt: #eef0f7;
    --surface: #ffffff;
    --surface-2: #f8f8fd;
    --border: rgba(20, 20, 40, 0.08);
    --border-strong: rgba(20, 20, 40, 0.14);
    --text: #14151f;
    --text-dim: #565b6b;
    --text-faint: #8a8fa0;
    --shadow: 0 20px 60px -25px rgba(30, 30, 60, 0.25);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

section { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--accent-2);
  border-radius: 2px;
}

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; margin: 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 12px;
}
.section-head p {
  color: var(--text-dim);
  font-size: 17px;
  margin: 0;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 18px -6px rgba(124, 108, 243, 0.6);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .sun { display: none; }
:root[data-theme="light"] .icon-btn .moon { display: none; }
:root[data-theme="light"] .icon-btn .sun { display: block; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

.mobile-menu {
  position: fixed;
  inset: 72px 0 auto 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 28px 22px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 13px 6px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

/* ===== Hero ===== */
.hero {
  padding: 168px 0 110px;
  overflow: hidden;
}
.hero .wrap { position: relative; z-index: 2; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
.blob-1 { width: 520px; height: 520px; background: #6f5cf5; top: -180px; right: -120px; }
.blob-2 { width: 420px; height: 420px; background: #21d4c0; top: 220px; left: -160px; opacity: 0.3; }
:root[data-theme="light"] .blob { opacity: 0.22; }

.hero-content { max-width: 780px; }

.hero-content .eyebrow { color: var(--accent-warm); }
.hero-content .eyebrow::before { background: var(--accent-warm); }

.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.05;
  margin-bottom: 22px;
}
.hero h1 .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-dim);
  max-width: 620px;
  margin-bottom: 36px;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 64px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color .18s ease;
}
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(124, 108, 243, 0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(124, 108, 243, 0.7); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.hero-stats .stat b {
  display: block;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  margin-bottom: 4px;
}
.hero-stats .stat span {
  font-size: 13.5px;
  color: var(--text-faint);
}
@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
}

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== Featured projects ===== */
.featured { padding: 40px 0 40px; }

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 60px 0;
  border-top: 1px solid var(--border);
}
.project:first-of-type { border-top: none; }
.project.reverse .project-media { order: 2; }
.project.reverse .project-copy { order: 1; }

@media (max-width: 900px) {
  .project, .project.reverse { grid-template-columns: 1fr; gap: 32px; }
  .project.reverse .project-media { order: 1; }
  .project.reverse .project-copy { order: 2; }
}

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-2);
  margin-bottom: 18px;
}
.project-copy h3 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 14px;
}
.project-copy p {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 22px;
}
.project-copy .highlight {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14.5px;
  margin-bottom: 22px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.project-copy .highlight svg { flex: none; margin-top: 2px; color: var(--accent-warm); width: 16px; height: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.project-media {
  position: relative;
  display: grid;
  gap: 16px;
}
.media-grid-2 { grid-template-columns: 1fr 1fr; }
.media-grid-3 { grid-template-columns: repeat(3, 1fr); }
.media-grid-1 { grid-template-columns: 1fr; }

.shot {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease;
  aspect-ratio: var(--ar, 4 / 5);
}
.shot:hover { transform: translateY(-6px); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.shot-wide { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .media-grid-3 { grid-template-columns: 1fr 1fr; }
  .media-grid-3 .shot:first-child { grid-column: 1 / -1; }
}

.arch-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.arch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
}
.arch-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.arch-row b { color: var(--text); font-weight: 700; }
.arch-arrow { align-self: center; color: var(--text-faint); font-size: 12px; }

/* ===== More projects grid ===== */
.more { padding: 40px 0 100px; }
.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1000px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-cards { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.card-top { display: flex; align-items: center; gap: 12px; }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; }
.card h4 { font-size: 16.5px; }
.card p { margin: 0; font-size: 14px; color: var(--text-dim); flex: 1; }
.card .tags { margin-top: auto; }
.card .tag { font-size: 11px; padding: 4px 9px; }
.card-shot {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
}
.card-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* ===== Stack ===== */
.stack { padding: 40px 0 100px; }
.stack-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 760px) { .stack-groups { grid-template-columns: 1fr; } }
.stack-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
}
.stack-group h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  margin-bottom: 16px;
}
.stack-badges { display: flex; flex-wrap: wrap; gap: 9px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* ===== About ===== */
.about { padding: 40px 0 100px; }
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: start;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; gap: 36px; } }
.about-copy p { color: var(--text-dim); font-size: 16.5px; margin-bottom: 18px; }
.about-copy p:last-child { margin-bottom: 0; }
.about-list { display: flex; flex-direction: column; gap: 18px; }
.about-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.about-item .num {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-2);
  flex: none;
  width: 30px;
}
.about-item h4 { font-size: 15.5px; margin-bottom: 6px; }
.about-item p { margin: 0; font-size: 14px; color: var(--text-dim); }

/* ===== Contact ===== */
.contact { padding: 40px 0 120px; }
.contact-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(150deg, var(--surface) 0%, var(--surface-2) 100%);
  padding: clamp(36px, 6vw, 70px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-card h2 {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 16px;
}
.contact-card p {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 480px;
  margin: 0 auto 32px;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-faint);
}
