/* ==========================================================================
   Tegnemaskin
   One stylesheet for every page. Change colors and fonts in :root below.
   ========================================================================== */

/* --- Tokens -------------------------------------------------------------- */

:root {
  --bg:          #0e0f11;
  --surface:     #17181b;
  --line:        #2a2c31;
  --text:        #ecebe8;
  --muted:       #9a9ba1;
  --accent:      #fd623c;
  --accent-soft: #ff8a6a;
  --on-accent:   #1a0b06;
  --snow:        #efedeb;
  --snow-text:   #1d1d1f;

  --font-display: "Tomorrow", "Segoe UI", system-ui, sans-serif;
  --font-body:    "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --wrap:    1180px;
  --gutter:  clamp(16px, 4vw, 48px);
  --section: clamp(72px, 10vw, 128px);

  color-scheme: dark;
}


/* --- Base ---------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  text-wrap: balance;
}

p { margin: 0; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--on-accent);
}
.skip-link:focus { top: 16px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* --- Layout helpers ------------------------------------------------------ */

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--tight-bottom { padding-bottom: 32px; }
.section--surface { background: var(--surface); }

.eyebrow {
  margin-bottom: 16px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.lead { color: var(--muted); max-width: 54ch; }
.lead a { color: var(--accent-soft); text-underline-offset: 3px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 32px 64px;
  align-items: end;
}

.split--top { align-items: start; }

.title { font-size: clamp(32px, 4.4vw, 54px); }


/* --- Header and navigation ----------------------------------------------- */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 600 17px/1 var(--font-display);
  letter-spacing: .12em;
  text-decoration: none;
  color: #fff;
}
.brand img { width: 34px; height: 34px; }

.nav { display: flex; flex-wrap: wrap; gap: clamp(14px, 2.4vw, 32px); }

.nav a {
  padding-block: 6px;
  font: 500 14px/1 var(--font-body);
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: #fff; border-color: var(--accent); }
.nav a[aria-current="page"] { color: #fff; border-color: var(--accent); }

.menu-button {
  display: none;
  padding: 9px 12px;
  background: none;
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
  font: 500 13px/1 var(--font-mono);
  cursor: pointer;
}

@media (max-width: 760px) {
  .menu-button { display: block; }
  .nav { display: none; }
  .nav.is-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: rgba(14, 15, 17, .97);
  }
  .nav.is-open a { padding-block: 14px; border-bottom: 1px solid var(--line); }
}


/* --- Hero (front page) and page banners ---------------------------------- */

.hero,
.banner {
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}

.hero { min-height: min(88vh, 860px); }
.banner { min-height: min(56vh, 520px); }

.hero > img,
.banner > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after,
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 10, .6) 0%, rgba(8, 8, 10, .25) 45%, rgba(8, 8, 10, 0) 75%),
    linear-gradient(180deg, rgba(8, 8, 10, .55) 0%, rgba(8, 8, 10, 0) 30%, rgba(14, 15, 17, .96) 100%);
}

.hero__content,
.banner__content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero__content { padding-block: 140px 72px; }
.banner__content { padding-block: 140px 48px; }

.hero h1 {
  max-width: 11ch;
  font-size: clamp(44px, 8.4vw, 116px);
  font-weight: 700;
  letter-spacing: -.02em;
}

.banner h1 { font-size: clamp(40px, 6.4vw, 84px); font-weight: 700; letter-spacing: -.02em; }

.hero .lead,
.banner .lead {
  margin-top: 22px;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(16px, 1.6vw, 19px);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}


/* --- Buttons and links --------------------------------------------------- */

.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  font: 600 15px/1 var(--font-display);
  letter-spacing: .04em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}

.button--primary { background: var(--accent); color: var(--on-accent); }
.button--primary:hover { background: var(--accent-soft); }

.button--ghost { border-color: color-mix(in srgb, currentColor 50%, transparent); }
.button--ghost:hover { border-color: currentColor; background: color-mix(in srgb, currentColor 8%, transparent); }

.text-link {
  display: inline-flex;
  gap: 8px;
  margin-top: 26px;
  padding-bottom: 6px;
  font: 600 14px/1 var(--font-display);
  letter-spacing: .04em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

@media (max-width: 480px) {
  .buttons .button { flex: 1 1 100%; justify-content: center; }
}


/* --- Specs grid ---------------------------------------------------------- */

.specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 56px;
  border-top: 1px solid var(--line);
}

