@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/nunito-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/nunito-latin-800-normal.woff2') format('woff2');
}

:root {
  --tekst: #1B2333;
  --dempet: #4E5A70;
  --lilla: #6D28D9;
  --lilla-mork: #4C1D95;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; font-size: 100%; }
@media (min-width: 1280px) and (min-height: 700px) { html { font-size: 106.25%; } }
@media (min-width: 1600px) and (min-height: 860px) { html { font-size: 118.75%; } }
@media (min-width: 2200px) and (min-height: 1150px) { html { font-size: 137.5%; } }
@media (orientation: portrait) and (min-width: 1000px) and (min-height: 1500px) { html { font-size: 118.75%; } }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, #DCEBFF 0%, #EEF5FF 45%, #FFF8EC 100%);
  background-attachment: fixed;
  color: var(--tekst);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.pynt {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.side {
  position: relative;
  z-index: 1;
  max-width: 64rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 2rem)
    calc(env(safe-area-inset-right) + 1.25rem)
    calc(env(safe-area-inset-bottom) + 1.5rem)
    calc(env(safe-area-inset-left) + 1.25rem);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.logo {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--lilla-mork);
  font-weight: 800;
  font-size: 1rem;
}
.logo-stjerne { color: #F5A400; font-size: 1.15rem; line-height: 1; }

.hode { display: flex; flex-direction: column; gap: 0.5rem; }
.hode h1 { margin: 0.5rem 0 0; font-size: 2.75rem; font-weight: 800; line-height: 1.05; color: var(--lilla-mork); }
.spor { margin: 0; font-size: 1.375rem; font-weight: 800; color: var(--dempet); }

.fliser {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.125rem;
}

.flis {
  position: relative;
  min-height: 11rem;
  border-radius: 1.75rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  overflow: hidden;
}

.flis.gloser {
  background: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);
  color: #FFFFFF;
  box-shadow: 0 0.5rem 1.5rem rgba(79, 70, 229, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.flis.gloser:hover { transform: translateY(-3px); box-shadow: 0 0.75rem 1.75rem rgba(79, 70, 229, 0.34); }
.flis.gloser:active { transform: scale(0.98); }
.flis.gloser:focus-visible { outline: 4px solid #FFC93C; outline-offset: 3px; }

.flis-tekst { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0.25rem; flex: 1; min-width: 0; }
.flis-tittel { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.flis-info { font-size: 1.125rem; opacity: 0.92; }
.flis-start {
  align-self: flex-start;
  margin-top: 0.75rem;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--lilla-mork);
  font-weight: 800;
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.flis-bilde { flex: 0 0 auto; width: 9.5rem; height: auto; }

.flis.snart {
  min-height: 7rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  border: 3px dashed #B9C6DD;
  background: rgba(255, 255, 255, 0.55);
  color: var(--dempet);
}
.flis.snart .flis-tittel { font-size: 1.25rem; }
.snart-ikon { width: 2.5rem; height: 2.5rem; color: #8B7CF6; }
.snart-ikon svg { width: 100%; height: 100%; }

.personvern { margin: auto 0 0; text-align: center; font-size: 0.875rem; color: var(--dempet); }

/* Smal telefon: bildet under teksten blir for trangt, så det krymper. */
@media (max-width: 380px) {
  .flis-bilde { width: 7rem; }
  .flis-tittel { font-size: 1.5rem; }
}

/* Nettbrett og PC */
@media (min-width: 700px) {
  .side { padding-top: calc(env(safe-area-inset-top) + 3rem); gap: 2.25rem; }
  .hode h1 { font-size: 3.5rem; }
  .spor { font-size: 1.625rem; }
  .fliser { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
  .flis.gloser { grid-column: 1 / -1; min-height: 14rem; padding: 2rem 2.25rem; }
  .flis.gloser .flis-tittel { font-size: 2.5rem; }
  .flis.gloser .flis-info { font-size: 1.375rem; }
  .flis.gloser .flis-bilde { width: 15rem; }
}

/* Liggende og bred skjerm: overskrift til venstre, flisene til høyre */
@media (orientation: landscape) and (min-width: 900px) {
  .side { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); grid-template-rows: 1fr auto; column-gap: 3rem; align-items: center; }
  .hode { align-self: center; }
  .hode h1 { font-size: 4rem; }
  .fliser { grid-template-columns: minmax(0, 1fr); }
  .personvern { grid-column: 1 / -1; }
}

/* Liggende telefon: lite høyde */
@media (orientation: landscape) and (max-height: 520px) {
  .side { padding-top: calc(env(safe-area-inset-top) + 1rem); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); grid-template-rows: 1fr auto; column-gap: 1.5rem; align-items: center; gap: 1rem; }
  .hode h1 { font-size: 2.25rem; }
  .spor { font-size: 1.125rem; }
  .fliser { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .flis.gloser { min-height: 9rem; padding: 1.25rem 1.5rem; }
  .flis.gloser .flis-tittel { font-size: 1.75rem; }
  .flis.gloser .flis-bilde { width: 9rem; }
  .flis.snart { min-height: 4rem; flex-direction: row; }
  .personvern { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
