/* =========================================================
   Mia Karlsrud — editorial system
   Warm oatmeal canvas · rust accent · sage + sand support
   Gaegu hand-lettered display + light humanist body
   ========================================================= */

:root {
  --bg:        #f1ebe0;   /* oatmeal */
  --sand:      #e4d9c5;   /* warm sand */
  --sage:      #c3ccb0;   /* muted sage */
  --sage-deep: #8f9d7c;
  --rust:      #a8452a;   /* earthy rust-red */
  --rust-dark: #8d3820;
  --ink:       #2b2724;   /* charcoal */
  --ink-soft:  #5f5850;
  --line:      #d6cab4;

  --maxw: 1040px;
  --radius: 4px;

  --display: "Gaegu", "Segoe Print", "Bradley Hand", cursive;
  --body:    "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img, video { max-width: 100%; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
}

::selection { background: var(--rust); color: var(--bg); }

/* ===== Layout ===== */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.section { padding: 84px 0; border-top: 1px solid var(--ink); }
.section > h2,
.section-head h2 { font-size: clamp(2.6rem, 5.4vw, 3.6rem); }
.section > h2 { margin-bottom: 14px; }
.section-intro { color: var(--ink-soft); margin-bottom: 38px; max-width: 54ch; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.section-head-link,
.back-link,
.eyebrow,
.work-meta,
.tile-label,
.case-meta dt,
.next-project span {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.section-head-link { color: var(--rust); text-decoration: none; white-space: nowrap; }
.section-head-link:hover { color: var(--rust-dark); text-decoration: underline; text-underline-offset: 4px; }

/* ===== Header / nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 28px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--ink);
}
.logo:hover { color: var(--rust); }

.nav-links { list-style: none; display: flex; gap: 28px; }
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-links a:hover { color: var(--rust); }
.nav-links a.is-active { color: var(--ink); border-bottom-color: var(--rust); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  cursor: pointer;
}

/* ===== Hero (home) ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 72px 0 88px;
}
.eyebrow { color: var(--rust); margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(3.6rem, 8vw, 6.2rem);
  line-height: 0.9;
  margin-bottom: 28px;
}
.hero h1 .hello {
  display: block;
  font-family: var(--display);
  font-size: 0.46em;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: var(--rust);
  margin-bottom: 6px;
}
.lede { font-size: 1.15rem; font-weight: 300; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

.hero-photo { margin: 0; }
.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 30% 30%;
  display: block;
  border-radius: var(--radius);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  text-decoration: none;
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--rust); border-color: var(--rust); color: var(--bg); }
.btn-primary:hover { background: var(--rust-dark); border-color: var(--rust-dark); color: var(--bg); }

/* ===== Prose ===== */
.prose { max-width: 62ch; font-size: 1.12rem; font-weight: 300; line-height: 1.8; }
.prose p + p { margin-top: 22px; }

/* ===== Work list (typographic rows) ===== */
.work-list { list-style: none; border-top: 1px solid var(--ink); }
.work-row {
  display: grid;
  grid-template-columns: 200px 1fr auto 28px;
  gap: 24px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.work-client {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.work-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0;
  transition: color 0.2s ease, transform 0.25s ease;
}
.work-meta { color: var(--ink-soft); white-space: nowrap; }
.work-arrow {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--rust);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.25s ease;
}
.work-row:hover .work-title,
.work-row:focus-visible .work-title { color: var(--rust); transform: translateX(6px); }
.work-row:hover .work-arrow,
.work-row:focus-visible .work-arrow { opacity: 1; transform: translateX(0); }
.work-row:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }

/* ===== Image tiles (Creative Projects) ===== */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 32px;
}
.tile { display: block; text-decoration: none; color: inherit; }
.tile-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--sand);
}
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.tile:hover .tile-media img { transform: scale(1.03); }
.tile-label { display: block; color: var(--rust); margin-top: 16px; }
.tile-title {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
  margin-top: 6px;
  transition: color 0.2s ease;
}
.tile:hover .tile-title { color: var(--rust); }
.tile-note { display: block; color: var(--ink-soft); font-size: 0.95rem; margin-top: 8px; max-width: 42ch; font-weight: 300; }

