/* =========================================================
   Odin S. Ulvatne – CV / portefølje
   Maritim/teknisk profil: dyp marineblå + signalgul aksent
   ========================================================= */

/* ---------- Grunnoppsett ---------- */
:root {
  --navy-900: #06111f;
  --navy-800: #0a1a2e;
  --navy: #0f2238;
  --navy-2: #173352;
  --navy-3: #22476f;
  --sea: #3fb6c9;
  --ink: #142032;
  --text: #334155;
  --muted: #5d6b7e;
  --line: #e2e8f0;
  --line-2: #cfd8e3;
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --accent: #f0b429;
  --accent-2: #ffc94d;
  --accent-dark: #a86f00;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1120px;
  --shadow-sm: 0 1px 2px rgba(15, 34, 56, .06), 0 1px 3px rgba(15, 34, 56, .05);
  --shadow: 0 4px 12px -2px rgba(15, 34, 56, .08), 0 2px 4px -2px rgba(15, 34, 56, .05);
  --shadow-lg: 0 20px 40px -12px rgba(15, 34, 56, .22), 0 6px 12px -6px rgba(15, 34, 56, .10);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--navy-3); text-underline-offset: .18em; }
h1, h2, h3 { line-height: 1.2; margin: 0; color: var(--ink); letter-spacing: -.015em; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--navy); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); font-weight: 500; }
.nowrap { white-space: nowrap; }

/* Språk: norsk som standard, engelsk når <html class="en"> */
html:not(.en) .en { display: none !important; }
html.en .no { display: none !important; }

/* ---------- Toppmeny ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 26, 46, .82);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  transition: background .25s, box-shadow .25s;
}
.topbar.scrolled { background: rgba(8, 20, 36, .94); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .5); }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }

.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none;
  letter-spacing: .01em; white-space: nowrap;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: url("assets/favicon.svg") center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 4px 10px -2px rgba(0, 0, 0, .4);
}
.brand:hover .brand-name { color: var(--accent-2); }
.brand-name { transition: color .2s; }

.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a {
  color: rgba(255, 255, 255, .78); text-decoration: none; font-size: .94rem; font-weight: 500;
  padding: .45rem .8rem; border-radius: 999px; transition: color .15s, background .15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { color: var(--navy); background: var(--accent); }

.lang-switch {
  display: flex; flex-shrink: 0; padding: 3px; gap: 2px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
}
.lang-switch button {
  font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .06em;
  background: transparent; color: rgba(255, 255, 255, .72);
  border: 0; padding: .3rem .75rem; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s;
}
.lang-switch button:hover { color: #fff; }
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.menu-toggle {
  display: none; align-items: center; gap: .55rem;
  font: inherit; font-size: .88rem; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px;
  padding: .42rem .9rem; cursor: pointer;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px; position: relative;
  transition: transform .2s var(--ease), background .2s;
}
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero, .page-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 480px at 88% -10%, rgba(63, 182, 201, .22), transparent 60%),
    radial-gradient(700px 420px at -5% 110%, rgba(240, 180, 41, .10), transparent 60%),
    linear-gradient(160deg, var(--navy-2) 0%, var(--navy) 45%, var(--navy-800) 100%);
}
.hero { padding: 6.5rem 0 8.5rem; margin-top: -68px; padding-top: calc(6.5rem + 68px); }
/* diskret "sjøkart"-rutenett */
.hero::before, .page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 75% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 75% 30%, #000 20%, transparent 75%);
}
.hero-wave {
  position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 64px; display: block;
  fill: var(--bg); pointer-events: none;
}
.page-hero .hero-wave { fill: var(--bg-alt); }

