:root {
  --ink: #160f1f;
  --plum: #2a1b33;
  --pixel: #f7f5ff;
  --ice: #a8d4ff;
  --brand: #068bff;       /* logo blue */
  --brand-deep: #0068d6;  /* button fill, keeps white text readable */
  --teal: #9fe3de;

  --sky-top: #2b1f4a;
  --sky-bottom: #e79aae;

  --display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--pixel);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

/* ---------- fixed layers ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

.pixels {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
}

/* ---------- header ---------- */

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.04em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo__mark {
  width: 28px;
  height: 28px;
  align-self: center;
  transition: transform .9s var(--ease);
}

.logo:hover .logo__mark { transform: rotate(360deg); }

.nav { display: flex; gap: 24px; }

.nav a,
.pill {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
}

.eyebrow {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav a {
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}

.nav a:hover::after { transform: scaleX(1); }

/* ---------- scenes ---------- */

.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: 120px var(--gutter) clamp(48px, 9vh, 96px);
  display: grid;
  grid-template-columns: 1fr minmax(0, 340px);
  align-items: end;
  gap: 32px;
}

.headline {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(56px, 10.5vw, 188px);
  line-height: 0.86;
  letter-spacing: -0.055em;
}

.headline .line { display: block; }

/* small visible h1 above the big hero headline: tells people and search engines who we are */
.hero__eyebrow {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--pixel);
  opacity: .85;
}

.headline .line--accent { color: var(--brand); }

.headline .word {
  display: inline-block;
  white-space: nowrap;
}

/* chunky, stepped wipe — each letter is "rendered" a few scanlines at a time */
.headline .char {
  display: inline-block;
  /* generous side/bottom margins so descenders (g, y, p) and tight-tracked edges aren't cut */
  clip-path: inset(140% -25% -40% -25%);
  transform: translateY(.18em);
  transition:
    clip-path .6s steps(6) calc(var(--i) * 24ms),
    transform .9s var(--ease) calc(var(--i) * 24ms);
}

.scene.is-in .headline .char {
  clip-path: inset(-40% -25% -40% -25%);
  transform: none;
  /* once in view the letters keep breathing: a slow wave lifts them a hair,
     and every few seconds a soft glint runs through the line */
  animation:
    letter-float 4.2s ease-in-out calc(var(--i) * -0.22s) infinite,
    letter-glint 7s ease-in-out calc(1.2s + var(--i) * 0.06s) infinite;
}

/* arrow after "något" that points at the Starta ett projekt button */
.headline__arrow {
  display: inline-block;
  width: .62em;
  height: .62em;
  margin-left: .12em;
  vertical-align: -0.02em;
  color: var(--brand);
  opacity: 0;
  transition: opacity .6s var(--ease) .7s;
}

.headline__arrow svg { display: block; width: 100%; height: 100%; }

.scene.is-in .headline__arrow {
  opacity: 1;
  animation: arrow-nudge 1.6s ease-in-out 1.3s infinite;
}

@keyframes arrow-nudge {
  0%, 100% { translate: 0 0; }
  50% { translate: .14em 0; }
}

@keyframes letter-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -0.035em; }
}

@keyframes letter-glint {
  0%, 82%, 100% { text-shadow: 0 0 0 rgba(168, 212, 255, 0); }
  88% { text-shadow: 0 0 .22em rgba(168, 212, 255, .85); }
}

.aside {
  justify-self: end;
  text-align: right;
  max-width: 340px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s var(--ease) .35s, transform .8s var(--ease) .35s;
}

.scene.is-in .aside { opacity: 1; transform: none; }

.aside p {
  margin: 0 0 20px;
  font-size: 17px;
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(22,15,31,.55), 0 0 24px rgba(22,15,31,.45);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1.5px solid rgba(247,245,255,.8);
  border-radius: 999px;
  text-decoration: none;
  transition: background .25s, color .25s, border-color .25s;
}

.pill::after {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
}

.pill:hover { background: var(--pixel); color: var(--ink); }

.pill--solid {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--pixel);
}

.pill--solid:hover { background: var(--pixel); border-color: var(--pixel); }

/* final scene: pixels spell the wordmark above, text sits low */
.scene--final { min-height: 110vh; }

/* ---------- footer ---------- */

.foot {
  position: relative;
  overflow: hidden;
  padding: clamp(96px, 16vh, 180px) var(--gutter) 28px;
  background:
    radial-gradient(ellipse 70% 60% at 15% 0%, rgba(6,139,255,.16), transparent 70%),
    var(--ink);
  border-top: 1.5px solid rgba(247,245,255,.12);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--ice);
}

.foot__cta { margin-bottom: clamp(64px, 10vh, 112px); }

.foot__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(36px, 7.5vw, 128px);
  line-height: 1;
  letter-spacing: -0.05em;
  text-decoration: none;
  padding-bottom: .12em;
  transition: color .3s;
  overflow-wrap: anywhere;
}

/* pixel underline that draws in on hover */
.foot__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: max(4px, .06em);
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s steps(8);
}

/* little pixel arrow */
.foot__arrow {
  flex: none;
  width: .56em;
  height: .4em;
  transition: transform .4s steps(4);
}

.foot__link:hover,
.foot__link:focus-visible { color: var(--brand); }
.foot__link:hover::after,
.foot__link:focus-visible::after { transform: scaleX(1); }
.foot__link:hover .foot__arrow { transform: translateX(.2em); }

.foot__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.foot__grid a,
.foot__grid p:not(.eyebrow) {
  max-width: 440px;
  display: block;
  width: fit-content;
  margin: 0 0 8px;
  text-decoration: none;
  font-size: 17px;
  color: rgba(247,245,255,.85);
  transition: color .2s, transform .3s steps(3);
}

.foot__grid a:hover { color: var(--brand); transform: translateX(6px); }

.foot__pixels {
  display: block;
  width: 100%;
  margin-top: clamp(64px, 10vh, 120px);
  cursor: pointer;
}

.foot__base {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  font-size: 13px;
}

.foot__base p { margin: 0; opacity: .5; }
.foot__base a { opacity: .5; text-decoration: none; transition: opacity .2s; }
.foot__base a:hover { opacity: 1; color: var(--brand); }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .scene {
    grid-template-columns: 1fr;
    align-content: end;
    padding-bottom: 72px;
  }
  .aside { justify-self: start; text-align: left; }
  .headline__arrow { rotate: 90deg; }
  @keyframes arrow-nudge {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 .14em; }
  }
  .foot__grid { grid-template-columns: 1fr; gap: 28px; }
  .foot__link { font-size: clamp(30px, 9vw, 48px); }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .headline .char,
  .aside {
    transition: none !important;
    clip-path: none !important;
    transform: none !important;
    opacity: 1 !important;
    animation: none !important;
  }
  .headline__arrow { animation: none !important; transition: none; }
  .logo__mark { transition: none; }
}
