/* =========================================================================
   site.min.css — Thorsvoll Media
   Docs-inspired layout (Claude API docs feel):
   - fixed topbar
   - full-height fixed sidebar (spans to bottom)
   - single content column with generous spacing
   - full-viewport hero
   Pairs with theme.css (tokens). Calm, retro, premium.
   ========================================================================= */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--tm-topbar-h) + 1.5rem);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--tm-bg);
  color: var(--tm-text);
  font-family: var(--tm-font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--tm-link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.018em;
  font-weight: 650;
}

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

code,
.mono,
.eyebrow {
  font-family: var(--tm-font-mono);
  font-feature-settings: "liga" 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tm-green);
  margin-bottom: 0.85rem;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--tm-dark);
  color: var(--tm-bg);
  padding: 0.5rem 1rem;
  border-radius: var(--tm-radius-sm);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ============================ Topbar / Nav ============================ */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--tm-topbar-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--tm-bg) 86%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--tm-border);
}

.site-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--tm-text);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.site-nav__brand:hover { text-decoration: none; }

/* Borderless logo mark */
.site-nav__logo {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--tm-dark);
}
.site-nav__logo svg { width: 26px; height: 26px; }

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--tm-muted);
  background: transparent;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-sm);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--tm-text); background: var(--tm-surface-2); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .theme-toggle__sun { display: none; }
.theme-toggle .theme-toggle__moon { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .theme-toggle__sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .theme-toggle__moon { display: none; }
}

.site-nav__toggle {
  display: none;
  width: 38px;
  height: 36px;
  padding: 0;
  color: var(--tm-text);
  background: transparent;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-sm);
  cursor: pointer;
}
.site-nav__toggle svg { width: 20px; height: 20px; margin: auto; }

/* ============================ Mobile menu ============================ */

.site-mobile-menu {
  position: fixed;
  inset: var(--tm-topbar-h) 0 0 0;
  z-index: 45;
  background: var(--tm-bg);
  border-top: 1px solid var(--tm-border);
  padding: 1.5rem;
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.site-mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.site-mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.site-mobile-menu a {
  font-family: var(--tm-font-mono);
  font-size: 0.95rem;
  color: var(--tm-text);
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid var(--tm-border);
}
.site-mobile-menu a:hover { color: var(--tm-link); text-decoration: none; }

/* ============================ App shell ============================ */

/* Full-height fixed sidebar (Claude docs style) */
.sidebar {
  position: fixed;
  top: var(--tm-topbar-h);
  left: 0;
  bottom: 0;
  width: var(--tm-sidebar-w);
  z-index: 40;
  padding: 2rem 1.25rem 2rem 1.5rem;
  overflow-y: auto;
  border-right: 1px solid var(--tm-border);
  background: var(--tm-bg);
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 1px solid var(--tm-border);
}
.sidebar a {
  font-family: var(--tm-font-mono);
  font-size: 0.86rem;
  color: var(--tm-muted);
  padding: 0.5rem 0.9rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.sidebar a:hover { color: var(--tm-text); text-decoration: none; }
.sidebar a.is-active {
  color: var(--tm-text);
  font-weight: 600;
  border-left-color: var(--tm-green);
  background: var(--tm-surface-2);
}
.sidebar a.is-parent {
  color: var(--tm-text);
  border-left-color: var(--tm-border);
}
.sidebar__sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar__sub a {
  padding-left: 1.75rem;
  font-size: 0.82rem;
}

/* Content offset by sidebar */
.layout {
  margin-left: var(--tm-sidebar-w);
  padding-top: var(--tm-topbar-h);
}

.content {
  max-width: var(--tm-content-max);
  margin: 0 auto;
  padding: 0 2rem 9rem;
  position: relative;
}

.section {
  padding-top: 9rem;
  min-height: 100vh;
  scroll-margin-top: var(--tm-topbar-h);
  position: relative;
  z-index: 1;
}
.section:first-child { min-height: calc(100vh - var(--tm-topbar-h)); padding-top: 3.5rem; }
.section__head {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--tm-border);
}
.section__head h2 {
  font-size: 1.85rem;
  margin-top: 0.35rem;
}
.section__lead {
  color: var(--tm-muted);
  font-size: 1.05rem;
  max-width: 62ch;
  margin-top: 1rem;
}

/* Synlighetspakken: no title divider + tighter rhythm (it has extra blocks) */
#synlighet .section__head {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 1.75rem;
}

