/* Able Innovation Sweden AB — ableinnovation.com */

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/sora.woff2') format('woff2');
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500 900;
  font-stretch: 125%;
  font-display: swap;
  src: url('../fonts/archivo-expanded.woff2') format('woff2');
}

:root {
  --bg: #0a0d0b;
  --surface: #10140f;
  --surface-2: #161c14;
  --line: #1f261e;
  --line-bright: #2c3628;
  --text: #eef1ec;
  --text-dim: #8f9a8e;
  --green: #4e9732;
  --green-dark: #2f8432;
  --green-bright: #7dc142;
  --lime: #a5d34a;
  --display: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --body: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-w: 1200px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* film grain */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  z-index: 2147483000;
}

/* faint engineering grid */
.grid-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(125, 193, 66, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 193, 66, 0.022) 1px, transparent 1px);
  background-size: 88px 88px;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

::selection { background: var(--green-dark); color: #fff; }

a { color: var(--green-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ================= header ================= */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 32px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
}

.brand:hover { text-decoration: none; }

.brand img { height: 34px; width: auto; display: block; }

.brand .wordmark {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 760;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-transform: uppercase;
}

.brand .wordmark small {
  display: block;
  font-family: var(--body);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 2px;
}

.site-nav { display: flex; gap: 34px; }

.site-nav a {
  color: var(--text-dim);
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.25s ease;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--green-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a:hover::after { transform: scaleX(1); }

/* ================= hero ================= */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 128px 0 64px;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero .wrap { width: 100%; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--green-bright);
  margin-bottom: 36px;
}

.eyebrow::before {
  content: '';
  width: 44px;
  height: 1px;
  background: var(--green-bright);
}

.hero h1 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 820;
  /* capped so the longest authored line ("with technology." = 13em) stays
     on one line down to ~560px; below that the mobile rule takes over */
  font-size: clamp(2.25rem, 6.8vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  /* line breaks are authored in the markup — no width cap needed */
}

.hero h1 .accent {
  background: linear-gradient(97deg, var(--lime), var(--green-dark) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em; /* keep italic-ish overhang of gradient text unclipped */
}

/* masked line reveal */
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; }

.hero .sub {
  margin-top: 40px;
  max-width: 46ch;
  color: var(--text-dim);
  font-size: clamp(1rem, 1.4vw, 1.1875rem);
  line-height: 1.8;
}

.hero .sub strong { color: var(--text); font-weight: 600; }

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 48px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 17px 36px;
  font-family: var(--body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0a0d0b;
  background: linear-gradient(100deg, var(--lime), var(--green));
  border-radius: 999px;
  transition: box-shadow 0.3s ease;
  will-change: transform;
}

.cta::after { content: '→'; font-size: 1rem; transition: transform 0.25s var(--ease-out); }

.cta:hover { text-decoration: none; box-shadow: 0 10px 40px rgba(125, 193, 66, 0.35); }
.cta:hover::after { transform: translateX(4px); }

.cta-ghost {
  font-family: var(--body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.cta-ghost:hover { color: var(--green-bright); text-decoration: none; }

/* stat strip */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 64px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hero-stats .stat {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-stats .stat::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* load choreography */
.boot {
  opacity: 0;
  transform: translateY(28px);
  animation: bootIn 0.9s var(--ease-out) forwards;
}

.hero h1 .line > span {
  transform: translateY(112%);
  animation: lineUp 0.95s var(--ease-out) forwards;
}

@keyframes bootIn { to { opacity: 1; transform: none; } }
@keyframes lineUp { to { transform: none; } }

.d1 { animation-delay: 0.10s; }
.d2 { animation-delay: 0.22s; }
.d3 { animation-delay: 0.34s; }
.d4 { animation-delay: 0.46s; }
.d5 { animation-delay: 0.62s; }
.d6 { animation-delay: 0.80s; }

/* ================= sections ================= */

section { padding: 130px 0; position: relative; }

.section-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}

.section-label {
  position: sticky;
  top: 48px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.section-label .num {
  font-family: var(--display);
  font-stretch: 125%;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--green-bright);
}

.section-label h2 {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.section-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--line-bright), transparent);
  margin-bottom: 72px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease-out);
}

.in-view .section-rule { transform: scaleX(1); }

.lede {
  font-family: var(--display);
  font-stretch: 125%;
  font-size: clamp(1.5rem, 3.2vw, 2.375rem);
  font-weight: 560;
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 26ch;
}

.lede strong { font-weight: 750; color: var(--green-bright); }

/* ================= cards ================= */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  position: relative;
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 55%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 44px 32px 40px;
  overflow: hidden;
  transition: border-color 0.35s ease, transform 0.35s var(--ease-out);
}

.card::before {
  content: attr(data-num);
  position: absolute;
  top: 8px;
  right: 16px;
  font-family: var(--display);
  font-stretch: 125%;
  font-size: 5.5rem;
  font-weight: 850;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-bright);
  transition: -webkit-text-stroke-color 0.35s ease;
}

.card:hover { border-color: rgba(125, 193, 66, 0.5); transform: translateY(-6px); }
.card:hover::before { -webkit-text-stroke-color: rgba(125, 193, 66, 0.45); }

