/* Hoff Labs: farger fra logoen (blekk, papir, rødt «>»), monospace som i ordmerket. */
:root {
  --paper: #f4f1ec;
  --paper-2: #ebe6de;
  --ink: #1b1917;
  --ink-2: #4a4540;
  --muted: #7a736b;
  --line: rgba(27, 25, 23, 0.12);
  --red: #c13c3b;
  --card: rgba(255, 255, 255, 0.72);
  --scene: var(--red);
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --paper-2: #1b1a18;
    --ink: #efebe5;
    --ink-2: #c4beb6;
    --muted: #8c857c;
    --line: rgba(239, 235, 229, 0.12);
    --red: #e0524f;
    --card: rgba(30, 28, 26, 0.72);
    color-scheme: dark;
  }
}
/* Hvert prosjekt farger siden mens det er i fokus. */
body[data-scene="mintrener"] { --scene: #e2a184; }
body[data-scene="hjemmeboka"] { --scene: #6f8c6c; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
  transition: background-color 0.8s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 500; }
::selection { background: var(--red); color: #fff; }

/* Bakgrunn: rutenett og en glød som følger pekeren. */
.grid-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 10%, transparent 70%);
  opacity: 0.6;
}
.glow {
  position: fixed; z-index: -1; pointer-events: none;
  width: 70vmax; height: 70vmax; left: 0; top: 0; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--scene) 22%, transparent), transparent 60%);
  transform: translate(calc(var(--mx, 50vw) - 50%), calc(var(--my, 30vh) - 50%));
  transition: background 0.8s var(--ease);
  filter: blur(20px);
}

/* Logo: ordmerket som maske, så det får riktig farge i lys og mørk modus. */
.logo { display: inline-flex; position: relative; width: 168px; aspect-ratio: 1367 / 169; }
.logo-sm { width: 120px; }
.logo-word, .logo-chev { position: absolute; inset: 0; }
.logo-word {
  background: var(--ink);
  -webkit-mask: url(/assets/logo-word.png) center / contain no-repeat;
  mask: url(/assets/logo-word.png) center / contain no-repeat;
}
.logo-chev {
  background: var(--red);
  -webkit-mask: url(/assets/logo-chevron.png) center / contain no-repeat;
  mask: url(/assets/logo-chevron.png) center / contain no-repeat;
}

