/* ============================================================
   MAILSEC — GHOST THEME STYLESHEET
   ============================================================ */

/* ============================================================
   SELF-HOSTED FONTS
   Served from static.mailsec.se/fonts/ — zero third-party
   font dependencies. Run fetch-fonts.sh to populate these files.
   ============================================================ */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://static.mailsec.se/fonts/instrument-serif-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('https://static.mailsec.se/fonts/instrument-serif-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('https://static.mailsec.se/fonts/dm-sans-300-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://static.mailsec.se/fonts/dm-sans-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('https://static.mailsec.se/fonts/dm-sans-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('https://static.mailsec.se/fonts/dm-sans-600-normal.woff2') format('woff2');
}

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Polymer-inspired Palette */
  --bg:           #F9F8F6;
  --surface:      #FFFFFF;
  --surface-2:    #F3F2EF;
  --ink:          #111110;
  --ink-2:        #5C5B57;
  --ink-3:        #9C9B96;
  --accent-soft:  #E8E6E1;
  --border:       #E4E2DC;
  --border-2:     #D0CEC7;

  /* High Contrast Dark (The "Polymer" Footer look) */
  --dark-bg:      #0A0A0A;
  --dark-surface: #121211;
  --dark-border:  #222220;
  --dark-ink:     #FFFFFF;
  --dark-ink-2:   #A1A19E;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Updated Radii for a softer, modern feel */
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  32px;

  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --max-w:        1120px;
  --section-gap: clamp(80px, 10vw, 140px);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.panel-open { overflow: hidden; }

img   { display: block; max-width: 100%; height: auto; }
a     { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
}

.container-narrow {
  max-width: 720px;
}

/* Ny utility-klass för att bryta ut ur containern och gå edge-to-edge */
.full-width {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding-left: 0;
  padding-right: 0;
}

.section-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 28px;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

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

.stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.stagger.visible > *:nth-child(1) { opacity:1; transform:none; transition-delay:0.05s; }
.stagger.visible > *:nth-child(2) { opacity:1; transform:none; transition-delay:0.12s; }
.stagger.visible > *:nth-child(3) { opacity:1; transform:none; transition-delay:0.19s; }
.stagger.visible > *:nth-child(4) { opacity:1; transform:none; transition-delay:0.26s; }
.stagger.visible > *:nth-child(5) { opacity:1; transform:none; transition-delay:0.33s; }
.stagger.visible > *:nth-child(6) { opacity:1; transform:none; transition-delay:0.40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger > *, .stagger.visible > * {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  transition: opacity 0.2s, transform 0.2s var(--ease-spring);
}

.btn-primary:hover { opacity: 0.84; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid var(--border-2);
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease-spring);
}

.btn-ghost:hover { background: var(--surface); border-color: var(--ink-3); transform: translateY(-1px); }
.btn-ghost:active { transform: translateY(0); }

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 3px;
}

.dashboards :focus-visible,
.footer :focus-visible {
  outline-color: rgba(255,255,255,0.7);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: background 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}

.nav.scrolled {
  background: rgba(249,248,246,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.nav-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--ink);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--bg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-webmail-btn {
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: none;
  transition: opacity 0.2s;
}

.nav-webmail-btn:hover { opacity: 0.82; }

@media (max-width: 640px) {
  .nav-links .hide-mobile { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 96px;
  padding-bottom: 80px;
  padding-inline: clamp(20px, 5vw, 64px);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(180,175,165,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(200,195,180,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 36px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 0.2s forwards;
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76,175,80,0.2);
  animation: pulse 2.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(76,175,80,0.2); }
  50%       { box-shadow: 0 0 0 5px rgba(76,175,80,0.08); }
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6.5vw, 5.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 820px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.35s forwards;
}

.hero-headline em {
  font-style: italic;
  color: var(--ink-2);
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.1875rem);
  color: var(--ink-2);
  max-width: 520px;
  line-height: 1.65;
  margin-top: 24px;
  margin-bottom: 48px;
  font-weight: 300;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.5s forwards;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.65s forwards;
}

.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeIn 0.7s var(--ease-out) 1.4s forwards;
}

.hero-scroll span {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--border-2), transparent);
  animation: scrollLine 1.8s ease infinite;
}

