/* ---------- Theme tokens ---------- */
:root {
  --bg: #fbfaf7;
  --bg-soft: #f3f1ec;
  --surface: #ffffff;
  --text: #22262b;
  --muted: #5f6770;
  --border: #e6e2da;
  --accent: #3b6ea5;
  --accent-soft: #e6eef7;
  --shadow: 0 1px 2px rgb(30 35 40 / 0.04), 0 8px 24px rgb(30 35 40 / 0.06);
  --radius: 16px;
  --max: 960px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171b;
    --bg-soft: #1a1e23;
    --surface: #1d2227;
    --text: #e9ebee;
    --muted: #a1a9b3;
    --border: #2c323a;
    --accent: #8db8e8;
    --accent-soft: #22303f;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #14171b;
  --bg-soft: #1a1e23;
  --surface: #1d2227;
  --text: #e9ebee;
  --muted: #a1a9b3;
  --border: #2c323a;
  --accent: #8db8e8;
  --accent-soft: #22303f;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 400; line-height: 1.15; margin: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

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

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links > li > a,
.dropdown-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.nav-links > li > a:hover,
.dropdown-toggle:hover,
.dropdown-toggle[aria-expanded="true"],
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.dropdown { position: relative; }
.dropdown-toggle svg { transition: transform 0.2s; }
.dropdown-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.dropdown-menu a:hover { background: var(--bg-soft); }
.menu-title { display: block; font-weight: 600; font-size: 0.95rem; }
.menu-desc { display: block; font-size: 0.85rem; color: var(--muted); }

.theme-toggle { padding: 8px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

section { padding: 56px 0; }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 28px;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(72px, 14vw, 140px) 0 64px; max-width: 680px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 4.75rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

.lede {
  margin: 24px 0 36px;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--muted);
  max-width: 34em;
}

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

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.97rem;
  text-decoration: none;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-ghost { color: var(--text); border: 1px solid var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- About cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}

.card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* ---------- Projects ---------- */
.project-list { display: grid; gap: 14px; }

.project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.project:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.project h3 { font-size: 1.35rem; margin-bottom: 4px; }
.project p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.project-arrow { font-size: 1.4rem; color: var(--accent); transition: transform 0.15s; }
.project:hover .project-arrow { transform: translateX(4px); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--max);
  margin: 40px auto 0;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { padding: 12px 16px; }
  main { padding: 0 16px; }
  .brand { font-size: 1.05rem; }
  .nav-links > li > a, .dropdown-toggle { padding: 8px 8px; font-size: 0.9rem; }
  .dropdown-menu { right: -48px; min-width: 240px; }
  .project { padding: 20px; }
  .card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
