/* Tamsby v4: bright editorial. One grid, one left edge. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3efe6;
  --card: #fffdf8;
  --ink: #1a1915;
  --ink-2: #57534a;
  --rule-soft: #d6d0c2;
  --accent: #1f3fc9;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --max: 1200px;
  --gutter: clamp(20px, 5vw, 72px);
  --gap: 24px;
  --sect: clamp(72px, 9vw, 136px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(17px, 1.05rem + 0.2vw, 19px);
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first last;
}
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- grid ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.grid > * { grid-column: 1 / -1; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); text-wrap: balance; }
h1 {
  font-size: clamp(46px, 2.6rem + 4vw, 100px);
  line-height: 0.98;
  letter-spacing: -0.022em;
  font-variation-settings: "opsz" 72;
}
h2 {
  font-size: clamp(38px, 1.9rem + 2.6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  font-variation-settings: "opsz" 72;
}
h3 {
  font-size: clamp(23px, 1.3rem + 0.4vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 36;
}
p, dd { text-wrap: pretty; }
.small { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.num { font-variant-numeric: lining-nums; }
.plan__price { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent); border-radius: 2px;
  font: 600 17px/1 var(--sans); letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 15px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.top__in { display: flex; align-items: center; gap: 36px; min-height: 68px; }
.wordmark {
  font-family: var(--serif); font-size: 29px; line-height: 1; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 48; text-decoration: none; margin-right: auto;
}
.top__nav { display: flex; gap: 32px; font-size: 16px; }
.top__nav a { text-decoration: none; }
.top__nav a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* ---------- hero ---------- */
.hero { overflow-x: clip; padding-block: clamp(56px, 7vw, 104px) var(--sect); row-gap: 56px; align-items: end; }
.hero__text { grid-column: 1 / span 7; }
.hero h1 { max-width: 12.5ch; }
.lede { margin-top: 32px; max-width: 34em; font-size: clamp(19px, 1.1rem + 0.25vw, 21px); line-height: 1.5; }
.hero__act { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.hero__act .small { max-width: 22em; }

.hero__card { grid-column: 8 / span 5; align-self: center; margin-top: 40px; }
.card {
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 26px 28px 30px;
  transform: rotate(-1.4deg);
  transform-origin: 50% 100%;
}

/* Stack of example cards. All cards share one grid cell, so the stack is as tall
   as the tallest card and never shifts the layout. The static order (no JS) is
   front card, two cards peeking behind, fourth hidden. JS moves the p0–p3 classes. */
.stack { display: grid; isolation: isolate; }
.stack .card { grid-area: 1 / 1; }
/* static order (no JS): by position in the HTML */
.stack .card:nth-child(1) { z-index: 4; transform: rotate(-1.4deg); }
.stack .card:nth-child(2) { z-index: 3; transform: translate(6px, -12px) rotate(1.5deg); }
.stack .card:nth-child(3) { z-index: 2; transform: translate(-12px, -20px) rotate(-3.2deg); }
.stack .card:nth-child(4) { z-index: 1; transform: translate(-12px, -20px) rotate(-3.2deg); opacity: 0; }
/* live order (JS): by class, which wins over the static order */
.stack.live .card.p0 { z-index: 4; transform: rotate(-1.4deg); opacity: 1; }
.stack.live .card.p1 { z-index: 3; transform: translate(6px, -12px) rotate(1.5deg); opacity: 1; }
.stack.live .card.p2 { z-index: 2; transform: translate(-12px, -20px) rotate(-3.2deg); opacity: 1; }
.stack.live .card.p3 { z-index: 1; transform: translate(-12px, -20px) rotate(-3.2deg); opacity: 0; }
/* the front card lifts away up and to the left, then rejoins the back of the stack */
.stack.live .card.out { z-index: 5; transform: translate(-80px, -56px) rotate(-7deg) scale(1.02); opacity: 0; }
.stack .card.moving { transition: transform 850ms cubic-bezier(.2, .7, .2, 1) 120ms, opacity 850ms cubic-bezier(.2, .7, .2, 1) 120ms; }
/* the leaving card clears quickly, so two faces never read on top of each other */
.stack .card.out.moving { transition: transform 850ms cubic-bezier(.4, 0, .2, 1), opacity 320ms ease-out; }
/* cards behind the front one are blank, so the front card reads first */
.stack .card > * { transition: opacity 500ms ease; }
.stack .card:not(:first-child) > *, .stack.live .card.p1 > *, .stack.live .card.p2 > *, .stack.live .card.p3 > * { opacity: 0; transition-delay: 0ms; }
.stack.live .card.p0 > * { opacity: 1; transition-delay: 450ms; }
.stack.live .card.out > * { opacity: 1; transition-delay: 0ms; }
.card p { border-bottom: 1px solid var(--rule-soft); padding: 9px 0 8px; font-size: 16px; line-height: 1.4; }
.card .card__firm {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  font-family: var(--serif); font-size: 30px; line-height: 1.1; letter-spacing: -0.01em;
  font-variation-settings: "opsz" 48;
  padding: 0 0 14px; border-bottom: 2px solid var(--ink);
}
.card__town, .card__pay { font-family: var(--sans); font-size: 15px; color: var(--ink-2); letter-spacing: 0; white-space: nowrap; }
.card__role { display: flex; justify-content: space-between; gap: 16px; margin-top: 6px; }
.card__pay { color: var(--ink); font-variant-numeric: lining-nums; }
.card__who { font-weight: 600; }
.card .card__open {
  font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.35;
  font-variation-settings: "opsz" 24;
  border-bottom: 0; padding-top: 14px; text-indent: -0.4em;
}
.hero__card figcaption { margin-top: 18px; }

/* ---------- sections ---------- */
.sect { padding-block: var(--sect); position: relative; }
/* section rules sit inside the gutters, on the text edge */
.sect::before, .foot::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--ink);
}
.sect__title { grid-column: 1 / span 8; margin-bottom: clamp(36px, 4.5vw, 64px); }

