:root{
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #f6f7f9;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17,24,39,.10);
  --shadow: 0 12px 28px rgba(17,24,39,.08);
  --radius: 14px;
  --max: 1140px;

  --accent: #2f6fed;

  /* Logo/brand gradient (modern fade) */
  --mh-grad: linear-gradient(135deg,#7B4DFF 0%,#FF5FA2 35%,#FF9F1C 70%,#FFD166 100%);
}

*{ box-sizing: border-box; }
html, body{ height:100%; }

body{
  margin:0;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  overflow-x:hidden;
}

a{ color: inherit; text-decoration:none; }
.container{ width:min(var(--max), calc(100% - 42px)); margin-inline:auto; }

/* ===== Topbar ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border);
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 0;
}

/* Logo (header) */
.logo{
  font-weight: 800;
  letter-spacing: .02em;
  display:inline-flex;
  align-items:center;
  gap: 10px;
}

.logo-mark{
  width: 34px;
  height: 34px;
  display:block;
  transition: transform .2s ease, filter .2s ease;
}

.logo:hover .logo-mark{
  transform: translateY(-1px);
  filter: saturate(1.12);
}

/* Nav */
.nav{
  display:flex;
  align-items:center;
  gap: 16px;
  flex-wrap: nowrap; /* ⬅️ viktig */
}

.nav a{
  color: var(--muted);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
@media (max-width: 520px){
  .nav{
    gap: 12px;
  }

  .nav a{
    font-size: 14px;
    padding: 6px 0;
  }

  .nav .btn-link{
    padding: 8px 10px;
    font-size: 14px;
    white-space: nowrap;
  }
}

.nav a:hover{
  color: var(--text);
  border-bottom-color: rgba(47,111,237,.28);
}

.nav .btn-link{
  border-bottom: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(47,111,237,.18);
  background: rgba(47,111,237,.08);
  color: var(--text);
}

.nav .btn-link:hover{
  background: rgba(47,111,237,.12);
  border-color: rgba(47,111,237,.24);
}

/* ===== Layout sections ===== */
.section{ padding: 64px 0; }

.section.alt{
  background: var(--surface2);
  border-top: 1px solid rgba(17,24,39,.06);
  border-bottom: 1px solid rgba(17,24,39,.06);
}

/* ===== Hero ===== */
.hero{
  position: relative;
  padding: 64px 0 34px;
  background:
    radial-gradient(900px 520px at 20% 20%, rgba(47,111,237,.10), transparent 60%),
    radial-gradient(900px 520px at 80% 50%, rgba(47,111,237,.06), transparent 60%),
    linear-gradient(180deg, #ffffff, #ffffff);
}

.hero-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items:center;
}

@media (min-width: 920px){
  .hero-grid{ grid-template-columns: 1.1fr .9fr; gap: 36px; }
}

.hero-logo{
  width: min(320px, 68vw);
  height: auto;
  display:block;
  margin: 0 0 14px;
}

/* Typography */
.kicker{
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  color: rgba(17,24,39,.55);
  margin:0 0 10px;
}

h1{
  margin:0 0 10px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-size: clamp(34px, 4.2vw, 54px);
}

h2{
  margin:0 0 10px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-size: clamp(22px, 2.2vw, 30px);
}

.lead{
  margin:0;
  color: var(--muted);
  font-size: 18px;
  max-width: 62ch;
}

/* Buttons */
.cta-row{ display:flex; gap: 12px; margin-top: 18px; flex-wrap:wrap; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(17,24,39,.06);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background .15s ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(17,24,39,.10);
}

.btn.primary{
  background: var(--mh-grad);
  border: 0;
  color: #ffffff;
}

.btn.primary:hover{
  filter: saturate(1.08);
}

.btn.ghost{
  background: rgba(255,255,255,.85);
}

/* Cards + grids */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 920px){
  .grid-2{ grid-template-columns: 1fr 1fr; gap: 18px; }
}

/* Footer */
.footer{
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(17,24,39,.08);
  color: var(--muted);
  font-size: 13px;
}

/* Muted helper */
.muted{ color: var(--muted); }

/* ===== Scroll reveal ===== */
.reveal{
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .55s ease, transform .55s ease;
  will-change: opacity, transform;
}

.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* ===== Kontaktseksjon (ny, penere) ===== */
.contact-section{
  background: linear-gradient(180deg,#ffffff,#f7f8fb);
}

.contact-header{
  max-width: 640px;
  margin-bottom: 28px;
}

.contact-panel{
  display:grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(17,24,39,.08);
}

@media (min-width: 768px){
  .contact-panel{
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 32px;
  }
}

.contact-item{
  display:flex;
  flex-direction:column;
  gap: 4px;
}

.contact-label{
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(17,24,39,.55);
}

.contact-value{
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  width: fit-content;
  position: relative;
}

.contact-value:not(.muted)::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-2px;
  width:100%;
  height:2px;
  background: var(--mh-grad);
  opacity:.65;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.contact-value:not(.muted):hover::after{
  transform: scaleX(1);
}

/* ===== CV gate (hvis du bruker cv.html) ===== */
.cv-body{ min-height: 100vh; }

.gate{
  position: fixed;
  inset: 0;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  z-index: 80;
  padding: 18px;
}

.gate.hidden{ display:none; }

.gate-card{
  width: min(520px, 100%);
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(17,24,39,.12);
}

.gate-form{ display:flex; gap: 10px; margin-top: 12px; }

.gate-form input{
  flex: 1;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(17,24,39,.14);
  background: rgba(255,255,255,.9);
  color: var(--text);
  outline: none;
}

.gate-form input:focus{
  border-color: rgba(47,111,237,.35);
  box-shadow: 0 0 0 4px rgba(47,111,237,.10);
}

.gate-msg{ margin: 10px 0 0; color: #b42318; }
.tiny{ font-size: 12px; }

/* a11y helper */
.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  border:0;
}
/* --- Hero animert logo (Variant B: silkemyk draw-once) --- */
.hero-logo-wrap{
  width: min(320px, 68vw);
  margin: 0 0 14px;
}

.hero-logo-svg{
  width: 100%;
  height: auto;
  display: block;
}

/* Midtlinjer: start skjult (dash) */
.hero-logo-svg #mh-line,
.hero-logo-svg #mh-line-hi{
  pathLength: 100;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
}

/* Trigger når hero er synlig */
.hero-logo-svg.mh-animate #mh-line{
  animation:
    mh-draw-soft 1.65s cubic-bezier(.16,1,.30,1) forwards,
    mh-fade-in .55s ease-out forwards;
}