@keyframes scrollLine {
  0%   { opacity:0; transform: scaleY(0); transform-origin: top; }
  40%  { opacity:1; transform: scaleY(1); }
  100% { opacity:0; transform: scaleY(1); transform-origin: bottom; }
}

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

@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}

/* ============================================================
   INFRASTRUCTURE STRIP
   ============================================================ */
.infra-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 48px 0;
}

.infra-strip-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.infra-stat {
  padding: 8px 32px;
  border-right: 1px solid var(--border);
}

.infra-stat:first-child { padding-left: 0; }
.infra-stat:last-child  { border-right: none; }

.infra-stat-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.infra-stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.375rem);
  color: var(--ink);
  line-height: 1.3;
}

.infra-stat-value small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--ink-2);
  font-weight: 300;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .infra-strip-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border);
  }
  .infra-stat {
    background: var(--surface);
    padding: 24px 20px;
    border-right: none;
  }
}

@media (max-width: 420px) {
  .infra-strip-inner { grid-template-columns: 1fr; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about { padding: var(--section-gap) 0; }

.about-intro {
  max-width: 640px;
  margin-bottom: 72px;
}

.about-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.about-intro p {
  font-size: 1.0625rem;
  color: var(--ink-2);
  line-height: 1.75;
  font-weight: 300;
}

.about-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.principle-card {
  background: var(--surface);
  padding: 40px 36px;
  transition: background 0.25s;
}

.principle-card:hover { background: var(--bg); }

.principle-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 24px;
  color: var(--ink-2);
}

.principle-card h3 {
  font-family: var(--font-display);
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.principle-card p {
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.7;
  font-weight: 300;
}

@media (max-width: 768px) {
  .about-principles { grid-template-columns: 1fr; }
  .principle-card { padding: 32px 28px; }
}

/* ============================================================
   CHANGELOG
   ============================================================ */
.changelog {
  padding: var(--section-gap) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.changelog-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  align-items: start;
}

.changelog-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.changelog-intro p {
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.7;
  font-weight: 300;
}

.changelog-list {
  list-style: none;
  position: relative;
}

.changelog-list::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-2);
}

.changelog-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  padding-bottom: 40px;
  position: relative;
}

.changelog-item:last-child { padding-bottom: 0; }

.changelog-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 5px;
  position: relative;
  z-index: 1;
}

.changelog-dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.changelog-dot-inner {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
}

.changelog-item.active .changelog-dot {
  border-color: var(--ink);
  background: var(--ink);
}

.changelog-item.active .changelog-dot-inner { background: var(--bg); }

.changelog-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.changelog-date {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.changelog-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--ink-2);
}

.changelog-tag.live {
  background: rgba(76,175,80,0.12);
  color: #2E7D32;
}

.changelog-content h3 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.changelog-content p {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.65;
  font-weight: 300;
}

@media (max-width: 768px) {
  .changelog-layout { grid-template-columns: 1fr; gap: 48px; }
}

/* ============================================================
   DASHBOARDS
   ============================================================ */
.dashboards {
  background: var(--dark-bg);
  padding: var(--section-gap) 0;
}

.dashboards .section-label { color: var(--dark-ink-2); }

.dashboards-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 48px;
  gap: 24px;
}

.dashboards-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--dark-ink);
  max-width: 480px;
}

.dashboards-header p {
  font-size: 0.9375rem;
  color: var(--dark-ink-2);
  line-height: 1.65;
  font-weight: 300;
  max-width: 280px;
  text-align: right;
}

.tabs {
  display: flex;
  gap: 2px;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--dark-ink-2);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--dark-ink); }
.tab-btn.active { background: var(--dark-border); color: var(--dark-ink); }

.dashboard-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--dark-border);
  background: var(--dark-surface);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s var(--ease-out); }

.dashboard-iframe {
  width: 100%;
  height: 520px;
  border: none;
  display: block;
  background: var(--dark-surface);
}

.iframe-placeholder {
  width: 100%;
  height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--dark-ink-2);
  background: var(--dark-surface);
  text-align: center;
}

.iframe-placeholder-icon {
  width: 48px;
  height: 48px;
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-ink-2);
}

.iframe-placeholder h4 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--dark-ink);
}

.iframe-placeholder p {
  font-size: 0.8125rem;
  font-weight: 300;
  max-width: 240px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .dashboards-header { flex-direction: column; align-items: flex-start; }
  .dashboards-header p { text-align: left; max-width: 100%; }
  .dashboard-iframe, .iframe-placeholder { height: 380px; }
}