.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 4rem; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  text-transform: uppercase; letter-spacing: .16em; font-size: .78rem;
  color: var(--accent-2); font-weight: 700; margin-bottom: 1.25rem;
}
.hero .eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(240, 180, 41, .2);
}
.hero h1 {
  color: #fff; font-size: clamp(2.5rem, 6vw, 4.1rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05;
}
.hero-title {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem); font-weight: 500; color: #d7e8f7; margin: 1rem 0 1.6rem;
}
.hero-lead { max-width: 38rem; font-size: 1.1rem; color: rgba(226, 236, 247, .82); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

.hero-card {
  position: relative; padding: 1.6rem; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero-card-head { display: flex; align-items: center; gap: .9rem; padding-bottom: 1.2rem; margin-bottom: 1.2rem; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.hero-card-head strong { display: block; color: #fff; font-size: 1.05rem; line-height: 1.3; }
.hero-card-head span:not(.avatar) { font-family: var(--font-mono); font-size: .8rem; color: var(--accent-2); letter-spacing: .08em; }
.avatar {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  font-weight: 800; font-size: 1.1rem; letter-spacing: .02em; color: var(--navy);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 8px 20px -6px rgba(240, 180, 41, .55);
}
.hero-card-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(207, 227, 245, .6); margin: 0 0 .6rem;
}
.hero-vessels { list-style: none; margin: 0 0 1.3rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.hero-vessels li {
  font-size: .82rem; font-weight: 600; color: #e6f1fb; padding: .28rem .7rem; border-radius: 999px;
  background: rgba(63, 182, 201, .14); border: 1px solid rgba(63, 182, 201, .32);
}
.hero-card-company { margin: 0; color: #fff; font-weight: 700; font-size: 1.05rem; }
.hero-card-company span { color: rgba(207, 227, 245, .7); font-weight: 500; }

/* ---------- Knapper ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .82rem 1.45rem; border-radius: 999px;
  font-weight: 650; font-size: .98rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background .18s, color .18s, border-color .18s, transform .18s var(--ease), box-shadow .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--navy); box-shadow: 0 10px 24px -10px rgba(240, 180, 41, .7); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 14px 28px -10px rgba(240, 180, 41, .8); }
.btn-ghost { border-color: rgba(255, 255, 255, .35); color: #fff; background: rgba(255, 255, 255, .04); }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .1); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #eef3f9; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); box-shadow: var(--shadow-lg); }

/* ---------- Seksjoner ---------- */
.section { padding: 6rem 0; position: relative; }
.section-alt { background: var(--bg-alt); border-top: 1px solid #eaf0f6; border-bottom: 1px solid #eaf0f6; }
.section h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.4rem); font-weight: 800; letter-spacing: -.03em;
  margin-bottom: 2.75rem; display: flex; align-items: center; gap: .85rem;
}
.section h2::before {
  content: ""; width: 36px; height: 4px; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(90deg, var(--accent), var(--sea));
}
.section-intro { color: var(--muted); margin-top: -1.6rem; margin-bottom: 2.4rem; max-width: 40rem; font-size: 1.08rem; }

/* ---------- Tidslinje ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 62rem; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 1.2rem; bottom: 1.2rem; width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--line-2) 18%, var(--line-2) 100%);
}
.timeline li { position: relative; padding: 0 0 1.25rem 3rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 2px; top: 1.55rem; z-index: 1;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--navy-3); box-shadow: 0 0 0 4px var(--bg);
}
.timeline li:first-child::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px rgba(240, 180, 41, .25); }
.tl-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.3rem; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s, transform .2s var(--ease);
}
.tl-card:hover { box-shadow: var(--shadow); border-color: var(--line-2); transform: translateX(3px); }
.when {
  display: inline-block; font-family: var(--font-mono); font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  color: var(--accent-dark); background: #fff6e0; border: 1px solid #f7deA0;
  padding: .12rem .6rem; border-radius: 999px; margin-bottom: .6rem;
}
.timeline h3 { font-size: 1.16rem; margin-bottom: .4rem; font-weight: 750; }
.timeline h3 .muted { font-weight: 500; }
.tl-card > p:not(.when) { margin-bottom: 0; color: var(--text); }
@media (min-width: 821px) {
  .tl-card { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); column-gap: 1.75rem; align-items: start; padding: 1.4rem 1.75rem; }
  .tl-card > .when { grid-column: 1; grid-row: 1 / span 3; justify-self: start; margin: .15rem 0 0; }
  .tl-card > :not(.when) { grid-column: 2; }
}

/* ---------- Kort / grid ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s var(--ease), border-color .25s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--line-2); }
.card h3 { font-size: 1.15rem; margin-bottom: .9rem; font-weight: 750; }

.card-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; margin-bottom: 1rem;
  color: var(--navy-3); background: linear-gradient(135deg, #e8f4fb, #dcebf7); border: 1px solid #cfe2f1;
}
.card-icon .icon { width: 22px; height: 22px; }
.skill-card:nth-child(1) .card-icon { color: var(--accent-dark); background: linear-gradient(135deg, #fff7e3, #ffefc6); border-color: #f7deA0; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { position: relative; padding-left: 1.5rem; margin-bottom: .5rem; font-size: 1rem; }
.list li::before {
  content: ""; position: absolute; left: 0; top: .52em;
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 3px, rgba(240, 180, 41, .2) 3.5px);
}
.card-sub { margin: 1.2rem 0 .6rem; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.chips li {
  font-size: .88rem; font-weight: 600; padding: .3rem .85rem; border-radius: 999px;
  background: #eef4fa; border: 1px solid #d6e3ef; color: var(--navy-2);
}

/* ---------- Sertifikater ---------- */
.certs {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem;
}
.certs li {
  position: relative; padding: .95rem 1.1rem .95rem 3.3rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-weight: 550; color: var(--ink); font-size: 1rem; line-height: 1.5;
  box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s;
}
.certs li:hover { border-color: #cfe2f1; box-shadow: var(--shadow); }
.certs li::before {
  content: ""; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 8px;
  background: #e7f6f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a8ea1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
  border: 1px solid #c6e8ee;
}

/* ---------- Prosjekt-teaser på forsiden ---------- */
.teaser { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.teaser-card {
  position: relative; overflow: hidden;
  padding: 2.75rem 3rem; border-radius: 24px; color: #fff;
  background:
    radial-gradient(500px 260px at 100% 0%, rgba(63, 182, 201, .28), transparent 70%),
    linear-gradient(135deg, var(--navy-2), var(--navy-800));
  box-shadow: var(--shadow-lg);
  max-width: calc(var(--wrap) - 3rem);
}
.teaser-card::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 0 0 40px rgba(255, 255, 255, .025), 0 0 0 80px rgba(255, 255, 255, .02);
  pointer-events: none;
}
.teaser-card h2 { color: #fff; margin-bottom: 1.2rem; }
.teaser-card .section-intro { color: rgba(226, 236, 247, .8); margin: 0; }
.teaser-card .btn-dark { background: var(--accent); color: var(--navy); position: relative; z-index: 1; }
.teaser-card .btn-dark:hover { background: var(--accent-2); }
#prosjekter.section-alt { background: var(--bg); border: 0; padding: 3rem 0; }

/* ---------- Utdanning ---------- */
.edu { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.edu li {
  display: flex; align-items: flex-start; gap: 1.1rem; padding: 1.3rem 1.4rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.edu-year {
  font-family: var(--font-mono); font-weight: 700; font-size: .95rem; color: var(--navy);
  background: #eef4fa; border: 1px solid #d6e3ef; border-radius: 10px; padding: .4rem .7rem; flex-shrink: 0;
}
.edu strong { display: block; color: var(--ink); font-weight: 700; }
.edu .muted { font-size: .95rem; }

/* ---------- Kontakt ---------- */
.contact {
  color: #fff;
  background:
    radial-gradient(800px 400px at 100% 0%, rgba(63, 182, 201, .16), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-800) 100%);
}
.contact h2 { color: #fff; }
.contact .section-intro { color: rgba(226, 236, 247, .72); }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.contact-item {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 1rem; row-gap: .1rem;
  align-items: center;
  padding: 1.3rem 1.4rem; border-radius: var(--radius);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .11);
  color: #fff; text-decoration: none; min-width: 0;
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
a.contact-item:hover { background: rgba(255, 255, 255, .09); border-color: rgba(240, 180, 41, .5); transform: translateY(-2px); }
.contact-icon {
  grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(240, 180, 41, .14); color: var(--accent-2); border: 1px solid rgba(240, 180, 41, .28);
}
.contact-icon .icon { width: 22px; height: 22px; }
.contact-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: rgba(207, 227, 245, .65); font-weight: 700; }
.contact-value { font-size: 1.05rem; font-weight: 650; overflow-wrap: anywhere; line-height: 1.4; }
.contact-cv { margin: 2.5rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.alt-cv { color: rgba(226, 236, 247, .78); font-size: .95rem; font-weight: 500; }
.alt-cv:hover { color: #fff; }

.footer {
  background: var(--navy-900); color: rgba(207, 227, 245, .5); font-size: .85rem;
  padding: 1.6rem 0 2rem; border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ---------- Prosjektsiden ---------- */
.page-hero { padding: calc(4.5rem + 68px) 0 6.5rem; margin-top: -68px; }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(2.4rem, 5.5vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; }
.page-hero .eyebrow a {
  color: var(--accent-2); text-decoration: none; display: inline-flex; gap: .4rem; align-items: center;
  padding: .3rem .8rem; margin-left: -.8rem; border-radius: 999px; transition: background .15s;
}
.page-hero .eyebrow a:hover { background: rgba(255, 255, 255, .08); }
.page-lead { max-width: 40rem; color: rgba(226, 236, 247, .82); margin: 1.1rem 0 0; font-size: 1.15rem; }
.projects-section { padding-top: 3rem; border-top: 0; }

.project-grid { gap: 1.75rem; align-items: stretch; }
.card.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; margin: 0;
  background: linear-gradient(135deg, #eef3f9, #e3ebf4); border-bottom: 1px solid var(--line);
  aspect-ratio: 16 / 10; overflow: hidden; font: inherit;
}
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .5s var(--ease); }
.zoomable { cursor: zoom-in; }
.zoomable::after {
  content: ""; position: absolute; right: .75rem; bottom: .75rem; width: 36px; height: 36px; border-radius: 10px;
  background: rgba(10, 26, 46, .72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s;
}
.zoomable:hover::after, .zoomable:focus-visible::after { opacity: 1; transform: none; }
.zoomable:hover img { transform: scale(1.04); }
.zoomable:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.is-placeholder .project-media { background: #eef2f7; }
.is-placeholder .project-media img { object-position: center; }

.project-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 1.4rem 1.5rem 1.5rem; }
.project-body h3 { font-size: 1.2rem; margin-bottom: .5rem; font-weight: 750; }
.project-body p { margin: 0; color: var(--text); font-size: .98rem; line-height: 1.65; }

.tag {
  display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-dark); background: #fff6e0; border: 1px dashed #e6b54a; border-radius: 999px;
  padding: .15rem .65rem; margin-bottom: .8rem;
}
.project-tags { list-style: none; margin: 1.1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.project-tags li {
  font-size: .78rem; font-weight: 650; letter-spacing: .02em; padding: .2rem .7rem; border-radius: 999px;
  background: #eef4fa; border: 1px solid #d6e3ef; color: var(--navy-2);
}
.project-link {
  margin-top: auto; align-self: stretch; justify-content: center;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .7rem 1.1rem; border-radius: 12px;
  font-weight: 700; font-size: .95rem; text-decoration: none;
  color: var(--navy); background: var(--accent);
  transition: background .18s, box-shadow .18s, transform .18s var(--ease);
}
.project-tags + .project-link, .project-body > p + .project-link { margin-top: 1.25rem; }
.project-body > .project-link { margin-top: auto; }
.project-body > * + .project-link { margin-top: 1.25rem; }
.project-link:hover { background: var(--accent-2); box-shadow: 0 10px 22px -10px rgba(240, 180, 41, .8); transform: translateY(-1px); }
.project-link:focus-visible { outline: 3px solid var(--navy-3); outline-offset: 2px; }
.is-placeholder { border-style: dashed; border-color: var(--line-2); background: #fcfdfe; }
.is-placeholder:hover { transform: none; box-shadow: var(--shadow-sm); }

.gallery-toggle {
  margin-top: 1rem; padding: .45rem .9rem; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; color: var(--navy-2);
  font: inherit; font-size: .88rem; font-weight: 650; cursor: pointer; transition: border-color .15s, background .15s;
}
.gallery-toggle:hover { border-color: var(--navy-3); background: #f4f8fc; }
.gallery-toggle.open { background: var(--navy); color: #fff; border-color: var(--navy); }
.project-gallery[hidden] { display: none; }
.project-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .9rem; width: 100%; }
.gallery-thumb {
  padding: 0; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; cursor: zoom-in;
  background: #fff; aspect-ratio: 4 / 3; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.gallery-thumb:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(92vw, 1200px); max-height: 92vh; overflow: visible;
}
.lightbox[open] { animation: lb-in .22s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lightbox::backdrop { background: rgba(4, 11, 20, .9); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lightbox img {
  max-width: min(92vw, 1200px); max-height: 82vh; width: auto; height: auto; border-radius: 12px; margin: 0 auto;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}
.lightbox-caption { color: #e6eef7; text-align: center; margin: .9rem 0 0; font-size: 1rem; font-weight: 600; }
.lightbox-close {
  position: absolute; top: -2.9rem; right: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: var(--navy); font-size: 1.5rem; line-height: 1; box-shadow: var(--shadow);
  transition: background .15s, transform .15s;
}
.lightbox-close:hover { background: var(--accent); transform: rotate(90deg); }

/* ---------- Responsivt ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.75rem; }
  .hero-card { max-width: 34rem; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .edu { grid-template-columns: 1fr; max-width: 40rem; }
}

@media (max-width: 820px) {
  .topbar-inner { gap: .6rem; }
  .brand { margin-right: auto; }
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: .15rem; margin: 0;
    background: var(--navy-800); border-top: 1px solid rgba(255, 255, 255, .06); border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: .75rem 1rem 1.1rem; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .5);
  }
  .nav.open { display: flex; animation: nav-in .2s var(--ease); }
  .nav a { font-size: 1.05rem; padding: .8rem 1rem; border-radius: 12px; }
  .nav a[aria-current="page"] { background: rgba(240, 180, 41, .14); color: var(--accent-2); }
}
@keyframes nav-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  body { font-size: 1.02rem; }
  .wrap { padding: 0 1.15rem; }
  .hero { padding: calc(3.5rem + 68px) 0 5.5rem; }
  .page-hero { padding: calc(3rem + 68px) 0 5rem; }
  .hero-wave { height: 36px; }
  .section { padding: 4.25rem 0; }
  .section h2 { margin-bottom: 2rem; }
  .section-intro { margin-top: -.9rem; }
  .grid-2, .grid-3, .certs, .contact-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-card { padding: 1.3rem; }
  .timeline li { padding-left: 2.2rem; }
  .timeline::before { left: 7px; }
  .timeline li::before { left: 0; width: 16px; height: 16px; }
  .tl-card { padding: 1.1rem 1.15rem; }
  .tl-card:hover { transform: none; }
  .card { padding: 1.4rem; }
  .teaser-card { padding: 2rem 1.5rem; border-radius: 20px; }
  .teaser-card .btn { width: 100%; }
  #prosjekter.section-alt { padding: 1.5rem 0; }
  .edu li { padding: 1rem 1.1rem; gap: 1rem; }
}
@media (max-width: 480px) {
  .topbar-inner { gap: .4rem; }
  .brand { gap: .5rem; font-size: 1rem; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .lang-switch button { padding: .28rem .58rem; }
  .menu-toggle { padding: .4rem .7rem; gap: .45rem; }
}
@media (max-width: 360px) {
  .menu-toggle .no, .menu-toggle .en { display: none !important; }
  .brand { font-size: .98rem; }
}

@media (hover: none) {
  .card:hover, .tl-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .hero-actions, .contact-cv, #prosjekter, .hero-wave, .hero-card { display: none; }
  .hero, .contact { background: none; color: #000; margin: 0; padding: 1rem 0; }
  .hero h1, .hero-title, .contact h2, .contact-item { color: #000; -webkit-text-fill-color: #000; }
  .card, .tl-card, .certs li, .edu li { box-shadow: none; }
}
