/* ============================================================
   etikk.qreate.no — stilark
   Møkt tema, varm gull-accent, Noto Serif/Inter
   ============================================================ */

:root {
  --bg: #0f1319;
  --bg-2: #141a23;
  --surface: #1a2230;
  --surface-2: #212b3d;
  --line: #2c3a52;
  --text: #ece9e2;
  --muted: #9aa7bd;
  --gold: #e5b25d;
  --gold-soft: rgba(229, 178, 93, .14);
  --blue: #7ea6e0;
  --green: #8fd0a8;
  --red: #e07e7e;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Noto Serif', Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(229, 178, 93, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(126, 166, 224, .05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--gold); text-decoration: none; }
em { font-style: italic; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); font-weight: 400; font-size: .85em; }

.kicker {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .6rem;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 19, 25, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--gold), #b57f2c);
  color: #14100a; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  display: grid; place-items: center;
}
.brand-text { font-weight: 700; letter-spacing: .02em; }
.brand-text em { color: var(--muted); font-style: normal; font-weight: 500; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); font-size: .9rem; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; transition: .18s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--gold); background: var(--gold-soft); }
.nav-cta { color: var(--gold) !important; border: 1px solid var(--line); }

.topbar-tools { display: flex; align-items: center; gap: 10px; }
.search-wrap { position: relative; }
#search {
  width: 210px; padding: 8px 12px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: .88rem; outline: none; transition: .18s;
}
#search:focus { border-color: var(--gold); width: 250px; }
.search-results {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 380px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px;
}
.search-results a {
  display: block; padding: 9px 11px; border-radius: 8px; color: var(--text); font-size: .88rem;
}
.search-results a:hover { background: var(--gold-soft); }
.search-results .sr-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px 11px 2px; }
.search-results mark { background: var(--gold); color: #14100a; border-radius: 3px; padding: 0 2px; }

.burger { display: none; }

.progress-track { height: 3px; background: transparent; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #b57f2c, var(--gold));
  transition: width .35s ease;
}

/* ===== Hero ===== */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -40% -20% auto; height: 120%;
  background: radial-gradient(600px 300px at 50% 0%, rgba(229, 178, 93, .12), transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; margin-bottom: .35em; }
.hero h1 em { color: var(--gold); }
.lede { max-width: 620px; color: var(--muted); font-size: 1.08rem; }

.hero-actions { display: flex; gap: 12px; margin: 28px 0 40px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 11px;
  font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--gold), #c98f3a); color: #17120a; box-shadow: 0 6px 20px rgba(229, 178, 93, .25); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-small { padding: 7px 14px; font-size: .85rem; }

.hero-stats { display: flex; gap: 36px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.hero-stats strong { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--gold); }
.hero-stats span { color: var(--muted); font-size: .85rem; }

/* ===== Seksjoner ===== */
.section { padding: 72px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.section-intro { color: var(--muted); max-width: 720px; margin-bottom: 0; }

.review-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; padding-top: 6px; }
.review-toggle input { accent-color: var(--gold); width: 18px; height: 18px; cursor: pointer; }
.review-toggle span { color: var(--muted); font-size: .88rem; font-weight: 500; }
.review-toggle input:checked + span { color: var(--green); }

/* ===== Teorikort (flip) ===== */
.theory-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px;
}
.theory-card { perspective: 1400px; height: 470px; cursor: pointer; }
.theory-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .6s cubic-bezier(.35, .1, .25, 1);
}
.theory-card.flipped .theory-inner { transform: rotateY(180deg); }
.theory-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius); padding: 24px;
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.theory-front .theory-bar { height: 4px; border-radius: 4px; margin-bottom: 18px; }
.theory-front h3 { font-size: 1.35rem; margin-bottom: .2em; }
.theory-front .author { color: var(--gold); font-size: .85rem; font-weight: 600; letter-spacing: .04em; margin-bottom: 14px; }
.theory-front .tagline { color: var(--muted); font-size: .95rem; font-style: italic; }
.theory-front .flip-hint { margin-top: auto; color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

.theory-back { transform: rotateY(180deg); overflow: auto; padding: 20px 22px; }
.theory-back h4 { font-family: var(--font-body); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin: 0 0 6px; }
.theory-back ol { margin: 0 0 12px; padding-left: 18px; font-size: .84rem; line-height: 1.5; color: var(--text); }
.theory-back ol li { margin-bottom: 4px; }
.theory-back .watch { font-size: .8rem; line-height: 1.5; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin: 0; }
.theory-back .watch strong { color: var(--red); }

/* ===== Triad ===== */
.triad { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.triad-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, border-color .2s;
}
.triad-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.triad-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill { font-family: var(--font-body); font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .08em; }
.pill-gold { background: var(--gold-soft); color: var(--gold); }
.pill-blue { background: rgba(126, 166, 224, .14); color: var(--blue); }
.pill-green { background: rgba(143, 208, 168, .13); color: var(--green); }
.triad-def { font-size: .95rem; }
.triad-ex {
  font-size: .88rem; color: var(--text); background: var(--bg-2);
  border-left: 3px solid var(--line); border-radius: 8px; padding: 12px 14px;
}
.triad-tip { font-size: .83rem; color: var(--muted); margin: 0; }

/* ===== CSR / pyramide ===== */
.csr-layout {
  display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 36px; align-items: start;
}
.pyramid-wrap { position: sticky; top: 110px; }
#pyramid { width: 100%; height: auto; display: block; }
.pyr-layer { cursor: pointer; transition: filter .2s, transform .2s; transform-origin: center; transform-box: fill-box; }
.pyr-layer:hover { filter: brightness(1.18); }
.pyr-layer.selected { filter: brightness(1.25) saturate(1.2); transform: scale(1.02); }
.pyr-label { pointer-events: none; }

.pyramid-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; min-height: 220px;
}
.pyramid-panel h3 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pyramid-panel .lvl-kind { font-family: var(--font-body); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); }
.pyramid-panel p { font-size: .95rem; }
.pyramid-panel .example { font-size: .88rem; color: var(--muted); background: var(--bg-2); border-radius: 8px; padding: 12px 14px; }
.pyramid-hint { color: var(--muted); font-style: italic; }