.card h3 {
  font-family: var(--display);
  font-stretch: 125%;
  font-size: 1.25rem;
  font-weight: 720;
  margin: 56px 0 14px;
}

.card p { color: var(--text-dim); font-size: 0.9375rem; }

/* card entrance stagger */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

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

.cards .card:nth-child(2) { transition-delay: 0.12s; }
.cards .card:nth-child(3) { transition-delay: 0.24s; }

/* ================= lab / teaser ================= */

.lab-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(900px 420px at 85% 20%, rgba(78, 151, 50, 0.12), transparent 65%),
    linear-gradient(160deg, var(--surface-2), var(--surface) 60%);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 460px;
}

.lab-copy { padding: 64px 24px 64px 56px; align-self: center; }

.lab-copy h3 {
  font-family: var(--display);
  font-stretch: 125%;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  max-width: 14ch;
}

.lab-copy h3 em {
  font-style: normal;
  background: linear-gradient(97deg, var(--lime), var(--green-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lab-copy p {
  margin-top: 24px;
  color: var(--text-dim);
  max-width: 44ch;
  font-size: 0.9875rem;
}

.lab-copy .lab-note {
  margin-top: 32px;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

#lab-canvas {
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: block;
}

/* ================= contact ================= */

.contact-box {
  position: relative;
  text-align: center;
  padding: 40px 24px 8px;
}

.contact-box .contact-kicker {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* The address is ~18em wide in this face, so size it from the box it lives in
   (not the viewport) — that keeps it on one line at every layout. */
.contact-box .email {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 780;
  font-size: clamp(1rem, 4vw, 2rem);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

@supports (container-type: inline-size) {
  .contact-box { container-type: inline-size; }
  .contact-box .email {
    font-size: min(5.2cqw, 2.75rem);
    overflow-wrap: normal;
    white-space: nowrap;
  }
}

.contact-box .email a {
  color: var(--text);
  transition: color 0.3s ease;
}

.contact-box .email a:hover { color: var(--green-bright); text-decoration: none; }

.contact-box .legal-line {
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 0.875rem;
}

/* ================= footer ================= */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 56px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
}

.footer-brand img { height: 56px; width: auto; opacity: 0.9; }

.footer-brand .wordmark {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 820;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.8125rem;
}

.footer-meta nav { display: flex; gap: 28px; }

.footer-meta a { color: var(--text-dim); }
.footer-meta a:hover { color: var(--green-bright); }

/* ================= subpages ================= */

.page { padding: 170px 0 110px; min-height: 60vh; }

.page h1 {
  font-family: var(--display);
  font-stretch: 125%;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.page .updated {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 56px;
}

.page h2 {
  font-family: var(--display);
  font-stretch: 125%;
  font-size: 1.3125rem;
  font-weight: 750;
  margin: 48px 0 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.page p, .page ul { color: var(--text-dim); max-width: 68ch; margin-bottom: 16px; font-size: 0.9675rem; }
.page ul { padding-left: 24px; }
.page .intro { font-size: 1.125rem; color: var(--text); max-width: 60ch; }

/* ================= 404 ================= */

.error-page { text-align: center; padding: 200px 0 160px; }

.error-page .code {
  font-family: var(--display);
  font-stretch: 125%;
  font-size: clamp(6rem, 22vw, 12rem);
  font-weight: 850;
  line-height: 1;
  background: linear-gradient(100deg, var(--lime), var(--green-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page p { color: var(--text-dim); margin: 24px 0 40px; }

/* ================= custom cursor ================= */

#cursor-dot, #cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 2147483001;
  display: none;
}

#cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--green-bright);
  transform: translate(-50%, -50%);
}

#cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(125, 193, 66, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
}

body.cursor-on #cursor-dot, body.cursor-on #cursor-ring { display: block; }
body.cursor-on.cursor-hover #cursor-ring {
  width: 56px;
  height: 56px;
  border-color: rgba(125, 193, 66, 0.9);
}

/* ================= motion safety ================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boot, .hero h1 .line > span { animation: none; opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .section-rule { transform: none; transition: none; }
  .card, .cta, .cta::after, .site-nav a::after { transition: none; }
}

/* ================= responsive ================= */

@media (max-width: 1020px) {
  .section-grid { grid-template-columns: 1fr; gap: 20px; }
  .section-label { position: static; }
  .lab-panel { grid-template-columns: 1fr; }
  .lab-copy { padding: 48px 32px 8px; }
  #lab-canvas { min-height: 320px; }
}

@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  section { padding: 88px 0; }
  .hero { padding: 120px 0 64px; }
  .hero-stats { gap: 12px 36px; margin-top: 64px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 22px; }
  .site-header { padding: 22px 0; }
  .site-nav { gap: 14px; }
  /* one destination only — the logo covers "home", the rest is a scroll away */
  .site-nav a:not(:last-child) { display: none; }
  .site-nav a { font-size: 0.6875rem; letter-spacing: 0.1em; white-space: nowrap; }
  .brand .wordmark { display: none; }
  .brand img { height: 30px; }
  .hero h1 { font-size: clamp(1.85rem, 8.7vw, 3rem); }
  .contact-box { padding: 32px 6px 8px; }
  .hero-cta-row { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-brand img { height: 40px; }
  .footer-meta { flex-direction: column; align-items: flex-start; }
}
