/* ===================== Design tokens ===================== */
:root {
  --color-bg: #fdf7f5;
  --color-bg-alt: #f8ece8;
  --color-surface: #ffffff;
  --color-text: #2b2222;
  --color-text-muted: #6b5a58;
  --color-primary: #7a2f4d;
  --color-primary-strong: #5c2239;
  --color-accent: #bd7f68;
  --color-border: #eeddd7;
  --color-invert-text: #f9f0ee;

  /* Fixed "signature" band (Let's Connect) — stays a deep wine panel
     regardless of light/dark mode, so its own text tones don't need
     to be re-derived per theme. */
  --color-band-bg: #57213a;
  --color-band-text: #f9f0ee;
  --color-band-muted: #ecd3d7;
  --color-band-eyebrow: #f0c4ac;

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

  --max-width: 1120px;
  --radius: 16px;
  --shadow-soft: 0 8px 24px -12px rgba(60, 30, 40, 0.18);
  --shadow-card: 0 12px 32px -16px rgba(60, 30, 40, 0.22);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1c1517;
    --color-bg-alt: #251b1e;
    --color-surface: #2a1f22;
    --color-text: #f4e9e6;
    --color-text-muted: #c9b6b2;
    --color-primary: #e2a9bd;
    --color-primary-strong: #edc2d1;
    --color-accent: #e0ab8a;
    --color-border: #3b2b2e;
    --color-invert-text: #2a1116;
    color-scheme: dark;
  }
}

/* ===================== Reset ===================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

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

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); max-width: 42ch; }
h3 { font-size: 1.25rem; }

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

ul { margin: 0; padding: 0; list-style: none; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: var(--color-invert-text);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

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

.eyebrow::before {
  content: "\2726";
  display: inline-block;
  margin-right: 0.5em;
  font-size: 0.9em;
  color: currentColor;
}

.eyebrow-invert { color: var(--color-band-eyebrow); }

.section-lede {
  font-size: 1.05rem;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-invert-text);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: var(--color-primary-strong); }

.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-ghost:hover { border-color: var(--color-primary); }

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

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

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}
.logo-dot { color: var(--color-accent); }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}
.nav-link:hover,
.nav-link.is-active { color: var(--color-primary); }

.nav-cta {
  background: var(--color-primary);
  color: var(--color-invert-text) !important;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--color-primary-strong); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ===================== Hero ===================== */
.hero {
  position: relative;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 5rem);
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.hero::before {
  width: 420px;
  height: 420px;
  top: -160px;
  right: -120px;
  background: var(--color-accent);
  opacity: 0.22;
}

.hero::after {
  width: 320px;
  height: 320px;
  bottom: -140px;
  left: -80px;
  background: var(--color-primary);
  opacity: 0.14;
}

.hero-inner { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 700px) auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-photo-wrap {
  justify-self: center;
  width: clamp(200px, 20vw, 280px);
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 4px solid var(--color-surface);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-lede {
  font-size: 1.1rem;
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ===================== Sections ===================== */
.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

/* ===================== About ===================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
  align-items: start;
}

.hobby-list {
  display: grid;
  gap: 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.hobby-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.hobby-icon { font-size: 1.2rem; }

.language-note {
  margin-top: 2.5rem;
  padding: 1.6rem 1.85rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.language-badge {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

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

/* ===================== Approach ===================== */
.approach-list {
  display: grid;
  gap: 0.9rem;
  margin: 1.5rem 0 2rem;
}
.approach-list li {
  position: relative;
  padding-left: 1.7rem;
  font-size: 1.05rem;
  color: var(--color-text);
}
.approach-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ===================== Working with me / AI ===================== */
.working-stack {
  margin-top: 1.5rem;
}

/* ===================== Resume / CV ===================== */
.resume-inner { max-width: 700px; }

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* CSS-only modal — opened via the :target pseudo-class, no JS. */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  padding: clamp(1rem, 5vw, 3rem);
  align-items: center;
  justify-content: center;
}

.modal:target { display: flex; }

body:has(#cv-modal:target) { overflow: hidden; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 15, 20, 0.55);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text);
}

.modal-close {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  color: var(--color-text-muted);
}
.modal-close:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.modal-pdf {
  flex: 1;
  width: 100%;
  min-height: 60vh;
  border: none;
}

.modal-fallback {
  margin: 0;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

/* ===================== Projects ===================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); }

.project-shot {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.project-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.project-card:hover .project-shot img { transform: scale(1.04); }

.project-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.project-summary { font-size: 0.95rem; margin-bottom: 0.2rem; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.project-tags li {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.project-details {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.project-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
}
.project-details p { margin-top: 0.6rem; margin-bottom: 0; }

.project-link {
  margin-top: auto;
  font-weight: 600;
  color: var(--color-primary);
  align-self: flex-start;
}
.project-link:hover { color: var(--color-accent); }

/* ===================== Connect ===================== */
.section-connect {
  position: relative;
  background: var(--color-band-bg);
  color: var(--color-band-text);
  overflow: hidden;
}
.section-connect h2 { color: var(--color-band-text); }
.connect-lede { color: var(--color-band-muted); }
.connect-inner { position: relative; z-index: 1; }

.wave-divider {
  position: absolute;
  left: 0;
  width: 100%;
  line-height: 0;
  pointer-events: none;
  z-index: 0;
}
.wave-divider svg {
  width: 100%;
  height: 48px;
  display: block;
}
.wave-divider path { fill: var(--color-bg); }
.wave-divider-top { top: 0; }
.wave-divider-bottom { bottom: 0; }

.connect-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.75rem 0;
}

.connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  background: rgba(246, 243, 234, 0.1);
  border: 1px solid rgba(246, 243, 234, 0.25);
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}
.connect-link:hover {
  background: rgba(246, 243, 234, 0.2);
  transform: translateY(-2px);
}
.connect-icon { display: inline-flex; }

.connect-thanks {
  color: var(--color-band-muted);
  font-style: italic;
  margin-top: 1rem;
}

/* ===================== Footer ===================== */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.back-to-top { font-weight: 600; color: var(--color-primary); }

/* ===================== Responsive ===================== */
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo-wrap { order: -1; }

  .hero-actions { justify-content: center; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem 1.5rem;
    gap: 0.25rem;
    display: none;
  }
  .primary-nav.is-open { display: flex; }

  .nav-link {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
  }
  .nav-cta {
    margin-top: 0.75rem;
    text-align: center;
    border-bottom: none;
  }
}

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