.spec {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 28px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.spec:nth-child(3n+1) { padding-left: 0; border-left: 0; }

.spec h3 { font-size: 26px; font-weight: 500; }
.spec h3 small { margin-left: 6px; font: 400 13px/1 var(--font-mono); letter-spacing: .04em; color: var(--accent-soft); }
.spec p { color: var(--muted); font-size: 15px; max-width: 34ch; }

@media (max-width: 900px) {
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec:nth-child(n) { padding: 24px 20px 26px; border-left: 1px solid var(--line); }
  .spec:nth-child(odd) { padding-left: 0; border-left: 0; }
}

@media (max-width: 480px) {
  .specs { grid-template-columns: minmax(0, 1fr); }
  .spec:nth-child(n) { padding-left: 0; border-left: 0; }
}


/* --- Steps (numbered process) -------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--line);
}

.steps li {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 28px 28px 32px;
  border-left: 1px solid var(--line);
  counter-increment: step;
}
.steps li:first-child { padding-left: 0; border-left: 0; }

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .14em;
  color: var(--accent-soft);
}

.steps h3 { font-size: 22px; font-weight: 500; }
.steps p { color: var(--muted); font-size: 15px; }

@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(n) { padding: 24px 20px 26px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .steps li:nth-child(odd) { padding-left: 0; border-left: 0; }
}

@media (max-width: 480px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li:nth-child(n) { padding-left: 0; border-left: 0; }
}


/* --- Gallery ------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(150px, 15vw, 270px);
  grid-auto-flow: dense;
  gap: 4px;
}

.gallery a {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.gallery a:hover img { transform: scale(1.04); }

.gallery span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 32px 14px 12px;
  font: 500 12px/1.2 var(--font-mono);
  letter-spacing: .06em;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  opacity: 0;
  transition: opacity .25s;
}
.gallery a:hover span,
.gallery a:focus-visible span { opacity: 1; }

.gallery--square { grid-auto-rows: auto; }
.gallery--square a { aspect-ratio: 1; }

.gallery .is-wide { grid-column: span 2; }
.gallery .is-big { grid-column: span 2; grid-row: span 2; }

.gallery + .gallery-head { padding-top: var(--section); }

@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(130px, 30vw, 260px); }
}

@media (hover: none) {
  .gallery span { opacity: 1; }
}


/* --- Media and text ------------------------------------------------------ */

.media-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.media-text--narrow-media { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }

.media-text img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-text--narrow-media img { aspect-ratio: 1; }

.media-text .title { font-size: clamp(30px, 3.8vw, 46px); margin-bottom: 18px; }
.media-text p + p { margin-top: 14px; }

@media (max-width: 900px) {
  .split,
  .media-text,
  .media-text--narrow-media { grid-template-columns: minmax(0, 1fr); }
  .media-text--narrow-media img { max-width: 360px; }
}


/* --- Lists: engines, tags ------------------------------------------------ */

.rows { margin-top: 30px; border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.row b { font: 500 14px/1.5 var(--font-display); }
.row span { color: var(--muted); }

@media (max-width: 600px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.tags + .lead { margin-top: 26px; }
.tags + .tags { margin-top: 10px; }
.tags a { color: inherit; text-decoration: none; }
.tags li:has(a):hover { border-color: var(--accent); color: var(--text); }
.tags li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  font: 400 12.5px/1 var(--font-mono);
  color: var(--muted);
}

code {
  padding: 1px 6px;
  background: var(--surface);
  font: 400 .85em var(--font-mono);
  color: var(--text);
}


/* --- Long-form text (guides, details) ------------------------------------ */

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: 56px; font-size: clamp(26px, 3vw, 34px); }
.prose h3 { margin-top: 36px; font-size: 20px; }
.prose p,
.prose li { color: var(--muted); }
.prose strong { color: var(--text); font-weight: 500; }
.prose ul,
.prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--accent-soft); }
.prose a:not(.button) { color: var(--accent-soft); text-underline-offset: 3px; }

.note {
  padding: 20px 24px;
  background: var(--surface);
  border-left: 2px solid var(--accent);
}
.note p { color: var(--text); }

.layout-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.toc {
  position: sticky;
  top: 32px;
  display: grid;
  gap: 10px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  font-size: 14px;
}
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent-soft); }

@media (max-width: 900px) {
  .layout-aside { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}


/* --- Contact panel (light) ----------------------------------------------- */

.cta {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(80vh, 720px);
  overflow: hidden;
  background: var(--snow);
  color: var(--snow-text);
}

.cta > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}

.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--snow) 94%, transparent) 0%,
    color-mix(in srgb, var(--snow) 82%, transparent) 38%,
    color-mix(in srgb, var(--snow) 0%, transparent) 70%);
}

.cta__content { position: relative; z-index: 1; width: 100%; padding-block: 96px; }
.cta h2 { max-width: 12ch; font-size: clamp(36px, 5.6vw, 72px); }
.cta p { max-width: 40ch; margin-top: 18px; color: #4a4a4e; }
.cta .eyebrow { color: #c2401f; }

@media (max-width: 760px) {
  .cta > img { object-position: 78% 50%; }
  .cta::after { background: color-mix(in srgb, var(--snow) 80%, transparent); }
}

.email {
  display: inline-block;
  margin-top: 26px;
  font: 600 clamp(20px, 3vw, 30px)/1.2 var(--font-display);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  word-break: break-word;
}
.email + .lead { margin-top: 26px; }


/* --- Footer -------------------------------------------------------------- */

.site-footer { padding-block: 56px 40px; border-top: 1px solid var(--line); }

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
}

.site-footer p { margin-top: 14px; max-width: 36ch; color: var(--muted); font-size: 14px; }

.social { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 22px; }
.social a { padding-block: 6px; font: 500 13px/1 var(--font-mono); color: var(--muted); text-decoration: none; }
.social a:hover { color: var(--accent); }

.legal { margin-top: 40px; font: 400 12px var(--font-mono); color: #66676d; }

@media (max-width: 760px) {
  .site-footer__inner { grid-template-columns: minmax(0, 1fr); }
  .social { justify-content: flex-start; }
}


/* --- Lightbox ------------------------------------------------------------ */

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: rgba(6, 6, 8, .95);
  color: var(--text);
}

.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }

.lightbox figure { margin: 0; display: grid; gap: 14px; justify-items: center; }
.lightbox img { max-width: 100%; max-height: 84vh; width: auto; }
.lightbox figcaption { font: 400 13px var(--font-mono); color: var(--muted); }

.lightbox button {
  position: absolute;
  padding: 10px 14px;
  background: rgba(14, 15, 17, .6);
  border: 1px solid #555;
  color: #fff;
  font: 500 13px/1 var(--font-mono);
  cursor: pointer;
}
.lightbox button:hover { border-color: var(--accent); }
.lightbox [data-close] { top: 16px; right: 16px; }
.lightbox [data-prev] { left: 16px; top: 50%; translate: 0 -50%; }
.lightbox [data-next] { right: 16px; top: 50%; translate: 0 -50%; }
