/* ============ VARIABLES ============ */
:root {
  /* Day theme (default) — liquid glass */
  --bg: #e8eff7;
  --bg-alt: #dce6f0;
  --text: #1a1a2e;
  --text-muted: #5a6578;
  --border: rgba(255,255,255,0.45);
  --border-outer: rgba(0,0,0,0.06);
  --primary: #0d9488;
  --primary-hover: #0b7c72;
  --primary-glow: rgba(13,148,136,0.25);
  --card-bg: rgba(255,255,255,0.35);
  --card-blur: 16px;
  --card-shadow: 0 8px 32px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
  --card-hover-shadow: 0 12px 40px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.7);
  --nav-bg: rgba(255,255,255,0.25);
  --nav-text: #1a1a2e;
  --hero-overlay: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(0,0,0,0.2));
  --footer-bg: rgba(17,24,39,0.85);
  --footer-text: rgba(255,255,255,0.6);
  --glass-shine: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.15) 100%);
}

[data-theme="night"] {
  --bg: #0c1525;
  --bg-alt: #111d32;
  --text: #e8edf5;
  --text-muted: #8193ab;
  --border: rgba(255,255,255,0.08);
  --border-outer: rgba(255,255,255,0.04);
  --primary: #14b8a6;
  --primary-hover: #0d9488;
  --primary-glow: rgba(20,184,166,0.2);
  --card-bg: rgba(255,255,255,0.04);
  --card-blur: 20px;
  --card-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.06);
  --card-hover-shadow: 0 12px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
  --nav-bg: rgba(12,21,37,0.45);
  --nav-text: #e8edf5;
  --hero-overlay: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
  --footer-bg: rgba(2,6,23,0.85);
  --glass-shine: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.04) 100%);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.6s, color 0.6s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ============ CONTAINER ============ */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: 12px; font-weight: 600;
  font-size: 0.9rem; transition: all 0.3s; cursor: pointer;
  border: none; text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}
.btn-outline {
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}
.btn-nav {
  background: var(--primary); color: #fff !important;
  padding: 8px 20px; border-radius: 10px; font-size: 0.85rem;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-nav:hover { background: var(--primary-hover); }
.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background 0.6s, border-color 0.6s;
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-weight: 800; font-size: 1.1rem; color: var(--nav-text);
  letter-spacing: -0.3px;
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
}
.nav-links a {
  font-size: 0.88rem; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  margin: 5px 0; transition: 0.3s;
}

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: opacity 0.8s ease;
}
.hero-img-day {
  background-image: url('images/hero-day.jpg');
  opacity: 1;
}
.hero-img-night {
  background-image: url('images/hero-night.jpg');
  opacity: 0;
}
[data-theme="night"] .hero-img-day { opacity: 0; }
[data-theme="night"] .hero-img-night { opacity: 1; }

.hero-overlay {
  position: absolute; inset: 0;
  background: var(--hero-overlay);
  transition: background 0.6s;
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; color: #fff;
  max-width: 680px; padding: 0 24px;
}
.hero-tag {
  font-size: 2.6rem; font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 3.2rem; font-weight: 800;
  line-height: 1.15; letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.1rem; opacity: 0.85;
  max-width: 520px; margin: 0 auto 32px;
  line-height: 1.6;
}

/* Scroll reveal text */
.hero-reveal {
  font-size: 1.5rem; line-height: 1.7;
  max-width: 640px; margin: 0 auto 40px;
  opacity: 1;
}
.hero-reveal .char {
  display: inline-block; opacity: 0.12;
  transition: opacity 0.15s ease;
}
.hero-reveal .char.lit { opacity: 1; }
.hero-reveal .char-space { display: inline; width: 0.3em; }
.hero-reveal strong .char { font-weight: 800; }
.hero-reveal strong .char.lit { color: var(--primary); text-shadow: 0 0 20px var(--primary-glow); }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

/* ============ SECTIONS ============ */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 1.8rem; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 8px;
}
.section-sub {
  color: var(--text-muted); font-size: 1rem;
  margin-bottom: 40px;
}