.prose { grid-column: 1 / span 6; display: grid; gap: 1.1em; max-width: 36em; font-size: clamp(19px, 1.1rem + 0.25vw, 21px); line-height: 1.55; }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); }
.steps li { padding-right: 24px; }
.steps__n {
  display: block; font-family: var(--serif); color: var(--accent);
  font-size: clamp(72px, 3rem + 4vw, 120px); line-height: 0.8; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 72; font-variant-numeric: lining-nums;
  margin-bottom: 28px;
}
.steps h3 { margin-bottom: 12px; }
.steps p { max-width: 26em; }

/* every lead comes with */
.rows { border-top: 1px solid var(--ink); }
.rows > div {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  padding: 20px 0 21px; border-bottom: 1px solid var(--rule-soft);
}
.rows dt { grid-column: 1 / span 4; font-weight: 600; }
.rows dd { grid-column: 5 / span 7; max-width: 36em; }
.rows .quote { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.35; text-indent: -0.4em; }
.rows .mail { overflow-wrap: anywhere; }
.rows__note { grid-column: 5 / span 7; margin-top: 24px; }

/* pricing */
.plans {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap);
  border-top: 1px solid var(--ink);
}
.plan {
  position: relative;
  padding: 28px 24px 8px 0;
  display: flex; flex-direction: column; gap: 14px;
}
/* vertical rules sit in the middle of the gutter, so text keeps the grid edge */
.plan + .plan::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gap) / -2);
  border-left: 1px solid var(--rule-soft);
}
/* the free sample leads: a heavier rule over its column */
.plan--lead::after {
  content: ""; position: absolute; top: -1px; left: 0; right: calc(var(--gap) / -2);
  border-top: 4px solid var(--ink);
}
.plan h3 { font-size: 23px; }
.plan__price {
  font-family: var(--serif); font-size: clamp(52px, 2.6rem + 2vw, 76px); line-height: 1;
  letter-spacing: -0.02em; font-variation-settings: "opsz" 72;
  margin-block: 2px 6px;
}
.plan__price span { font-family: var(--sans); font-size: 17px; letter-spacing: 0; color: var(--ink-2); }
.plan p:not(.plan__price) { max-width: 22em; }
.plan .btn { margin-top: 12px; align-self: flex-start; }
.plans__note { margin-top: 48px; max-width: 36em; }

/* questions */
.faq { border-top: 1px solid var(--ink); }
.faq > div {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  padding: 26px 0 28px; border-bottom: 1px solid var(--rule-soft);
}
.faq dt {
  grid-column: 1 / span 4; font-family: var(--serif); font-size: 23px; line-height: 1.25;
  font-variation-settings: "opsz" 36; padding-right: 16px;
}
.faq dd { grid-column: 5 / span 7; max-width: 36em; }

/* final call */
.sect--cta .sect__title { grid-column: 1 / span 9; }
.form {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 28px;
}
.field { grid-column: span 4; display: flex; flex-direction: column; gap: 10px; }
.field label { font-weight: 600; font-size: 16px; }
.opt { font-weight: 400; color: var(--ink-2); }
.field input, .field select {
  font: 400 18px/1.3 var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid var(--ink); border-radius: 0;
  height: 54px; padding: 0 14px; width: 100%;
  -webkit-appearance: none; appearance: none;
}
.field select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231a1915' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.field input::placeholder { color: #6f6a5f; }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form__act { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 8px; }

