/* Framkoll - public site.
   Register: brand. Strategy: committed. The deep marine ground carries the
   identity on the hero and the closing band; everything between them sits on
   white so the data reads. The app (/dashboard) keeps its own restrained sheet.

   Lane: a departure board. The product is a schedule of things that have not
   happened yet, ordered by when they will, so the type is signage-grotesque and
   the figures are monospaced and tabular. Familjen Grotesk is drawn in Sweden,
   which is where every buyer and every contract in this database is. */

:root {
    --bg: oklch(1 0 0);
    --tint: oklch(0.975 0.004 215);
    --line: oklch(0.90 0.005 215);
    --line-strong: oklch(0.64 0.006 215);

    --ink: oklch(0.20 0.015 235);
    --ink-soft: oklch(0.42 0.012 235);
    --ink-faint: oklch(0.52 0.010 235);

    --deep: oklch(0.25 0.050 215);
    --deep-soft: oklch(0.34 0.045 215);
    --on-deep: oklch(0.97 0.006 215);
    --on-deep-soft: oklch(0.82 0.020 215);

    --brand: oklch(0.45 0.095 205);
    --brand-hover: oklch(0.38 0.095 205);
    --brand-weak: oklch(0.955 0.020 205);

    --signal: oklch(0.52 0.150 45);
    --signal-on-deep: oklch(0.78 0.140 60);

    --focus: oklch(0.60 0.16 250);

    --sans: 'Familjen Grotesk', ui-sans-serif, system-ui, 'Segoe UI', Arial, sans-serif;
    --mono: 'Azeret Mono', ui-monospace, Consolas, monospace;

    --step--1: 0.875rem;
    --step-0: 1.0625rem;
    --step-1: 1.375rem;
    --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
    --step-3: clamp(2rem, 1.5rem + 2.2vw, 3rem);
    --step-4: clamp(2.5rem, 1.6rem + 4.2vw, 4.5rem);

    --wrap: 68rem;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dur: 160ms;
}

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

body.site {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--step-0);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

.skip {
    position: absolute; left: -9999px;
    background: var(--deep); color: var(--on-deep);
    padding: 0.6rem 1rem; z-index: 50;
}
.skip:focus { left: 1rem; top: 1rem; }

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

h1, h2, h3 { text-wrap: balance; letter-spacing: -0.022em; margin: 0; }
p { text-wrap: pretty; }

.h1 { font-size: var(--step-3); font-weight: 600; line-height: 1.08; }
.h2 { font-size: var(--step-2); font-weight: 600; line-height: 1.15; margin-bottom: 0.75rem; }
.h2--light { color: var(--on-deep); }
.h3 { font-size: var(--step-1); font-weight: 600; margin: 2rem 0 0.4rem; }

.prose { max-width: 64ch; color: var(--ink-soft); margin: 0 0 1.1rem; }
.prose--tight { margin-bottom: 0; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; }

/* --- nav ----------------------------------------------------------------- */

.nav {
    display: flex; align-items: center; gap: 1.5rem;
    max-width: var(--wrap); margin-inline: auto;
    padding: 1.25rem 1.5rem;
}

.nav__brand {
    display: inline-flex; align-items: center; gap: 0.55rem;
    font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.03em;
    color: var(--ink); text-decoration: none;
}

/* The mark is a schedule: three bars, the nearest one lit. */
.nav__mark {
    width: 1.05rem; height: 1.05rem;
    background:
        linear-gradient(var(--signal) 0 0) 0 0 / 100% 3px no-repeat,
        linear-gradient(var(--line-strong) 0 0) 0 6px / 70% 3px no-repeat,
        linear-gradient(var(--line-strong) 0 0) 0 12px / 45% 3px no-repeat;
}

.nav__links { display: flex; gap: 1.5rem; margin-left: auto; }
.nav__links a, .nav__login {
    color: var(--ink-soft); text-decoration: none; font-size: var(--step--1); font-weight: 500;
}
.nav__links a:hover, .nav__login:hover { color: var(--ink); }
.nav__links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

