/* ============================
   Mattsson Aviation – Navy / clean
   No yellow accents anywhere
   Works with: index + subpages + loader + timeline + portfolio + contact
============================ */

:root{
  /* Core palette */
  --navy: #081a33;
  --navy-2: #0d2b56;
  --navy-3: #123a73;

  /* Surfaces */
  --bg: #f4f6f8;
  --surface: rgba(255,255,255,.92);
  --surface-2: rgba(255,255,255,.82);
  --line: #e4e9ef;

  /* Text */
  --ink: #0b1220;
  --muted: #556476;

  /* Radius / shadows */
  --radius: 18px;
  --radius-sm: 14px;

  --shadow-sm: 0 10px 26px rgba(8,26,51,.10);
  --shadow: 0 18px 48px rgba(8,26,51,.16);

  --container: 1160px;

  /* Focus */
  --focus: 0 0 0 4px rgba(8,26,51,.16);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; height: 100%; }

/* Sticky footer baseline */
body{
  margin:0;
  min-height: 100vh;
  display:flex;
  flex-direction: column;

  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  position: relative;
}

main{ flex: 1 0 auto; }
footer{ margin-top: auto; }

img{ max-width:100%; height:auto; display:block; }
a{ color: inherit; }

.container{
  width: min(var(--container), calc(100% - 44px));
  margin: 0 auto;
}

/* Accessibility */
.skip{
  position:absolute;
  left:-999px;
  top:0;
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.skip:focus{ left:12px; top:12px; z-index:9999; outline:none; }

/* ============================
   Header
============================ */
.site-header{
  position: sticky;
  top:0;
  z-index: 1000;
  background: rgba(244,246,248,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration:none;
  min-width: 260px;
}

.brand-logo{
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.brand-text{ display:flex; flex-direction:column; line-height:1.1; }
.brand-name{
  font-weight: 850;
  letter-spacing: .2px;
}
.brand-tag{
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* Nav */
.nav{
  display:flex;
  align-items:center;
  gap: 12px;
}

.nav a{
  text-decoration:none;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 10px;
  border-radius: 999px;
  color: rgba(11,18,32,.88);
}

.nav a:hover{ background: rgba(8,26,51,.06); }

.nav a.active{
  background: rgba(8,26,51,.10);
  color: var(--navy);
}

.nav-cta{
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(8,26,51,.18);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.nav-cta:hover{
  border-color: rgba(8,26,51,.28);
  background: rgba(255,255,255,.98);
}

/* Mobile toggle */
.nav-toggle{
  display:none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  cursor:pointer;
}

.nav-toggle span{
  display:block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: rgba(11,18,32,.75);
  border-radius: 2px;
}

/* ============================
   Buttons (white contrast)
============================ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(8,26,51,.20);
  background: #ffffff;
  color: var(--navy);
  text-decoration:none;
  font-weight: 850;
  font-size: 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
  cursor:pointer;
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.btn:hover{
  border-color: rgba(8,26,51,.30);
  box-shadow: 0 18px 52px rgba(0,0,0,.16);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(0); }

.btn.primary{
  background: #ffffff;
  border-color: rgba(255,255,255,.92);
}
.btn.primary:hover{
  background: linear-gradient(180deg, #ffffff, #eef3ff);
}

.btn.ghost{
  background: transparent;
  border-color: rgba(8,26,51,.20);
  color: var(--navy);
  box-shadow: none;
}
.btn.ghost:hover{
  background: rgba(8,26,51,.06);
}

/* ============================
   Hero (index)
============================ */
.hero{ position: relative; }

.hero-image{
  min-height: 78vh;
  display:flex;
  align-items:center;
  overflow:hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg{
  position:absolute;
  inset:0;
  z-index:-1;
}

.hero-bg img{
  width:100%;
  height:100%;
  zoom: 0.9;
}

/* Navy overlay only (no yellow glow) */
.hero-bg::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(900px 520px at 18% 35%, rgba(255,255,255,.10), transparent 62%),
    linear-gradient(90deg,
      rgba(8,26,51,.86) 0%,
      rgba(8,26,51,.70) 44%,
      rgba(8,26,51,.38) 78%,
      rgba(8,26,51,.22) 100%
    );
}

/* La heroen få litt ekstra bredde enn resten */
.hero-content{
  padding: 98px 0 82px;
  color: rgba(255,255,255,.92);
}

/* HERO split: 3/4 tekst + 1/4 bilde */
.hero-split{
  display: grid;
  grid-template-columns: 1.15fr .45fr;
  gap: 82px;
  align-items: center;
}

.hero-text{ min-width: 0; }

/* Bilde-container */
.hero-photo{
  justify-self: end;
  width: clamp(340px, 28vw, 460px);
  display: grid;
  gap: 12px;
}

/* Portrett: høyere enn bred, men aldri høyere enn vinduet */
.portrait{
  width: 100%;
  height: auto;
  max-height: calc(78vh - 140px);
  object-fit: cover;

  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.20);
  box-shadow: 0 18px 48px rgba(0,0,0,.26);
  background: rgba(255,255,255,.06);
}

@media (min-width: 981px){
  .portrait{ min-height: 420px; }
}

/* Kicker */
.kicker{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .25px;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  padding: 8px 12px;
  border-radius: 999px;
  margin: 0 0 16px;
}

.hero-content h1{
  margin: 0 0 12px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -1.2px;
}

.hero-content .lead{
  margin: 0 0 18px;
  font-size: 16.5px;
  color: rgba(255,255,255,.86);
  max-width: 64ch;
}

.hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin: 16px 0 18px;
}

/* Buttons in hero */
.hero-image .btn{
  border-color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.94);
  color: var(--navy);
}
.hero-image .btn:hover{
  border-color: rgba(255,255,255,.96);
  background: #ffffff;
}

.hero-image .btn.ghost{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.34);
  color: rgba(255,255,255,.92);
  box-shadow: none;
}
.hero-image .btn.ghost:hover{
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.46);
}