/* Toppen */
.top {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px max(20px, env(safe-area-inset-left));
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.top.scrolled { border-color: var(--line); }
.top.hidden { transform: translateY(-100%); }
.top-logo { display: flex; }
.top-nav { display: flex; gap: 22px; font: 500 14px var(--mono); }
.top-nav a { text-decoration: none; color: var(--ink-2); position: relative; }
.top-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.top-nav a:hover::after { transform: scaleX(1); }

main, .foot { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.eyebrow { font: 500 13px/1 var(--mono); letter-spacing: 0.04em; color: var(--muted); margin: 0 0 20px; text-transform: lowercase; }
.prompt { color: var(--red); font-weight: 700; }

/* Hero */
.hero { position: relative; min-height: min(100svh, 980px); padding: 140px 0 80px; display: flex; flex-direction: column; justify-content: center; }
.hero-chev {
  position: absolute; right: -2vw; top: 62%; width: min(30vw, 380px); translate: 0 -50%;
  fill: none; stroke: var(--red); stroke-width: 7; stroke-linecap: square; opacity: 0.85;
  stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.4s 0.3s var(--ease) forwards;
  z-index: 0; pointer-events: none;
}
.hero > :not(.hero-chev) { position: relative; z-index: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-title { font: 500 clamp(44px, 9vw, 120px)/1.02 var(--mono); letter-spacing: -0.04em; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.22em; margin-bottom: -0.16em; }
.hero-title .line > span { display: inline-block; transform: translateY(105%); animation: rise 1s var(--ease) forwards; }
.hero-title .line:nth-child(2) > span { animation-delay: 0.12s; }
@keyframes rise { to { transform: none; } }
.cursor {
  display: inline-block; width: 0.5em; height: 0.82em; margin-left: 0.08em; vertical-align: -0.06em;
  background: var(--red); animation: blink 1.05s steps(1) infinite 1.2s;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-lead { max-width: 560px; font-size: clamp(17px, 2vw, 20px); margin: 32px 0 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px; border-radius: 999px;
  font: 500 15px var(--mono); text-decoration: none; transition: transform 0.25s var(--ease), background 0.25s;
}
.btn:active { transform: scale(0.97); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--red); color: #fff; }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

.hero-term {
  margin-top: 56px; max-width: 520px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
}
.term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.term-bar i:first-child { background: var(--red); }
.term-bar span { margin-left: 8px; }
.term-body { margin: 0; padding: 16px 18px; min-height: 118px; font: 13.5px/1.7 var(--mono); color: var(--ink); white-space: pre-wrap; }
.term-body .c { color: var(--red); }
.term-body .m { color: var(--muted); }

/* Bånd */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; margin: 0 -20px; }
.marquee-track { display: flex; gap: 28px; width: max-content; animation: marquee 30s linear infinite; font: 500 clamp(18px, 2.4vw, 26px) var(--mono); color: var(--ink); white-space: nowrap; }
.marquee b { color: var(--red); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Seksjoner */
.section-head { padding: 120px 0 40px; }
.section-head h2, .contact h2 { font: 500 clamp(30px, 5vw, 58px)/1.05 var(--mono); letter-spacing: -0.03em; max-width: 900px; }

/* Prosjekter */
.project { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding: 60px 0 120px; }
.project-flip .project-copy { order: 2; }
.project-id { display: flex; align-items: center; gap: 14px; }
.project-id img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); }
.tag { font: 500 12px/1 var(--mono); padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); }
.tag-soon { color: var(--scene); border-color: color-mix(in srgb, var(--scene) 50%, transparent); }
.tag-live { color: #fff; background: #4f634d; border-color: transparent; }
.tag-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #9fe39b; margin-right: 7px; vertical-align: 1px; animation: blink 1.6s steps(1) infinite; }
.project h3 { font: 500 clamp(40px, 6vw, 76px)/1 var(--mono); letter-spacing: -0.04em; margin: 22px 0 14px; }
.project-lead { font-size: clamp(18px, 2vw, 21px); color: var(--ink); max-width: 480px; margin: 0; }
.facts { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 14px; align-items: baseline; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.facts b { font: 500 12px var(--mono); color: var(--scene); }
.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px; border-radius: 12px;
  background: var(--ink); color: var(--paper); text-decoration: none; font: 600 16px/1.05 var(--sans);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.store svg { width: 24px; height: 24px; fill: currentColor; }
.store small { display: block; font: 500 10.5px var(--mono); opacity: 0.75; letter-spacing: 0.02em; }
a.store:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.5); }
.store.is-soon { background: transparent; color: var(--ink); border: 1px dashed var(--line); cursor: default; }
.links { display: flex; gap: 18px; margin: 20px 0 0; font: 13px var(--mono); }
.links a { color: var(--muted); }
.links a:hover { color: var(--ink); }

.project-visual { position: relative; min-height: 600px; display: grid; place-items: center; perspective: 1200px; }
.project-visual > * { will-change: transform; }
.phone {
  width: min(300px, 70vw); border-radius: 46px; padding: 10px; background: #0b0b0b;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 50px 90px -40px rgba(0, 0, 0, 0.6), 0 0 120px -20px color-mix(in srgb, var(--scene) 45%, transparent);
  transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) translateY(var(--py, 0px));
  transition: transform 0.6s var(--ease);
}
.phone img { border-radius: 36px; }
.float {
  position: absolute; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.45);
  translate: 0 var(--py, 0px); animation: bob 6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-10px); } }