/* ============================================================
   BLOG (HOME FEED)
   ============================================================ */
.blog { padding: var(--section-gap) 0; }

.blog-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 56px;
  gap: 24px;
}

.blog-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, gap 0.2s;
}

.view-all-link:hover { color: var(--ink); gap: 10px; }

.blog-featured-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  margin-bottom: 2px;
}

.blog-card {
  background: var(--surface);
  padding: 40px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: background 0.25s;
}

.blog-card:hover { background: var(--bg); }

.blog-card-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}

.blog-card h3 {
  font-family: var(--font-display);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.blog-card-featured h3 { font-size: clamp(1.375rem, 3vw, 2rem); }
.blog-card-small h3    { font-size: 1.125rem; }

.blog-card p {
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.7;
  font-weight: 300;
  flex-grow: 1;
}

.blog-card-small p { font-size: 0.875rem; }

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.blog-card-date {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s, gap 0.2s;
}

.blog-card:hover .blog-read-more { color: var(--ink); gap: 8px; }

.blog-side-cards {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blog-list {
  list-style: none;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.blog-list-item {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.blog-list-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.blog-list-link:hover { background: var(--bg); }

.blog-list-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.blog-list-tag {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  min-width: 100px;
}

.blog-list-title {
  font-size: 0.9375rem;
  color: var(--ink);
}

.blog-list-right {
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
}

.blog-list-date {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.blog-list-arrow {
  color: var(--ink-3);
  transition: color 0.2s, transform 0.2s;
}

.blog-list-link:hover .blog-list-arrow {
  color: var(--ink);
  transform: translateX(3px);
}

.blog-empty {
  padding: 64px 32px;
  text-align: center;
  color: var(--ink-2);
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

@media (max-width: 900px) {
  .blog-featured-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .blog-card { padding: 28px 24px; }
  .blog-list-link { grid-template-columns: 1fr; gap: 8px; padding: 18px 24px; }
  .blog-list-content { flex-direction: column; align-items: flex-start; gap: 4px; }
  .blog-list-tag { min-width: 100px; }
  .blog-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   BLOG INDEX PAGE
   ============================================================ */
.blog-index { padding: calc(var(--section-gap) + 80px) 0 var(--section-gap); }

.blog-index-header {
  max-width: 600px;
  margin-bottom: 56px;
}

.blog-index-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.blog-index-header p {
  font-size: 1.0625rem;
  color: var(--ink-2);
  line-height: 1.7;
  font-weight: 300;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
}

.tag-filter-btn {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tag-filter-btn:hover,
.tag-filter-btn.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.blog-index-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.blog-index-item { background: var(--surface); }

.blog-index-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 36px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.blog-index-link:hover { background: var(--bg); }

.blog-index-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex: 1;
}

.blog-index-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  min-width: 110px;
  padding-top: 4px;
}

.blog-index-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 6px;
}

.blog-index-excerpt {
  font-size: 0.875rem;
  color: var(--ink-2);
  font-weight: 300;
  line-height: 1.6;
}

.blog-index-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 4px;
}

.blog-index-date {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.blog-index-empty {
  padding: 64px 36px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  text-align: center;
}

.blog-list-arrow {
  transition: color 0.2s, transform 0.2s;
}

.blog-index-link:hover .blog-list-arrow {
  transform: translateX(3px);
  color: var(--ink);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 48px;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--ink-3);
}

@media (max-width: 768px) {
  .blog-index-link {
    flex-direction: column;
    gap: 16px;
    padding: 24px 24px;
  }
  .blog-index-content { flex-direction: column; gap: 8px; }
  .blog-index-tag { min-width: auto; }
}

/* ============================================================
   POST / PAGE
   ============================================================ */
.post-article,
.static-page {
  padding: calc(var(--section-gap) + 80px) 0 var(--section-gap);
}

.post-header { margin-bottom: 48px; }

.post-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.post-tag:hover { color: var(--ink); }

.post-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.post-excerpt {
  font-size: 1.125rem;
  color: var(--ink-2);
  line-height: 1.65;
  font-weight: 300;
  margin-bottom: 24px;
  max-width: 600px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.post-meta-sep { color: var(--border-2); }

.post-feature-image {
  margin: 48px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-feature-image img { width: 100%; object-fit: cover; }

.post-feature-image figcaption {
  padding: 12px 20px;
  font-size: 0.8125rem;
  color: var(--ink-3);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Ghost content — rendered HTML from editor */
.gh-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink);
}

.gh-content > * + * { margin-top: 1.5em; }

.gh-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
}

.gh-content h3 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.625rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.gh-content p { font-weight: 300; color: var(--ink); }

.gh-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border-2);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.gh-content a:hover { text-decoration-color: var(--ink); }

.gh-content ul,
.gh-content ol {
  padding-left: 1.5em;
  color: var(--ink-2);
}

.gh-content li + li { margin-top: 0.5em; }

.gh-content blockquote {
  border-left: 2px solid var(--border-2);
  padding-left: 24px;
  margin: 2em 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.5;
}

.gh-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--ink);
}

.gh-content pre {
  background: var(--dark-bg);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  overflow-x: auto;
}

.gh-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--dark-ink);
  font-size: 0.875rem;
  line-height: 1.7;
}

