/* =========================================================
   Calere – design tokens. Change colors/fonts here.
   Layout idea: calm editorial real-estate page (vistaprops-style),
   split image/text rows, one folder menu instead of a nav bar.
   ========================================================= */
:root {
  /* Base colours (shared by all palettes) */
  --ink:    #16261e;   /* text + dark bands, deep Calere green */
  --moss:   #2f4a3b;   /* secondary green */
  --glow:   #209868;   /* accent: the green from the Calere logo */
  --sun:    #d2d84f;   /* yellow from the logo, for highlights on dark backgrounds */
  --folder: #d9c39a;   /* folder paper */

  /* Background palette "Salvia" (sage green, chosen by Eric) */
  --paper:  #c5d3c0;   /* main page background */
  --soft:   #dce6d6;   /* alternate band */
  --line:   #a6b8a0;   /* hairlines */
  --muted:  #3f5146;   /* secondary text */

  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1040px;
  --gutter: max(20px, 4vw);
  --radius: 4px;
  --header-h: 88px;
}


*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}

h1, h2, h3 { font-weight: 400; line-height: 1.08; margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--f-display); }
h1 { font-size: clamp(3rem, 8vw, 6.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); }
h3 { font-family: var(--f-body); font-weight: 600; font-size: 1.15rem; line-height: 1.3; }
h1 em, h2 em { font-style: italic; color: var(--glow); }
p { margin: 0; max-width: 62ch; }

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

/* ---------- Header ----------
   Transparent, floats over the hero video. After scrolling past the
   hero the logo/links fade out and only the round menu button stays. */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: flex-end;   /* logo is positioned separately */
  padding-inline: var(--gutter);
  background: transparent;
  pointer-events: none;            /* only the logo/links/button catch clicks */
}
.site-header > * { pointer-events: auto; }
.brand { text-decoration: none; transition: opacity .3s; }

.brand-text { font-family: var(--f-display); font-size: 4rem; color: #fff; }
.header-actions { display: flex; align-items: center; gap: 1.5rem; }
.link-quiet { text-decoration: none; font-family: var(--f-display); font-size: 1.9rem; color: #fff; transition: opacity .3s; }
.link-quiet:hover { color: var(--sun); }
.site-header.scrolled .link-quiet { opacity: 0; pointer-events: none; }   /* logo stays visible */
/* Logo: the green cube alone. Starts big just above the hero text "Fastighetsutveckling",
   scrolls up with the page, then sticks at the top and shrinks (script.js sets --logo-h/top/left). */
.brand {
  position: fixed; z-index: 81;
  top: var(--logo-top, 18px); left: var(--logo-left, 20px);
  background: none !important; padding: 0 !important; box-shadow: none !important;
}
.brand img { height: var(--logo-h, 140px); width: auto; transition: none; filter: drop-shadow(0 2px 12px rgba(0,0,0,.3)); }
.site-header { padding-left: max(12px, env(safe-area-inset-left, 0px)); }   /* logo hugs the left edge */

/* ---------- Menu button (three stacked lines) ---------- */
.menu-btn {
  width: 48px; height: 48px;
  display: grid; place-content: center; gap: 6px;
  background: transparent; border: 0; border-radius: 50%;
  cursor: pointer;
  transition: background .3s;
}
.menu-btn span {
  display: block; width: 26px; height: 2px; border-radius: 2px;
  background: #fff;
  transition: transform .25s, opacity .2s;
}
.site-header.scrolled .menu-btn { background: var(--ink); }
.menu-btn:hover span { background: var(--sun); }
.menu-btn[aria-expanded="true"] { background: var(--ink); }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.menu-btn:focus-visible, .btn:focus-visible, .folder-list a:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }

/* ---------- Folder panel ---------- */
.folder-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(22, 38, 30, .35);
}
.folder {
  position: fixed; z-index: 70;
  top: calc(var(--header-h) + 10px);
  right: var(--gutter);
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  animation: folder-open .28s cubic-bezier(.2,.8,.2,1);
  transform-origin: top right;
}
.folder-tab {
  display: inline-block;
  background: var(--paper);   /* folder outline = sage green */
  padding: 0.45rem 1.4rem 0.3rem;
  border-radius: 10px 10px 0 0;
  font-family: var(--f-display); font-size: 1.3rem; font-style: italic;
  color: var(--ink);
}
.folder-body {
  background: var(--paper);
  border-radius: 0 10px 10px 10px;
  padding: 0.75rem;
  box-shadow: 0 24px 60px -20px rgba(22, 38, 30, .45);
}
.folder-list {
  list-style: none; margin: 0; padding: 0;
  background: #fff;   /* tabs are white */
  border-radius: 6px;
  counter-reset: tab;
}
.folder-list li + li { border-top: 1px solid var(--line); }
.folder-list a {
  display: grid; grid-template-columns: 2.2rem 1fr; column-gap: .5rem;
  padding: 0.9rem 1rem;
  text-decoration: none;
  transition: background .15s, padding .15s;
}
.folder-list a::before {
  counter-increment: tab;
  content: counter(tab, decimal-leading-zero);
  grid-row: span 2;
  font-size: .75rem; color: var(--muted); padding-top: .45rem;
}
.folder-list a:hover { background: var(--soft); padding-left: 1.3rem; }
.fl-title { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.15; }
.fl-sub { font-size: .82rem; color: var(--muted); }
@keyframes folder-open {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-block;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: background .2s, color .2s;
}
.btn-primary { background: var(--glow); color: #fff; }
.btn-primary:hover { background: var(--ink); }
.btn-ghost { border: 1px solid currentColor; }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  background: var(--ink);
  display: flex; align-items: flex-end;
  color: #fff;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,38,30,.45) 0%, rgba(22,38,30,.25) 35%, rgba(22,38,30,.85) 100%);
}
.hero-content { position: relative; width: 100%; padding-block: 4rem 5rem; display: grid; gap: 1.5rem; }
.hero .eyebrow { color: rgba(255,255,255,.8); margin: 0; }
.hero h1 em { color: var(--sun); }
.hero .lead { font-size: 1.15rem; max-width: 56ch; color: rgba(255,255,255,.92); }