/* footer */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  padding-block: 28px 40px; position: relative;
  font-size: 15px; color: var(--ink-2);
}
.foot ul { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot a { color: var(--ink); }

/* ---------- legal pages ---------- */
.doc { padding-block: clamp(56px, 7vw, 104px) var(--sect); }
.doc__head { grid-column: 1 / span 8; padding-bottom: 40px; margin-bottom: 8px; }
.doc__head h1 { font-size: clamp(48px, 3rem + 3vw, 88px); }
.doc__lede { margin-top: 24px; font-size: clamp(19px, 1.1rem + 0.25vw, 21px); max-width: 34em; }
.doc__updated { margin-top: 16px; }
.doc__body { grid-column: 1 / span 7; max-width: 38em; border-top: 1px solid var(--ink); padding-top: 8px; }
.doc__body h2 { font-size: clamp(26px, 1.4rem + 0.6vw, 32px); line-height: 1.15; margin: 48px 0 14px; }
.doc__body p, .doc__body ul { margin-bottom: 1em; }
.doc__body ul { list-style: disc; padding-left: 1.2em; }
.doc__body li { margin-bottom: 0.4em; }
.doc__body li::marker { color: var(--ink-2); }

/* ---------- load ---------- */
/* All of this runs only when <html> has .motion: JS is on and motion is allowed. */
:root { --ease: cubic-bezier(.2, .7, .2, 1); }

/* hero: headline lines rise one after another, then the lede, button and stack */
.motion .h1-line { display: inline-block; opacity: 0; transform: translateY(0.28em); }
.motion .hero.go .h1-line {
  opacity: 1; transform: none;
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
  transition-delay: calc(var(--i) * 110ms);
}
.motion .hero .lede, .motion .hero__act, .motion .hero__card { opacity: 0; transform: translateY(18px); }
.motion .hero.go .lede, .motion .hero.go .hero__act, .motion .hero.go .hero__card {
  opacity: 1; transform: none;
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}
.motion .hero.go .lede { transition-delay: 380ms; }
.motion .hero.go .hero__act { transition-delay: 480ms; }
.motion .hero.go .hero__card { transition-delay: 300ms; }

/* sections: blocks rise and fade in once, as they enter the view */
.motion [data-reveal] { opacity: 0; transform: translateY(20px); }
.motion [data-reveal].in {
  opacity: 1; transform: none;
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
/* section rules draw from left to right */
.motion .sect::before, .motion .foot::before { transform: scaleX(0); transform-origin: 0 50%; }
.motion .sect.in::before, .motion .foot.in::before { transform: scaleX(1); transition: transform 1200ms var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  /* no stack movement: show the front card only */
  .stack .card:not(:first-child) { display: none; }
}

/* ---------- tablet ---------- */
@media (max-width: 1040px) {
  .hero__text { grid-column: 1 / -1; }
  .hero h1 { max-width: 13ch; }
  .hero__card { grid-column: 1 / span 9; max-width: 560px; }
  .top__nav { gap: 22px; }
}
@media (max-width: 860px) {
  .top__nav { display: none; }
  .steps { grid-template-columns: 1fr; row-gap: 48px; }
  .steps li { padding-right: 0; }
  .steps__n { font-size: 80px; margin-bottom: 20px; }
  .plans { grid-template-columns: 1fr; }
  .plans { border-top: 0; }
  .plan { padding: 28px 0 32px; border-top: 1px solid var(--ink); }
  .plan + .plan::before { display: none; }
  .plan--lead { border-top: 0; }
  .plan--lead::after { right: 0; }
  .plans__note { margin-top: 24px; }
  .rows > div, .faq > div { display: block; }
  .rows dt { margin-bottom: 4px; }
  .faq dt { margin-bottom: 10px; padding-right: 0; }
  .rows__note { grid-column: 1 / -1; }
  .field { grid-column: 1 / -1; }
  .sect__title, .sect--cta .sect__title, .prose, .doc__head, .doc__body { grid-column: 1 / -1; }
}

/* ---------- phone ---------- */
@media (max-width: 560px) {
  .top__in { min-height: 60px; gap: 16px; }
  .wordmark { font-size: 26px; }
  .hero { row-gap: 48px; }
  .hero__card { grid-column: 1 / -1; }
  /* smaller peeks on a phone, so the cards behind stay inside the gutter */
  .stack .card:nth-child(2), .stack.live .card.p1 { transform: translate(3px, -8px) rotate(1deg); }
  .stack .card:nth-child(3), .stack .card:nth-child(4), .stack.live .card.p2, .stack.live .card.p3 { transform: translate(-4px, -14px) rotate(-2deg); }
  .stack.live .card.out { transform: translate(-40px, -48px) rotate(-6deg); }
  .card { padding: 20px 20px 22px; transform: rotate(-1deg); }
  .card .card__firm { font-size: 25px; flex-wrap: wrap; row-gap: 2px; }
  .card .card__open { font-size: 18px; }
  .hero__act .btn, .plan .btn, .form__act .btn { width: 100%; }
  .plan .btn { align-self: stretch; }
  .rows .quote { font-size: 20px; }
  .faq dt { font-size: 21px; }
  .foot { flex-direction: column; }
}
@media (max-width: 860px) { .top__nav--doc { display: flex; } }
