:root {
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #a1a1a6;
  --accent: #1d1d1f;
  --accent-blue: #0066cc;
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.16);
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 980px;
  --container: 1080px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 140px;
}

main { overflow-x: hidden; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
}

h1 { letter-spacing: -0.03em; }
h2 { letter-spacing: -0.02em; }
h3, h4 { letter-spacing: 0; }

a { text-decoration: none; color: inherit; }
img { display: block; width: 100%; height: auto; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
section { padding: 100px 0; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  /* Only opacity/color transitions allowed; transform is active-only */
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-dark { background: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--border-strong); color: var(--text-primary); }

/* Apple Instant Feedback */
.btn:active, .filter-btn:active, .portfolio-card:active {
  transform: scale(0.97);
  transition: transform 100ms ease-out;
}

.tag {
  display: inline-block; padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: 0.8rem; font-weight: 500; background: rgba(0,0,0,0.04); color: var(--text-secondary);
}

/* ─── Navbar (Apple Glass) ─── */
.navbar {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  padding: 12px 24px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 64px); max-width: var(--container); z-index: 1000;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  /* JS handles structural motion */
}

.nav-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1rem; }
.nav-logo {
  width: 32px; height: 32px; background: var(--accent); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  font-size: 0.9rem; font-weight: 400; color: var(--text-primary);
  padding: 8px 16px; border-radius: var(--radius-pill);
  transition: background 0.2s;
}
.nav-links a:hover { background: rgba(0,0,0,0.04); }
.nav-links a.nav-cta { background: var(--accent); color: #fff; font-weight: 500; }

.nav-hamburger {
  display: none; width: 32px; height: 32px; background: none; border: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-hamburger span {
  display: block; width: 18px; height: 1.5px; background: var(--text-primary);
  transition: transform 0.3s ease-out, opacity 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── Mobile Menu Sheet ─── */
.mobile-menu {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  padding: 100px 32px 32px; z-index: 999;
  touch-action: none; /* Required for 1:1 JS tracking */
  /* Transforms/opacity handled by JS Springs */
}
.mobile-menu-handle {
  width: 40px; height: 5px; background: var(--border-strong);
  border-radius: 10px; margin: 0 auto 32px;
}
.mobile-menu a {
  display: block; padding: 16px; font-size: 1.5rem; font-weight: 600;
  border-bottom: 1px solid var(--border); color: var(--text-primary);
}

/* ─── Hero ─── */
.hero-section { padding: 60px 0 80px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.hero-title { font-size: clamp(3rem, 6vw, 4.5rem); margin-bottom: 24px; max-width: 900px; }
.hero-title em { font-style: normal; color: var(--text-secondary); }
.hero-tagline { font-size: 1.2rem; color: var(--text-secondary); max-width: 600px; margin-bottom: 48px; }
.hero-actions { display: flex; gap: 16px; margin-bottom: 80px; justify-content: center; }
.hero-stats { display: flex; justify-content: center; gap: 64px; border-top: 1px solid var(--border); padding-top: 48px; width: 100%; max-width: 800px; }
.stat-value { font-size: 2.5rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.04em; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }

.section-label {
  display: block; font-size: 0.85rem; font-weight: 600; color: var(--accent-blue);
  margin-bottom: 16px;
}

/* ─── About ─── */
.about-container { max-width: 800px; }
.about-h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 32px; }
.about-bio p { margin-bottom: 24px; color: var(--text-secondary); font-size: 1.15rem; }
.about-details { margin-top: 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.detail-title { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); margin-bottom: 32px; }
.timeline-item { margin-bottom: 32px; }
.timeline-date { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
.timeline-content h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.timeline-content p { font-size: 0.95rem; color: var(--text-secondary); }

/* ─── Portfolio Grid ─── */
.portfolio-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 48px; }
.filter-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 10px 20px; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: rgba(0,0,0,0.04); color: var(--text-primary); cursor: pointer;
  font-family: inherit; font-size: 0.9rem; font-weight: 500;
  transition: background 0.2s;
}
.filter-btn.active { background: var(--accent); color: #fff; }

.portfolio-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px 32px; }
.portfolio-img-wrapper {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 4 / 3; background: #eae8e4;
}
.portfolio-img { width: 100%; height: 100%; object-fit: cover; }
.portfolio-meta { margin-top: 16px; }
.portfolio-cat { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.portfolio-title-row { display: flex; justify-content: space-between; align-items: center; }
.portfolio-card h3 { font-size: 1.25rem; font-weight: 600; }

/* ─── Services ─── */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.service-card {
  background: var(--bg-card); padding: 48px; border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.02);
}
.service-num { font-size: 1.1rem; font-weight: 600; color: var(--text-tertiary); }
.service-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 12px; }
.service-desc { color: var(--text-secondary); font-size: 1rem; }

/* ─── Contact ─── */
.contact-section { text-align: center; max-width: 600px; margin: 0 auto; padding: 40px 0; }
.contact-section h2 { font-size: clamp(2.5rem, 4vw, 3.5rem); margin-bottom: 24px; }
.contact-section p { color: var(--text-secondary); margin-bottom: 48px; font-size: 1.15rem; }
.contact-actions { display: flex; justify-content: center; gap: 16px; }

/* ─── Footer ─── */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-secondary); }

/* Default state for JS reveals */
.reveal { opacity: 0; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .about-details, .portfolio-grid, .services-grid { grid-template-columns: 1fr; }
  .portfolio-header { flex-direction: column; align-items: flex-start; gap: 24px; }
}