/* Bjole portfolio — shared design tokens, type and layout.
   Written mobile-first: base rules target a ~375px phone, min-width
   layers add the desktop composition (pinned sections, tilt, detail card). */

:root {
  --paper: #F1F2F4;
  --paper-2: #E7E9EC;
  --ink: #15181D;
  --ink-2: #3A404A;
  --muted: #6B7380;
  --line: #D5D9DF;
  --frame: #FFFFFF;
  --frame-line: #C9CED6;
  --shadow: 0 30px 80px -20px rgba(21, 24, 29, 0.28), 0 8px 24px -8px rgba(21, 24, 29, 0.12);
  --accent: #2B4C7E;
  --accent-2: #5E8FE0;

  --skanr: #1FB975;
  --numra: #2563EB;
  --kludda: #C2562E;
  --likna: #E8A93A;
  --loppis: #C9832F;
  --fluster: #B84FD6;

  --display: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Geist', 'Inter', system-ui, sans-serif;
  --mono: 'Geist Mono', 'SF Mono', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1013;
    --paper-2: #14171C;
    --ink: #ECEEF1;
    --ink-2: #B9C0CA;
    --muted: #8A929E;
    --line: #262B33;
    --frame: #1A1E25;
    --frame-line: #2E343D;
    --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --accent: #8FB0E6;
    --accent-2: #D6E4FF;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { display: block; max-width: 100%; }

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  color: var(--ink);
  /* Solid strip so content scrolling under the logo is hidden, not overlapped. */
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  pointer-events: none;
}
.bar a { pointer-events: auto; }
.bar__logo { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; font-size: 1.1rem; }

@media (prefers-reduced-motion: no-preference) {
  body.home .bar { opacity: 0; transition: opacity 0.2s; }
  body.home .bar:has(.bar__logo.is-visible) { opacity: 1; }
}

/* ---------- intro ---------- */
.intro {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 5rem;
}
/* Sticky full-bleed strip in the page colour: intro text scrolling underneath
   is hidden rather than overlapped while the brand shrinks. Only the inner
   link is transformed by the script. */
.intro__brand {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 1;
  position: sticky;
  top: 0;
  z-index: 51;
  margin: 0 calc(-1 * clamp(1.25rem, 4vw, 3rem));
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem) 0.6rem;
  background: var(--paper);
}
.intro__brand a { display: inline-block; transform-origin: 0 0; will-change: transform; }
.intro__bottom {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
.intro__lede {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 16ch;
}
.intro__lede em, .outro__lede em {
  font-style: normal; font-weight: 700;
  color: var(--accent);
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro__meta {
  display: grid; gap: 1.25rem;
  max-width: 44ch;
  color: var(--ink-2);
}
.intro__meta p { font-size: 1.05rem; }

.index { border-top: 1px solid var(--line); }
.index a {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
  transition: padding-left 0.25s ease;
}
.index__name { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; }
.index__what { color: var(--muted); font-size: 0.95rem; }
.index__dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 0.6rem; flex: 0 0 auto; }

@media (min-width: 480px) {
  .index a { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; }
}
@media (max-width: 379px) {
  .index a .mono { display: none; }
}
@media (min-width: 900px) {
  .intro__bottom { grid-template-columns: 7fr 5fr; align-items: end; }
  .index a {
    display: grid; grid-template-columns: 9rem 1fr auto; align-items: baseline; gap: 1rem;
    padding: 0.85rem 0;
  }
  .index a:hover { padding-left: 0.5rem; }
}

/* ---------- case sections ---------- */
.case { position: relative; }
.case__pin {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2rem;
  padding: 6rem clamp(1.25rem, 4vw, 3rem);
}
.case__tint {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at var(--tx, 70%) 50%, color-mix(in oklab, var(--c) 22%, transparent), transparent 70%);
}
.case__text { position: relative; z-index: 2; display: grid; gap: 1.1rem; max-width: 34rem; }
.case__kicker { display: flex; gap: 1rem; align-items: center; }
.case__kicker .swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.case__name {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(2.2rem, 4.5vw, 4rem); line-height: 1;
}
.case__tag {
  font-family: var(--display); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem); line-height: 1.25; color: var(--ink-2);
  text-wrap: balance;
}
.case__desc { color: var(--muted); max-width: 40ch; }
.case__facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.25rem; margin-top: 0.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.case__facts dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 0.2rem; }
.case__facts dd { font-size: 0.92rem; color: var(--ink-2); }
.case__link {
  display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem;
  font-weight: 500; font-size: 0.95rem;
  border-bottom: 1px solid var(--ink); padding-bottom: 2px; width: max-content;
}
.case__link svg { transition: transform 0.25s ease; }
.case__link:hover svg { transform: translate(3px, -3px); }

