/* ============================================
   Abonnementsvekten – HugByte
   Modern, light, clean Nordic aesthetic
   ============================================ */

@font-face {
  font-family: 'LibreBaskerville';
  src: url('https://hugbyte.no/fonts/LibreBaskerville-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'LibreBaskerville';
  src: url('https://hugbyte.no/fonts/LibreBaskerville-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SourceSerif4';
  src: url('https://hugbyte.no/fonts/SourceSerif4-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SourceSerif4';
  src: url('https://hugbyte.no/fonts/SourceSerif4-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'SourceSerif4';
  src: url('https://hugbyte.no/fonts/SourceSerif4-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- Variables ---- */
:root {
  --moss: #2d5a27;
  --moss-light: #4a7c43;
  --moss-pale: #e8f0e6;
  --fjord: #1e3a5f;
  --fjord-light: #2a5080;
  --granite: #5a5a5a;
  --granite-light: #8a8a8a;
  --paper: #faf9f7;
  --white: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #2e2e2e;
  --border: #e0ddd8;
  --border-light: #ede9e3;
  --active-bg: #2d5a27;
  --active-text: #ffffff;
  --accent: #d4501a;
  --accent-pale: #fdf0eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'SourceSerif4', Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
svg { display: block; }

/* ---- Site Header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-family: 'LibreBaskerville', Georgia, serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--moss);
  letter-spacing: -0.02em;
}
.back-link {
  font-size: 0.85rem;
  color: var(--granite);
  transition: color 0.2s;
}
.back-link:hover { color: var(--moss); }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--fjord) 0%, var(--moss) 100%);
  padding: 4rem 2rem 3.5rem;
  color: white;
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.hero-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.75rem;
}
.hero h1 {
  font-family: 'LibreBaskerville', Georgia, serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  hyphens: auto;
}
.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.82);
  max-width: 560px;
  line-height: 1.65;
}
.hero-sub em {
  color: white;
  font-style: normal;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.4);
}

/* ---- Calculator Section ---- */
.calculator-section {
  padding: 2.5rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

/* ---- Toggles Panel ---- */
.toggles-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.category {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.category:hover { box-shadow: var(--shadow-md); }
.cat-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  font-family: 'SourceSerif4', Georgia, serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--granite);
  background: var(--border-light);
  border-bottom: 1px solid var(--border);
}
.cat-icon {
  width: 15px;
  height: 15px;
  opacity: 0.7;
  flex-shrink: 0;
}
.service-list {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.service-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  transition: all 0.15s ease;
  text-align: left;
  position: relative;
}
.service-toggle:hover {
  background: var(--moss-pale);
  border-color: rgba(45,90,39,0.15);
}
.service-toggle[aria-pressed="true"] {
  background: var(--active-bg);
  border-color: var(--active-bg);
  color: var(--active-text);
  box-shadow: 0 2px 8px rgba(45,90,39,0.25);
}
.service-toggle[aria-pressed="true"] .service-price {
  color: rgba(255,255,255,0.75);
}
.service-name {
  font-size: 0.92rem;
  font-weight: 500;
}
.service-price {
  font-size: 0.8rem;
  color: var(--granite-light);
  font-weight: 500;
  white-space: nowrap;
  margin-left: 1rem;
  font-variant-numeric: tabular-nums;
}

/* ---- Result Panel ---- */
.result-panel {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.result-inner {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 200px;
}
.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 2rem;
  color: var(--granite-light);
  text-align: center;
}
.result-empty svg {
  width: 32px;
  height: 32px;
  opacity: 0.35;
}
.result-empty p {
  font-size: 0.9rem;
  line-height: 1.5;
}
.result-data {
  padding: 0;
}
.result-header {
  background: linear-gradient(135deg, var(--fjord), var(--moss));
  padding: 1.5rem 1.5rem 1.25rem;
  color: white;
}
.result-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.35rem;
}
.result-monthly {
  font-family: 'LibreBaskerville', Georgia, serif;
  font-weight: 800;
  font-size: 2.6rem;
  letter-spacing: -0.04em;
  line-height: 1;
}
.result-rows {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-light);
}
.result-row:last-child { border-bottom: none; }
.result-row--highlight .row-value {
  font-family: 'LibreBaskerville', Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--moss);
}
.row-label {
  font-size: 0.88rem;
  color: var(--granite);
}
.row-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.row-value--zero {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}
.result-invoice {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--granite);
  border-bottom: 1px solid var(--border-light);
}
.result-invoice strong {
  color: var(--accent);
  font-weight: 600;
}
.active-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  min-height: 44px;
}
.active-chip {
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--moss-pale);
  color: var(--moss);
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  border: 1px solid rgba(45,90,39,0.2);
}
.result-compare {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.compare-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--granite-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.compare-item {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fjord);
  line-height: 1.4;
}
.result-tax {
  padding: 0.9rem 1.5rem;
  font-size: 0.82rem;
  color: var(--granite-light);
  line-height: 1.55;
}
.result-tax strong { color: var(--granite); }

/* ---- CTA Block ---- */
.cta-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.cta-text {
  font-size: 0.88rem;
  color: var(--granite);
  margin-bottom: 0.9rem;
  line-height: 1.5;
}
.cta-text em {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
}
.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: var(--moss);
  color: white;
  font-family: 'LibreBaskerville', Georgia, serif;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}
.cta-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.cta-btn:hover {
  background: var(--moss-light);
  transform: translateY(-1px);
}
.cta-btn:active { transform: translateY(0); }

/* ---- Explainer Section ---- */
.explainer {
  background: var(--fjord);
  color: white;
  padding: 3.5rem 2rem;
}
.explainer-inner {
  max-width: 680px;
  margin: 0 auto;
}
.explainer h2 {
  font-family: 'LibreBaskerville', Georgia, serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.explainer p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1rem;
  line-height: 1.7;
}
.explainer p:last-child { margin-bottom: 0; }
.explainer strong { color: white; }
.explainer-note {
  font-size: 0.8rem !important;
  color: rgba(255,255,255,0.45) !important;
  font-style: italic;
}

/* ---- Footer ---- */
.site-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--granite-light);
  border-top: 1px solid var(--border);
}
.site-footer a {
  color: var(--moss);
  font-weight: 500;
}
.site-footer a:hover { text-decoration: underline; }

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-data {
  animation: fadeIn 0.2s ease;
}
.active-chip {
  animation: fadeIn 0.15s ease;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
  .result-panel {
    position: static;
    order: -1;
  }
}
@media (max-width: 600px) {
  .site-header { padding: 0.9rem 1.25rem; }
  .hero { padding: 2.5rem 1.25rem 2.5rem; }
  .calculator-section { padding: 1.5rem 1rem 3rem; }
  .result-monthly { font-size: 2.1rem; }
  .explainer { padding: 2.5rem 1.25rem; }
}