.hero-logo-svg.mh-animate #mh-line-hi{
  animation:
    mh-draw-soft 1.55s cubic-bezier(.16,1,.30,1) forwards,
    mh-fade-in .55s ease-out forwards;
  animation-delay: .10s, .10s; /* litt etter hovedlinja */
}

@keyframes mh-draw-soft{
  0%   { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

@keyframes mh-fade-in{
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Respekter reduced motion */
@media (prefers-reduced-motion: reduce){
  .hero-logo-svg #mh-line,
  .hero-logo-svg #mh-line-hi{
    stroke-dashoffset: 0;
    opacity: 1;
    animation: none !important;
  }
}
/* ===== Profilkort (CV) ===== */
.profile-card{
  display:flex;
  flex-direction:column;
  gap: 16px;
  text-align:center;
}

.profile-image{
  width: 160px;
  height: 160px;
  margin: 0 auto;
  border-radius: 50%;
  overflow:hidden;
  background: #f3f4f6;
  border: 1px solid rgba(17,24,39,.10);
}

.profile-image img{
  width:100%;
  height:100%;
  object-fit: cover;
}

.profile-info h2{
  margin-bottom:4px;
}
/* ===== Referanser ===== */
.references-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px){
  .references-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

.reference-card{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(17,24,39,.06);
}

.reference-image{
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow:hidden;
  background: #f3f4f6;
  border: 1px solid rgba(17,24,39,.10);
  flex-shrink: 0;
}

.reference-image img{
  width:100%;
  height:100%;
  object-fit: cover;
}

.reference-card h3{
  margin:0 0 2px;
  font-size: 16px;
}