.csr-note {
  margin-top: 26px; font-size: .9rem; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 14px 18px;
}

/* ===== Trippel bunnlinje ===== */
.tbl-box {
  display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 36px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; margin-bottom: 44px;
}
.tbl-ps { display: flex; flex-direction: column; gap: 14px; }
.p-card {
  border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
  font-size: .87rem; color: var(--text);
}
.p-card strong { font-family: var(--font-display); font-size: 1.15rem; }
.p-people { background: rgba(126, 166, 224, .13); border: 1px solid rgba(126, 166, 224, .35); }
.p-people strong { color: var(--blue); }
.p-planet { background: rgba(143, 208, 168, .11); border: 1px solid rgba(143, 208, 168, .35); }
.p-planet strong { color: var(--green); }
.p-profit { background: var(--gold-soft); border: 1px solid rgba(229, 178, 93, .4); }
.p-profit strong { color: var(--gold); }
.tbl-text blockquote {
  margin: 14px 0; padding: 14px 20px; border-left: 3px solid var(--gold);
  background: var(--bg-2); border-radius: 0 10px 10px 0;
  font-family: var(--font-display); font-style: italic; font-size: 1.02rem;
}

.sdg-head { margin-top: 10px; }
.sdg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 18px; }
.sdg-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s;
}
.sdg-card:hover { transform: translateY(-4px); }
.sdg-top { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.sdg-num {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #10151d;
  background: var(--sdg-color, var(--gold)); flex-shrink: 0;
}
.sdg-top h4 { margin: 0; font-size: 1rem; line-height: 1.3; }
.sdg-top .sdg-sub { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sdg-desc { padding: 0 18px 16px; font-size: .87rem; color: var(--muted); margin: 0; }
.sdg-biz {
  max-height: 0; overflow: hidden; transition: max-height .35s ease;
  padding: 0 18px; font-size: .85rem; color: var(--text);
}
.sdg-card.open .sdg-biz { max-height: 260px; padding-bottom: 16px; }
.sdg-card.open { border-color: var(--sdg-color, var(--gold)); }
.sdg-more { display: block; padding: 0 18px 14px; font-size: .8rem; color: var(--gold); }

/* ===== Strategi ===== */
.strategy-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.strategy-card { border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); background: var(--surface); }
.strategy-card.sun { border-color: rgba(229, 178, 93, .45); background: linear-gradient(170deg, rgba(229, 178, 93, .08), var(--surface) 55%); }
.strategy-card.sun h3 { color: var(--gold); }
.strategy-card.shadow { border-color: rgba(126, 166, 224, .4); background: linear-gradient(170deg, rgba(126, 166, 224, .07), var(--surface) 55%); }
.strategy-card.shadow h3 { color: var(--blue); }
.strategy-lede { font-size: 1rem; }
.strategy-card ul { padding-left: 20px; font-size: .92rem; }
.strategy-card li { margin-bottom: 8px; }
.strategy-risk { margin-top: 16px; font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }

/* ===== Dilemma ===== */
.dilemma-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px;
}
.dilemma-def {
  margin: 0 0 26px; padding: 20px 26px; border-left: 4px solid var(--gold);
  background: var(--bg-2); border-radius: 0 12px 12px 0;
  font-family: var(--font-display); font-size: 1.12rem; line-height: 1.55;
}
.dilemma-def strong { color: var(--gold); }
.dilemma-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.dilemma-cols h4 { font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.dilemma-cols ul { padding-left: 20px; font-size: .92rem; margin: 0; }
.dilemma-cols li { margin-bottom: 8px; }

.mal-box { margin-top: 22px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; }
.mal-steps { margin: 0; padding-left: 22px; font-size: .93rem; }
.mal-steps li { margin-bottom: 10px; }

/* ===== Pugging ===== */
.mode-tabs { display: flex; gap: 8px; margin-bottom: 26px; }
.mode-tab {
  padding: 10px 22px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: .18s;
}
.mode-tab.active { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }

.flash-stage { display: flex; align-items: center; gap: 18px; }
.flashcard { flex: 1; height: 320px; perspective: 1400px; cursor: pointer; outline: none; }
.flash-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .55s cubic-bezier(.35, .1, .25, 1);
}
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 32px;
}
.flash-front { background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.flash-front p { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.flash-hint { position: absolute; bottom: 16px; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.flash-back { transform: rotateY(180deg); background: linear-gradient(160deg, #2a2417, var(--surface)); border-color: rgba(229, 178, 93, .4); }
.flash-back p { font-size: 1rem; white-space: pre-line; line-height: 1.7; }

.flash-nav {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--gold); font-size: 1.5rem; cursor: pointer; flex-shrink: 0;
  transition: .18s; line-height: 1;
}
.flash-nav:hover { border-color: var(--gold); transform: scale(1.08); }

.flash-meta { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.flash-meta span:first-child { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.flash-keys { font-size: .78rem; color: var(--muted); }

/* Quiz */
.quiz-stage { max-width: 760px; margin: 0 auto; }
.quiz-progress { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.quiz-bar { height: 6px; background: var(--surface); border-radius: 6px; overflow: hidden; margin-bottom: 26px; }
.quiz-bar div { height: 100%; background: linear-gradient(90deg, #b57f2c, var(--gold)); transition: width .3s; }
.quiz-q { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 22px; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  text-align: left; padding: 14px 18px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font-size: .95rem; cursor: pointer; transition: .15s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--gold); transform: translateX(4px); }
.quiz-opt.correct { border-color: var(--green); background: rgba(143, 208, 168, .12); }
.quiz-opt.wrong { border-color: var(--red); background: rgba(224, 126, 126, .1); }
.quiz-opt:disabled { cursor: default; opacity: .85; }
.quiz-why {
  margin-top: 18px; padding: 14px 18px; border-radius: 10px; font-size: .9rem;
  background: var(--bg-2); border-left: 3px solid var(--gold);
  animation: fadeUp .3s ease;
}
.quiz-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: flex-end; }

.quiz-result { text-align: center; padding: 40px 20px; animation: fadeUp .4s ease; }
.quiz-score { font-family: var(--font-display); font-size: 3.4rem; color: var(--gold); font-weight: 700; }
.quiz-result p { color: var(--muted); max-width: 460px; margin: 0 auto 24px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line); padding: 34px 24px; text-align: center; }
.footer p { color: var(--muted); font-size: .82rem; max-width: 640px; margin: 0 auto; }

/* ===== Responsivt ===== */
@media (max-width: 860px) {
  .csr-layout, .tbl-box { grid-template-columns: 1fr; }
  .pyramid-wrap { position: static; max-width: 420px; margin: 0 auto; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; gap: 2px;
  }
  .nav.open { display: flex; }
  .burger {
    display: flex; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px;
  }
  .burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
  #search { width: 150px; }
  #search:focus { width: 170px; }
  .search-results { width: 290px; right: -50px; }
  .hero { padding: 64px 0 52px; }
  .section { padding: 52px 0; }
  .flashcard { height: 360px; }
}

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