/* -------------------------------------------------------------------------- */
/* Design tokens                                                              */
/* -------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;

  --bg: #f6f3ee;
  --bg-elevated: #fffefb;
  --text: #1a1714;
  --text-muted: #5c554c;
  --border: #e3dcd2;
  --accent: #2d6a4f;
  --accent-soft: #d8f3e4;
  --accent-contrast: #fff;
  --shadow: 0 18px 50px rgba(26, 23, 20, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: min(1120px, calc(100% - 2.5rem));
  --ph-bg: #fff3c9;
  --ph-border: #e8c96a;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12110f;
  --bg-elevated: #1b1a17;
  --text: #f3eee6;
  --text-muted: #a89f92;
  --border: #2f2c27;
  --accent: #52b788;
  --accent-soft: #1a2e24;
  --accent-contrast: #0d1110;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  --ph-bg: #3d3420;
  --ph-border: #8a7638;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s ease, color 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

code {
  font-size: 0.92em;
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
}

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

.nav-cta {
  padding: 0.35rem 0.85rem !important;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast) !important;
}

.nav-cta:hover {
  filter: brightness(1.05);
}

@media (max-width: 520px) {
  .nav {
    font-size: 0.82rem;
    gap: 0.35rem 0.65rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                       */
/* -------------------------------------------------------------------------- */
.hero {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 8vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

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

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.5vw, 3.35rem);
  line-height: 1.12;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.hero-lead {
  max-width: 52ch;
  margin: 0 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn.ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.hero-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 28rem;
}

.hero-meta li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.meta-label {
  color: var(--text-muted);
}

.hero-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.15rem;
  box-shadow: var(--shadow);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

.facts {
  margin: 0;
}

.facts > div {
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}

.facts > div:first-of-type {
  border-top: none;
  padding-top: 0;
}

.facts dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.facts dd {
  margin: 0.2rem 0 0;
}

.hint {
  color: var(--text-muted);
  font-size: 0.9em;
}

.facts-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ph-link {
  word-break: break-all;
}

/* -------------------------------------------------------------------------- */
/* Sections                                                                   */
/* -------------------------------------------------------------------------- */
.section {
  padding: clamp(2.75rem, 6vw, 4rem) 0;
}

.section-alt {
  background: color-mix(in oklab, var(--bg-elevated) 65%, var(--bg));
  border-block: 1px solid var(--border);
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0 0 0.5rem;
}

.section-intro {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  max-width: 65ch;
}

.prose p {
  max-width: 65ch;
}

.ph-block {
  margin-top: 1.25rem;
}

/* -------------------------------------------------------------------------- */
/* Placeholders — visually distinct until replaced                            */
/* -------------------------------------------------------------------------- */
.ph,
a.ph {
  display: inline;
  padding: 0.08em 0.28em;
  border-radius: 6px;
  background: var(--ph-bg);
  border: 1px dashed var(--ph-border);
  color: inherit;
  text-decoration: none;
  font-style: normal;
}

a.ph:hover {
  filter: brightness(0.97);
}

.ph::after {
  content: "";
}

/* -------------------------------------------------------------------------- */
/* Skills                                                                     */
/* -------------------------------------------------------------------------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

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

.skill-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.skill-card h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.skill-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.skill-card li {
  margin: 0.35rem 0;
}

/* -------------------------------------------------------------------------- */
/* Projects                                                                   */
/* -------------------------------------------------------------------------- */
.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.project-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.project-item p {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  max-width: 75ch;
}

.project-links {
  margin-top: 0.75rem !important;
  font-size: 0.95rem;
}

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

.timeline > li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -6px;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
}

.timeline-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.timeline-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.timeline-org {
  margin: 0.15rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.timeline-card li {
  margin: 0.35rem 0;
}

/* -------------------------------------------------------------------------- */
/* Education                                                                  */
/* -------------------------------------------------------------------------- */
.edu-list {
  padding-left: 1.1rem;
  max-width: 65ch;
}

.edu-list li {
  margin: 0.5rem 0;
}

/* -------------------------------------------------------------------------- */
/* Contact                                                                    */
/* -------------------------------------------------------------------------- */
.contact-section {
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.contact-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  word-break: break-word;
}

.contact-list li:last-child {
  border-bottom: none;
}

.contact-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

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

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
  max-width: 55ch;
}

.theme-toggle {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* -------------------------------------------------------------------------- */
/* Print — reasonable CV printout from the same page                          */
/* -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .hero-actions,
  .theme-toggle,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .hero-card,
  .skill-card,
  .project-item,
  .timeline-card,
  .contact-list {
    box-shadow: none;
    break-inside: avoid;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }

  a.ph[href^="mailto"]::after,
  a.ph[href="#"]::after {
    content: none;
  }
}
