/* === Layout — v5.0 === */

body { background: var(--bg); }

/* Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Sections */
.section {
  padding: 0;
  margin-bottom: var(--s-section);
  position: relative;
}
.section:last-of-type { margin-bottom: 0; }

.section-alternate {
  background: var(--surface);
  padding: var(--s-9) 0;
  margin-bottom: var(--s-section);
}

/* Section header */
.section-header { margin-bottom: var(--s-8); }
.section-header .kicker { display: block; margin-bottom: var(--s-4); }
.section-header h2 { color: var(--text); margin-bottom: var(--s-4); }
.section-header p { color: var(--text-soft); max-width: var(--content); }

/* === Nav === */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  background: rgba(242, 237, 227, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nav-links a {
  font-size: var(--text-sm);
  color: var(--text-soft);
  text-decoration: none;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--text); background: var(--bg-tint); }
.nav-links a.active { color: var(--primary); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--s-2);
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all var(--dur-base) var(--ease-out);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-5);
  padding: 80px var(--gutter) var(--gutter);
}
.nav-overlay.open { display: flex; }
.nav-overlay a {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2rem, 8vw, 3.5rem);
  color: var(--text);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-overlay a:hover { color: var(--primary); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 64px;
}

/* Blob background */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg);
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0;
}

.hero-blob--1 {
  width: 60vw; height: 60vw;
  max-width: 720px; max-height: 720px;
  background: radial-gradient(circle, var(--blob-violet) 0%, transparent 65%);
  top: -20%; right: -15%;
  animation: blob-enter 1.4s var(--ease-out) 0.1s forwards, blob-float-1 20s ease-in-out 1.5s infinite;
}

.hero-blob--2 {
  width: 50vw; height: 50vw;
  max-width: 600px; max-height: 600px;
  background: radial-gradient(circle, var(--blob-terra) 0%, transparent 65%);
  bottom: -10%; left: -12%;
  animation: blob-enter 1.4s var(--ease-out) 0.3s forwards, blob-float-2 24s ease-in-out 1.7s infinite;
}

.hero-blob--3 {
  width: 40vw; height: 40vw;
  max-width: 460px; max-height: 460px;
  background: radial-gradient(circle, var(--blob-green) 0%, transparent 65%);
  top: 20%; left: 5%;
  animation: blob-enter 1.4s var(--ease-out) 0.2s forwards, blob-float-3 28s ease-in-out 1.9s infinite;
}

.hero-grain {
  position: absolute; inset: 0; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04; pointer-events: none; mix-blend-mode: multiply;
}

/* Marquee */
.hero-marquee {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center;
  overflow: hidden; pointer-events: none;
}
.hero-marquee-text {
  font-size: clamp(6rem, 14vw, 11rem);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: rgba(91, 71, 208, 0.05);
  white-space: nowrap;
  animation: marquee 90s linear infinite;
  user-select: none;
  letter-spacing: 0.04em;
}

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

/* Hero content */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 860px;
  padding: var(--s-9) var(--gutter);
}

.hero-content .hero-title {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s-4);
}

.hero-content h1 {
  color: var(--text);
  margin-bottom: var(--s-5);
}

/* Chromatic aberration — signature moment */
.hero-chroma {
  text-shadow:
    -3px 0 0 rgba(0, 80, 255, 0.30),
     3px 0 0 rgba(220, 40, 0, 0.25),
     0   0 60px rgba(91, 71, 208, 0.08);
}

.hero-content .hero-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto var(--s-7);
}

.hero-actions {
  display: flex;
  gap: var(--s-4);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-photo {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--hairline);
  margin: var(--s-7) auto 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.hero-photo .placeholder-icon { color: var(--text-mute); font-size: 2.5rem; }

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.service-icon { font-size: 1.5rem; margin-bottom: var(--s-4); }
.card h3 { color: var(--text); margin-bottom: var(--s-4); }
.card p { color: var(--text-soft); font-size: var(--text-sm); line-height: 1.6; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.tag {
  font-size: 0.72rem; font-weight: 500;
  padding: 3px 10px; border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}
.tag-tech { background: var(--primary-soft); color: var(--primary); }
.tag-warm { background: var(--terracotta-soft); color: var(--terracotta); }

/* === Services Grid === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
@media (max-width: 1024px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .services-grid { grid-template-columns: 1fr; } }

/* === Projects === */
.projects-list { display: flex; flex-direction: column; gap: var(--s-5); }

.project-card {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 0;
  min-height: 280px;
  padding: 0;
  overflow: hidden;
}
@media (max-width: 1024px) { .project-card { grid-template-columns: 1fr; min-height: auto; } }

.project-card-image {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  min-height: 220px;
  background: var(--bg-tint);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
@media (max-width: 1024px) { .project-card-image { border-radius: var(--radius-lg) var(--radius-lg) 0 0; } }

.project-card-content {
  padding: var(--s-7) var(--s-6);
  display: flex; flex-direction: column; justify-content: center;
}
.project-tags { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-4); }

/* === Skills === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
@media (max-width: 1024px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .skills-grid { grid-template-columns: 1fr; } }

/* === About === */
.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--s-9);
  align-items: start;
}
@media (max-width: 1024px) { .about-layout { grid-template-columns: 1fr; gap: var(--s-7); } }

.about-photo {
  width: 100%; aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: var(--bg-tint);
  border: 1px solid var(--hairline);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}

/* === Timeline === */
.timeline { position: relative; padding-left: var(--s-7); max-width: 600px; }
.timeline::before {
  content: ''; position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 1px; background: var(--hairline);
}
.timeline-item { position: relative; padding-bottom: var(--s-7); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute;
  left: calc(-1 * var(--s-7) + 5px); top: 7px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg);
}
.timeline-period {
  font-family: var(--font-display);
  font-style: italic; font-size: var(--text-xs);
  color: var(--terracotta); display: block; margin-bottom: 2px;
}
.timeline-company { font-size: var(--text-sm); color: var(--text-mute); display: block; margin-bottom: var(--s-2); }
.timeline-item h3 { color: var(--text); font-size: var(--text-title); font-weight: 600; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-size: var(--text-body); font-weight: 600;
  padding: 14px 28px; border-radius: var(--radius-md);
  text-decoration: none; border: none; cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 71, 208, 0.25);
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--hairline);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-sm { padding: 10px 20px; font-size: var(--text-sm); }

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--s-7) var(--gutter) var(--s-6);
  margin-top: var(--s-section);
}
.footer-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--s-4);
}
.footer-mute { color: var(--text-mute); font-size: var(--text-sm); }
.footer-links { display: flex; gap: var(--s-5); }
.footer-links a { font-size: var(--text-sm); color: var(--text-mute); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
.footer-links a:hover { color: var(--primary); }

/* === Contact === */
.contact-links { display: flex; gap: var(--s-5); flex-wrap: wrap; }

/* Scroll offset */
.scroll-offset { scroll-margin-top: 80px; }

@media (max-width: 640px) {
  .section { margin-bottom: var(--s-9); }
  .hero-photo { width: 130px; height: 130px; }
  .contact-links { flex-direction: column; gap: var(--s-4); }
  .footer-inner { flex-direction: column; text-align: center; }
}
