/* =========================================================
   Alex Ding — Personal Site
   Palette: deep navy + warm gold + cream
   ========================================================= */

:root {
  --navy: #16213e;
  --navy-2: #1f2c52;
  --navy-soft: #2a3a68;
  --gold: #a9812e;
  --gold-light: #c9a227;
  --cream: #faf8f3;
  --cream-2: #f2efe6;
  --ink: #1e1e1e;
  --muted: #6a6f78;
  --line: #e4e0d4;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(22, 33, 62, 0.08);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.35em; }

p { margin: 0 0 1em; color: var(--ink); }

.section-eyebrow, .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.6em;
}

.section-lede {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--navy);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--navy);
  position: relative;
  padding: 6px 0;
}

.main-nav a:not(.nav-cta):not(.active)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.main-nav a:not(.nav-cta):hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}

.main-nav a.active { color: var(--gold); }

.nav-cta {
  background: var(--navy);
  color: #fff !important;
  padding: 8px 18px !important;
  border-radius: 999px;
}

.nav-cta:hover { background: var(--navy-soft); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */

.hero {
  padding: 110px 0 90px;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(169, 129, 46, 0.10), transparent 60%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream) 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}

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

.hero-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--shadow);
}

.hero-tagline {
  font-weight: 600;
  color: var(--navy-soft);
  font-size: 1.02rem;
  margin-bottom: 1.2em;
}

.hero-lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 1.6em;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-soft); transform: translateY(-1px); }

.btn-outline {
  border-color: var(--navy);
  color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: #fff; transform: translateY(-1px); }

/* ---------- Sections ---------- */

.section { padding: 90px 0; }
.section-alt { background: var(--cream-2); }

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  margin-top: 2em;
  align-items: start;
}

.about-text p { color: var(--ink); font-size: 1.02rem; }

.about-side {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.about-photo-wrap { width: 100%; }

.about-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: left;
}

.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Timeline ---------- */

.timeline {
  margin-top: 2.2em;
  border-left: 2px solid var(--line);
  padding-left: 32px;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--cream-2);
}

.timeline-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.timeline-body h3 { margin-bottom: 0.3em; }
.timeline-body p { color: var(--muted); max-width: 720px; }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 2em;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-image {
  display: block;
  width: calc(100% + 48px);
  margin: -28px -24px 20px -24px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-meta {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8em;
}

.feature-card p:not(.card-meta) { color: var(--muted); font-size: 0.96rem; margin-bottom: 0; }

.feature-card p a {
  color: var(--gold);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.feature-card p a:hover { color: var(--navy); }

/* ---------- Awards ---------- */

.awards-list {
  list-style: none;
  margin: 2em 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.awards-list li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 0.96rem;
  color: var(--muted);
}

.awards-list li strong { color: var(--navy); }
.awards-list li span { color: var(--gold); font-weight: 600; font-size: 0.85rem; }

/* ---------- Blog preview (index) ---------- */

.blog-preview-grid { margin-bottom: 1.4em; }

.blog-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease;
  overflow: hidden;
}

.blog-card:hover { transform: translateY(-3px); }

.blog-card-image {
  display: block;
  width: calc(100% + 44px);
  margin: -26px -22px 20px -22px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.4em;
}

.blog-card .card-meta { display: flex; gap: 10px; align-items: center; }
.blog-card .tag {
  background: var(--cream-2);
  color: var(--navy-soft);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.blog-card h3 { margin-top: 0.4em; }
.blog-card .excerpt { color: var(--muted); font-size: 0.95rem; }
.blog-card .read-more { margin-top: auto; color: var(--gold); font-weight: 600; font-size: 0.88rem; padding-top: 10px; }

/* ---------- Blog page ---------- */

.blog-hero { padding-top: 64px; padding-bottom: 40px; }

.blog-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.92rem;
}

.blog-detail .post-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 0.6em;
}

.blog-detail h1 { margin-bottom: 0.3em; }
.blog-detail .post-date { color: var(--muted); font-size: 0.9rem; }
.blog-detail .post-body { max-width: 700px; margin-top: 1.6em; font-size: 1.05rem; }
.blog-detail .post-body p { color: var(--ink); }

/* ---------- Contact ---------- */

.contact-section { text-align: center; }
.contact-inner { max-width: 600px; }
.contact-email {
  display: inline-block;
  margin-top: 0.6em;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-photo-wrap { order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { aspect-ratio: 16 / 10; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .blog-list { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: 68px;
    left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 28px 28px;
    gap: 18px;
    transform: translateY(-130%);
    transition: transform 0.25s ease;
  }
  .main-nav.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .card-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .hero { padding: 90px 0 60px; }
  .section { padding: 64px 0; }
}