.nav__actions { display: flex; align-items: center; gap: 1rem; }

@media (max-width: 46rem) {
    .nav { flex-wrap: wrap; gap: 0.75rem 1rem; }
    .nav__links { order: 3; width: 100%; margin-left: 0; }
    .nav__actions { margin-left: auto; }
}

/* --- buttons ------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    font: inherit; font-size: var(--step--1); font-weight: 600; line-height: 1;
    padding: 0.7rem 1.1rem; border-radius: 3px; border: 1px solid transparent;
    text-decoration: none; cursor: pointer;
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn--lg { font-size: var(--step-0); padding: 0.85rem 1.4rem; }
.btn--block { width: 100%; }

.btn--solid { background: var(--brand); color: oklch(1 0 0); }
.btn--solid:hover { background: var(--brand-hover); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }

.btn--quiet { background: transparent; color: var(--ink-faint); border-color: var(--line); }
.btn--quiet:hover { color: var(--ink); border-color: var(--line-strong); }

/* On the deep ground the solid button would disappear into it. */
.hero .btn--solid, .close .btn--solid { background: var(--on-deep); color: var(--deep); }
.hero .btn--solid:hover, .close .btn--solid:hover { background: oklch(1 0 0); }
.hero .btn--ghost, .close .btn--ghost { color: var(--on-deep); border-color: var(--on-deep-soft); }
.hero .btn--ghost:hover, .close .btn--ghost:hover { border-color: var(--on-deep); }

/* --- hero ---------------------------------------------------------------- */

.hero {
    background: var(--deep);
    color: var(--on-deep);
    padding: clamp(3.5rem, 2rem + 6vw, 7rem) 0 clamp(3rem, 2rem + 4vw, 5rem);
}

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

.hero__kicker {
    font-family: var(--mono); font-size: var(--step--1); font-weight: 500;
    color: var(--signal-on-deep); margin: 0 0 1.25rem;
}

.hero__title {
    font-size: var(--step-4); font-weight: 700; line-height: 1.02;
    letter-spacing: -0.035em; margin: 0 0 1.5rem;
}

.hero__lead {
    max-width: 58ch; font-size: var(--step-1); line-height: 1.5;
    color: var(--on-deep-soft); margin: 0 0 2.25rem;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: clamp(2.5rem, 2rem + 3vw, 4rem); }

.hero__stats {
    display: grid; gap: 1.75rem 2.5rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin: 0; padding-top: 2rem; border-top: 1px solid var(--deep-soft);
}
.hero__stats dt { font-size: var(--step--1); color: var(--on-deep-soft); order: 2; }
.hero__stats dd {
    font-family: var(--mono); font-size: var(--step-2); font-weight: 500;
    margin: 0 0 0.35rem; color: var(--on-deep); order: 1;
}
.hero__stats > div { display: flex; flex-direction: column; }

/* --- bands --------------------------------------------------------------- */

.band { padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0; }
.band--tint { background: var(--tint); border-block: 1px solid var(--line); }

.page-head { padding: clamp(2.5rem, 2rem + 3vw, 4rem) 0 0; }
.page-head__lead { max-width: 58ch; font-size: var(--step-1); color: var(--ink-soft); margin: 1rem 0 0; }

/* --- sample table -------------------------------------------------------- */

.sample { margin-top: 2rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
.sample__table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.sample__table thead th {
    text-align: left; font-weight: 600; color: var(--ink-soft);
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line-strong);
}
.sample__table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.sample__table td.mono { white-space: nowrap; }
.sample__table tr:last-child td { border-bottom: 0; }
.sample__title { color: var(--ink-soft); }
.sample__note { margin: 0; padding: 0.7rem 0.9rem; font-size: 0.8125rem; color: var(--ink-faint); border-top: 1px solid var(--line); }

@media (max-width: 52rem) {
    .sample { overflow-x: auto; }
    .sample__table { min-width: 44rem; }
}

/* --- steps / fields / faq ------------------------------------------------ */

