/* FreeTabs, V1: a clear sky. Sky blues, pale pastel fields, one warm grotesque, and a tab silhouette as the only ornament.
   The product's paper appears only inside its own windows. */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/assets/worlds/fonts/schibsted-grotesk-latin-wght.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --sky: #bcd8f4;
  --sky-2: #d4e6f8;
  --air: #e6f0fb;
  --cloud: #fbfdff;
  --ink: #16355c;
  --ink-2: #33557e;
  --sun: #fdf5d9;
  --dawn: #fdeae1;
  --meadow: #e2f3e8;
  --lilac: #ebe8fb;
  --paper: #ebe6de;
  --gutter: clamp(20px, 5vw, 80px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow: 0 2px 6px rgb(46 96 158 / 0.08), 0 30px 80px -24px rgb(46 96 158 / 0.34);
}

html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 420;
  /* The sky: exactly the world's colour for the whole hero, paling as you go down, and blue again before the last tab. */
  background:
    linear-gradient(180deg,
      var(--sky) 0, var(--sky) 230vh,
      var(--air) 330vh,
      var(--air) calc(100% - 120vh),
      var(--sky) calc(100% - 30vh));
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* One calm scale: the headline, a section title, the text, a quiet note. Nothing shouts. */
h1, h2, h3 { font-weight: 560; letter-spacing: -0.028em; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2rem, 3.6vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
p { text-wrap: pretty; }

/* ---------- Top ---------- */
.ft-top {
  position: absolute; z-index: 5; inset: 0 0 auto 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 14px var(--gutter);
  font-size: 16px; font-weight: 520;
}
.ft-top .world-exit { justify-self: start; }
.ft-top .world-lang { justify-self: end; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: flex-end; }
.ft-brand { display: inline-flex; align-items: center; gap: 9px; letter-spacing: -0.015em; font-size: 17px; font-weight: 600; }
.ft-logo { width: 24px; height: 24px; flex: none; }
.ft-logo rect { fill: var(--ink); }
.ft-logo path { fill: none; stroke: var(--sky); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Hero: the same layout with or without JS at the top of the page. world.js adds .is-staged. ---------- */
.ft-hero { position: relative; }
.ft-hero__pin { position: relative; padding: clamp(120px, 19vh, 190px) var(--gutter) 0; }
.ft-sky { display: none; }
.ft-hero__copy { position: relative; z-index: 2; text-align: center; }
.ft-n { font-variant-numeric: tabular-nums; display: inline-block; }
.ft-hero__sub { display: flex; flex-direction: column; align-items: center; margin-top: 16px; }
.ft-lead { font-size: clamp(1.06rem, 1.4vw, 1.22rem); line-height: 1.45; color: var(--ink-2); max-width: 34em; text-wrap: balance; }
.ft-hero__sub .ft-tab { margin-top: clamp(26px, 4vh, 36px); }
.ft-note { margin-top: 12px; font-size: 15px; color: var(--ink-2); }

/* The call to action is a tab. */
.ft-tab {
  position: relative; display: inline-flex; align-items: center;
  min-height: 52px; padding: 0 26px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 580; font-size: 17px; letter-spacing: -0.01em;
  border-radius: 16px 16px 0 0;
  transition: transform 180ms var(--ease-out);
}
.ft-tab::before, .ft-tab::after {
  content: ''; position: absolute; bottom: 0; width: 16px; height: 16px; pointer-events: none;
}
.ft-tab::before { left: -16px; background: radial-gradient(circle at 0 0, transparent 15.5px, var(--ink) 16px); }
.ft-tab::after { right: -16px; background: radial-gradient(circle at 100% 0, transparent 15.5px, var(--ink) 16px); }
.ft-tab:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) {
  .ft-tab:hover { transform: translateY(-2px); }
}
.ft-tab:focus-visible { outline-offset: 4px; border-radius: 16px 16px 0 0; }

/* The soft window */
.ft-window { position: relative; z-index: 3; max-width: 1120px; margin: clamp(44px, 7vh, 72px) auto 0; transform-origin: 50% 0; }
.ft-window__float { background: var(--sky-2); border-radius: 22px; box-shadow: var(--shadow), inset 0 0 0 1px rgb(255 255 255 / 0.55); overflow: hidden; }
.ft-window__bar { display: flex; align-items: flex-end; gap: 14px; height: clamp(38px, 3.4vw, 46px); padding: 0 18px 0 18px; }
.ft-dots { display: flex; gap: 7px; align-self: center; flex: none; }
.ft-dots i { width: 11px; height: 11px; border-radius: 50%; background: rgb(22 53 92 / 0.16); }
.ft-strip { position: relative; flex: 1; align-self: stretch; min-width: 0; display: flex; align-items: flex-end; padding-top: 8px; }
.ft-strip canvas { display: none; position: absolute; inset: 0; width: 100%; height: 100%; }
.ft-onetab {
  display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 26px 0 16px;
  background: var(--paper); border-radius: 13px 13px 0 0; font-size: 14.5px; font-weight: 560; color: #2a2520;
}
.ft-onetab .ft-logo { width: 17px; height: 17px; }
.ft-onetab .ft-logo rect { fill: #2a2520; }
.ft-onetab .ft-logo path { stroke: #ede8df; }
.ft-window__clip { width: 100%; background: var(--paper); aspect-ratio: 1280 / 496; }

/* Staged by world.js: the hero is pinned while the window rises and the tabs leave. */
.ft-hero.is-staged { height: calc(100svh + var(--travel, 190vh)); }
.is-staged .ft-hero__pin { position: sticky; top: 0; height: 100svh; overflow: clip; }
.is-staged .ft-sky { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.is-staged .ft-strip canvas { display: block; }
.is-staged .ft-onetab { display: none; }
.is-staged .ft-hero__sub[data-gone] { pointer-events: none; }
.is-staged .ft-window { will-change: transform; }
.is-staged h1 { will-change: transform; }

/* Arrival: you fall in, and the sky catches you. */
@keyframes ft-land { from { opacity: 0; transform: translateY(12vh); } }
@keyframes ft-rise { from { opacity: 0.4; transform: translateY(24vh); } }
@keyframes ft-fade { from { opacity: 0; } }
html.is-arriving body { animation: none; }
html.is-arriving .ft-hero__copy { animation: ft-land 1050ms var(--ease-out) 40ms both; }
html.is-arriving .ft-window__float { animation: ft-rise 1400ms var(--ease-out) 40ms both; }
html.is-arriving .ft-top { animation: ft-fade 700ms ease 360ms both; }

/* ---------- The parts: a title, one sentence, one thing to look at ---------- */
.ft-part { padding: clamp(84px, 15vh, 150px) var(--gutter) 0; text-align: center; }
.ft-part__text { margin: 12px auto 0; max-width: 34em; text-wrap: balance; font-size: clamp(1.06rem, 1.4vw, 1.22rem); line-height: 1.45; color: var(--ink-2); }
.ft-part__foot { margin: 22px auto 0; max-width: 36em; text-wrap: balance; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.ft-part a { text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgb(22 53 92 / 0.4); transition: text-decoration-color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .ft-part a:hover { text-decoration-color: currentColor; } }

.ft-field { max-width: 720px; margin: clamp(32px, 5vh, 48px) auto 0; border-radius: clamp(24px, 3vw, 36px); padding: clamp(24px, 4.4vw, 52px); }
.ft-field--sun { background: var(--sun); }
.ft-field--dawn { background: var(--dawn); }
.ft-field--lilac { background: var(--lilac); }

.ft-shot { width: 100%; border-radius: clamp(10px, 1.2vw, 16px); box-shadow: 0 1px 3px rgb(46 96 158 / 0.1), 0 24px 60px -24px rgb(120 60 40 / 0.35); background: var(--paper); }

/* Undo: the one promise you can press. The tabs come back out of the folder to the places they left. */
.ft-undo { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.ft-undo__row { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 2vw, 24px); min-height: 48px; }
.ft-undo__tabs { display: flex; gap: 5px; }
.ft-undo__tabs i { position: relative; width: clamp(17px, 3.4vw, 34px); height: 22px; border-radius: 7px 7px 0 0; background: rgb(255 255 255 / 0.55); }
.ft-undo__tabs i::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: #fff; box-shadow: 0 8px 18px -10px rgb(120 96 20 / 0.5); opacity: 0; transform: translateX(var(--to, -60px)) scale(0.7); transition: transform 320ms var(--ease-out), opacity 220ms ease; transition-delay: calc(var(--i, 0) * 30ms); }
.ft-undo.is-undone .ft-undo__tabs i::after { opacity: 1; transform: none; }
.ft-undo__folder { display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px 10px 14px; background: #fff; border-radius: 14px; font-size: 16px; font-weight: 560; letter-spacing: -0.012em; box-shadow: 0 10px 24px -14px rgb(120 96 20 / 0.45); white-space: nowrap; }
.ft-undo__folder b { width: 10px; height: 10px; border-radius: 50%; background: #6d8fbd; }
.ft-undo__folder em { font-style: normal; font-weight: 420; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-left: 8px; }
.ft-toast { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; padding: 8px 10px 8px 20px; background: var(--ink); color: #fff; border-radius: 24px; font-size: 16px; }
.ft-toast__btn { font: inherit; font-weight: 580; color: var(--ink); background: #fff; border: 0; border-radius: 16px; padding: 6px 15px; min-height: 36px; cursor: pointer; transition: transform 140ms var(--ease-out); }
.ft-toast__btn:active { transform: scale(0.96); }
.ft-toast__btn:focus-visible { outline-color: #fff; }

/* Chat: what you would type to your AI, and what the board says back. */
.ft-chat { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 480px; margin: 0 auto; text-align: left; }
.ft-chat li { max-width: 86%; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 20px 20px 6px 20px; font-size: 16.5px; line-height: 1.38; }
.ft-chat li.ft-chat__done { align-self: flex-start; max-width: 100%; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 14px; padding: 9px 10px 9px 14px; background: #fff; color: var(--ink); border-radius: 20px 20px 20px 6px; font-size: 15.5px; }
.ft-chat__done i { width: 8px; height: 8px; border-radius: 50%; background: #5fb98a; flex: none; }
.ft-chat__done span { padding: 3px 12px; border-radius: 12px; background: var(--air); font-weight: 560; font-size: 14.5px; }

/* ---------- FAQ ---------- */
.ft-faq__list { margin: clamp(28px, 4vh, 40px) auto 0; max-width: 680px; text-align: left; }
.ft-faq details { border-top: 1px solid rgb(22 53 92 / 0.16); }
.ft-faq details:last-child { border-bottom: 1px solid rgb(22 53 92 / 0.16); }
.ft-faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 60px; padding: 14px 0; }
.ft-faq summary::-webkit-details-marker { display: none; }
.ft-faq summary h3 { font-size: 18px; line-height: 1.3; letter-spacing: -0.012em; font-weight: 540; text-wrap: pretty; }
.ft-faq summary::after { content: ''; flex: none; width: 13px; height: 13px; background: linear-gradient(var(--ink), var(--ink)) center / 100% 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.5px 100% no-repeat; transition: transform 200ms var(--ease-out); }
.ft-faq details[open] summary::after { transform: rotate(45deg); }
.ft-faq details p { padding: 0 0 20px; max-width: 36em; font-size: 17px; color: var(--ink-2); }
/* the answer unfolds where the browser can animate to auto height, and simply appears elsewhere */
@supports (interpolate-size: allow-keywords) {
  .ft-faq { interpolate-size: allow-keywords; }
  .ft-faq details::details-content { height: 0; overflow: clip; transition: height 240ms var(--ease-out), content-visibility 240ms allow-discrete; }
  .ft-faq details[open]::details-content { height: auto; }
  @media (prefers-reduced-motion: reduce) { .ft-faq details::details-content { transition: none; } }
}

/* ---------- The last tab: the page ends on one tab and one clean window ---------- */
.ft-last { position: relative; margin-top: clamp(100px, 18vh, 180px); }
.ft-last__tab {
  position: relative; width: min(760px, calc(100% - 2 * var(--gutter) - 48px)); margin: 0 auto;
  background: #fff; border-radius: clamp(28px, 3.4vw, 44px) clamp(28px, 3.4vw, 44px) 0 0;
  padding: clamp(48px, 9vh, 84px) clamp(20px, 5vw, 64px) clamp(36px, 6vh, 56px);
  text-align: center;
}
.ft-last__tab::before, .ft-last__tab::after { content: ''; position: absolute; bottom: 0; width: 24px; height: 24px; }
.ft-last__tab::before { left: -24px; background: radial-gradient(circle at 0 0, transparent 23.5px, #fff 24px); }
.ft-last__tab::after { right: -24px; background: radial-gradient(circle at 100% 0, transparent 23.5px, #fff 24px); }
.ft-last__lead { margin: 12px auto clamp(26px, 4vh, 36px); font-size: clamp(1.06rem, 1.4vw, 1.22rem); line-height: 1.45; color: var(--ink-2); }
.ft-last__thanks { background: #fff; padding: clamp(28px, 5vh, 48px) var(--gutter) clamp(28px, 5vh, 48px); text-align: center; color: var(--ink-2); font-size: 15px; }

.world-colophon { background: #fff; color: var(--ink-2); padding: 0 var(--gutter) 30px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 15px; }
.world-colophon p { margin: 0; max-width: none; }
.world-colophon a { min-height: 44px; display: inline-flex; align-items: center; text-underline-offset: 3px; }
.world-colophon p a { display: inline; min-height: 0; }
.world-colophon p { align-self: center; }

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  body { font-size: 17px; }
  .world-colophon { flex-direction: column; }
}
@media (max-width: 480px) {
  .ft-hero__pin { padding-top: 112px; }
  .ft-window__float { border-radius: 16px; }
  .ft-window__bar { padding: 0 10px; gap: 8px; }
  .ft-dots i { width: 7px; height: 7px; }
  .ft-dots { gap: 4px; }
  .ft-last__tab { width: calc(100% - 2 * 24px - 2 * 20px); }
  .ft-undo__row { flex-wrap: wrap; }
  .ft-undo__tabs i { height: 18px; border-radius: 5px 5px 0 0; }
  .ft-undo__tabs { gap: 3px; }
  .ft-toast { font-size: 15px; }
  .ft-chat li { max-width: 92%; font-size: 16px; }
}

/* Fewer, gentler movements: no stage (world.js stands down), and the arrival is a short fade. */
@media (prefers-reduced-motion: reduce) {
  html.is-arriving .ft-hero__copy, html.is-arriving .ft-window__float { animation: ft-fade 240ms ease both; }
  html.is-arriving .ft-top { animation: none; }
  .ft-undo__tabs i::after, .ft-tab, .ft-faq summary::after { transition: none; }
}
