/* =========================================================
   Barman Hanssen AS – prototype v2
   Selvstendig stilark. Avhenger kun av Font Awesome-kittet
   og Google Fonts (Inter). Ingen Bootstrap / jQuery.
   ========================================================= */

/* --- Reset & base ---------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--text-strong);
}

h1 {
  font-size: clamp(2.25rem, 4vw + 1rem, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
}

h3 {
  font-size: 1.375rem;
}

p {
  margin: 0 0 1em;
}

/* --- Design tokens --------------------------------------- */
:root {
  --primary: #0f4c81;
  --primary-hover: #0b3a63;
  --primary-contrast: #ffffff;
  --accent: #e08a1e;

  --surface: #ffffff;
  --surface-alt: #f5f7fa;
  --surface-raised: #ffffff;
  --border: #e5e9f0;
  --border-strong: #cbd3df;

  --text: #2b3648;
  --text-strong: #0f172a;
  --text-muted: #5b6677;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px -8px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 16px 40px -16px rgba(15, 23, 42, 0.25);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --container: 1160px;
  --gap: clamp(1rem, 2vw, 1.75rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-contrast: #0b1220;
    --accent: #fbbf24;

    --surface: #0b1220;
    --surface-alt: #0f1a2e;
    --surface-raised: #12203a;
    --border: #1f2d48;
    --border-strong: #2a3a5a;

    --text: #c7d2e1;
    --text-strong: #f1f5f9;
    --text-muted: #8b97ac;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  }
}

/* --- Layout helpers -------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.section--alt {
  background: var(--surface-alt);
}

.section__header {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.section__lead {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* --- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-contrast);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--primary-hover);
  color: var(--primary-contrast);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--surface-alt);
  color: var(--text-strong);
}

/* --- Site header / nav ----------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding-block: 0.5rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.nav__brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-contrast);
  font-weight: 700;
  font-size: 0.9rem;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link[aria-current='true'] {
  color: var(--text-strong);
  background: var(--surface-alt);
}

.nav__cta {
  margin-left: 0.5rem;
}

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-strong);
  font-size: 1.25rem;
  cursor: pointer;
}

.nav__toggle:hover {
  background: var(--surface-alt);
}

/* Dropdowns */
.nav__dropdown {
  position: relative;
}

.nav__dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.nav__dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  max-height: min(70vh, 540px);
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.nav__dropdown[data-open='true'] .nav__dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__dropdown-panel a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9375rem;
}

.nav__dropdown-panel a:hover {
  background: var(--surface-alt);
  color: var(--text-strong);
}

.nav__dropdown-panel details {
  border-top: 1px solid var(--border);
}

.nav__dropdown-panel details:first-of-type {
  border-top: 0;
}

.nav__dropdown-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
  list-style: none;
}

.nav__dropdown-panel summary::-webkit-details-marker {
  display: none;
}

.nav__dropdown-panel summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}

.nav__dropdown-panel details[open] summary::after {
  transform: rotate(180deg);
}

.nav__dropdown-panel summary:hover {
  background: var(--surface-alt);
}

.nav__dropdown-panel .nav__year-list {
  list-style: none;
  margin: 0 0 0.25rem;
  padding: 0 0 0.25rem 0.75rem;
}

/* Mobile menu overlay */
@media (max-width: 860px) {
  .nav__toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav__menu {
    position: fixed;
    inset: 64px 0 0 0;
    padding: 1.5rem;
    background: var(--surface);
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

  .nav__menu[data-open='true'] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav__link,
  .nav__dropdown-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
  }

  .nav__dropdown-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    padding-left: 0;
    padding-right: 0;
    max-height: none;
    display: none;
  }

  .nav__dropdown[data-open='true'] .nav__dropdown-panel {
    display: block;
  }

  .nav__cta {
    margin-left: 0;
    margin-top: 0.75rem;
    justify-content: center;
  }
}

/* --- Hero ------------------------------------------------ */
.hero {
  position: relative;
  min-height: min(80vh, 720px);
  display: flex;
  align-items: center;
  color: #fff;
  isolation: isolate;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url('../img/bg1.jpg');
  background-size: cover;
  background-position: center;
  z-index: -2;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(10, 25, 50, 0.85) 0%,
    rgba(10, 25, 50, 0.55) 55%,
    rgba(10, 25, 50, 0.35) 100%
  );
  z-index: -1;
}

.hero__content {
  max-width: 720px;
  padding-block: clamp(4rem, 10vw, 7rem);
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}

.hero h1 {
  color: #fff;
  margin-bottom: 1rem;
}

.hero__sub {
  font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.25rem);
  color: rgba(255, 255, 255, 0.85);
  max-width: 56ch;
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__actions .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.hero__actions .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero__stat-value {
  display: block;
  font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero__stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
}

/* --- Timeline (Historikk) -------------------------------- */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--border-strong),
    var(--border-strong) 90%,
    transparent
  );
}

.timeline__item {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0 0 0.75rem 2.25rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.timeline__year {
  flex: 0 0 auto;
  min-width: 5.5rem;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

.timeline__desc {
  margin: 0;
  color: var(--text);
}

/* --- Strategy value cards -------------------------------- */
.values {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.value-card {
  padding: 1.75rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.value-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.value-card__icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.value-card h3 {
  margin-bottom: 0.5rem;
}

.value-card p {
  color: var(--text-muted);
  margin: 0;
}

/* --- Feature cards (iSkole) ------------------------------ */
.features {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-card__icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.feature-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.feature-card__list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text);
}

.feature-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
}

/* --- Screenshot gallery (scroll-snap) -------------------- */
.gallery {
  margin-top: 3rem;
}

.gallery__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.gallery__controls {
  display: flex;
  gap: 0.5rem;
}

.gallery__btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.gallery__btn:hover {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

.gallery__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(85%, 720px);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding: 0;
  padding-bottom: 1rem;
  margin: 0 calc(-1 * clamp(1rem, 4vw, 2rem));
  padding-inline: clamp(1rem, 4vw, 2rem);
  scrollbar-width: thin;
}

.gallery__item {
  scroll-snap-align: start;
  margin: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}

.gallery__item figcaption {
  padding: 0.9rem 1.1rem 1.1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* --- Contact --------------------------------------------- */
.contact {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.contact-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.contact-card h3 {
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.contact-card h3 i {
  color: var(--primary);
  font-size: 1rem;
}

.contact-card h3 ~ h3 {
  margin-top: 1.25rem;
}

.contact-card address {
  font-style: normal;
  color: var(--text);
  line-height: 1.65;
}

.contact-card__person {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-card__person img {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}

.contact-card__person strong {
  display: block;
  color: var(--text-strong);
  font-size: 1.0625rem;
}

.contact-card__person span {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.contact-socials {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.contact-socials a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.contact-socials a:hover {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

/* --- Footer ---------------------------------------------- */
.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--text-strong);
}

/* --- Reveal on scroll (diskré) --------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --- Motion preferences ---------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