.steps { display: grid; gap: 2.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.step h2 { font-size: var(--step-1); font-weight: 600; margin-bottom: 0.5rem; }
.step p { color: var(--ink-soft); margin: 0; }

.fields { display: grid; gap: 1rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); margin: 2rem 0 0; }
.fields dt { font-weight: 600; }
.fields dd { margin: 0 0 0.25rem; color: var(--ink-soft); }

.faq { display: grid; gap: 2rem; max-width: 64ch; }
.faq h2 { font-size: var(--step-1); font-weight: 600; margin-bottom: 0.35rem; }
.faq p { color: var(--ink-soft); margin: 0; }

.regions { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 1.5rem 0 2rem; }
.regions li {
    border: 1px solid var(--line); border-radius: 3px;
    padding: 0.35rem 0.7rem; font-size: var(--step--1);
}

/* --- pricing ------------------------------------------------------------- */

.price-wrap { display: grid; gap: 3rem; grid-template-columns: minmax(18rem, 22rem) 1fr; align-items: start; }
@media (max-width: 52rem) { .price-wrap { grid-template-columns: 1fr; } }

.price { border: 1px solid var(--line-strong); border-radius: 4px; padding: 1.75rem; background: var(--bg); }
.price__amount { font-family: var(--mono); font-size: var(--step-3); font-weight: 500; margin: 0; letter-spacing: -0.03em; }
.price__amount span { font-family: var(--sans); font-size: var(--step-0); color: var(--ink-faint); letter-spacing: 0; }
.price__vat { color: var(--ink-faint); font-size: var(--step--1); margin: 0.25rem 0 1.5rem; }
.price__list { list-style: none; padding: 0; margin: 0 0 1.75rem; display: grid; gap: 0.6rem; }
.price__list li { position: relative; padding-left: 1.4rem; color: var(--ink-soft); font-size: var(--step--1); }
.price__list li::before {
    content: ''; position: absolute; left: 0; top: 0.55em;
    width: 0.6rem; height: 0.6rem; background: var(--brand); border-radius: 1px;
}
.price__fine { font-size: 0.8125rem; color: var(--ink-faint); margin: 1rem 0 0; }
.price-side .prose { margin-bottom: 0.5rem; }

/* --- closing band -------------------------------------------------------- */

.close { background: var(--deep); color: var(--on-deep); padding: clamp(3rem, 2rem + 4vw, 5rem) 0; }
.close__inner { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; justify-content: space-between; }
.close__price { font-family: var(--mono); font-size: var(--step-2); margin: 0.5rem 0 0.25rem; }
.close__price span { font-family: var(--sans); font-size: var(--step--1); color: var(--on-deep-soft); }
.close__note { color: var(--on-deep-soft); margin: 0; font-size: var(--step--1); }

/* --- forms --------------------------------------------------------------- */

.band--form { display: flex; justify-content: center; }
.formcard { width: min(26rem, 100%); padding: 0 1.5rem; }
.formcard--wide { width: min(34rem, 100%); }
.formcard__lead { color: var(--ink-soft); margin: 0.5rem 0 1.75rem; }
.formcard__alt { font-size: var(--step--1); color: var(--ink-soft); margin: 1.5rem 0 0; }
.formcard__fine { font-size: 0.8125rem; color: var(--ink-faint); margin: 0.75rem 0 0; }
.formcard a { color: var(--brand); }

