/* Turbinen – skisse. Sort bakgrunn, hvit tekst. PP Fraktion Mono til overskrifter, Sans til brødtekst. */

@font-face {
  font-family: "PP Fraktion Mono";
  src: url("../fonts/PPFraktionMono-Semibold.woff2") format("woff2"),
       url("../fonts/PPFraktionMono-Semibold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Fraktion Sans";
  src: url("../fonts/PPFraktionSans-Regular.woff2") format("woff2"),
       url("../fonts/PPFraktionSans-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.18);
  --gutter: clamp(20px, 4vw, 72px);
  --wordmark-w: clamp(148px, 18.75vw, 312px);
  --gear: clamp(65px, 8.75vw, 138px);
  --head-h: calc(var(--gutter) + var(--gear));
  --mono: "PP Fraktion Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "PP Fraktion Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --spin: 15s;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(16px, 0.35vw + 15px, 19px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
h1, h2, h3, h4, .mono {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.05;
}
p { margin: 0; }
p + p { margin-top: 1em; }
ul { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Sticky header: navnetrekk venstre, tannhjul høyre ---------- */
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--gutter) var(--gutter) 0;
  pointer-events: none;
}
.site-head::before {
  /* svak toning slik at logo og tannhjul leses over bilder som scroller under */
  content: "";
  position: absolute;
  inset: 0 0 calc(var(--gear) * -1.1) 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.75) 45%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: -1;
}
.site-head > * { pointer-events: auto; }
.wordmark { display: block; width: var(--wordmark-w); }
.wordmark svg { width: 100%; height: auto; display: block; }
.wordmark:hover { text-decoration: none; }

.gears { display: flex; align-items: center; }
.gear { width: var(--gear); height: var(--gear); flex: none; }
.gear + .gear { margin-left: calc(var(--gear) * -0.04); }
.gear svg { width: 100%; height: 100%; display: block; overflow: visible; }
.gear svg {
  animation: spin var(--spin) linear infinite;
  will-change: transform;
}
.gear--ccw svg { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .gear svg { animation: none; }
}

/* ---------- Layout ---------- */
main { padding: 0 var(--gutter) var(--gutter); }
.section { padding-top: clamp(64px, 9vw, 160px); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(24px, 3vw, 48px);
}
@media (max-width: 599px) { .section-head { flex-direction: column; align-items: flex-start; gap: 0.25rem; } }
.section-head h2 { font-size: clamp(18px, 1.4vw, 24px); text-transform: uppercase; letter-spacing: 0.02em; }
.section-head .muted { font-size: 0.9em; }

/* Hero */
.hero {
  padding-top: calc(var(--head-h) + clamp(48px, 9vw, 180px));
  display: grid;
  gap: clamp(20px, 3vw, 40px);
  max-width: 1400px;
}
.hero h1 {
  font-size: clamp(38px, 7vw, 112px);
  max-width: 13ch;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero .lead {
  font-size: clamp(18px, 1.3vw, 24px);
  line-height: 1.4;
  max-width: 58ch;
}
.hero .lead a { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-color: var(--line); }

/* Eiendomsgrid: 1–5 kolonner */
.grid {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: 1fr;
}
@media (min-width: 600px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1360px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1800px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.card { display: block; }
.card:hover { text-decoration: none; }
.card figure { margin: 0 0 1rem; aspect-ratio: 1 / 1; overflow: hidden; background: #111; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease, opacity 0.4s ease; }
.card:hover img { transform: scale(1.03); }
.card h3 { font-size: clamp(18px, 1.3vw, 22px); margin-bottom: 0.35rem; }
.card .meta { color: var(--muted); font-size: 0.92em; }
.card .cta { margin-top: 0.6rem; font-size: 0.92em; display: inline-block; border-bottom: 1px solid var(--line); }
.card:hover .cta { border-color: var(--fg); }

/* Liv / arbeidsliv */
.split { display: grid; gap: var(--gutter); grid-template-columns: 1fr; }
@media (min-width: 800px) { .split { grid-template-columns: 1fr 1fr; } }
.split h3 { font-size: clamp(24px, 3vw, 44px); margin-bottom: 1rem; text-transform: uppercase; }
.split ul li { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.split ul li:last-child { border-bottom: 1px solid var(--line); }
.split ul li span { color: var(--muted); }

/* Kontakt */
.contacts { display: grid; gap: var(--gutter); grid-template-columns: 1fr; }
@media (min-width: 700px) { .contacts { grid-template-columns: repeat(2, minmax(0, 420px)); } }
.contact { display: grid; grid-template-columns: 112px 1fr; gap: 1.25rem; align-items: start; }
.contact img { width: 112px; height: 140px; object-fit: cover; background: #111; }
.contact h3 { font-size: 1.15em; margin-bottom: 0.2rem; }
.contact .role { color: var(--muted); margin-bottom: 0.75rem; }
.contact ul li { line-height: 1.6; }
.contact .for { color: var(--muted); font-size: 0.9em; margin-top: 0.6rem; }

/* Footer */
.site-foot {
  margin-top: clamp(64px, 9vw, 160px);
  padding: 2rem 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: clamp(32px, 4vw, 56px);
  color: var(--muted);
  font-size: 0.9em;
}
.site-foot__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-foot__row p { margin: 0; }
.site-foot__owner img { width: clamp(130px, 12vw, 180px); height: auto; display: block; }

/* ---------- Undersider ---------- */
.prop-head { padding-top: calc(var(--head-h) + clamp(32px, 6vw, 120px)); max-width: 1400px; }
.back { display: inline-block; color: var(--muted); margin-bottom: clamp(20px, 3vw, 48px); }
.back:hover { color: var(--fg); }
.prop-head h1 { font-size: clamp(34px, 5.5vw, 88px); letter-spacing: -0.02em; text-wrap: balance; }
.prop-head .lead { font-size: clamp(18px, 1.3vw, 24px); line-height: 1.4; max-width: 56ch; margin-top: clamp(16px, 2vw, 28px); }
.prop-hero { margin: clamp(32px, 5vw, 80px) 0 0; aspect-ratio: 16 / 9; overflow: hidden; background: #111; }
@media (max-width: 700px) { .prop-hero { aspect-ratio: 4 / 3; } }
.prop-hero img { width: 100%; height: 100%; object-fit: cover; }

.units { display: grid; gap: 0; }
.unit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 2rem;
  padding: clamp(20px, 2.5vw, 36px) 0;
  border-top: 1px solid var(--line);
}
.unit:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .unit { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr); } }
.unit h3 { font-size: clamp(20px, 1.6vw, 28px); margin-bottom: 0.4rem; }
.unit .meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.95em; }
.unit .meta li + li::before { content: "·"; margin-right: 0.75rem; color: var(--line); }
.unit .status {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.25em 0.7em;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.unit .status--ready { background: var(--fg); color: var(--bg); }
.unit .status--soft { border-color: var(--muted); color: var(--muted); }
.unit .desc { max-width: 60ch; }
.unit .desc .muted { display: block; margin-top: 0.6rem; font-size: 0.9em; }

.facts { display: grid; gap: var(--gutter); grid-template-columns: 1fr; }
@media (min-width: 800px) { .facts { grid-template-columns: 1fr 1fr; } }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: minmax(120px, 0.6fr) 1.4fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
dl div:last-child { border-bottom: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; }

.gallery { display: grid; grid-auto-flow: dense; gap: calc(var(--gutter) / 2); grid-template-columns: 1fr; }
@media (min-width: 600px)  { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: #111; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figure.wide { grid-column: span 2; aspect-ratio: 8 / 3; }
@media (max-width: 599px) { .gallery figure.wide { grid-column: auto; aspect-ratio: 4 / 3; } }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(64px, 9vw, 160px);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.pager a { display: grid; gap: 0.25rem; max-width: 48%; }
.pager a:last-child { text-align: right; }
.pager a .muted { font-size: 0.85em; }
.pager a .mono { font-size: clamp(16px, 1.3vw, 22px); }
