/* ═══════════════════════════════════════════════════════
   Projekt Varvet — dokumentärfilm
   3 färger: svart / grå / blå
   Grid-struktur återanvänd från andunge.se (egen kod)
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Svart */
  --bg:         #0b0c0e;
  --card-dark:  #08090b;
  /* Grå */
  --card:       #17191d;
  --card-alt:   #1f2228;
  --grey:       #8a8f96;
  --grey-dim:   rgba(138,143,150,.6);
  /* Blå */
  --blue:       #3d6a8f;
  --blue-deep:  #1e3a52;
  --blue-hover: #4a7fa8;
  /* Text */
  --white:      #eceef0;
  --white-dim:  rgba(236,238,240,.85);
  --white-faint:rgba(236,238,240,.3);

  --nav-h:      64px;   /* JS animerar */
  --max-w:      1480px;
  --pad:        clamp(1.5rem, 5vw, 6rem);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: "Cormorant Garamond", Georgia, serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 64px;
  z-index: 100;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 var(--pad);
  background: rgba(11,12,14,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(61,106,143,.2);
  will-change: height;
}
.nav-links {
  display: flex; gap: .2rem 1rem; align-items: flex-start;
  flex-wrap: wrap;
  position: absolute;
  right: var(--pad);
  top: var(--nav-links-top, 14px);
  max-width: calc(100% - clamp(260px, 28vw, 400px));
  justify-content: flex-end;
}
.nav-links a {
  font-family: sans-serif; font-size: 0.68rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--grey); transition: color .2s;
}
.nav-links a:hover { color: var(--white); }

/* ── Logo ───────────────────────────────────────────────── */
#logo-block {
  position: fixed; z-index: 200; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end;
}
.logo-kicker {
  font-family: "Archivo", sans-serif;
  font-weight: 300; text-transform: uppercase;
  color: var(--grey);
  line-height: 1; white-space: nowrap;
  margin-bottom: .3em;
}
.logo-line {
  display: block;
  font-family: "Archivo", "Helvetica Neue", sans-serif;
  font-weight: 300; text-transform: uppercase;
  line-height: 1.1; white-space: nowrap;
  color: var(--white);
}
#line2 { color: var(--blue-hover); font-weight: 500; }

/* Hyvel-siluett bredvid logotypen */
#plane-img {
  position: fixed; z-index: 300;
  pointer-events: none; opacity: 0;
  /* Tonad blå för att matcha paletten */
  filter: brightness(0) saturate(100%) invert(45%) sepia(18%) saturate(900%) hue-rotate(165deg) brightness(92%);
}

/* ── Hamburger + drawer (mobil) ─────────────────────────── */
.hamburger {
  display: none;
  position: fixed; right: 1.2rem; z-index: 300;
  width: 26px; height: 18px;
  background: none; border: none; cursor: pointer;
  flex-direction: column; justify-content: space-between;
}
.hamburger span {
  display: block; height: 2px; width: 100%;
  background: var(--white); transition: transform .3s, opacity .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.nav-drawer {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(11,12,14,.97);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.6rem;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.nav-drawer.open { opacity: 1; pointer-events: auto; }
.nav-drawer a {
  font-family: sans-serif; font-size: .9rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--white-dim);
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* ── Hero — ren bild ────────────────────────────────────── */
.hero-clean {
  position: relative;
  width: 100%;
  padding-top: var(--nav-h);
  background: var(--bg);
}
.hero-clean-img {
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
}
.hero-clean-img img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
}

/* Textruta i nedre högra hörnet av heron, med riktad gradient */
.hero-corner {
  position: absolute;
  right: 14%; bottom: 8%;
  width: min(46%, 600px);
  height: 60%;
  z-index: 2;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 2.4rem;
  pointer-events: none;
}
.hero-corner::before {
  content: '';
  position: absolute;
  /* Större än boxen så gradienten tonar ut långt innan sin egen kant */
  inset: -30% -40%;
  background: radial-gradient(ellipse at 70% 100%,
    rgba(11,12,14,.65) 0%,
    rgba(11,12,14,.4) 35%,
    rgba(11,12,14,.15) 60%,
    rgba(11,12,14,0) 85%);
  z-index: -1;
}
.hero-corner .lbl { color: var(--white); opacity: .9; font-size: .72rem; }
.hero-corner h3 {
  color: var(--white);
  font-family: "Archivo", sans-serif;
  font-weight: 500; font-size: 1.65rem;
  margin: .4rem 0 .6rem;
}
.hero-corner p {
  color: var(--white);
  font-size: 1.08rem; line-height: 1.6;
  opacity: .9; max-width: 480px;
}
@media (max-width: 720px) {
  .hero-corner { width: 100%; height: 45%; padding: 1.4rem; }
}

/* Titelband under bilden */
.hero-caption {
  background: var(--bg);
  padding: 4rem var(--pad) 3rem;
}
.hero-caption-inner {
  max-width: var(--max-w); margin: 0 auto;
}
.hero-label {
  font-family: sans-serif; font-size: .68rem;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--blue-hover);
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 14px;
}
.hero-label::before {
  content: ''; display: block;
  width: 40px; height: 1px; background: var(--blue);
}
.hero-h1 {
  font-family: "Archivo", sans-serif;
  font-size: clamp(2.6rem, 7vw, 6rem);
  font-weight: 200; letter-spacing: .01em;
  line-height: 1.0; color: var(--white);
  margin-bottom: 1.4rem;
  text-transform: uppercase;
}
.hero-h1 strong { font-weight: 500; color: var(--blue-hover); }
.hero-sub {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-style: italic;
  color: var(--white-dim);
  max-width: 560px; line-height: 1.6;
  margin-bottom: 2.4rem;
}
.hero-btns { display: flex; flex-wrap: wrap; gap: 1rem; }
.btn {
  font-family: sans-serif; font-size: .72rem;
  letter-spacing: .18em; text-transform: uppercase;
  padding: .95rem 2rem;
  border: 1px solid var(--grey-dim);
  color: var(--white-dim);
  transition: border-color .25s, color .25s, background .25s;
}
.btn:hover { border-color: var(--blue-hover); color: var(--white); }
.btn-fill {
  background: var(--blue-deep);
  border-color: var(--blue);
  color: var(--white);
}
.btn-fill:hover { background: var(--blue); }

