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

:root {
  /* Core backgrounds */
  --white: #ffffff;
  --off-white: #fafaf8;
  --cream: #f5f3ef;

  /* Text */
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-tertiary: #888888;

  /* Accent — warm terracotta */
  --accent: #c4956a;
  --accent-hover: #b07d52;
  --accent-dark: #8a6040;

  /* Borders & dividers */
  --border-light: #e8e5e0;
  --border-medium: #d4d0ca;

  /* Shadows — subtle for light theme */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.15;
  font-weight: 600;
}

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

/* ========== LAYOUT ========== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

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

/* ========== NAVIGATION ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: all 0.3s ease;
}

.nav.scrolled {
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.nav__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  letter-spacing: -0.01em;
}

.nav__links a:hover {
  color: var(--text-primary);
}

.nav__cta {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--accent-dark) !important;
  border: 1.5px solid var(--accent);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  transition: all 0.3s ease !important;
}

.nav__cta:hover {
  background: var(--accent);
  color: var(--white) !important;
}

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  letter-spacing: -0.01em;
}

/* Rotating border button (primary) */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.btn-primary {
  position: relative;
  background: var(--accent);
  color: var(--white);
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-full);
  background: conic-gradient(from var(--border-angle), transparent 40%, var(--accent) 50%, var(--accent-hover) 60%, transparent 70%);
  z-index: -1;
  animation: rotateBorder 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 149, 106, 0.25);
}

@keyframes rotateBorder {
  to { --border-angle: 360deg; }
}

/* Glass button (secondary) */
.btn-glass {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

.hero__grid {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}

.hero__rule {
  width: 48px;
  height: 2px;
  background: var(--accent);
  border: none;
  margin-bottom: 16px;
}

.hero__name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.hero__tagline {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--accent-dark);
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.hero__intro {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 36px;
  max-width: 520px;
}

.hero__image-wrap {
  display: flex;
  justify-content: center;
}

.hero__image {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-light);
  box-shadow: var(--shadow-lg);
}

.hero__image--placeholder {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: var(--cream);
  border: 3px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ========== ABOUT ========== */
.about__grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 60px;
  align-items: start;
}

.about__heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 24px;
}

.about__text p {
  margin-bottom: 16px;
}

.about__text p:last-child {
  margin-bottom: 0;
}

.about__sidebar-heading {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.skill-tag {
  padding: 6px 14px;
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat {
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}

.stat__number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ========== ARTICLES / PORTFOLIO ========== */
.articles__heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 8px;
}

.articles__subtitle {
  color: var(--text-tertiary);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

.articles__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.article-card__publication {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
}

.article-card__date {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.article-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 10px;
}

.article-card__excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.article-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-dark);
  transition: color 0.2s ease;
  margin-top: auto;
}

.article-card__link:hover {
  color: var(--accent-hover);
}

.article-card__link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.article-card__link:hover svg {
  transform: translate(2px, -2px);
}

/* ========== CONTACT ========== */
.contact__inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.contact__heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 12px;
}

.contact__subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.contact-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact-form .btn-primary {
  align-self: flex-start;
  width: 100%;
  justify-content: center;
}

.form-success {
  display: none;
  text-align: center;
  padding: 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  color: #166534;
  font-weight: 500;
}

.form-success.show {
  display: block;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--cream);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

/* ========== FOOTER ========== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.footer__text {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ========== SCROLL ANIMATIONS ========== */
.animate-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .hero__grid {
    gap: 40px;
  }

  .hero__image,
  .hero__image--placeholder {
    width: 280px;
    height: 280px;
  }
}

@media (max-width: 768px) {
  /* Mobile nav */
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  }

  .nav__links.active {
    right: 0;
  }

  .nav__links a {
    font-size: 1rem;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding-top: 120px;
    padding-bottom: 60px;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero__image-wrap {
    order: -1;
  }

  .hero__image,
  .hero__image--placeholder {
    width: 200px;
    height: 200px;
  }

  .hero__intro {
    max-width: 100%;
  }

  .hero__actions {
    justify-content: center;
  }

  /* About */
  .about__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Articles */
  .articles__grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .form-row {
    grid-template-columns: 1fr;
  }
}