.form { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.field { display: grid; gap: 0.35rem; }
.field__label { font-size: var(--step--1); font-weight: 600; }
.field__hint { font-size: 0.8125rem; color: var(--ink-faint); margin: 0; }

.control {
    font: inherit; font-size: var(--step-0); color: var(--ink);
    background: var(--bg); border: 1px solid var(--line-strong);
    border-radius: 3px; padding: 0.6rem 0.7rem;
    transition: border-color var(--dur) var(--ease);
}
.control:hover { border-color: var(--ink-faint); }

.alert {
    margin: 0; padding: 0.7rem 0.85rem; font-size: var(--step--1);
    color: var(--signal); background: oklch(0.97 0.02 45);
    border: 1px solid var(--signal); border-radius: 3px;
}
.alert--ok { color: var(--brand); background: var(--brand-weak); border-color: var(--brand); }

/* --- account ------------------------------------------------------------- */

.account { display: grid; gap: 0.9rem; margin: 1.5rem 0 2rem; }
.account > div { display: flex; gap: 1rem; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
.account dt { color: var(--ink-soft); font-size: var(--step--1); }
.account dd { margin: 0; font-weight: 500; text-align: right; }

.pill { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.8125rem; font-weight: 600; }
.pill--ok { color: var(--brand); background: var(--brand-weak); }
.pill--warn { color: var(--signal); background: oklch(0.97 0.02 45); }
.pill--off { color: var(--ink-faint); background: var(--tint); }

.account__actions { margin: 1.5rem 0; }
.account__setup { font-size: var(--step--1); color: var(--ink-soft); }
.account__setup code { font-family: var(--mono); font-size: 0.8125rem; }
.account__out { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* --- legal / contact ----------------------------------------------------- */

.legal { max-width: 64ch; }
.legal h2 { font-size: var(--step-1); font-weight: 600; margin: 2rem 0 0.4rem; }
.legal h2:first-child { margin-top: 0; }
.legal p { color: var(--ink-soft); margin: 0 0 0.5rem; }

.contact__mail { font-size: var(--step-2); font-weight: 600; margin: 0 0 1.5rem; }
.contact__mail a { color: var(--brand); text-decoration: none; }
.contact__mail a:hover { text-decoration: underline; }

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

.foot { border-top: 1px solid var(--line); margin-top: 0; padding: 3.5rem 0 0; }

.foot__inner {
    max-width: var(--wrap); margin-inline: auto; padding-inline: 1.5rem;
    display: grid; gap: 2.5rem 3rem;
    grid-template-columns: minmax(16rem, 22rem) 1fr;
    align-items: start;
}

.foot__name { font-weight: 700; letter-spacing: -0.03em; font-size: 1.1875rem; }
.foot__line { color: var(--ink); font-size: var(--step--1); font-weight: 500; margin: 0.4rem 0 0; }
.foot__blurb { color: var(--ink-soft); font-size: var(--step--1); margin: 0.75rem 0 1rem; max-width: 34ch; }
.foot__mail { color: var(--brand); font-size: var(--step--1); text-decoration: none; font-weight: 500; }
.foot__mail:hover { text-decoration: underline; }

.foot__nav {
    display: grid; gap: 2rem 2.5rem;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.foot__nav h2 {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--ink-faint); margin-bottom: 0.7rem; font-weight: 600;
}
.foot__nav a, .foot__item {
    display: block; color: var(--ink-soft); text-decoration: none;
    font-size: var(--step--1); padding: 0.18rem 0;
}
.foot__nav a:hover { color: var(--ink); }

.foot__base {
    max-width: var(--wrap); margin: 3rem auto 0; padding: 1.5rem 1.5rem 2rem;
    border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; justify-content: space-between;
}
.foot__legal { color: var(--ink-soft); font-size: 0.8125rem; margin: 0; }
.foot__note { color: var(--ink-faint); font-size: 0.8125rem; margin: 0; max-width: 52ch; }

@media (max-width: 46rem) {
    .foot__inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Lead-time comparison. Replaces the timeline: it makes the same point about
   how much warning you get, without describing where the warning comes from. */
.lead-time { margin: 2.5rem 0 0; padding: 0; }
.lead-time__row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.lead-time__label { flex: 0 0 11rem; font-size: var(--step--1); font-weight: 600; }
.lead-time__bar {
    display: flex; align-items: center; height: 2.25rem; border-radius: 2px;
    padding: 0 0.75rem; color: oklch(1 0 0); font-size: var(--step--1); font-weight: 600;
    white-space: nowrap;
}
.lead-time__bar--short { background: var(--signal); width: 8%; min-width: 7rem; }
.lead-time__bar--long { background: var(--brand); width: 100%; }
.lead-time figcaption { font-size: 0.8125rem; color: var(--ink-faint); margin-top: 0.75rem; }

@media (max-width: 40rem) {
    .lead-time__row { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
    .lead-time__label { flex: none; }
    .lead-time__bar--short { width: 40%; }
}

.plain { margin: 1.5rem 0 0; padding-left: 1.1rem; max-width: 64ch; }
.plain li { color: var(--ink-soft); margin-bottom: 0.5rem; }

/* --- business case ------------------------------------------------------- */

.calc { border: 1px solid var(--line); border-radius: 4px; margin: 2rem 0; }
.calc__row {
    display: grid; grid-template-columns: 1fr auto minmax(10rem, 14rem);
    gap: 0.5rem 1.5rem; align-items: baseline;
    padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line);
}
.calc__row:last-child { border-bottom: 0; }
.calc__row--strong { background: var(--tint); }
.calc__row--strong .calc__value { color: var(--brand); font-weight: 500; }
.calc__label { font-size: var(--step--1); font-weight: 500; }
.calc__value { font-size: var(--step-1); white-space: nowrap; }
.calc__unit { font-size: 0.8125rem; color: var(--ink-faint); }

@media (max-width: 46rem) {
    .calc__row { grid-template-columns: 1fr auto; }
    .calc__unit { grid-column: 1 / -1; }
}

.facts { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 2rem 0; }
.facts dt { font-size: var(--step--1); color: var(--ink-soft); }
.facts dd { margin: 0.3rem 0 0; font-size: var(--step-2); font-weight: 500; }

.cases { display: grid; gap: 2rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin-top: 2rem; }
.case h3 { font-size: var(--step-1); font-weight: 600; margin-bottom: 0.5rem; }
.case p { color: var(--ink-soft); margin: 0; }

/* --- account settings ---------------------------------------------------- */

.settings { width: min(34rem, 100%); padding: 0 1.5rem; }
.settings > .h2 { margin-bottom: 1.5rem; }

.panel {
    border: 1px solid var(--line); border-radius: 4px;
    padding: 1.5rem; margin-bottom: 1.5rem;
}
.panel__title { font-size: var(--step-1); font-weight: 600; margin: 0 0 1rem; }
.panel__note { font-size: var(--step--1); color: var(--ink-soft); margin: 0 0 1rem; }
.panel__note code { font-family: var(--mono); font-size: 0.8125rem; }
.panel__note a { color: var(--brand); }
.panel__actions { margin-top: 1.25rem; }
.panel .form { margin-top: 0; }

/* Destructive actions look different from everything else, and the button
   says what it deletes rather than "OK". */
.panel--danger { border-color: var(--signal); }
.panel--danger .panel__title { color: var(--signal); }

.btn--danger { background: var(--signal); color: oklch(1 0 0); }
.btn--danger:hover { background: oklch(0.44 0.15 45); }

.settings__out { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

.switch {
    display: flex; align-items: flex-start; gap: 0.6rem;
    font-size: var(--step--1); cursor: pointer; line-height: 1.4;
}
.switch input { margin: 0.2rem 0 0; accent-color: var(--brand); cursor: pointer; flex: none; }


/* Swedish groups thousands with a non-breaking space. In a monospace face that
   space is a full character wide, so "6 137" reads as two numbers rather than
   one. Tightening word-spacing on figures fixes it without changing the font
   or the locale formatting. */
.mono, .hero__stats dd, .price__amount, .close__price, .calc__value {
    word-spacing: -0.35em;
}

/* ...but only the figure. These elements also contain ordinary words ("/ mån",
   "exkl. moms"), and squeezing those runs them into the number. */
.price__amount span, .close__price span, .calc__unit, .calc__label {
    word-spacing: normal;
}


/* Reserve the scrollbar gutter on every page, scrolling or not.
   Without it a short page (login, kontakt, a filtered-to-nothing list) has no
   scrollbar, so the viewport is ~15px wider and every centred container shifts
   right by half that. Navigating between a long page and a short one makes the
   whole layout jump sideways. */
html { scrollbar-gutter: stable; }