/* ── Typografi-hjälpare ─────────────────────────────────── */
.lbl {
  font-family: sans-serif; font-size: .62rem;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--blue-hover);
}
.rule { width: 42px; height: 1px; background: var(--blue); margin: .9rem 0 1.1rem; }
.h2 {
  font-family: "Archivo", sans-serif;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  font-weight: 300; letter-spacing: .01em;
  line-height: 1.15; color: var(--white);
}
.h3 {
  font-family: "Archivo", sans-serif;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  font-weight: 300; color: var(--white);
}
.body {
  font-size: 1.12rem; line-height: 1.65;
  color: var(--white-dim);
}
.link-arr {
  display: inline-block; margin-top: 1.6rem;
  font-family: sans-serif; font-size: .72rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--blue-hover);
  border-bottom: 1px solid rgba(61,106,143,.4);
  padding-bottom: 2px; transition: border-color .2s, color .2s;
}
.link-arr:hover { border-color: var(--blue-hover); color: var(--white); }

/* ── Reveal on scroll ───────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .05s; }
.reveal.d2 { transition-delay: .18s; }
.reveal.d3 { transition-delay: .3s; }

/* ── Grid: ren 50/50 centrumdelning, två oberoende kolumner ──
   Oregelbundenheten kommer från korthöjderna, inte kolumnbredden
   (Folkoperan-principen). ───────────────────────────────────── */
.folk-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;   /* fast mittdelning */
  align-items: start;
}
.folk-col { display: flex; flex-direction: column; min-width: 0; }

/* Hela och halva kvadrater (Folkoperan-principen).
   aspect-ratio håller dem exakt kvadratiska vid alla bredder:
   full = kvadrat, half = halva höjden. */
.fc-full { aspect-ratio: 1 / 1; }
.fc-half { aspect-ratio: 2 / 1; }

.f-img { position: relative; overflow: hidden; }

.f-img .inner {
  position: absolute; inset: 0;
  transform: scale(1);
  transition: transform 1s ease, filter .6s ease;
}
.f-img .inner img {
  width: 100%; height: 100%;
  object-fit: cover;   /* standard: croppa för att fylla rutan */
  display: block;
}
/* Sätts av JS när bildens egna proportioner redan matchar rutan —
   då visas bilden i sin helhet utan att croppas. */
.f-img .inner img.fit-contain {
  object-fit: contain;
  background: var(--card);
}
.f-img:hover .inner {
  transform: scale(1.04);
}

.f-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom,
    rgba(11,12,14,0) 0%,
    rgba(11,12,14,0) 55%,
    rgba(11,12,14,.55) 75%,
    rgba(11,12,14,.92) 100%);
  transition: background .45s ease;
}
.f-img:hover .f-overlay {
  background: linear-gradient(to bottom,
    rgba(11,12,14,0) 0%,
    rgba(11,12,14,.1) 55%,
    rgba(11,12,14,.62) 75%,
    rgba(11,12,14,.95) 100%);
}
.f-body {
  position: absolute; inset: 0;
  z-index: 2; padding: 2.2rem 2.4rem;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end;
  text-align: left; gap: .5rem;
  transform: translateY(0);
  transition: transform .45s ease;
}
.f-img:hover .f-body { transform: translateY(-6px); }

