/* =========================================================
   Willa Monet — CV & Archive
   Minimal, modern, dark-by-default
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}

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

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

ul { padding-left: 1.25rem; margin: 0 0 1em; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ---------- Theme tokens ---------- */
:root {
  /* Dark (default) */
  --bg: #0a0a0a;
  --bg-elev: #131313;
  --fg: #f2f2f2;
  --fg-muted: #9a9a9a;
  --fg-soft: #c4c4c4;
  --border: #232323;
  --border-strong: #2f2f2f;
  --accent: #c9a4ff;   /* soft purple */
  --accent-2: #ff9ec7; /* soft pink */
  --focus: #c9a4ff;
  --card-bg: #111111;
  --card-hover: #161616;
  --input-bg: #0f0f0f;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #fafafa;
  --fg: #0a0a0a;
  --fg-muted: #6b6b6b;
  --fg-soft: #3a3a3a;
  --border: #e5e5e5;
  --border-strong: #d0d0d0;
  --accent: #7a3fd6;
  --accent-2: #d9438a;
  --focus: #7a3fd6;
  --card-bg: #ffffff;
  --card-hover: #f6f6f6;
  --input-bg: #ffffff;
}

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

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  padding: 2rem 0 4rem;
}

section {
  margin-top: 4rem;
  scroll-margin-top: 5rem;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
}

/* The header spans the full viewport, so the inner row needs its own
   side padding instead of relying on .container — otherwise the brand
   sits flush against the left edge of the window. Generous gutters on
   wider screens keep the brand from looking pinned to the edge. */
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  max-width: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--fg);
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 0;
  white-space: nowrap;
}

.brand:hover {
  color: var(--fg);
  border-bottom: 0;
}

.brand-text {
  letter-spacing: -0.005em;
}

.brand-text .em-dash {
  color: var(--fg-muted);
  margin: 0 0.25rem;
}

.brand-text .sub {
  color: var(--fg-muted);
  font-weight: 500;
}

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

nav.primary a {
  color: var(--fg-soft);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border-bottom: 0;
  font-size: 0.95rem;
}

nav.primary a:hover {
  color: var(--fg);
  background: var(--card-hover);
  border-bottom: 0;
}

/* Theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg-soft);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  margin-left: 0.5rem;
}

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

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------- Hero / intro ---------- */
.intro {
  padding: 3.5rem 0 1rem;
  margin-top: 0;
}

.intro h1 {
  margin-bottom: 1.25rem;
}

.intro-facts {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  color: var(--fg-soft);
}

.intro-facts li {
  font-size: 1.05rem;
  padding: 0.15rem 0;
}

.intro-facts li.muted {
  color: var(--fg-muted);
}

.intro-desc {
  font-size: 1.05rem;
  color: var(--fg-soft);
  max-width: 60ch;
  margin-top: 0.75rem;
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  margin: 0;
}

.section-head .count {
  color: var(--fg-muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Activities ---------- */
.activities {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.activity:last-child {
  border-bottom: 0;
}

.activity-main {
  font-size: 0.98rem;
  color: var(--fg);
  line-height: 1.5;
}

.activity-main .role {
  font-weight: 600;
}

.activity-main .sep {
  color: var(--fg-muted);
  margin: 0 0.4rem;
}

.activity-main .org {
  color: var(--fg-soft);
}

.activity-main .desc {
  color: var(--fg-muted);
}

.activity-dates {
  color: var(--fg-muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .activity {
    grid-template-columns: 1fr;
  }
  .activity-dates {
    font-size: 0.8rem;
  }
}

/* ---------- Archive grid ---------- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.archive-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 0.15s ease;
}

.archive-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  color: var(--fg);
  transform: translateY(-2px);
}

.archive-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.card-preview {
  aspect-ratio: 4 / 3;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-preview.text-preview {
  padding: 1rem;
  align-items: flex-start;
  text-align: left;
  font-size: 0.9rem;
  color: var(--fg-soft);
  line-height: 1.5;
  overflow: hidden;
  position: relative;
}

.card-preview.text-preview::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bg-elev));
}

.card-body {
  padding: 0.875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.card-meta .dot {
  margin: 0 0.4rem;
  opacity: 0.6;
}

.card-tags {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* ---------- Contact form ---------- */
/* Contact section is intentionally compact — it's a utility,
   not the focus of the page. */
#contact {
  margin-top: 3rem;
  max-width: 460px;
}

#contact .section-head {
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
}

#contact .section-head h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.contact-intro {
  color: var(--fg-soft);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.contact-form {
  display: grid;
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.3rem;
}

.field label {
  font-size: 0.8rem;
  color: var(--fg-soft);
  font-weight: 500;
}

.field input,
.field textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0a0a0a;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease;
  justify-self: start;
}

.btn:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(1px);
}

.form-note {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 0 2.5rem;
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
}

/* ---------- Individual item pages ---------- */
.item-page .item-header {
  padding: 2.5rem 0 1rem;
}

.item-page .item-meta {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.item-page .item-meta .sep {
  margin: 0 0.4rem;
  opacity: 0.6;
}

.item-page .item-desc {
  color: var(--fg-soft);
  max-width: 65ch;
  font-size: 1.02rem;
}

.item-content {
  margin: 2rem 0 3rem;
}

.item-content img {
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 0 auto;
}

.story-body {
  max-width: 65ch;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--fg);
}

.story-body p { margin-bottom: 1.25em; }

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

/* Prev/next nav */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pager a:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  color: var(--fg);
}

.pager .pager-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.pager .pager-title {
  font-weight: 600;
}

.pager .next { text-align: right; }
.pager .placeholder {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 520px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}

/* Back-to-archive link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  border-bottom: 0;
  margin-top: 1.5rem;
}

.back-link:hover {
  color: var(--accent);
  border-bottom: 0;
}

/* ---------- Mobile nav tweaks ---------- */
@media (max-width: 540px) {
  /* Hide the em-dash AND the "CV & Archive" suffix together so the brand
     reads cleanly as just "Willa Monet" on phones, with no orphan dash. */
  .brand-text .em-dash,
  .brand-text .sub-full { display: none; }
  nav.primary a { padding: 0.4rem 0.55rem; font-size: 0.9rem; }
  .intro { padding-top: 2.5rem; }
}