/* ============================ Hero (full viewport) ============================ */

.hero {
  min-height: calc(100vh - var(--tm-topbar-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  letter-spacing: -0.03em;
  margin-bottom: 1.6rem;
  max-width: 16ch;
}
.hero__lead {
  color: var(--tm-muted);
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  max-width: 44ch;
}

/* ============================ Offerings ============================ */

.card {
  border-top: 1px solid var(--tm-border);
  padding: 1.5rem 0 0;
}

.offer {
  margin-top: 3.5rem;
  display: grid;
  gap: 2rem 2.5rem;
}
@media (min-width: 700px) { .offer { grid-template-columns: 1fr 1fr; } }

.offer__card {
  padding: 0;
}
.offer__card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.offer__card p { color: var(--tm-muted); margin: 0; }
.offer__tag {
  font-family: var(--tm-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tm-green);
  margin-bottom: 0.8rem;
  display: inline-block;
}

/* ============================ Synlighet (base package) ============================ */

.pak {
  margin-top: 2.5rem;
  display: grid;
  gap: 2rem;
}
.pak__price {
  font-family: var(--tm-font-mono);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
}
.pak__price-row { text-align: left; }
.pak__price .big {
  display: block;
  font-size: 1.5rem;
  color: var(--tm-text);
  letter-spacing: -0.01em;
}
.pak__price .sub {
  display: block;
  font-size: 0.82rem;
  color: var(--tm-muted);
  margin-top: 0.15rem;
}
.pak__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .pak__list { grid-template-columns: 1fr 1fr; gap: 0.75rem 2.5rem; } }
.pak__list li {
  display: flex;
  gap: 0.65rem;
  font-size: 0.96rem;
  color: var(--tm-text);
}
.pak__list li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 0.6em;
  border-radius: 2px;
  background: var(--tm-green);
}
.pak__note {
  font-family: var(--tm-font-mono);
  font-size: 0.84rem;
  color: var(--tm-muted);
}

/* ============================ Work list ============================ */

.work-list {
  margin-top: 3rem;
  border-top: 1px solid var(--tm-border);
}
.work-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0.5rem;
  border-bottom: 1px solid var(--tm-border);
  color: var(--tm-text);
}
.work-item:hover { background: var(--tm-surface); text-decoration: none; }
.work-item__main { min-width: 0; flex: 1; }
.work-item__name { font-weight: 600; }
.work-item__desc { color: var(--tm-muted); font-size: 0.9rem; }
.work-item__url {
  font-family: var(--tm-font-mono);
  font-size: 0.78rem;
  color: var(--tm-muted);
  white-space: nowrap;
}
.work-item__arrow { color: var(--tm-muted); flex: none; }
.work-item:hover .work-item__arrow { color: var(--tm-green); }

/* ============================ Drift ============================ */

.drift {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 760px) { .drift { grid-template-columns: 1.1fr 0.9fr; } }
.drift__visual {
  display: grid;
  place-items: center;
  color: var(--tm-muted);
}
.drift__visual svg { width: 100%; max-width: 240px; height: auto; }
.drift__led { fill: var(--tm-green); }

/* ============================ Kontakt ============================ */

.contact p { font-size: 1.15rem; max-width: 46ch; }
.contact__rows {
  margin-top: 1.75rem;
  display: grid;
  gap: 0.85rem;
}
.contact__row {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  font-family: var(--tm-font-mono);
  font-size: 0.98rem;
}
.contact__row .label {
  color: var(--tm-muted);
  font-size: 0.78rem;
  min-width: 80px;
}

