/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --border: #e1e5ec;
  --text: #12151c;
  --text-muted: #5b6472;
  --accent: #1565c0;
  --accent-dim: #6fa8dc;
  --accent-glow: rgba(21, 101, 192, 0.25);
  --radius: 14px;
  --max-width: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { 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.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }

.section h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: 40px; }

.accent { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 rgba(21,101,192,0);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(255, 255, 255, 0.92);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav-logo img {
  height: 30px;
  width: auto;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 6px;
  color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(600px circle at 20% 20%, var(--accent-glow), transparent 60%),
    radial-gradient(500px circle at 80% 70%, rgba(21,101,192,0.12), transparent 60%),
    var(--bg);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.08;
  margin-bottom: 22px;
}

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Hero entrance animation ---------- */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.eyebrow, .hero h1, .hero-sub, .hero-actions {
  opacity: 0;
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.eyebrow { animation-delay: 0.1s; }
.hero h1 { animation-delay: 0.25s; }
.hero-sub { animation-delay: 0.4s; }
.hero-actions { animation-delay: 0.55s; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: center;
}

.photo-frame {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ---------- Scroll reveal ---------- */
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 2.5s cubic-bezier(0.16, 1, 0.3, 1), transform 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--accent);
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
}
.photo-placeholder img { display: none; }
.photo-placeholder .photo-fallback { display: flex; }

.about-copy p { color: var(--text-muted); margin-bottom: 16px; }
.about-copy strong { color: var(--text); }
.about-copy h2 { margin-bottom: 18px; font-size: clamp(1.8rem, 3.5vw, 2.4rem); }

.stats {
  display: flex;
  gap: 40px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Filters ---------- */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ---------- Logo grid ---------- */
.logo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  max-width: 708px;
  margin: 0 auto;
}

.logo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.logo-card:not(.no-link) { cursor: pointer; }
.logo-card:not(.no-link):hover { transform: translateY(-4px); border-color: var(--accent-dim); }
.logo-card.hidden { display: none; }

.logo-card img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.logo-card h3 { font-size: 0.98rem; color: var(--text); }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.service-card:hover { transform: translateY(-4px); border-color: var(--accent-dim); }

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(21, 101, 192, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.service-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Resume ---------- */
.resume-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
}

.timeline {
  border-left: 2px solid var(--border);
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(21,101,192,0.15);
}
.timeline-date {
  display: block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.timeline-item h3 { font-size: 1.1rem; margin-bottom: 2px; }
.timeline-item p { color: var(--text-muted); font-size: 0.92rem; }

.timeline-role {
  display: flex;
  align-items: center;
  gap: 14px;
}
.timeline-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.skills h3 { font-size: 1.1rem; margin-bottom: 18px; }
.skills-logos { display: flex; flex-wrap: wrap; gap: 16px; }
.skill-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: start;
}
.contact-copy p { color: var(--text-muted); margin-bottom: 20px; }
.contact-copy h2 { margin-bottom: 16px; font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.contact-heading, .contact-sub, .contact-label { text-align: center; }

.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.required-mark { color: var(--accent); }
.form-row input, .form-row textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s ease;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form .btn { align-self: flex-start; }
.form-note { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.footer { padding: 32px 0; border-top: 1px solid var(--border); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-inner a:hover { color: var(--accent); }

.footer-socials {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.footer-social:hover { color: var(--accent); transform: translateY(-2px); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ---------- Page header (subpages) ---------- */
.page-header {
  padding-top: 140px;
  padding-bottom: 40px;
  text-align: center;
}
.page-header h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 14px; }
.page-header-sub { color: var(--text-muted); max-width: 480px; margin: 0 auto; }

.work-cta-inner { text-align: center; }
.work-cta-inner h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 12px; }
.work-cta-inner p { color: var(--text-muted); margin-bottom: 28px; }

/* ---------- Carousel ---------- */
.carousel {
  max-width: 1040px;
  margin: 0 auto;
}

.carousel-stage {
  display: flex;
  align-items: center;
  gap: 20px;
}

.carousel-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.carousel-slide {
  flex: 0 0 auto;
  height: min(600px, 70vh);
  cursor: pointer;
}

.carousel-thumb {
  position: relative;
  height: 100%;
  aspect-ratio: 9/16;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(145deg, var(--surface-2), #d7dce4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  transform: scale(0.88);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.4s ease;
}
.carousel-slide.active .carousel-thumb {
  opacity: 1;
  transform: scale(1);
  cursor: pointer;
}
.carousel-thumb img, .carousel-thumb video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.carousel-play-btn {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, background 0.2s ease;
}
.carousel-play-btn::after {
  content: "";
  position: absolute;
  top: 50%; left: 55%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--text);
}
.carousel-slide.active .carousel-thumb:hover .carousel-play-btn {
  background: var(--accent);
  transform: scale(1.08);
}
.carousel-slide.active .carousel-thumb:hover .carousel-play-btn::after { border-color: transparent transparent transparent #ffffff; }

.carousel-meta { text-align: center; margin-top: 28px; }
.carousel-meta h2 { font-size: 1.4rem; margin-bottom: 6px; }
.carousel-tag { color: var(--text-muted); font-size: 0.85rem; }

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
}

.carousel-arrow {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.carousel-arrow:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.carousel-counter {
  min-width: 76px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .photo-frame { max-width: 220px; margin: 0 auto; }
  .resume-grid { grid-template-columns: 1fr; gap: 48px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 64px; right: 0;
    height: calc(100vh - 64px);
    width: 240px;
    background: var(--bg-alt);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 28px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .section { padding: 72px 0; }

  .carousel-stage { gap: 10px; }
  .carousel-arrow { width: 40px; height: 40px; }
  .carousel-slide { height: auto; width: min(220px, 48vw); }
  .carousel-thumb { height: auto; width: 100%; }
}
