/* SGS Ventures – webbplats v1.0
   Färger och typografi enligt grafisk manual v1.0 */

@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ink: #0E0E10;
  --ground: #F4F4F1;
  --white: #FFFFFF;
  --blue: #3D5AFE;
  --blue-light: #7C93FF;
  --grey: #6B6B70;
  --grey-on-dark: #A3A3A8;
  --line: #D9D9D4;
  --line-dark: #45454B;
  --grid-dot: #2A2A2E;
  --gutter: clamp(20px, 5vw, 48px);
  --max: 1200px;
  --ease: cubic-bezier(.2, .75, .1, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: "Space Grotesk", Arial, sans-serif;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--white); color: var(--ink); padding: 12px 16px; z-index: 200; }
.skip:focus { left: 16px; top: 16px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- Mörk topp ---------- */
.top { background: var(--ink); color: var(--ground); padding-top: env(safe-area-inset-top, 0px); }

.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 24px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 28px; width: auto; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--grey-on-dark); }
.nav a:not(.nav-contact) {
  background-image: linear-gradient(var(--blue), var(--blue));
  background-size: 0 2px; background-repeat: no-repeat; background-position: 0 calc(100% - 8px);
  transition: background-size .35s ease, color .2s;
}
.nav a:not(.nav-contact):hover, .nav a[aria-current="page"] { color: var(--ground); background-size: 100% 2px; }
.nav-contact { padding: 0 18px; border: 1px solid var(--line-dark); border-radius: 8px; color: var(--ground) !important; transition: border-color .2s, background-color .2s; }
.nav-contact:hover { border-color: var(--ground); }

.menu-toggle { display: none; }

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px;
    font: inherit; font-size: 15px; font-weight: 500; color: var(--ground);
    background: transparent; border: 1px solid var(--line-dark); border-radius: 8px; cursor: pointer;
  }
  .menu-toggle .bars { position: relative; width: 16px; height: 10px; }
  .menu-toggle .bars::before, .menu-toggle .bars::after {
    content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .3s var(--ease), top .3s var(--ease);
  }
  .menu-toggle .bars::before { top: 0; }
  .menu-toggle .bars::after { top: 8px; }
  .menu-toggle[aria-expanded="true"] .bars::before { top: 4px; transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .bars::after { top: 4px; transform: rotate(-45deg); }

  .site-header .wrap { flex-wrap: wrap; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 4px; }
  .nav.is-open { display: flex; }
  .nav a { min-height: 52px; font-size: 20px; border-top: 1px solid var(--grid-dot); background-image: none !important; }
  .nav a[aria-current="page"] { color: var(--blue-light); }
  .nav-contact { padding: 0; border: 0; border-top: 1px solid var(--grid-dot) !important; border-radius: 0; }
}

/* ---------- Hero ---------- */
.hero .wrap {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 64px;
  padding-top: clamp(64px, 12vw, 160px); padding-bottom: clamp(72px, 10vw, 140px);
}
.hero-text { flex: 1 1 560px; display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.hero h1 {
  margin: 0; max-width: 1000px;
  font-size: clamp(56px, 12vw, 176px); line-height: .9; font-weight: 700; letter-spacing: -.05em;
}
.page-hero h1 { font-size: clamp(52px, 10vw, 144px); line-height: .92; }
.hero .lead { margin: 0; max-width: 600px; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.5; color: var(--grey-on-dark); }
.hero .step { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .2em; color: var(--grey-on-dark); }

.word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.word > span { display: inline-block; }
.nowrap { white-space: nowrap; }
.dot { display: inline-block; width: .19em; height: .19em; border-radius: 50%; background: var(--blue); margin-left: .04em; }

.grid-mark { flex: 0 0 auto; width: 200px; height: 200px; overflow: visible; }
.grid-mark .g { fill: var(--grid-dot); }
.grid-mark .walker { fill: var(--blue); transform: translate(118px, 82px); }

/* ---------- Ljus del ---------- */
.section { padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(48px, 7vw, 96px); }
.section-title { margin: 0 0 48px; font-size: 13px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--grey); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--ink); padding-top: 24px; color: var(--ink); text-decoration: none;
}
.card::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 2px; width: 0; background: var(--blue);
  transition: width .55s var(--ease);
}
.card:hover::before, .card:focus-visible::before { width: 100%; }
.card .num { font-size: 14px; font-weight: 500; color: var(--blue); }
.card .title { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.02; font-weight: 700; letter-spacing: -.03em; }
.card .arr { display: inline-block; transition: transform .4s var(--ease); }
.card:hover .arr, .card:focus-visible .arr { transform: translateX(10px); }
.card .desc { font-size: 16px; line-height: 1.5; color: var(--grey); }