/* Split layout: text + side visual (used by drift, synlighet, tilpasset) */
.split {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 760px) { .split { grid-template-columns: 1.1fr 0.9fr; } }
.split--head { margin-bottom: 1rem; }
.split__visual {
  display: grid;
  place-items: center;
  color: var(--tm-muted);
}
.split__visual svg { width: 100%; max-width: 200px; height: auto; }

/* Contact form (real submit via endpoint, mailto fallback) */
.contact-form {
  margin-top: 4.5rem;
  display: grid;
  gap: 1.1rem;
  max-width: 560px;
}
.contact-form__row {
  display: grid;
  gap: 1.1rem;
}
@media (min-width: 560px) { .contact-form__row { grid-template-columns: 1fr 1fr; } }
.contact-form__field {
  display: grid;
  gap: 0.4rem;
}
.contact-form__field > span {
  font-family: var(--tm-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tm-muted);
}
.contact-form input,
.contact-form textarea {
  font-family: var(--tm-font-sans);
  font-size: 0.96rem;
  color: var(--tm-text);
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-sm);
  padding: 0.65rem 0.8rem;
  width: 100%;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--tm-green);
}
.contact-form button { justify-self: start; }
.contact-form__note {
  font-family: var(--tm-font-mono);
  font-size: 0.8rem;
  color: var(--tm-muted);
  margin: 0;
}

/* ============================ Footer ============================ */

.site-footer {
  border-top: 1px solid var(--tm-border);
  background: var(--tm-surface);
}
.site-footer__wrap {
  max-width: var(--tm-content-max);
  margin: 0 auto;
  padding: 3rem 2rem 2.5rem;
}
.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}
.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--tm-text);
  font-weight: 600;
}
.site-footer__brand:hover { text-decoration: none; }
.site-footer__tagline {
  color: var(--tm-muted);
  font-size: 0.92rem;
  margin-top: 0.85rem;
  max-width: 34ch;
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.5rem;
}
.site-footer__nav a {
  font-family: var(--tm-font-mono);
  font-size: 0.86rem;
  color: var(--tm-muted);
}
.site-footer__nav a:hover { color: var(--tm-text); }
.site-footer__nav-sub {
  flex-basis: 100%;
  margin-top: 0.4rem;
  opacity: 0.75;
}
.site-footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tm-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-family: var(--tm-font-mono);
  font-size: 0.78rem;
  color: var(--tm-muted);
}
.site-footer__meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.85rem; font-size: 0.92rem; }
.site-footer__meta a { color: var(--tm-muted); }

/* ============================ Buttons ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--tm-font-mono);
  font-size: 0.86rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--tm-radius-sm);
  border: 1px solid var(--tm-border);
  cursor: pointer;
}
.btn--primary {
  color: var(--tm-bg);
  background: var(--tm-dark);
  border-color: var(--tm-dark);
}
.btn--primary:hover { opacity: 0.9; text-decoration: none; }
.btn--ghost {
  color: var(--tm-text);
  background: var(--tm-surface);
}
.btn--ghost:hover { background: var(--tm-surface-2); text-decoration: none; }
.btn--sm { font-size: 0.8rem; padding: 0.45rem 0.85rem; }

/* ============================ Cookie consent ============================ */

.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(8px);
  width: min(680px, calc(100vw - 2rem));
  z-index: 60;
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--tm-shadow);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.cookie-banner.is-open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.cookie-banner__text { font-size: 0.88rem; color: var(--tm-muted); flex: 1; min-width: 240px; }
.cookie-banner__text strong { color: var(--tm-text); font-weight: 600; }
.cookie-banner__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(34, 32, 28, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.cookie-modal.is-open { opacity: 1; visibility: visible; }
.cookie-modal__panel {
  width: min(540px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--tm-shadow);
  padding: 1.75rem;
}
.cookie-modal__panel h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.cookie-modal__panel > p { color: var(--tm-muted); font-size: 0.92rem; }
.cookie-modal__about {
  margin-top: 1rem;
  font-size: 0.86rem;
  color: var(--tm-muted);
  line-height: 1.6;
}
.cookie-opt {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--tm-border);
}
.cookie-opt:first-of-type { margin-top: 1rem; }
.cookie-opt__info strong { display: block; font-size: 0.95rem; }
.cookie-opt__info span { color: var(--tm-muted); font-size: 0.85rem; }
.cookie-opt input { margin-top: 0.3rem; accent-color: var(--tm-green); width: 18px; height: 18px; }
.cookie-modal__actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ============================ Responsive ============================ */

