/* ==========================================================================
   GRUND — nollställning, typografi, knappar och formulär
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fin kornighet över hela sidan — "svett och krita" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: .2em; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: var(--on-accent); }

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

/* ---- Typografi ------------------------------------------------------- */
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  line-height: var(--lh-tight);
  letter-spacing: -.01em;
  margin: 0 0 .4em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1; }
h4 { font-size: 1.25rem; line-height: 1.1; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lead { font-size: var(--fs-lead); color: var(--text-muted); max-width: 46ch; }

.prose { color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose ul { padding: 0; margin: 0 0 1em; list-style: none; }
.prose li { position: relative; padding-left: 1.6em; margin: .45em 0; color: var(--text); }
.prose li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: .85em; height: .5em;
  border-left: 2px solid var(--pulse); border-bottom: 2px solid var(--pulse);
  transform: rotate(-45deg);
}
.prose a { color: var(--accent); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--pulse);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 12'%3E%3Cpath d='M0 6h8l2-4 3 9 3-11 2 6h10' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 12'%3E%3Cpath d='M0 6h8l2-4 3 9 3-11 2 6h10' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--text);
}

/* ---- Knappar --------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 52px;
  padding: .85em 1.6em;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }

.btn--primary {
  --btn-fg: var(--on-accent);
  background: var(--gradient);
  box-shadow: 0 8px 30px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn--primary:hover { box-shadow: var(--glow); }

.btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--text); }

.btn--small { min-height: 40px; padding: .6em 1.1em; font-size: 1rem; }
.btn--block { width: 100%; }

.btn__arrow {
  width: 1.1em; height: 1.1em;
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--dur) var(--ease-out);
}
.btn:hover .btn__arrow { transform: translateX(4px); }

.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- Formulär -------------------------------------------------------- */
.field { display: grid; gap: .45rem; margin-bottom: 1.1rem; }
.field label, .field .label { font-weight: 600; font-size: var(--fs-small); color: var(--text-muted); }

input[type=text], input[type=email], input[type=tel], input[type=password], input[type=url],
input[type=number], input[type=time], select, textarea {
  width: 100%;
  min-height: 50px;
  padding: .8em 1em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
textarea { min-height: 150px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23a6a6ad' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8em center; background-size: 1.1em; padding-right: 2.5em; }

.check { display: flex; gap: .7em; align-items: flex-start; font-size: var(--fs-small); color: var(--text-muted); cursor: pointer; }
.check input { width: 1.25em; height: 1.25em; margin-top: .15em; accent-color: var(--accent); flex: none; }

/* ---- Hjälpklasser ---------------------------------------------------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 200; padding: .7em 1em; background: var(--pulse); color: var(--bg); font-weight: 700; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
