:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --text: #1a1a1a;
  --muted: #4d5b71;
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --border: #dfe3ea;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  font-family: Inter, BlinkMacSystemFont, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

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

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

button,
a.btn {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand-box {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.brand-box strong {
  display: block;
  font-size: 1rem;
}

.brand-box p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.theme-toggle {
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  background: var(--surface);
  border-radius: 999px;
  color: var(--text);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--primary);
}

main {
  padding: 2rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-section {
  display: grid;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.hero-copy {
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.hero-copy h1 {
  margin: 1rem 0 1rem;
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  line-height: 1.02;
}

.hero-copy p {
  max-width: 34rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.hero-image {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.hero-logo {
  width: min(280px, 100%);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-card {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card svg,
.feature-icon svg {
  width: 2.25rem;
  height: 2.25rem;
  fill: var(--primary);
}

.hero-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.section-box {
  padding: 2.5rem 0;
}

.section-head h2 {
  margin: 0;
  font-size: 2rem;
}

.section-head p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  max-width: 46rem;
}

.grid-3,
.grid-4,
.project-grid,
.contact-cards {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 2rem;
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 2rem;
}

.feature-card,
.project-card,
.detail-card,
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.feature-card h3,
.detail-card h4,
.contact-card h3,
.project-card h3 {
  margin: 1rem 0 0.75rem;
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
}

.feature-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 2rem;
}

.project-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.project-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  background: var(--primary-soft);
  padding: 0.75rem;
}

.project-card ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.project-card li {
  margin-bottom: 0.65rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.project-links a {
  color: var(--primary);
  font-weight: 600;
}

.detail-card {
  text-align: center;
}

.detail-card img {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  object-fit: contain;
}

.detail-card p {
  margin-top: 0.85rem;
  color: var(--muted);
}

.contact-cards {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 2rem;
}

.contact-card p {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.contact-card a {
  color: var(--primary);
  font-weight: 600;
}

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.site-footer p + p {
  margin-top: 0.5rem;
}

.dark {
  color-scheme: dark;
  --bg: #0d111b;
  --surface: #111827;
  --surface-strong: #161d2b;
  --text: #f8fafc;
  --muted: #a3b1c2;
  --primary: #8b5cf6;
  --primary-soft: rgba(139, 92, 246, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.dark .site-header {
  background: rgba(17, 24, 39, 0.92);
}

.dark .btn-secondary {
  background: #111827;
}

.dark .project-card,
.dark .detail-card,
.dark .feature-card,
.dark .contact-card,
.dark .hero-card {
  background: #111827;
}

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-section {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .project-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header,
  main,
  .section-box {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-copy h1 {
    font-size: 2.5rem;
  }
}

/* Subtle animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.98) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Utility animation class applied via JavaScript */
.animate {
  opacity: 0;
  transform: translateY(8px);
  will-change: opacity, transform;
}
.animate.in-view {
  opacity: 1;
  transform: none;
}

.animate.fade-up.in-view {
  animation: fadeUp 700ms cubic-bezier(.2,.9,.3,1) both;
}
.animate.pop.in-view {
  animation: popIn 500ms cubic-bezier(.2,.9,.3,1) both;
}

/* Gentle hover for cards and buttons */
.btn {
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(79,70,229,0.08);
}

.feature-card, .project-card, .detail-card, .contact-card {
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.feature-card:hover, .project-card:hover, .detail-card:hover, .contact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(15,23,42,0.06);
}

/* Small playful SVG tilt in hero on hover */
.hero-card svg {
  transition: transform 300ms ease;
}
.hero-card:hover svg {
  transform: rotate(-6deg) translateY(-2px);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate, .btn, .feature-card, .project-card, .detail-card, .contact-card, .hero-card svg {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
