/* Same Darkroom palette as the photo site: earthy, no blue anywhere. */
:root {
  --espresso: #1F1813;
  --bark: #2E241C;
  --cream: #EFE6D6;
  --muted: #B8A68E;
  --ochre: #D9A33A;
  --terracotta: #E0925E;
  --olive: #5E6B3A;
  --brick: #963A2A;
  --saddle: #7A5236;

  --pad: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --header-h: 64px;

  color-scheme: dark;
  accent-color: var(--ochre);
}

* { box-sizing: border-box; }

/* Language toggle: every text exists as lang="sv" and lang="en"; show one. */
html[lang="sv"] body [lang="en"],
html[lang="en"] body [lang="sv"] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  scrollbar-color: var(--saddle) var(--espresso);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--espresso);
  color: var(--cream);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--ochre); color: var(--espresso); }

a { color: var(--terracotta); }
a:hover { color: var(--ochre); }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ochre); color: var(--espresso); padding: 8px 12px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding: 10px var(--pad);
  background: rgba(31, 24, 19, 0.94);
  border-bottom: 1px solid var(--bark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 14px;
}
.brand:hover { color: var(--cream); }
.brand img { display: block; width: 40px; height: 40px; }

.lang-switch { display: flex; border: 1px solid var(--saddle); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 5px 11px;
  background: transparent;
  color: var(--muted);
  border: 0;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--cream); }
.lang-switch button[aria-pressed="true"] { background: var(--ochre); color: var(--espresso); }

/* Sections */
main > section {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 20px;
  max-width: 20ch;
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.15;
}

h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; }

/* Intro: text on the left, video on the right; stacked on phones. */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(32px, 6vw, 72px) 40px;
}
.intro p { max-width: 60ch; margin: 0 0 14px; }
.intro .lead { font-size: 18px; line-height: 1.5; }
.intro em { font-style: normal; color: var(--ochre); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 24px !important; }
.text-link { text-decoration: none; }

.video { margin: 0; }
.video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  background: var(--bark);
  border-top: 3px solid var(--ochre);
}
.video figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }

/* Filters */
.filters {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 calc(var(--pad) * -1);
  padding: 12px var(--pad);
  background: var(--espresso);
}
.filters[hidden] { display: none; }

.filters button {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--saddle);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
}
.filters button:hover { color: var(--cream); border-color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--ochre); border-color: var(--ochre); color: var(--espresso); }

/* CV sections: one colour each, like the price cards on the photo site. */
.cv-section { --accent: var(--ochre); padding-top: 32px; }
.cv-section[data-cat="education"] { --accent: var(--terracotta); }
.cv-section[data-cat="volunteer"] { --accent: var(--olive); }
.cv-section[data-cat="skills"] { --accent: var(--saddle); }
.cv-section[data-cat="leisure"] { --accent: var(--brick); }
.cv-section[hidden] { display: none; }
.cv-section > h2 { padding-bottom: 12px; border-bottom: 3px solid var(--accent); }

.entry {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--bark);
}
.entry:last-child { border-bottom: 0; }
.entry p, .entry ul { max-width: 70ch; }
.entry p { margin: 6px 0 0; }

.when {
  margin: 2px 0 0 !important;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.org { color: var(--muted); margin-top: 2px !important; margin-bottom: 8px !important; }
.org a { text-decoration: none; }

.entry ul { margin: 10px 0 0; padding-left: 18px; }
.entry li { margin: 4px 0; }
.entry li::marker { color: var(--accent); }

blockquote {
  margin: 16px 0 0;
  padding: 14px 18px;
  max-width: 70ch;
  background: var(--bark);
  border-left: 3px solid var(--accent);
  color: var(--cream);
}
blockquote p { margin: 0 !important; }

/* Skills */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  padding-top: 24px;
}
.skill-group { padding: 20px; background: var(--bark); border-top: 3px solid var(--accent); }
.skill-group h3 { font-size: 15px; margin-bottom: 10px; }
.skill-group p { margin: 0; color: var(--muted); }
.skill-group .chips ~ p { margin-top: 10px; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 3px 11px;
  border: 1px solid var(--saddle);
  border-radius: 999px;
  font-size: 14px;
}

