/* ── Custom properties ─────────────────────────────── */
:root {
  --bg:       #fafafa;
  --surface:  #ffffff;
  --text:     #1a1a1a;
  --muted:    #6b7280;
  --accent:   #2563eb;
  --accent-h: #1d4ed8;
  --border:   #e5e7eb;
  --radius:   10px;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-h: 0 4px 12px rgba(0,0,0,.12), 0 8px 28px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-w: 1100px;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Utilities ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container--narrow { max-width: 620px; }

/* ── Navigation ────────────────────────────────────── */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,250,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  color: var(--text);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s;
}
.nav-links a:hover { color: var(--accent); }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

@media (max-width: 640px) {
  /* solid background on mobile — blur looks muddy over content */
  .nav-wrap { background: var(--bg); }

  .nav-toggle { display: flex; }

  /* dropdown below the bar instead of a side drawer */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    padding: 0;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }

  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a { display: block; padding: .9rem 1.25rem; font-size: 1rem; color: var(--text); }

  .nav-wrap.open .nav-links { max-height: 260px; }

  /* animate hamburger → X when open */
  .nav-wrap.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-wrap.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-wrap.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ── Sections ──────────────────────────────────────── */
.section {
  padding: 5rem 0;
}
.section--alt { background: var(--surface); }

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.section-sub {
  color: var(--muted);
  margin-bottom: 2.5rem;
  font-size: .95rem;
}

/* ── Hero ──────────────────────────────────────────── */
.hero { padding: 5rem 0 4rem; }

.hero-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3rem;
}

.hero-photo {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 4px solid var(--border);
  flex-shrink: 0;
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: .5rem;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.social-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.social-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.social-link--yt:hover { background: #ff0000; border-color: #ff0000; }

@media (max-width: 640px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-photo {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }
  .hero-links { justify-content: center; }
}

/* ── Family ────────────────────────────────────────── */
/* ── Family carousel ───────────────────────────────── */
.carousel {
  position: relative;
  margin-bottom: 3rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  aspect-ratio: 2 / 1;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity .7s ease;
  pointer-events: none;
}
.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.35);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  z-index: 10;
}
.carousel-btn:hover { background: rgba(0,0,0,.6); }
.carousel-btn--prev { left: .75rem; }
.carousel-btn--next { right: .75rem; }

.carousel-counter {
  position: absolute;
  bottom: .6rem;
  right: .9rem;
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,.4);
  padding: .2rem .55rem;
  border-radius: 999px;
  z-index: 10;
  letter-spacing: .02em;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .family-grid { grid-template-columns: repeat(4, 1fr); }
}

.family-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: .5rem;
  transition: box-shadow .2s, transform .2s;
}
.family-card:hover {
  box-shadow: var(--shadow-h);
  transform: translateY(-3px);
}

.family-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  margin-bottom: .5rem;
  border: 3px solid var(--border);
}

.family-card h3 {
  font-size: 1rem;
  font-weight: 700;
}

.family-role {
  font-size: .8rem;
  color: var(--muted);
}

.family-cta {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: .25rem;
}
.family-card:hover .family-cta { text-decoration: underline; }

/* ── Project & App cards ───────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  gap: .75rem;
  transition: box-shadow .2s, transform .2s;
}
.card:hover {
  box-shadow: var(--shadow-h);
  transform: translateY(-3px);
}

.card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .35rem;
}
.card-body p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.55;
}

.card-cta {
  margin-top: auto;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
}
.card:hover .card-cta { text-decoration: underline; }

/* app-specific card additions */
.card--app { flex-direction: column; gap: 1rem; }

.card-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #01875f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.card-app-icon svg { width: 28px; height: 28px; }
.card-app-icon--apple { background: #000; }
.card-app-icon--ms    { background: #0078d4; }
.card-app-icon--img   { background: none; padding: 0; }
.card-app-icon--img img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }

.card-platform {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .25rem;
}

/* ── Contact form ──────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.field-group { display: flex; flex-direction: column; gap: .35rem; }

.field-group label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  resize: vertical;
}
.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.btn-submit {
  align-self: flex-start;
  padding: .7rem 1.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  transition: background .15s, transform .1s;
}
.btn-submit:hover:not(:disabled) { background: var(--accent-h); transform: translateY(-1px); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.form-status {
  font-size: .9rem;
  font-weight: 500;
  min-height: 1.4rem;
}
.form-status.success { color: #16a34a; }
.form-status.error   { color: #dc2626; }

/* ── Footer ────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
}