/* Metrics */
.hero-metrics{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric{
  padding: 12px 12px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
}

.metric-value{
  font-weight: 950;
  letter-spacing: .2px;
  color: rgba(255,255,255,.94);
}

.metric-label{
  color: rgba(255,255,255,.74);
  font-size: 13px;
  margin-top: 3px;
}

.note{
  margin: 14px 0 0;
  color: rgba(255,255,255,.70);
  font-size: 13px;
}

.pc-title{
  font-weight: 950;
  color: rgba(255,255,255,.92);
  letter-spacing: .2px;
  line-height: 1.1;
}
.pc-sub{
  font-size: 13px;
  color: rgba(255,255,255,.75);
  margin-top: 4px;
}

/* ============================
   Subpages: Page hero
============================ */
.page-hero{
  padding: 58px 0 24px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.page-kicker{
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
  color: rgba(8,26,51,.85);
  letter-spacing: .25px;
}

.page-title{
  margin: 0 0 10px;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--navy);
}

.page-lead{
  margin: 0;
  max-width: 76ch;
  color: var(--muted);
  font-size: 16px;
}

.page-hero + .section{ padding-top: 44px; }

/* ============================
   Sections / cards
============================ */
.section{ padding: 64px 0; }

.section-head{ margin-bottom: 18px; }
.section-head h2{
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -.4px;
  color: var(--navy);
}
.section-head p{
  margin: 0;
  color: var(--muted);
  max-width: 80ch;
}

.grid{ display:grid; gap: 16px; }
.cards{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.two-col{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items:start;
}

.card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.card h3{ margin: 0 0 8px; font-size: 18px; }
.card p{ margin: 0; color: rgba(11,18,32,.82); }

.muted{ color: var(--muted); }
.small{ font-size: 13px; }

.divider{
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

/* ============================
   Profile box
============================ */
.profile-box{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.profile-row{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.profile-row:last-of-type{
  border-bottom:none;
  padding-bottom: 6px;
}

.label{
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.value{
  font-weight: 900;
  color: rgba(8,26,51,.92);
  text-align: right;
}

/* ============================
   Timeline (Erfaring) – FIXED
   (No line overlapping pill)
============================ */
.timeline{
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.timeline-item{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 22px 74px; /* room for the rail */
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

/* Rail line (stays behind content) */
.timeline-item::after{
  content:"";
  position:absolute;
  left: 34px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: rgba(8,26,51,.14);
  z-index: 0;
}

/* Dot */
.timeline-item::before{
  content:"";
  position:absolute;
  left: 29px;
  top: 28px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(8,26,51,.65);
  box-shadow: 0 0 0 7px rgba(8,26,51,.08);
  z-index: 1;
}

/* Ensure content sits above rail */
.timeline-item > *{ position: relative; z-index: 2; }

.timeline-meta{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  align-items:center;
  margin-bottom: 10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: var(--navy);
  background: rgba(8,26,51,.08);
  border: 1px solid rgba(8,26,51,.14);
}

.timeline-item h3{ margin: 0 0 8px; font-size: 18px; }
.timeline-item p{ margin: 0; color: rgba(11,18,32,.82); }

/* ============================
   Portfolio
============================ */
.portfolio-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.portfolio-item{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.portfolio-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tags{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag{
  font-size: 12px;
  font-weight: 850;
  color: rgba(8,26,51,.88);
  border: 1px solid rgba(8,26,51,.14);
  background: rgba(8,26,51,.06);
  padding: 6px 10px;
  border-radius: 999px;
}

/* ============================
   Callout
============================ */
.callout{
  margin-top: 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(8,26,51,.14);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-sm);
}

/* ============================
   Contact + form
============================ */
.contact-cards{
  display:grid;
  gap: 12px;
  margin-top: 14px;
}

.contact-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.contact-label{
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  margin-bottom: 6px;
}

.contact-value{
  font-weight: 900;
  color: var(--navy);
  text-decoration:none;
}
.contact-value:hover{ text-decoration: underline; }

.form{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.field{ margin-bottom: 12px; }

label{
  display:block;
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  margin-bottom: 6px;
}

input, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(8,26,51,.16);
  background: rgba(255,255,255,.96);
  color: rgba(11,18,32,.92);
  outline:none;
}
input:focus, textarea:focus{
  border-color: rgba(8,26,51,.35);
  box-shadow: var(--focus);
}

.form-actions{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 10px;
}

.form-hint{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ============================
   Footer
============================ */
.footer{
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.70);
}

.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 14px;
}

.footer-left{
  display:flex;
  align-items:center;
  gap: 12px;
}

.footer-logo{
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.footer-title{ font-weight: 950; color: var(--navy); }
.footer-sub{ color: var(--muted); font-size: 13px; }

.footer-right{
  display:flex;
  gap: 10px;
  align-items:center;
}
.footer-right a{ text-decoration:none; }
.footer-right a:hover{ text-decoration: underline; }
.sep{ color: rgba(11,18,32,.35); }

/* ============================
   Loader (transparent, no blur) – fly straight up + smooth scale
============================ */
.loader{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: transparent;     /* gjennomsiktig */
  backdrop-filter: none;       /* ingen blur */
  opacity: 1;
  pointer-events: all;
}

/* Fullscreen scene */
.loader-inner{
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* fjern/ignorer trail hvis den finnes */
.trail{ display:none !important; }
/* fjern tekst hvis den finnes */
.loader-text{ display:none !important; }

.plane{
  position: absolute;
  left: 50%;
  bottom: -25vh; /* start under skjermen */
  width: clamp(70px, 10vw, 130px);
  height: auto;

  color: rgba(8,26,51,.92);
  filter: drop-shadow(0 18px 36px rgba(0,0,0,.22));
  will-change: transform, opacity, bottom;

  /* START: pek rett opp (juster rotasjon ved behov) */
  transform: translateX(-50%) rotate(0deg) scale(0.35);
  opacity: 1;
}

.loader.is-leaving{
  pointer-events: none;
}

.loader.is-leaving .plane{
  animation: plane-up 1400ms cubic-bezier(.2,.9,.2,1) forwards;
}

/* Rett linje opp, gradvis større */
@keyframes plane-up{
  0%{
    bottom: -25vh;
    transform: translateX(-50%) rotate(0deg) scale(0.35);
    opacity: 1;
  }
  65%{
    bottom: 45vh;
    transform: translateX(-50%) rotate(0deg) scale(1.4);
    opacity: 1;
  }
  100%{
    bottom: 120vh; /* langt over toppen */
    transform: translateX(-50%) rotate(0deg) scale(3.2); /* stor nok til 50%+ */
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce){
  .loader{ display:none; }
}


/* ============================
   Responsive
============================ */
@media (max-width: 980px){
  .cards{ grid-template-columns: 1fr; }
  .two-col{ grid-template-columns: 1fr; }
  .portfolio-grid{ grid-template-columns: 1fr; }
  .hero-metrics{ grid-template-columns: 1fr; }
  .hero-content{ padding: 78px 0 62px; }

  .hero-split{
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hero-photo{
    justify-self: start;
    width: min(520px, 92vw);
  }
  .portrait{
    max-height: 56vh;
    min-height: 320px;
  }
}

@media (max-width: 820px){
  .brand-logo{ width: 56px; height: 56px; }
  .nav-toggle{ display:inline-block; }

  .nav{
    position:absolute;
    right: 22px;
    top: 70px;
    display:none;
    flex-direction:column;
    gap: 6px;
    padding: 10px;
    background: rgba(107, 67, 67, 0.92);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: min(320px, calc(100% - 44px));
  }
  .nav.open{ display:flex; }

  .nav a{
    padding: 12px 12px;
    border-radius: 14px;
  }
}