@media (max-width: 900px) {
  .sidebar { display: none; }
  .layout { margin-left: 0; }
  .site-nav__links { display: none; }
  .site-nav__toggle { display: inline-grid; place-items: center; }
  .hero { min-height: auto; padding: 3rem 0 4rem; }
  .section { padding-top: 7rem; min-height: 0; }
  .section__head { margin-bottom: 2rem; }
  /* Keep the copyright on one tidy line on small screens */
  .site-footer__bottom { font-size: 0.7rem; justify-content: center; text-align: center; }
  .site-footer__orgnr { white-space: nowrap; }
}

@media (max-width: 380px) {
  /* Drop the org.nr on the very narrowest phones rather than let it wrap */
  .site-footer__orgnr { display: none; }
}

@media (min-width: 901px) {
  .site-mobile-menu { display: none; }
}

/* On wide screens, stop centering the text column and let it sit left of
   centre. This opens a generous right-hand gutter that the background thread
   reads live and swings far out into, using the empty right side of the page. */
@media (min-width: 1300px) {
  .content {
    margin-left: max(2rem, calc((100% - var(--tm-content-max)) * 0.3));
    margin-right: auto;
  }
}

/* =========================================================================
   Background thread — a thin line that follows your reading position and
   sparks each section title as the leading dot reaches it.
   ========================================================================= */
.thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.thread__track {
  fill: none;
  stroke: var(--tm-thread);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.45;
}
.thread__glow {
  fill: none;
  stroke: var(--tm-thread-strong);
  stroke-width: 1.7;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px var(--tm-thread-glow));
  transition: stroke-dashoffset 0.18s linear;
}
.thread__dot {
  transition: transform 0.18s linear;
}
.thread__dot-core {
  fill: var(--tm-thread-strong);
}
.thread__dot-halo {
  fill: var(--tm-thread-glow);
  transform-box: fill-box;
  transform-origin: center;
  animation: tm-thread-breathe 2.8s ease-in-out infinite;
}
@keyframes tm-thread-breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 0.6; transform: scale(1.2); }
}
.thread.is-static .thread__glow,
.thread.is-static .thread__dot { display: none; }

/* Title spark as the thread passes */
.section__head.is-lit .eyebrow,
.hero.is-lit .eyebrow { color: var(--tm-thread-strong); }
.section__head.is-lit h2,
.section__head.is-lit .eyebrow,
.hero.is-lit h1,
.hero.is-lit .eyebrow {
  animation: tm-spark 1100ms ease-out;
}
@keyframes tm-spark {
  0% { text-shadow: 0 0 0 transparent; }
  20% { text-shadow: 0 0 16px var(--tm-thread-glow), 0 0 4px var(--tm-thread-glow); }
  100% { text-shadow: 0 0 0 transparent; }
}

/* Text gets a touch stronger right where the thread passes beside it.
   No frames or boxes — only a soft lift in colour/clarity of the words. */
.is-touched {
  transition: color 0.5s ease, text-shadow 0.5s ease;
}
.section__lead.is-touched,
.hero__lead.is-touched { color: var(--tm-text); }
h1.is-touched,
h2.is-touched { text-shadow: 0 0 14px var(--tm-thread-glow); }

@media (prefers-reduced-motion: reduce) {
  .thread__dot-halo { animation: none; }
  .thread__glow,
  .thread__dot { transition: none; }
  .is-touched { transition: none; color: inherit; text-shadow: none; }
  .section__head.is-lit .eyebrow,
  .section__head.is-lit h2,
  .hero.is-lit .eyebrow,
  .hero.is-lit h1 { animation: none; }
}