/* ---------- Bands ---------- */
.band { padding-block: clamp(4rem, 9vw, 7.5rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(3rem, 6vw, 5rem); }
.band-soft { background: var(--soft); }
.band-dark { background: var(--ink); color: var(--paper); }
.band-dark .eyebrow { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.band-dark h2 em { color: var(--sun); }
.section-title.small { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }

/* split rows */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split.reverse .split-media { order: 2; }
.split-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.split-media.stack { display: grid; gap: 1rem; }
.split-media.stack img { aspect-ratio: auto; height: auto; object-fit: contain; }   /* full pictures, no cropping */
.split-media.portrait img { aspect-ratio: 4 / 5; max-height: 640px; }
.split-text { display: grid; gap: 1.25rem; min-width: 0; }

/* statement band */
.statement { display: grid; gap: 2rem; }
.statement-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; color: color-mix(in srgb, var(--paper) 85%, transparent); }
.services { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; border-top: 1px solid color-mix(in srgb, var(--paper) 25%, transparent); }
.services li {
  flex: 1 1 180px;
  padding: 1.25rem 1rem 0 0;
  font-family: var(--f-display); font-size: 1.5rem;
}

/* concept cards */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.card { border-top: 2px solid var(--ink); padding-top: 1.25rem; display: grid; gap: .75rem; align-content: start; }
.card p { font-size: .95rem; color: var(--muted); }
.partners { display: grid; gap: 1rem; }
.partners ul { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.partners li { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; font-size: .88rem; }

/* projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 2.5rem 2rem; }
.project { display: grid; gap: .7rem; align-content: start; }
.project-img { overflow: hidden; border-radius: var(--radius); background: var(--line); }
.project-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s; }
.project:hover .project-img img { transform: scale(1.04); }
.project p { font-size: .93rem; color: var(--muted); }
.tag {
  justify-self: start;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  color: var(--glow);
}
.tag-done { color: var(--moss); }
.tag-sold { color: #fff; background: var(--ink); padding: .2rem .6rem; border-radius: 2px; }

/* till salu */
.sale-list { display: grid; gap: 2rem; }
.sale { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2rem; align-items: center; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.sale img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); }
.sale > div { display: grid; gap: .6rem; }
.news { display: grid; gap: 1.5rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.timeline time { font-variant-numeric: tabular-nums; color: var(--glow); font-weight: 600; font-size: .9rem; padding-top: .1rem; }
.timeline p { font-size: .95rem; }

/* workers */
.workers-hero { min-height: 82vh; min-height: 82svh; }
.workers-facts { align-self: center; width: 100%; }
.workers-facts div { grid-template-columns: minmax(9rem, 1fr) minmax(0, 1.4fr); }
.facts { margin: .5rem 0; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }
#workers .btn { justify-self: start; }

/* contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.contact > div { display: grid; gap: 1.25rem; }
.contact-list { margin: 0; display: grid; }
.contact-list div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .9rem 0; border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); }
.contact-list dt { color: color-mix(in srgb, var(--paper) 60%, transparent); font-size: .9rem; }
.contact-list dd { margin: 0; font-family: var(--f-display); font-size: 1.45rem; line-height: 1.2; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--sun); }

/* footer */
.site-footer { background: var(--ink); color: color-mix(in srgb, var(--paper) 55%, transparent); font-size: .85rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid color-mix(in srgb, var(--paper) 15%, transparent); }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  :root { --header-h: 76px; }
  .link-quiet { display: none; }
  .split, .statement-cols, .cards-3, .contact, .sale { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
  .facts div, .contact-list div { grid-template-columns: 1fr; gap: .15rem; }
  .timeline li { grid-template-columns: 1fr; gap: .2rem; }
}

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