.gh-content img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  max-width: 100%;
}

.gh-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

/* Post footer */
.post-footer { margin-top: 80px; padding-top: 48px; border-top: 1px solid var(--border); }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
}

.post-tag-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.post-tag-chip:hover { background: var(--surface-2); border-color: var(--border-2); }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, border-color 0.2s;
}

.post-nav-link:hover { background: var(--surface); border-color: var(--border-2); }

.post-nav-next { text-align: right; }

.post-nav-direction {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post-nav-next .post-nav-direction { justify-content: flex-end; }

.post-nav-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.post-back-link { margin-top: 24px; }

@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
}

/* ============================================================
   ERROR PAGE
   ============================================================ */
.error-page {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}

.error-content { max-width: 480px; }

.error-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.error-content p {
  font-size: 1.0625rem;
  color: var(--ink-2);
  line-height: 1.7;
  font-weight: 300;
}

/* ============================================================
   FOOTER (Polymer-Inspired)
   ============================================================ */
.footer {
  background: var(--dark-bg);
  color: var(--dark-ink-2);
  padding: 80px 0 40px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  margin-top: 80px;
  box-shadow: 0 -20px 40px rgba(0,0,0,0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--dark-border);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--dark-ink);
}

.footer-logo-mark {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-ink);
}

.footer-brand-name {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.footer-tagline {
  font-size: 0.875rem;
  line-height: 1.7;
  font-weight: 300;
}

.footer-col h4 {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 20px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.footer-col a {
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--dark-ink-2);
  font-weight: 300;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--dark-ink); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.8125rem;
  font-weight: 300;
  color: rgba(255,255,255,0.25);
}

.footer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 300;
  color: rgba(255,255,255,0.25);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-identity { grid-column: 1 / -1; }
}

@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-identity { grid-column: auto; }
}

/* ============================================================
   WEBMAIL SLIDE-OVER PANEL
   ============================================================ */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(14,14,13,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--ease-smooth);
}

.panel-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 201;
  width: min(520px, 100vw);
  background: var(--surface);
  box-shadow: -24px 0 80px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(0.4, 0, 0.15, 1);
}

.panel.open { transform: translateX(0); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-identity { display: flex; align-items: center; gap: 12px; }

.panel-logo-mark {
  width: 30px;
  height: 30px;
  background: var(--ink);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
}

.panel-title-group { display: flex; flex-direction: column; }

.panel-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.panel-subtitle {
  font-size: 0.75rem;
  color: var(--ink-3);
}

.panel-actions { display: flex; align-items: center; gap: 8px; }

.panel-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  color: var(--ink-2);
}

.panel-close:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--ink); }

.panel-open-external {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.panel-open-external:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--ink); }

.panel-iframe-wrap { flex: 1; overflow: hidden; position: relative; }

.panel-iframe { width: 100%; height: 100%; border: none; display: block; }

.panel-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.875rem;
}

.panel-loading.hidden { display: none; }

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   KOENIG EDITOR — REQUIRED GHOST CLASSES
   ============================================================ */

.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: 2em calc(50% - 42.5vw);
}

.kg-width-full {
  position: relative;
  width: 100vw;
  margin: 2em calc(50% - 50vw);
}

/* Koenig card base */
.kg-card { margin: 2em 0; }
.kg-card figcaption {
  font-size: 0.8125rem;
  color: var(--ink-3);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

/* Image card */
.kg-image-card img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: 100%;
}