/* Free time */
.leisure { list-style: none; margin: 0; padding: 12px 0 0; max-width: 70ch; }
.leisure li { padding: 12px 0; border-bottom: 1px solid var(--bark); color: var(--muted); }
.leisure li:last-child { border-bottom: 0; }
.leisure strong { color: var(--cream); font-weight: 600; }

/* Portfolio: built by js/work.js from the folders in portfolio/. */
.cv-section[data-cat="portfolio"] { --accent: var(--muted); }

.subfilters { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 20px; }
.subfilters[hidden] { display: none; }
.subfilters button {
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 4px 2px;
  margin-right: 14px;
  cursor: pointer;
}
.subfilters button:hover { color: var(--cream); }
.subfilters button[aria-pressed="true"] { color: var(--cream); border-bottom-color: var(--ochre); }

.portfolio { padding-top: 24px; }
.portfolio > * + * { margin-top: 32px; }

/* Images keep their own shape (articles are tall, renders are wide). */
.pf-images { columns: 3 260px; column-gap: 12px; }
.pf-thumb {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  break-inside: avoid;
  font: inherit;
  text-align: left;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: zoom-in;
}
.pf-thumb img { display: block; width: 100%; height: auto; background: var(--bark); transition: opacity 0.2s ease; }
.pf-thumb:hover img { opacity: 0.85; }
.pf-thumb span { display: block; padding: 6px 0 0; font-size: 14px; }
.pf-thumb:hover span { color: var(--cream); }

.pf-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pf-videos figure { margin: 0; }
.pf-videos video { display: block; width: 100%; height: auto; background: var(--bark); }
.pf-videos figcaption { margin-top: 6px; color: var(--muted); font-size: 14px; }

.pf-audio { list-style: none; margin: 0; padding: 0; max-width: 70ch; }
.pf-audio li { padding: 14px 0; border-bottom: 1px solid var(--bark); }
.pf-audio li:last-child { border-bottom: 0; }
.pf-audio p { margin: 0 0 8px; }
.pf-audio audio { display: block; width: 100%; }

/* Image viewer */
body:has(dialog[open]) { overflow: hidden; }

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(20, 15, 11, 0.97);
  color: var(--cream);
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }

.lightbox figure {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 72px 16px;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}
/* Zoomed: full width up to 1100px, scroll to read. */
.lightbox.zoom { overflow-y: auto; }
.lightbox.zoom figure { justify-content: flex-start; }
.lightbox.zoom img { max-height: none; max-width: min(100%, 1100px); cursor: zoom-out; }

.lightbox figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; text-align: center; }

.lightbox button {
  position: fixed;
  background: none;
  border: 0;
  color: var(--cream);
  font-size: 44px;
  line-height: 1;
  padding: 12px 18px;
  cursor: pointer;
  opacity: 0.75;
}
.lightbox button:hover { opacity: 1; color: var(--ochre); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
.lb-close { top: 6px; right: 6px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* Contact */
.contact { padding-block: 72px 96px; }
.contact p { margin: 0 0 16px; }
.photo-link { color: var(--muted); }

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 4px;
  background: var(--ochre);
  color: var(--espresso);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--cream); color: var(--espresso); }

.site-footer {
  border-top: 1px solid var(--bark);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px var(--pad);
}
.site-footer p { margin: 0; }

/* Phones: header not sticky (keeps the screen for content), video under the text. */
@media (max-width: 760px) {
  :root { --header-h: 0px; }
  .site-header { position: static; }
  .brand { font-size: 12px; letter-spacing: 0.14em; }
  .brand img { width: 32px; height: 32px; }
  .intro { grid-template-columns: 1fr; }
  .filters { gap: 6px; }
  .filters button { padding: 6px 12px; font-size: 11px; }
  .entry { grid-template-columns: 1fr; gap: 2px; padding: 20px 0; }
  .pf-images { columns: 2; column-gap: 8px; }
  .pf-videos { grid-template-columns: 1fr; }
  .lightbox figure { padding: 52px 8px 64px; }
  .lb-prev, .lb-next { top: auto; bottom: 4px; transform: none; }
}
