/* ---------- Design tokens ---------- */
:root {
  --bg: #FAF5EE;
  --bg-alt: #F1E8DB;
  --text: #2A2521;
  --text-muted: #6E6259;
  --accent: #B5573F;
  --accent-soft: #EBDACB;
  --border: #E4D8C8;
  --card-bg: #FFFFFF;
  --shadow: rgba(43, 34, 24, 0.08);
  --nav-bg: rgba(250, 245, 238, 0.85);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 920px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1714;
    --bg-alt: #221C18;
    --text: #EDE6DC;
    --text-muted: #A79A8C;
    --accent: #E28863;
    --accent-soft: #3A2C22;
    --border: #33291F;
    --card-bg: #221C18;
    --shadow: rgba(0, 0, 0, 0.35);
    --nav-bg: rgba(27, 23, 20, 0.85);
  }
}

:root[data-theme="dark"] {
  --bg: #1B1714;
  --bg-alt: #221C18;
  --text: #EDE6DC;
  --text-muted: #A79A8C;
  --accent: #E28863;
  --accent-soft: #3A2C22;
  --border: #33291F;
  --card-bg: #221C18;
  --shadow: rgba(0, 0, 0, 0.35);
  --nav-bg: rgba(27, 23, 20, 0.85);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--text);
}

p { margin: 0 0 1.2em; color: var(--text); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; border-radius: 10px; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-nav .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
}
.site-nav .brand:hover { text-decoration: none; }

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
}

.hero .eyebrow {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  max-width: 14ch;
}

.hero .lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin-top: 20px;
}

.hero .cta-row {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { text-decoration: none; opacity: 0.9; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
section.alt { background: var(--bg-alt); }

.section-heading {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

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

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}

.about-photo figure {
  margin: 0;
}

.about-photo figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
}

.about-photo img {
  box-shadow: 0 12px 32px var(--shadow);
}

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { order: -1; }
}

/* ---------- Experience timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 40px 32px;
}
.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline .role-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.timeline h3 { font-size: 1.2rem; margin-bottom: 6px; }

.timeline .links { margin-top: 10px; font-size: 0.9rem; }
.timeline .links a { margin-right: 16px; }

/* ---------- Project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 700px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px var(--shadow);
}

.project-card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.project-card h3 { font-size: 1.25rem; }
.project-card p { color: var(--text-muted); flex-grow: 1; }
.project-card .read-more { font-weight: 600; margin-top: 8px; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  gap: 24px;
}

.skill-group h4 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-chips span {
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- Contact ---------- */
.contact-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 1.05rem;
}

/* ---------- Footer ---------- */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Case study page ---------- */
.case-header {
  padding: 72px 0 40px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.case-header h1 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  max-width: 20ch;
}

.case-meta {
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 1rem;
}

.case-body {
  padding: 0 0 80px;
}

.case-body h2 {
  font-size: 1.4rem;
  margin-top: 2.2em;
}

.case-body ul {
  padding-left: 1.2em;
  margin: 0 0 1.2em;
}

.case-body li { margin-bottom: 0.6em; }

.case-body figure {
  margin: 2em 0;
}

.case-body figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
}

.callout {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