/* Gallery card */
.kg-gallery-container { display: flex; flex-direction: column; gap: 4px; }
.kg-gallery-row { display: flex; gap: 4px; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }

/* Embed / bookmark card */
.kg-bookmark-card { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.kg-bookmark-container { display: flex; text-decoration: none; color: inherit; }
.kg-bookmark-content { padding: 20px 24px; flex: 1; }
.kg-bookmark-title { font-weight: 500; font-size: 0.9375rem; margin-bottom: 4px; }
.kg-bookmark-description { font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.8125rem; color: var(--ink-3); }
.kg-bookmark-thumbnail { width: 160px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* Video card */
.kg-video-card { border-radius: var(--radius-md); overflow: hidden; background: var(--dark-bg); }

/* Callout card */
.kg-callout-card {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.kg-callout-emoji { font-size: 1.25rem; flex-shrink: 0; }
.kg-callout-text { font-size: 0.9375rem; line-height: 1.7; }

/* Toggle card */
.kg-toggle-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 20px; }
.kg-toggle-heading { font-weight: 500; cursor: pointer; }
.kg-toggle-content { margin-top: 12px; font-size: 0.9375rem; color: var(--ink-2); }

/* Code card */
.kg-code-card pre {
  background: var(--dark-bg);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  overflow-x: auto;
  margin: 0;
}
.kg-code-card pre code {
  color: var(--dark-ink);
  font-size: 0.875rem;
  line-height: 1.7;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Button card */
.kg-button-card { text-align: center; }
.kg-button-card a {
  display: inline-flex;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: opacity 0.2s;
}
.kg-button-card a:hover { opacity: 0.84; }

/* Header card */
.kg-header-card {
  background: var(--dark-bg);
  color: var(--dark-ink);
  padding: clamp(48px, 8vw, 96px) clamp(24px, 5vw, 64px);
  border-radius: var(--radius-lg);
  text-align: center;
}
.kg-header-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.u-mt-16 { margin-top: 16px; display: inline-flex; }
.u-mt-32 { margin-top: 32px; display: inline-flex; }

/* ============================================================
   POWERED BY MARQUEE - VERSION 2.0 (BALANCED)
   ============================================================ */
.marquee-wrapper {
  overflow: hidden;
  user-select: none;
  display: flex;
  align-items: center; /* Centrerar loggorna vertikalt */
  justify-content: center; /* Hjälper till med startpositionen */
  mask-image: linear-gradient(
    to right,
    transparent,
    black 15%,
    black 85%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 15%,
    black 85%,
    transparent
  );
  padding: 50px 0 !important; /* Mer luft uppe och nere för balans */
  background: transparent;
  width: 100% !important;
}

.marquee-content {
  display: flex;
  flex-shrink: 0;
  gap: 80px; /* Ökat avstånd för en lyxigare känsla */
  align-items: center;
  animation: scrollMarquee 35s linear infinite; /* Lite långsammare = mer elegant */
}

.marquee-item img {
  height: 42px; /* Ökad storlek så de fyller ut bättre */
  width: auto;
  filter: grayscale(1) opacity(0.5);
  transition: filter 0.3s, opacity 0.3s, transform 0.3s;
  cursor: pointer;
}

.marquee-item img:hover {
  filter: grayscale(0) opacity(1);
  transform: scale(1.1); /* En liten "pop" när man hovrar */
}

@keyframes scrollMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* New */

/* --- HERO WAVE & DARK BACKGROUND FIX --- */
.hero {
  position: relative !important;
  width: 100% !important;
  min-height: 80vh !important;
  height: 650px !important; /* Fast höjd så Three.js vet exakt hur stor ytan är */
  background-color: #050a18 !important; /* Tvinga mörkblå bakgrund */
  background-image: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Ta bort eventuella vita overlays/skuggor som Ghost-temat lägger ovanpå */
.hero::before,
.hero::after {
  display: none !important;
  background: none !important;
}

/* Tvinga rubrik och brödtext att bli vita och hamna över canvas */
.hero h1,
.hero p,
.hero .hero-headline,
.hero .hero-sub {
  position: relative !important;
  z-index: 2 !important;
  color: #ffffff !important;
  text-align: center !important;
}

/* Canvas täcker hela hero-ytan i bakgrunden */
#hero-wave-canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
  pointer-events: none !important;
}
