/* Romundgard Labs – én stilfil, ingen eksterne fonter */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #171a19;
  --muted: #59605d;
  --line: #e2e0d9;
  --line-strong: #c9c6bc;
  --accent: #0f6e5c;
  --accent-text: #ffffff;
  --accent-soft: #e3efe9;
  --shadow: 0 24px 60px -24px rgba(23, 26, 25, 0.28);
  --radius: 14px;
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121413;
    --surface: #1b1e1d;
    --text: #ecefed;
    --muted: #a3aba7;
    --line: #2b302e;
    --line-strong: #3e4542;
    --accent: #5fd3b3;
    --accent-text: #0c1a16;
    --accent-soft: #1d2d28;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121413;
  --surface: #1b1e1d;
  --text: #ecefed;
  --muted: #a3aba7;
  --line: #2b302e;
  --line-strong: #3e4542;
  --accent: #5fd3b3;
  --accent-text: #0c1a16;
  --accent-soft: #1d2d28;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.6em; }
h1 { font-size: clamp(2.1rem, 4.2vw, 3.2rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); max-width: 22ch; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 32px; } }

.skip {
  position: absolute; left: 16px; top: -60px;
  background: var(--accent); color: var(--accent-text);
  padding: 8px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand b { color: var(--accent); font-weight: 600; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:not(.btn):hover { color: var(--text); }
@media (max-width: 640px) { .nav a:not(.btn) { display: none; } }

/* Knapper */
.btn {
  display: inline-block;
  background: var(--accent); color: var(--accent-text);
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
  border: 2px solid var(--accent);
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-small { padding: 7px 16px; font-size: 0.95rem; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 0.8em;
}
.lead { font-size: 1.18rem; color: var(--muted); max-width: 58ch; }

/* Seksjoner */
.section { padding: clamp(64px, 9vw, 112px) 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); }

/* Topp */
.hero {
  padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 6vw, 72px);
  background: radial-gradient(60% 70% at 85% 35%, var(--accent-soft), transparent 70%);
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 920px) { .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 48px; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-visual { margin: 0; max-width: 520px; width: 100%; justify-self: center; }

.skills {
  list-style: none; padding: 0; margin: clamp(40px, 6vw, 64px) 0 0;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.skills li {
  font-family: var(--mono); font-size: 0.82rem;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 14px; color: var(--muted);
  background: var(--surface);
}

/* Illustrasjoner (SVG) */
.ill { width: 100%; height: auto; display: block; overflow: visible; }
.ill text { font: 600 12px var(--font); fill: var(--text); text-anchor: middle; }
.ill-result text { font-size: 10.5px; }
.ill-grid path { stroke: var(--line); stroke-width: 1; fill: none; }
.ill-wire path {
  fill: none; stroke: var(--line-strong); stroke-width: 2;
  stroke-dasharray: 4 6; animation: ill-dash 1.2s linear infinite;
}
.ill-pulse circle { fill: var(--accent); }
.ill-node rect { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.ill-stroke, .ill-stroke * { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill-check { fill: var(--accent); }
.ill-core-bg { fill: var(--accent); }
.ill-spark, .ill-cloud { fill: var(--accent-text); }
.ill-spark { transform-box: fill-box; transform-origin: center; animation: ill-spin 8s linear infinite; }
.ill-ring {
  fill: none; stroke: var(--accent); stroke-width: 2;
  transform-box: fill-box; transform-origin: center;
  animation: ill-ring 2.4s ease-out infinite;
}
.ill-ring-2 { animation-delay: 1.2s; }

.ill-paper > rect { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.ill-paper { animation: ill-float 6s ease-in-out infinite; }
.ill-arrow path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ill-arrow { animation: ill-nudge 1.6s ease-in-out infinite; }
.ill-device > rect:not([class]) { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.ill-screen-bar, .ill-card { fill: var(--accent-soft); }
.ill-card { stroke: var(--line-strong); stroke-width: 1; }
.ill-field, .ill-soft-block, .ill-dot, .ill-divider-fill { fill: var(--line-strong); }
.ill-divider { stroke: var(--line-strong); stroke-width: 1.5; }
.ill-fill, .ill-accent-block, .ill-bars rect { fill: var(--accent); }

.ill-fill { transform-box: fill-box; transform-origin: left center; animation: ill-fill 6s var(--ease) infinite; }
.ill-fill.f2 { animation-delay: 0.5s; }
.ill-check.c1, .ill-check.c2 { transform-box: fill-box; transform-origin: center; animation: ill-pop 6s var(--ease) infinite; }
.ill-check.c1 { animation-delay: 1s; }
.ill-check.c2 { animation-delay: 1.3s; }
.ill-bars rect { transform-box: fill-box; transform-origin: center bottom; animation: ill-grow 6s var(--ease) infinite; }
.ill-bars .b1 { animation-delay: 1.6s; }
.ill-bars .b2 { animation-delay: 1.8s; }
.ill-bars .b3 { animation-delay: 2s; }
.ill-bars .b4 { animation-delay: 2.2s; }

.ill-build rect { animation: ill-build 7s var(--ease) infinite; }
.ill-build .k2 { animation-delay: 0.3s; }
.ill-build .k3 { animation-delay: 0.6s; }
.ill-build .k4 { animation-delay: 0.9s; }
.ill-build .k5 { animation-delay: 1.2s; }
.ill-build .k6 { animation-delay: 1.5s; }

@keyframes ill-dash { to { stroke-dashoffset: -20; } }
@keyframes ill-spin { to { transform: rotate(360deg); } }
@keyframes ill-ring { from { transform: scale(1); opacity: 0.7; } to { transform: scale(1.6); opacity: 0; } }
@keyframes ill-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ill-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@keyframes ill-fill { 0%, 10% { transform: scaleX(0); } 30%, 85% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes ill-pop { 0%, 15% { transform: scale(0); } 25%, 85% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes ill-grow { 0%, 10% { transform: scaleY(0); } 30%, 85% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes ill-build {
  0% { opacity: 0; transform: translateY(8px); }
  12%, 82% { opacity: 1; transform: none; }
  94%, 100% { opacity: 0; transform: none; }
}

/* Tjenester: uten JavaScript eller på smale skjermer står illustrasjonen ved hver tjeneste */
.story-stage { display: none; }
.service { display: grid; gap: 24px; padding: 28px 0; }
.service + .service { border-top: 1px solid var(--line); }
.service-visual {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(16px, 4vw, 28px);
}
@media (min-width: 760px) {
  .service { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
}
.service-num { display: block; font-family: var(--mono); font-size: 0.85rem; color: var(--accent); margin-bottom: 12px; }
.service-text h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.service-text p { color: var(--muted); max-width: 48ch; }
.deliverables { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.deliverables li { display: flex; gap: 10px; align-items: baseline; }
.deliverables li::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); transform: translateY(-1px) rotate(45deg);
}

/* Med JavaScript på brede skjermer: illustrasjonen står fast og bytter ved scroll */
@media (min-width: 920px) {
  .js .story { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; }
  .js .story-stage {
    display: flex; flex-direction: column; gap: 16px;
    position: sticky; top: calc(64px + 8vh); height: 72vh; max-height: 620px;
  }
  .js .stage-frame {
    position: relative; flex: 1;
    background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
    box-shadow: var(--shadow); overflow: hidden;
    background-image: radial-gradient(var(--line) 1px, transparent 1px);
    background-size: 22px 22px;
  }
  .js .stage-slide {
    position: absolute; inset: 0; display: grid; place-items: center; padding: 36px;
    opacity: 0; transform: translateY(24px) scale(0.96);
    transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
  }
  .js .stage-slide.is-active { opacity: 1; transform: none; }
  .js .stage-slide .ill { max-height: 100%; }
  .js .stage-progress {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--mono); font-size: 0.85rem; color: var(--muted);
  }
  .js .stage-count { color: var(--accent); }
  .js .stage-bar { flex: 1; height: 2px; background: var(--line); position: relative; overflow: hidden; }
  .js .stage-bar i {
    position: absolute; inset: 0; background: var(--accent);
    transform-origin: left; transform: scaleX(0.25); transition: transform 0.6s var(--ease);
  }

  .js .service { display: flex; align-items: center; min-height: 72vh; padding: 0; border: 0; }
  .js .service-visual { display: none; }
  .js .service-text { opacity: 0.25; transform: translateX(12px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
  .js .service.is-active .service-text { opacity: 1; transform: none; }
}

/* Vilkår under tjenestene */
.terms {
  list-style: none; padding: 0; margin: clamp(40px, 6vw, 72px) 0 0;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.terms li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; border-top: 3px solid var(--accent);
}
.terms strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.terms span { color: var(--muted); font-size: 0.97rem; }

/* Prosjekter */
.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  overflow: hidden;
}
.case-preview {
  position: relative;
  padding: clamp(20px, 5vw, 56px) clamp(20px, 5vw, 56px) 0;
  background: radial-gradient(70% 90% at 50% 100%, var(--accent-soft), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--line);
}
.mock-browser {
  border-radius: 12px 12px 0 0; overflow: hidden;
  border: 1px solid var(--line-strong); border-bottom: 0;
  box-shadow: var(--shadow); background: #141210;
  max-width: 880px; margin: 0 auto;
}
.mock-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.mock-bar span {
  margin-left: 12px; flex: 1; max-width: 280px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  background: var(--bg); border-radius: 6px; padding: 3px 10px;
}
.mock-phone {
  position: absolute; right: clamp(16px, 6vw, 72px); bottom: 0;
  width: clamp(110px, 20%, 200px);
  border: 6px solid #0e0f0f; border-radius: 26px; overflow: hidden;
  box-shadow: var(--shadow); background: #0e0f0f;
  transform: translateY(12%);
}
.case-preview[data-reveal] .mock-phone { transition: transform 0.9s var(--ease) 0.2s; }
.js .case-preview[data-reveal]:not(.is-visible) .mock-phone { transform: translateY(30%); }

.case-body { padding: clamp(24px, 4vw, 48px); padding-top: clamp(40px, 6vw, 64px); }
.case-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 28px; }
.case-head h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 4px; }
.case-meta { color: var(--muted); margin: 0; font-size: 0.95rem; }
.case-status {
  font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--accent-soft); color: var(--accent);
  padding: 5px 12px; border-radius: 999px;
}
.case-grid { display: grid; gap: 16px; }
@media (min-width: 860px) { .case-grid { grid-template-columns: repeat(3, 1fr); } }
.case-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.case-col-result { background: var(--accent-soft); border-color: transparent; }
.case-tag { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.case-col-result .case-tag { color: var(--accent); }
.case-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.case-col li { position: relative; padding-left: 26px; font-size: 0.98rem; }
.case-col li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.case-col:nth-child(1) li::before { content: "–"; color: var(--muted); }
.case-col:nth-child(2) li::before { content: "→"; color: var(--accent); }
.case-col:nth-child(3) li::before { content: "✓"; color: var(--accent); }

/* Prosess */
.steps {
  list-style: none; padding: 0; margin: 0; counter-reset: step;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.steps li { counter-increment: step; border-top: 2px solid var(--accent); padding-top: 18px; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--mono); font-size: 0.85rem; color: var(--accent); margin-bottom: 8px;
}
.steps h3 { font-size: 1.15rem; }
.steps p { color: var(--muted); margin: 0; }

/* Om */
.about { display: grid; gap: 32px; align-items: start; }
@media (min-width: 760px) { .about { grid-template-columns: 220px 1fr; gap: 56px; } }
.about p { max-width: 62ch; }
.role { color: var(--muted); font-weight: 500; margin-top: -0.4em; }
.portrait {
  width: 180px; aspect-ratio: 1; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-size: 3rem; font-weight: 700; letter-spacing: -0.04em;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Kontakt */
.contact { background: var(--accent-soft); }
.contact-mail {
  display: inline-block; margin-top: 8px;
  font-size: clamp(1.3rem, 4.5vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: 0.92rem; }
.footer-inner p { margin: 0 0 6px; }
.site-footer a { color: var(--muted); }

/* Undersider */
.page { padding: clamp(48px, 8vw, 96px) 0; }
.page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page h2 { font-size: 1.3rem; margin-top: 1.6em; }
.page p, .page li { max-width: 65ch; }

/* Innglidning ved scroll (bare når JavaScript kjører) */
.js [data-reveal] { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-reveal]:not(.is-visible) { opacity: 0; transform: translateY(24px); }
.steps li:nth-child(2) { transition-delay: 0.1s; }
.steps li:nth-child(3) { transition-delay: 0.2s; }
.steps li:nth-child(4) { transition-delay: 0.3s; }
.case-grid .case-col:nth-child(2) { transition-delay: 0.1s; }
.case-grid .case-col:nth-child(3) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal]:not(.is-visible) { opacity: 1; transform: none; }
}