.stage {
  position: relative; z-index: 1;
  height: auto; margin-top: 1rem;
  display: grid; place-items: center;
}
.frame {
  position: relative;
  width: 100%; aspect-ratio: 4 / 5;
  background: var(--frame);
  border: 1px solid var(--frame-line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}
.frame__chrome {
  height: 34px; display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--frame-line);
  background: var(--paper-2);
}
.frame__url {
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
  background: var(--paper); border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 10px; letter-spacing: 0.01em;
}
.frame__view { position: absolute; inset: 34px 0 0 0; overflow: hidden; }
.frame__view img { width: 100%; height: auto; will-change: transform; }

.detail {
  display: none;
  position: absolute; z-index: 3;
  width: clamp(150px, 26%, 220px); aspect-ratio: 4 / 5;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--frame-line);
  box-shadow: var(--shadow);
  background: var(--frame);
  will-change: transform;
}
.detail img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.detail--right { right: -4%; bottom: 8%; }
.detail--left { left: -4%; bottom: 10%; }

.case[data-side="right"] .case__pin { --tx: 70%; }
.case[data-side="left"]  .case__pin { --tx: 30%; }

@media (min-width: 900px) {
  .case { height: 190vh; }
  .case__pin {
    position: sticky; top: 0; height: 100vh; overflow: hidden;
    grid-template-columns: 5fr 7fr; gap: clamp(2rem, 5vw, 6rem);
    padding: 0 clamp(1.25rem, 4vw, 3rem);
  }
  .case[data-side="left"] .case__text { order: 2; }
  .case[data-side="left"] .stage { order: 1; }

  .stage { height: min(78vh, 720px); perspective: 1600px; perspective-origin: 50% 40%; }
  .frame { width: min(100%, 560px); aspect-ratio: 10 / 11; }
  .detail { display: block; }
}

/* ---------- outro ---------- */
.outro {
  padding: 10rem clamp(1.25rem, 4vw, 3rem) 4rem;
  display: grid; gap: 4rem;
  border-top: 1px solid var(--line);
}
.outro__lede {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(2rem, 4.5vw, 4rem); line-height: 1; max-width: 18ch; text-wrap: balance;
}
.outro__cols { display: grid; gap: 2.5rem; }
.outro__contact { display: grid; gap: 0.4rem; font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; }
.outro__contact a { border-bottom: 1px solid transparent; width: max-content; transition: border-color 0.2s; }
.outro__contact a:hover { border-color: var(--ink); }
.foot { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.foot nav { display: flex; gap: 1.25rem; }
.foot a:hover { color: var(--ink); }
@media (min-width: 900px) {
  .outro { grid-template-columns: 7fr 5fr; align-items: start; }
  .outro .foot { grid-column: 1 / -1; }
}

/* ---------- motion defaults (no-JS + reduced motion are the static state) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame, .frame__view img, .detail { transform: none !important; }
}

/* ================================================================
   Legal pages (terms, policy, likna/terms, likna/privacy)
   Shared header/footer + tokens, ~65ch readable column.
   ================================================================ */
.legal {
  max-width: 65ch;
  margin: 0 auto;
  padding: 8rem clamp(1.25rem, 4vw, 3rem) 0;
  display: grid;
  gap: 1.5rem;
}
.legal__back { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); width: max-content; }
.legal__back:hover { color: var(--ink); }
.legal__title {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1;
}
.legal__updated { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.legal__intro { color: var(--ink-2); max-width: 60ch; }

.legal__list { list-style: none; display: grid; gap: 0.85rem; font-size: 1.05rem; }
.legal__list a { font-weight: 600; border-bottom: 1px solid var(--ink); padding-bottom: 1px; }
.legal__extra { color: var(--muted); font-size: 0.85rem; }
.legal__extra a { color: var(--muted); font-weight: 400; border-bottom: none; }

.legal__section { display: grid; gap: 0.6rem; }
.legal__section h2 { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.legal__section p, .legal__section li { color: var(--ink-2); line-height: 1.65; }
.legal__section ul { padding-left: 1.25rem; display: grid; gap: 0.4rem; }

.legal__company { margin-top: 0.5rem; color: var(--muted); font-size: 0.85rem; }
.legal__company a { color: var(--muted); text-decoration: underline; }

.legal-foot {
  max-width: 65ch;
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 4vw, 3rem) 4rem;
}

/* ================================================================
   404
   ================================================================ */
.notfound {
  min-height: 92vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.25rem;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  max-width: 40rem;
  margin: 0 auto;
}
.notfound__code { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.notfound__title {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1;
}
.notfound__back { font-weight: 500; border-bottom: 1px solid var(--ink); padding-bottom: 2px; width: max-content; }