/* ===== Music band ===== */
.music {
  background: var(--sage);
  border-radius: var(--radius);
  padding: 56px;
}
.music h2 { font-size: clamp(2.6rem, 5.4vw, 3.6rem); margin-bottom: 14px; }
.music p { max-width: 52ch; margin-bottom: 26px; font-weight: 400; color: #36402c; }
.music .btn:hover { background: var(--ink); }

/* ===== CTA ===== */
.cta { text-align: center; }
.cta h2 { font-size: clamp(2.2rem, 4.8vw, 3.2rem); margin-bottom: 24px; }
.cta .hero-actions { justify-content: center; margin-top: 0; }

/* ===== Interior pages ===== */
.back-link {
  display: inline-block;
  margin: 44px 0 6px;
  color: var(--ink-soft);
  text-decoration: none;
}
.back-link:hover { color: var(--rust); }

.page-header { padding: 28px 0 40px; }
.page-header .eyebrow { margin-bottom: 18px; }
.page-title {
  font-size: clamp(3.2rem, 8vw, 5.6rem);
  line-height: 0.98;
  max-width: 16ch;
}
.page-lede { color: var(--ink-soft); font-size: 1.2rem; font-weight: 300; max-width: 52ch; margin-top: 24px; }

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 22px;
  margin: 12px 0;
  padding: 24px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.case-meta dt { color: var(--rust); margin-bottom: 6px; }
.case-meta dd { font-size: 0.98rem; }

.article { max-width: 66ch; margin: 64px auto; }
.article h2 { font-size: 2.2rem; margin: 52px 0 16px; }
.article h2:first-child { margin-top: 0; }
.article p { font-weight: 300; font-size: 1.08rem; }
.article p + p { margin-top: 18px; }
.article ul { margin: 14px 0 14px 1.1em; }
.article li { margin: 8px 0; font-weight: 300; font-size: 1.05rem; }
.article li::marker { color: var(--rust); }
.article .lead { font-size: 1.28rem; font-weight: 400; line-height: 1.6; }

/* ===== Media ===== */
.gallery { display: grid; gap: 32px; margin: 64px 0; }
.gallery--two { grid-template-columns: 1fr 1fr; }
.gallery figure { margin: 0; min-width: 0; }
.gallery img,
.gallery video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  background: var(--sand);
}
.gallery figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 12px; }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  margin: 64px 0;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.scroll-shot {
  max-height: 680px;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}
.scroll-shot img { width: 100%; display: block; }

/* ===== Photo wall (rows, natural aspect ratios, newest first) ===== */
.photo-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 56px 0 80px; }
.photo-grid::after { content: ""; flex-grow: 999999; }
.photo-grid .shot {
  display: block;
  flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 230px);
  min-width: 0;
}
.photo-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  transition: opacity 0.2s ease;
}
.photo-grid .shot:hover img { opacity: 0.85; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(30, 26, 22, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vw;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 3px; cursor: pointer; }
.lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: var(--bg);
  font-family: var(--display);
  font-size: 2.6rem;
  line-height: 1;
  padding: 14px;
  cursor: pointer;
  opacity: 0.75;
}
.lightbox button:hover { opacity: 1; color: #e7b9a6; }
.lightbox .lb-close { top: 6px; right: 10px; }
.lightbox .lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 6px; top: 50%; transform: translateY(-50%); }

/* ===== Music page ===== */
.music-block { padding: 56px 0; border-top: 1px solid var(--ink); display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; }
main > .music-block:last-child { margin-bottom: 96px; }
.music-block h2 { font-size: clamp(2.4rem, 5vw, 3.2rem); }
.music-block .stat {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.2rem, 7vw, 5rem);
  line-height: 1;
  color: var(--rust);
  margin: 10px 0 4px;
}
.music-block p { font-weight: 300; font-size: 1.08rem; }
.music-block p + p { margin-top: 16px; }
.music-block .hero-actions { margin-top: 24px; }
.embed-spotify { width: 100%; border: 0; border-radius: 12px; margin-top: 24px; }

/* ===== Next project ===== */
.next-project { margin: 40px 0 100px; padding-top: 28px; border-top: 1px solid var(--ink); }
.next-project a {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  line-height: 1.1;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.2s ease;
}
.next-project a:hover { color: var(--rust); }
.next-project span { display: block; color: var(--rust); margin-bottom: 10px; }

/* ===== Footer ===== */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 28px 60px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .work-row { grid-template-columns: 160px 1fr auto 24px; gap: 18px; }
  .music-block { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 56px 0 64px; }
  .hero-photo { max-width: 460px; width: 100%; order: -1; }
  .gallery--two { grid-template-columns: 1fr; }
  .article { margin: 48px auto; }
  .section { padding: 64px 0; }
  .work-row {
    grid-template-columns: 1fr 24px;
    gap: 6px 12px;
    padding: 22px 0;
  }
  .work-client { grid-column: 1 / 2; }
  .work-title { grid-column: 1 / 2; grid-row: 2; }
  .work-meta { grid-column: 1 / 2; grid-row: 3; white-space: normal; }
  .work-arrow { grid-column: 2; grid-row: 1 / 4; align-self: center; opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  main { padding: 0 20px; }
  .site-header { padding: 14px 20px; }
  .site-footer { padding: 24px 20px 48px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--ink);
    padding: 8px 20px 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.8rem; }
  .nav-links a.is-active { border-bottom-color: var(--rust); }
  .music { padding: 36px 24px; }
  .photo-grid { gap: 8px; }
  .photo-grid .shot { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 150px); }
  .tile-grid { grid-template-columns: 1fr; }
}

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

/* ===== Audio + typographic tile ===== */
.audio-card {
  background: var(--sage);
  border-radius: var(--radius);
  padding: 28px;
  margin: 56px 0;
}
.audio-card audio { width: 100%; display: block; }
.tile-media.type {
  background: var(--sage);
  display: flex;
  align-items: flex-end;
  padding: 26px;
}
.tile-media.type span {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5.4vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--ink);
}
.photo-grid--book .shot img { background: #fff; box-shadow: 0 0 0 1px var(--line); }