/* ============ GRID ============ */
.grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ============ GLASS CARDS ============ */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
  box-shadow: var(--card-shadow);
  position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, background 0.6s, border-color 0.6s;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--glass-shine);
  pointer-events: none; border-radius: 16px;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover-shadow);
}
.card-icon { font-size: 1.8rem; margin-bottom: 14px; position: relative; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; position: relative; }
.card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; position: relative; }

/* ============ STEPS ============ */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.step {
  text-align: center;
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 24px;
  box-shadow: var(--card-shadow);
  position: relative; overflow: hidden;
}
.step::before {
  content: ''; position: absolute; inset: 0;
  background: var(--glass-shine);
  pointer-events: none; border-radius: 16px;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: 1.2rem;
  margin-bottom: 16px; position: relative;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.step h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; position: relative; }
.step p { font-size: 0.88rem; color: var(--text-muted); position: relative; }

/* ============ PROJECTS — infinite scroll ============ */
.projects-scroll-wrapper {
  overflow: hidden;
  padding: 8px 0 20px;
}
.projects-scroll-track {
  display: flex; gap: 20px;
  animation: scrollProjects 25s linear infinite;
  width: max-content;
}
.projects-scroll-track:hover { animation-play-state: paused; }

@keyframes scrollProjects {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.project-card-mini {
  display: flex; align-items: center; gap: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 20px;
  min-width: 320px; flex-shrink: 0;
  box-shadow: var(--card-shadow);
  text-decoration: none; color: var(--text);
  position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.project-card-mini::before {
  content: ''; position: absolute; inset: 0;
  background: var(--glass-shine);
  pointer-events: none; border-radius: 14px;
}
.project-card-mini:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-hover-shadow);
}
.project-mini-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0; position: relative;
}
.project-mini-info { position: relative; }
.project-mini-info h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.project-mini-info p { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.project-tag {
  display: inline-block; font-size: 0.68rem; font-weight: 600;
  color: var(--primary); background: rgba(13,148,136,0.08);
  padding: 3px 8px; border-radius: 20px;
}

/* ============ CONTACT FORM ============ */
.contact-form {
  max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--border);
  border-radius: 20px; padding: 32px;
  box-shadow: var(--card-shadow);
  position: relative; overflow: hidden;
}
.contact-form::before {
  content: ''; position: absolute; inset: 0;
  background: var(--glass-shine);
  pointer-events: none; border-radius: 20px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; position: relative; }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: 14px 16px; position: relative;
  background: rgba(255,255,255,0.15); border: 1px solid var(--border);
  border-radius: 12px; font-family: inherit; font-size: 0.9rem;
  color: var(--text); transition: border-color 0.3s, background 0.3s;
  backdrop-filter: blur(4px);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-muted); }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none; border-color: var(--primary);
  background: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.contact-form textarea { resize: vertical; }
.contact-form .btn { position: relative; }

/* ============ FOOTER ============ */
.footer {
  background: var(--footer-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer-inner { color: var(--footer-text); }
.footer-logo {
  font-size: 1.1rem; font-weight: 800;
  color: #fff; margin-bottom: 4px;
}
.footer-sub { font-size: 0.85rem; margin-bottom: 12px; }
.footer-copy { font-size: 0.75rem; opacity: 0.5; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; gap: 16px;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    padding: 24px; border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .hero h1 { font-size: 2.2rem; }
  .hero-sub { font-size: 0.95rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .grid-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .projects-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .section-title { font-size: 1.5rem; }
}

/* ============ FORM SUCCESS ============ */
.form-success {
  display: none; text-align: center; padding: 40px 0;
}
.form-success.show {
  display: block;
  animation: fadeUp 0.5s ease;
}
.form-success h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.form-success p { color: var(--text-muted); font-size: 0.9rem; }

/* Animated checkmark */
.success-checkmark { width: 64px; height: 64px; margin: 0 auto 20px; }
.success-checkmark svg { width: 100%; height: 100%; }
.success-checkmark circle {
  stroke: var(--primary); stroke-width: 2;
  stroke-dasharray: 166; stroke-dashoffset: 166;
  animation: checkStroke 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.success-checkmark path {
  stroke: var(--primary); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: checkStroke 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.4s forwards;
}

@keyframes checkStroke {
  to { stroke-dashoffset: 0; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
