/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --text-soft: #8a8a8a;
  --border: #e8e4de;
  --accent: #c45a3f;
  --accent-dark: #a04530;
  --accent-soft: #fbeee9;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.10);
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

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

.nav-brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a {
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}

.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links a:not(.nav-cta):hover { color: var(--text); }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }

.nav-cta,
.nav-links .nav-cta,
.nav-links a.nav-cta {
  background: var(--accent) !important;
  color: #ffffff !important;
  padding: 8px 16px;
  border-radius: 100px;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover,
.nav-links .nav-cta:hover {
  background: var(--accent-dark) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 140px 28px 100px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(196, 90, 63, 0.10) 0%, rgba(196, 90, 63, 0.02) 40%, transparent 70%);
  animation: pulse 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

.hero-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 60px;
  align-items: center;
}

.hero-photo img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-lg);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-text h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text);
}

.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-meta {
  font-size: 13.5px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-meta .dot { color: var(--border); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, color 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(196, 90, 63, 0.25);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 90, 63, 0.35);
}

.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary svg { transition: transform 0.2s; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

/* ============ Sections ============ */
.section {
  padding: 90px 28px;
}

.section-alt {
  background: var(--surface);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 32px;
}

.section-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
  margin-top: -16px;
}

.section-sub a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s;
}
.section-sub a:hover { border-color: var(--accent); }

/* About */
.about-text {
  font-size: 19px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 780px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}

.skill-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.skill-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.project-card:hover::before { transform: scaleX(1); }

.project-tag {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.project-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.project-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

.project-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.2s;
  display: inline-block;
}

.project-card:hover .project-link {
  letter-spacing: 0.01em;
}

/* Contact */
.contact-lead {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 40px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.contact-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}

.contact-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

/* Footer */
.footer {
  padding: 32px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-soft);
  flex-wrap: wrap;
  gap: 12px;
}

.footer a { transition: color 0.2s; }
.footer a:hover { color: var(--accent); }

/* ============ Reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger reveal for grids */
.skills-grid .reveal:nth-child(1) { transition-delay: 0s; }
.skills-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.skills-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.skills-grid .reveal:nth-child(4) { transition-delay: 0.24s; }

.projects-grid .reveal:nth-child(1) { transition-delay: 0s; }
.projects-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.projects-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.projects-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.projects-grid .reveal:nth-child(5) { transition-delay: 0.32s; }

.contact-grid .reveal:nth-child(1) { transition-delay: 0s; }
.contact-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.contact-grid .reveal:nth-child(3) { transition-delay: 0.16s; }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .hero { padding: 110px 22px 70px; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .hero-photo { display: flex; justify-content: center; }
  .hero-photo img { width: 170px; height: 170px; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-meta { justify-content: center; }

  .section { padding: 70px 22px; }
  .skills-grid { grid-template-columns: 1fr; }
  .about-text, .contact-lead { font-size: 17px; }

  .nav-links { gap: 18px; font-size: 13px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-links .nav-cta { display: inline-flex; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 14px 20px; }
  .hero-text h1 { font-size: 26px; }
  .project-card { padding: 22px; }
  .skill-card { padding: 22px; }
}