/* ---- Typsnitt (självhostade, SIL Open Font License) ---- */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/fraunces-latin-wght-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Fraunces'; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url(/fonts/fraunces-latin-wght-italic.woff2) format('woff2');
}
@font-face {
  font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/fonts/newsreader-latin-wght-normal.woff2) format('woff2');
}

  :root {
    --navy: #1f3864;
    --navy-deep: #16294a;
    --ink: #1a1d24;
    --slate: #4a5160;
    --mist: #f4f5f7;
    --line: #d9dde4;
    --paper: #ffffff;
    --red: #8e2f2f;
    --red-soft: #a84a4a;
    --nav-h: 116px;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  section[id], header[id] { scroll-margin-top: var(--nav-h); }
  body {
    font-family: 'Newsreader', Georgia, serif;
    color: var(--ink); background: var(--paper);
    line-height: 1.7; font-size: 18px;
    -webkit-font-smoothing: antialiased;
  }
  .wrap { max-width: 1080px; margin: 0 auto; padding: 0 40px; }
  section { padding: 96px 0; border-bottom: 1px solid var(--line); }
  .eyebrow {
    text-transform: uppercase; letter-spacing: 0.18em;
    font-size: 13px; font-weight: 500; color: var(--red);
    margin-bottom: 22px;
  }

  /* ---- Nav ---- */
  nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.93);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .nav-inner {
    max-width: 1080px; margin: 0 auto; padding: 0 40px;
    height: 116px; display: flex; align-items: center; justify-content: space-between;
  }
  .nav-logo { height: 96px; display: block; }
  .nav-logo svg { height: 96px; width: auto; }
  .nav-links { display: flex; gap: 34px; }
  .nav-links a {
    font-size: 15px; color: var(--slate); text-decoration: none;
    letter-spacing: 0.01em; transition: color 0.2s;
  }
  .nav-links a:hover { color: var(--navy); }
  .nav-right { display: flex; align-items: center; gap: 28px; }
  .lang-switch { display: flex; align-items: center; gap: 2px; font-size: 14px; }
  .lang-switch a {
    text-decoration: none; padding: 4px 9px; border-radius: 999px;
    color: var(--slate); letter-spacing: 0.03em; transition: background 0.2s, color 0.2s;
  }
  .lang-switch a.active { background: var(--navy); color: #fff; }
  .lang-switch a:not(.active):hover { color: var(--navy); }
  .lang-switch .sep { color: var(--line); }
  @media (max-width: 720px) {
    :root { --nav-h: 128px; }
    .wrap, .nav-inner { padding-left: 20px; padding-right: 20px; }
    .nav-inner { height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 0; }
    .nav-logo, .nav-logo svg { height: 60px; }
    .nav-right { display: contents; }
    .lang-switch { order: 2; }
    .nav-links {
      order: 3; flex-basis: 100%; gap: clamp(10px, 3.4vw, 22px); margin-top: 6px;
      justify-content: space-between;
      overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch;
      border-top: 1px solid var(--line); padding: 10px 0 11px;
    }
    .nav-links a { font-size: clamp(13px, 3.7vw, 15px); padding: 2px 0; }
    section { padding: 72px 0; }
    .hero { padding: 80px 0 76px; }
  }

  /* ---- Hero ---- */
  .hero {
    padding: 84px 0 88px;
    background:
      linear-gradient(180deg, var(--mist) 0%, var(--paper) 100%);
    border-bottom: 1px solid var(--line);
    position: relative; overflow: hidden;
  }
  .hero::after {
    content: ""; position: absolute; right: -120px; top: 40px;
    width: 420px; height: 420px;
    border: 1px solid var(--line); border-radius: 50%; opacity: 0.6;
  }
  .hero::before {
    content: ""; position: absolute; right: 30px; top: 150px;
    width: 220px; height: 220px;
    border: 1px solid var(--line); border-radius: 50%; opacity: 0.5;
  }
  .hero-grid { display: grid; grid-template-columns: 1fr 300px; gap: 72px; align-items: center; position: relative; z-index: 2; }
  .hero-content { max-width: 720px; }
  .hero .portrait { box-shadow: 0 18px 40px -22px rgba(22,41,74,0.45); }
  @media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 44px; }
    .hero .portrait { max-width: 240px; }
  }
  .hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(38px, 6vw, 62px);
    font-weight: 500; line-height: 1.1; letter-spacing: -0.02em;
    color: var(--navy-deep); margin-bottom: 14px;
  }
  .hero h1 .accent { color: var(--red); }
  .hero p.lede {
    font-size: 20px; color: var(--slate); max-width: 600px; margin-bottom: 38px;
  }
  .btn {
    display: inline-block; background: var(--navy); color: #fff;
    text-decoration: none; font-family: 'Newsreader', serif; font-size: 16px;
    padding: 16px 40px; border-radius: 999px; letter-spacing: 0.02em;
    transition: background 0.2s, transform 0.2s;
  }
  .btn:hover { background: var(--navy-deep); transform: translateY(-1px); }

  /* ---- Section headings ---- */
  .section-head { max-width: 640px; margin-bottom: 56px; }
  .section-head h2 {
    font-family: 'Fraunces', serif;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 500; color: var(--navy-deep);
    letter-spacing: -0.015em; line-height: 1.2;
  }

  /* ---- About ---- */
  .about p { font-size: 19px; color: var(--slate); margin-bottom: 20px; max-width: 680px; }
  .about p:last-child { margin-bottom: 0; }
  .about strong { color: var(--ink); font-weight: 500; }

  /* ---- Services ---- */
  .services-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
    background: var(--line); border: 1px solid var(--line);
  }
  @media (max-width: 680px) { .services-grid { grid-template-columns: 1fr; } }
  .service { background: var(--paper); padding: 38px 36px; transition: background 0.25s; }
  .service:hover { background: var(--mist); }
  .service .num {
    font-family: 'Fraunces', serif; font-size: 14px; color: var(--red);
    font-weight: 600; letter-spacing: 0.04em;
  }
  .service h3 {
    font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500;
    color: var(--navy-deep); margin: 14px 0 12px;
  }
  .service p { font-size: 17px; color: var(--slate); line-height: 1.65; }

  /* ---- Quote ---- */
  .quote-section {
    background: var(--navy);
  }
  .quote-section .wrap { text-align: center; }
  .quote-mark {
    font-family: 'Fraunces', serif; font-size: 90px; line-height: 0.5;
    color: var(--red-soft); display: block; margin-bottom: 20px; height: 50px;
  }
  blockquote {
    font-family: 'Fraunces', serif; font-size: clamp(24px, 3.6vw, 36px);
    font-weight: 400; font-style: italic; color: #fff;
    line-height: 1.4; max-width: 820px; margin: 0 auto 32px;
  }
  .quote-attr { color: #aab8d0; font-size: 16px; letter-spacing: 0.04em; }
  .quote-attr strong { color: #fff; font-weight: 600; }

  /* ---- Facts ---- */
  .facts-list { list-style: none; max-width: 720px; }
  .facts-list li {
    display: flex; gap: 22px; align-items: baseline;
    padding: 20px 0; border-bottom: 1px solid var(--line);
    font-size: 18px; color: var(--slate);
  }
  .facts-list li:last-child { border-bottom: none; }
  .facts-list .marker {
    font-family: 'Fraunces', serif; color: var(--red);
    font-weight: 600; font-size: 15px; flex-shrink: 0; width: 26px;
  }

  /* ---- Contact ---- */
  .contact { background: var(--mist); }
  .contact .section-head { margin-bottom: 36px; }
  .contact p.invite { font-size: 19px; color: var(--slate); max-width: 560px; margin-bottom: 32px; }
  .contact-grid { display: grid; grid-template-columns: 1fr 460px; gap: 72px; align-items: start; }
  @media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }
  .contact-row-phone a { font-size: 21px; }
  .contact-card {
    background: var(--paper); border: 1px solid var(--line);
    border-top: 3px solid var(--red);
    padding: 40px; width: 100%;
  }
  .contact-card .name {
    font-family: 'Fraunces', serif; font-size: 24px; font-weight: 500; color: var(--navy-deep);
  }
  .contact-card .firm { color: var(--red); font-size: 16px; margin-bottom: 24px; }
  .contact-row { display: flex; gap: 14px; align-items: center; padding: 10px 0; font-size: 17px; }
  .contact-row a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
  .contact-row a:hover { border-color: var(--red); }
  .contact-label {
    font-family: 'Fraunces', serif; font-size: 13px; color: var(--red);
    text-transform: uppercase; letter-spacing: 0.1em; width: 78px; flex-shrink: 0;
  }


  /* ---- Porträtt ---- */
  @media (max-width: 780px) { .portrait { max-width: 320px; } }
  .portrait { border: 1px solid var(--line); background: var(--paper); }
  .portrait img { width: 100%; height: auto; display: block; }
  .portrait figcaption {
    font-family: 'Fraunces', serif; font-size: 13px; color: var(--slate);
    letter-spacing: 0.06em; text-transform: uppercase; padding: 12px 16px;
  }

  /* ---- Cases ---- */
  .cases-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    background: var(--line); border: 1px solid var(--line);
  }
  @media (max-width: 860px) { .cases-grid { grid-template-columns: 1fr; } }
  .case { background: var(--paper); padding: 34px 32px; }
  .case .tag {
    font-family: 'Fraunces', serif; font-size: 12px; color: var(--red);
    text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;
  }
  .case h3 {
    font-family: 'Fraunces', serif; font-size: 21px; font-weight: 500;
    color: var(--navy-deep); margin: 12px 0 10px;
  }
  .case p { font-size: 16.5px; color: var(--slate); line-height: 1.65; }

  /* ---- Tech tags ---- */
  .tech-group {
    display: grid; grid-template-columns: 210px 1fr; gap: 12px 32px; align-items: baseline;
    padding: 20px 0; border-top: 1px solid var(--line); max-width: 900px;
  }
  .tech-group:last-child { border-bottom: 1px solid var(--line); }
  .tech-head {
    font-family: 'Fraunces', serif; font-size: 13px; color: var(--red);
    text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;
  }
  @media (max-width: 720px) { .tech-group { grid-template-columns: 1fr; padding: 18px 0; } }
  .tech-list { display: flex; flex-wrap: wrap; gap: 10px; max-width: 760px; list-style: none; }
  .tech-list li {
    font-size: 15px; color: #343b49; background: #eef1f6;
    border: 1px solid #c5cdda; padding: 6px 16px; border-radius: 999px;
  }

  /* ---- Footer ---- */
  footer {
    background: var(--navy-deep); color: #8ea0bf;
    padding: 36px 0; text-align: center; font-size: 14px; border-bottom: none;
  }
  footer .wrap { border: none; }

  /* ---- Entrance animation ---- */
  .reveal { opacity: 0; transform: translateY(16px); animation: rise 0.7s ease forwards; }
  @keyframes rise { to { opacity: 1; transform: translateY(0); } }
  .d1 { animation-delay: 0.05s; }
  .d2 { animation-delay: 0.15s; }
  .d3 { animation-delay: 0.25s; }
  .d4 { animation-delay: 0.35s; }

  /* ---- Nyckeltal ---- */
  section.stats { padding: 44px 0; background: var(--paper); }
  .stats-list { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .stats-list li { padding-left: 18px; border-left: 2px solid var(--red); }
  .stats-list strong {
    display: block; font-family: 'Fraunces', serif; font-weight: 500; line-height: 1.15;
    font-size: clamp(26px, 3.2vw, 34px); color: var(--navy-deep);
  }
  .stats-list span { font-size: 15px; color: var(--slate); }
  @media (max-width: 720px) { .stats-list { grid-template-columns: 1fr 1fr; gap: 24px 20px; } section.stats { padding: 32px 0; } }
  .industries { font-size: 18px; color: var(--slate); max-width: 720px; margin-bottom: 32px; }
  .industries strong { color: var(--ink); font-weight: 500; }

  /* ---- Tillgänglighet ---- */
  .skip-link {
    position: absolute; left: 12px; top: -80px; z-index: 100;
    background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 999px;
    text-decoration: none; font-size: 16px;
  }
  .skip-link:focus { top: 12px; }
  a:focus-visible, .btn:focus-visible {
    outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px;
  }
  .btn:focus-visible { border-radius: 999px; }
  .quote-section a:focus-visible, footer a:focus-visible { outline-color: #fff; }

  /* ---- Länk i tjänstekort ---- */
  .service-featured {
    background: var(--mist); border-left: 4px solid var(--red);
    display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 28px;
  }
  .service-featured:hover { background: var(--mist); }
  .service-featured p { max-width: 640px; }
  .badge {
    display: inline-block; margin-left: 14px; padding: 3px 12px; border: 1px solid var(--red);
    border-radius: 999px; font-family: 'Fraunces', serif; font-size: 12px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); background: var(--paper);
    vertical-align: 1px;
  }
  .btn-sm { padding: 13px 30px; font-size: 16px; white-space: nowrap; }
  .service-link {
    display: inline-block; margin-top: 16px; font-size: 16px; color: var(--navy);
    text-decoration: none; border-bottom: 1px solid var(--red);
  }
  .service-link:hover { color: var(--red); }

  /* ---- Kontakt: svarstid ---- */
  .contact-note { font-size: 15px; color: var(--slate); margin-top: 18px; }

  /* ---- 404-sidan ---- */
  .notfound { padding: 140px 0; text-align: left; }
  .notfound h1 {
    font-family: 'Fraunces', serif; font-size: clamp(34px, 5vw, 52px);
    font-weight: 500; color: var(--navy-deep); margin-bottom: 18px;
  }
  .notfound p { color: var(--slate); margin-bottom: 28px; max-width: 560px; }

  /* ---- Respektera reducerad rörelse ---- */
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; animation: none; }
    .btn, .service, .nav-links a, .lang-switch a { transition: none; }
    .btn:hover { transform: none; }
  }


  /* ---- Sidfot ---- */
  .footer-note { display: block; margin-top: 6px; font-size: 13px; }

  .notfound .en-note { margin-top: 28px; font-size: 16px; }
  .notfound .en-note a { color: var(--navy); }

  @media (max-width: 720px) { .contact-card { padding: 28px 24px; } }