/* Vit text genomgående, tre nivåer, förankrad i nederkant */
.f-body .lbl {
  color: var(--white);
  font-size: .6rem; letter-spacing: .22em; opacity: .85;
}
.f-body .h2, .f-body .h3 {
  color: var(--white);
  font-weight: 600; margin: 0;
}
.f-body .body {
  color: var(--white);
  font-size: 1rem; line-height: 1.55;
  max-width: none; opacity: .92;
}
/* Halva rutor: samma formatering, kompaktare avstånd */
.fc-half .f-body { padding: 1.6rem 2rem; gap: .4rem; }
.fc-half .f-body .body { font-size: .95rem; }

.f-solid {
  display: flex; flex-direction: column; justify-content: center;
  padding: 3rem 3.5rem;
  cursor: pointer;
  transition: background .35s ease;
}
/* Tre gråtoner + en blå accent */
.f-solid-a { background: var(--card); }
.f-solid-b { background: var(--card-alt); }
.f-solid-c { background: var(--card-dark); }
.f-solid-accent { background: var(--blue-deep); }
.f-solid-a:hover { background: #1d2026; }
.f-solid-b:hover { background: #262a32; }
.f-solid-c:hover { background: #0e1013; }
.f-solid-accent:hover { background: #254764; }

.f-solid .h2, .f-solid .h3, .f-solid .body,
.f-solid .lbl, .f-solid .rule, .f-solid .link-arr {
  transition: transform .4s ease;
}
.f-solid:hover .h2, .f-solid:hover .h3, .f-solid:hover .body,
.f-solid:hover .lbl, .f-solid:hover .rule, .f-solid:hover .link-arr {
  transform: translateY(-6px);
}
.f-img { cursor: pointer; }

/* Platshållare tills bilder finns */
.ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: sans-serif; font-size: .58rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(61,106,143,.35);
}
/* Tydligt synliga platshållarfärger (grått/blått) — byt till bild sen */
.ph-1 { background: #3a4048; }               /* grått */
.ph-2 { background: #2f4a63; }               /* blågrått */
.ph-3 { background: #4a5058; }               /* ljusare grått */
.ph-4 { background: #2a5578; }               /* blått */

/* Lättare overlay när cellen är en färgplatshållare (grid-arbete) */
.inner.ph ~ .f-overlay {
  background: linear-gradient(to bottom,
    rgba(11,12,14,0) 0%,
    rgba(11,12,14,0) 60%,
    rgba(11,12,14,.4) 80%,
    rgba(11,12,14,.7) 100%);
}


/* ── Extra sektion: 1/3·1/3·1/3 + 1/2·1/2 × 2 ───────────── */
.mix-grid {
  max-width: var(--max-w); margin: 0 auto;
}
.mix-row { display: grid; }
.mix-thirds { grid-template-columns: 1fr 1fr 1fr; }
.mix-halves { grid-template-columns: 1fr 1fr; }
/* Rutorna i denna sektion: hela kvadrater i tredjedelsraden,
   liggande (2:1) i halvraderna — justera fritt. */
.mix-thirds .f-img { aspect-ratio: 1 / 1; }
.mix-halves .f-img { aspect-ratio: 16 / 9; }
@media (max-width: 720px) {
  .mix-thirds, .mix-halves { grid-template-columns: 1fr; }
  .mix-thirds .f-img, .mix-halves .f-img { aspect-ratio: auto; min-height: 260px; }
}

/* ── Citat-sektion ──────────────────────────────────────── */
.quote-band {
  max-width: var(--max-w); margin: 0 auto;
  padding: 7rem var(--pad);
  text-align: center;
}
.quote-band blockquote {
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  font-style: italic; font-weight: 300;
  line-height: 1.45; color: var(--white);
  max-width: 820px; margin: 0 auto 1.6rem;
}
.quote-band cite {
  font-family: sans-serif; font-style: normal;
  font-size: .68rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--blue-hover);
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid rgba(61,106,143,.2);
  background: var(--card-dark);
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 4rem var(--pad) 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem; margin-bottom: 3rem;
}
.footer-logo {
  font-family: "Archivo", sans-serif;
  font-weight: 300; font-size: 1.3rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--white); margin-bottom: .8rem;
}
.footer-brand p { font-size: 1.05rem; color: var(--grey); font-style: italic; }
.footer-col h4 {
  font-family: sans-serif; font-size: .62rem;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--blue-hover); margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { padding: .3rem 0; }
.footer-col a { font-size: 1.05rem; color: var(--white-dim); transition: color .2s; }
.footer-col a:hover { color: var(--blue-hover); }
.footer-bottom {
  border-top: 1px solid rgba(138,143,150,.12);
  padding-top: 1.6rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-family: sans-serif; font-size: .68rem;
  letter-spacing: .1em; color: var(--grey);
}

/* ── Mobil ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .folk-grid { grid-template-columns: 1fr; }  /* en kolumn på mobil */
  .fc-full, .fc-half { aspect-ratio: auto; min-height: 260px; }
  .f-img { min-height: 300px; }
  .f-solid { padding: 2.4rem 1.8rem; min-height: 240px; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-inner { padding-bottom: 4rem; }
}