.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.point { border-top: 1px solid var(--ink); padding-top: 24px; }
.point h2 { margin: 0 0 12px; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.point p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--grey); max-width: 34ch; }

.next { padding-bottom: clamp(56px, 7vw, 88px); }
.next a {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-top: 28px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.next .k { font-size: 13px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--grey); }
.next .v { font-size: clamp(26px, 3.6vw, 48px); font-weight: 700; letter-spacing: -.03em; }
.next .arr { display: inline-block; transition: transform .4s var(--ease); }
.next a:hover .arr { transform: translateX(10px); }

/* ---------- Sidfot ---------- */
.site-footer { background: var(--white); border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 28px; padding-bottom: 28px; }
.site-footer img { height: 22px; width: auto; }
.mail { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--blue); transition: color .2s; }
.mail:hover { color: var(--blue); }
.copy { margin: 0; font-size: 13px; color: var(--grey); }
.site-footer.flash .mail { animation: flash 1.2s var(--ease); }
@keyframes flash { 0%, 100% { color: var(--ink); } 30% { color: var(--blue); } }

/* ---------- Animeringar (endast när JS är aktivt och rörelse tillåts) ---------- */
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes walk {
  0%, 7.5% { transform: translate(118px, 82px); }
  12.5%, 20% { transform: translate(154px, 82px); }
  25%, 32.5% { transform: translate(154px, 118px); }
  37.5%, 45% { transform: translate(82px, 118px); }
  50%, 57.5% { transform: translate(82px, 46px); }
  62.5%, 70% { transform: translate(46px, 46px); }
  75%, 82.5% { transform: translate(46px, 154px); }
  87.5%, 95% { transform: translate(118px, 154px); }
  100% { transform: translate(118px, 82px); }
}

@media (prefers-reduced-motion: no-preference) {
  .motion .word > span { animation: rise 1s var(--ease) both; }
  .motion .word:nth-of-type(2) > span { animation-delay: .2s; }
  .motion .word:nth-of-type(3) > span, .motion .nowrap .word > span { animation-delay: .4s; }
  .motion .dot { animation: pop .7s cubic-bezier(.3, 1.5, .5, 1) 1s both; }
  .page-hero.motion .dot { animation-delay: .6s; }
  .motion .fade { animation: fadein .9s var(--ease) both; }
  .motion .fade-1 { animation-delay: .1s; }
  .motion .fade-2 { animation-delay: .8s; }
  .motion .fade-3 { animation-delay: 1.2s; }
  .motion .grid-mark .walker { animation: walk 18s cubic-bezier(.65, 0, .35, 1) 1.6s infinite; }

  .js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .reveal.d1 { transition-delay: .12s; }
  .js .reveal.d2 { transition-delay: .24s; }
}

/* Blå muspekare – bara på enheter med mus/styrplatta */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .has-cursor, .has-cursor * { cursor: none !important; }
  .has-cursor .cursor {
    display: block; position: fixed; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px;
    border-radius: 50%; background: var(--blue); pointer-events: none; z-index: 150; opacity: 0;
    transition: width .3s, height .3s, margin .3s, opacity .3s;
  }
  .has-cursor .cursor.is-on { opacity: 1; }
  .has-cursor .cursor.is-big { width: 56px; height: 56px; margin: -28px 0 0 -28px; opacity: .3; }
}

@media (max-width: 760px) {
  .grid-mark { width: 140px; height: 140px; }
  .hero .wrap { gap: 48px; }
}