.float p { margin: 0; }
.f-label { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.f-big { font: 500 28px/1.2 var(--mono); color: var(--ink); letter-spacing: -0.02em; margin-top: 4px !important; }
.f-big span { color: var(--muted); font-size: 0.7em; }
.f-big em { font-style: normal; color: var(--scene); }
.f-sub { font: 12px var(--mono); color: var(--muted); margin-top: 4px !important; }
.float-a { left: -2%; top: 16%; animation-delay: -1s; }
.float-b { right: 0; bottom: 18%; animation-delay: -3s; }
.float-c { right: 8%; top: 8%; padding: 14px; animation-delay: -2s; }
.float-d { left: 4%; bottom: 10%; animation-delay: -2.5s; }
.seg { display: flex; gap: 4px; margin-top: 8px; padding: 3px; border-radius: 10px; background: var(--line); font: 500 13px var(--mono); }
.seg span { padding: 6px 12px; border-radius: 7px; color: var(--ink-2); }
.seg .on { background: var(--scene); color: #121110; animation: segpick 6s infinite; }
@keyframes segpick { 0%, 100% { transform: none; } 50% { transform: scale(1.04); } }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 44px; }
.bars i { width: 9px; border-radius: 2.5px; background: var(--muted); transform-origin: bottom; animation: rep 2.4s var(--ease) infinite; }
.bars i:nth-child(1) { height: 34%; opacity: 0.35; }
.bars i:nth-child(2) { height: 55%; opacity: 0.55; animation-delay: 0.08s; }
.bars i:nth-child(3) { height: 76%; opacity: 0.8; animation-delay: 0.16s; }
.bars i:nth-child(4) { height: 100%; background: var(--scene); animation-delay: 0.24s; }
@keyframes rep { 0%, 60%, 100% { transform: scaleY(1); } 20% { transform: scaleY(0.35); } 35% { transform: scaleY(1.08); } }
.check { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #6f8c6c; margin-right: 6px; vertical-align: -1px; }

.photo { margin: 0; position: absolute; border-radius: 22px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.55); }
.photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.2s var(--ease); }
.project.in-view .photo img { transform: scale(1); }
.photo-main { width: 86%; aspect-ratio: 4 / 3; left: 0; top: 10%; }
.photo-side { width: 38%; aspect-ratio: 1; right: 0; bottom: 4%; border: 6px solid var(--paper); }

/* Om */
.about-lead { font-size: clamp(19px, 2.4vw, 26px); line-height: 1.45; color: var(--ink); max-width: 820px; margin: 0 0 56px; }
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.principle { background: var(--paper); padding: 28px 24px 32px; transition: background 0.3s; }
.principle:hover { background: var(--paper-2); }
.principle h3 { font: 500 20px var(--mono); margin: 18px 0 8px; }
.principle p { margin: 0; font-size: 15px; }
.p-num { font: 500 12px var(--mono); color: var(--red) !important; }

/* Kontakt */
.contact { padding: 160px 0 120px; text-align: left; }
.big-mail { text-decoration: none; background: linear-gradient(var(--red), var(--red)) 0 100% / 0 3px no-repeat; transition: background-size 0.5s var(--ease); word-break: break-word; }
.big-mail:hover { background-size: 100% 3px; }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--line); font: 13px var(--mono); color: var(--muted); }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.foot p { margin: 0; }

/* Innglidning ved scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 880px) {
  .project { grid-template-columns: 1fr; padding-bottom: 80px; }
  .project-flip .project-copy { order: 0; }
  .project-visual { min-height: 520px; }
  .principles { grid-template-columns: 1fr 1fr; }
  .hero-chev { opacity: 0.18; width: 80vw; right: -20vw; }
  .top-nav { gap: 14px; font-size: 13px; }
}
@media (max-width: 520px) {
  .principles { grid-template-columns: 1fr; }
  .float-a { left: 0; top: 4%; }
  .float-b { right: 0; bottom: 6%; }
  .top-nav a:nth-child(2) { display: none; }
  .logo { width: 136px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-title .line > span { transform: none; }
  .hero-chev { stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
