/* studio dalits v2: the paint chip card. */

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

:root {
  /* Ground and ink */
  --chalk: #f5f5f0;
  --white: #ffffff;
  --ink: #1d2b29;
  --ink-soft: #4b5b57;
  --rule: #dcdfd8;
  --rule-strong: #c3c9c2;

  /* Chips */
  --mist: #e2e9e8;
  --stone: #ebe8e0;
  --sand: #f3f0e8;           /* the paper of the pencil portrait */
  --sketch-paper: #f1e9da;   /* the paper of the hero drawing */
  --sage-1: #dfe8df;
  --sage-2: #b7cbbd;
  --sage-3: #7f9f8c;
  --harbour: #2b4a42;
  --harbour-deep: #223c35;
  --on-harbour: #f2f4ef;
  --on-harbour-soft: #c9d6cf;

  /* Type */
  --sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;

  /* Grid */
  --gutter: clamp(10px, 1vw, 14px);
  --side: clamp(16px, 3.2vw, 48px);
  --max: 1360px;
  --rule-gap: clamp(48px, 6vw, 88px);   /* space above and below every divider line */

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Roles that change in dark mode */
  --error: #9b2c1f;                       /* 6.9:1 on white. Form errors only. */
  --ok: var(--harbour);                   /* a "done" mark in text */
  --placeholder: #6f7c78;
  --wash: rgb(29 43 41 / 0.07);           /* hover wash on a line button */
  --col-wash-1: rgb(223 232 223 / 0.55);  /* table column hover, one for each size */
  --col-wash-2: rgb(183 203 189 / 0.32);
  --col-wash-3: rgb(127 159 140 / 0.2);

  color-scheme: light dark;
}

/* Dark mode follows the visitor's system setting. There is no switch.
   The page keeps its structure. Only the colours change:
   - chalk is the dark ground, white is the card (label bands, panels),
   - the sage strip still runs in size order, and the harbour green stays
     the main action,
   - the pencil drawings keep their warm paper, like paper pinned on a dark
     board. Text on that paper keeps the light-mode ink (see .chip--extra). */
@media (prefers-color-scheme: dark) {
  :root {
    --chalk: #111816;
    --white: #202c29;
    --ink: #edf1ec;
    --ink-soft: #a9b9b3;
    --rule: #2f3c38;
    --rule-strong: #42524c;

    --mist: #1a2522;
    --stone: #2a302c;
    --sage-1: #2d4439;
    --sage-2: #3d5a4b;
    --sage-3: #4f7461;
    --harbour: #33705a;
    --harbour-deep: #295d4c;
    --on-harbour: #f2f4ef;
    --on-harbour-soft: #e6eee9;

    --error: #f4998b;
    --ok: #8fb59f;
    --placeholder: #8a9a94;
    --wash: rgb(237 241 236 / 0.08);
    --col-wash-1: rgb(45 68 57 / 0.7);
    --col-wash-2: rgb(61 90 75 / 0.55);
    --col-wash-3: rgb(79 116 97 / 0.4);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  scrollbar-color: var(--sage-3) var(--chalk);
}

body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sage-2); color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3, p, dl, dd, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--side);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--chalk);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Grid ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--side));
  margin-inline: auto;
  padding-inline: var(--side);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}

/* ---------- Type ---------- */

.display {
  font-size: clamp(42px, 5.6vw, 84px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.h2 {
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.h3 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.012em;
}

/* ---------- Top row ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.mark-sd {
  width: 36px;
  height: 36px;
  flex: none;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 36px);
  font-size: 16px;
  font-weight: 500;
}

.top-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 8px;
}

.top-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* The Get started button keeps its own colours and shape. */
.top-nav a.btn {
  min-height: 44px;
  padding: 0 20px;
  font-size: 16px;
  color: var(--on-harbour);
}

.top-nav a.btn:hover { color: var(--on-harbour); text-decoration: none; }

/* ---------- Chips ---------- */

/* A chip is a colour field with a white label band at its foot. */
.chip {
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.chip > .field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 16px 12px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--ink-soft);
}

/* ---------- First viewport ---------- */

.hero {
  row-gap: var(--gutter);
  padding-bottom: var(--rule-gap);
}

.chip--intro {
  grid-column: 1 / span 6;
  min-height: clamp(480px, calc(100svh - 76px - 40px), 760px);
}

.chip--intro .field {
  background: var(--mist);
  justify-content: flex-end;
  padding: clamp(28px, 4.4vw, 72px);
  gap: 0;
}

.chip--intro .display { max-width: 12ch; }

.lead {
  margin-top: 24px;
  max-width: 34ch;
  font-size: clamp(18px, 1.45vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.btn--go { gap: 12px; padding-right: 22px; }
.go { width: 16px; height: 16px; flex: none; transition: transform 0.25s var(--ease); }
.btn--go:hover .go { transform: translateX(4px); }
.btn--go:hover .go--down { transform: translateY(3px); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 26px;
  border: 1px solid transparent;
  font: 600 17px/1 var(--sans);
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn--solid { background: var(--harbour); color: var(--on-harbour); }
.btn--solid:hover { background: var(--harbour-deep); }

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

.btn--light { background: var(--on-harbour); color: var(--harbour-deep); }
.btn--light:hover { background: var(--white); }

.btn--line-light { border-color: var(--on-harbour); color: var(--on-harbour); }
.btn--line-light:hover { background: rgb(242 244 239 / 0.1); }

.btn:hover { text-decoration: none; }

.from {
  font-size: max(12px, 0.48em);
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: 0.32em;
  margin-right: 0.1em;
}

/* The hero drawing: sketch to screen, on its own paper. */
.chip--sketch { grid-column: 7 / span 6; }

.sketch {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #f2ebdd;   /* the paper of the drawing, so no edge shows */
  padding-inline: clamp(20px, 4vw, 52px);
  min-height: 0;
}

/* The drawing fills the chip, less a side margin. All four edges fade into
   the chip colour, so no paper edge shows. */
.sketch img {
  width: 100%;
  height: auto;
  flex: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 80%, transparent 100%),
                      linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 80%, transparent 100%),
              linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* One authored moment: the drawing appears left to right, sketch first,
   then the screens. */
@media (prefers-reduced-motion: no-preference) {
  .sketch img { animation: sketch-in 1.5s var(--ease) 0.15s both; }

  @keyframes sketch-in {
    from { clip-path: inset(0 58% 0 0); }
    to { clip-path: inset(0 0 0 0); }
  }
}

/* ---------- Sections ---------- */

.section {
  padding-bottom: var(--rule-gap);
}

.section-head {
  align-items: start;
  row-gap: 20px;
  padding-top: var(--rule-gap);
  border-top: 1px solid var(--rule-strong);
  margin-bottom: clamp(36px, 4vw, 56px);
}

.section-head .h2 { grid-column: 1 / span 6; }

.section-lead {
  grid-column: 1 / span 5;
  color: var(--ink-soft);
  max-width: 44ch;
  text-wrap: pretty;
}

.section-lead a { color: var(--ink); }

/* ---------- Start: one centred column ---------- */

.start {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.start .h2 { max-width: 16ch; }

.start-lead {
  margin-top: 20px;
  max-width: 40ch;
  font-size: clamp(18px, 1.45vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.start .btn { margin-top: 36px; }

.start-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  margin-top: 22px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft);
}

.start-facts li { display: inline-flex; align-items: center; gap: 9px; }
.start-facts li::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--sage-3); }

/* ---------- Comparison table ---------- */

.compare {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.compare .corner { width: 25%; }

.col-head {
  text-align: left;
  vertical-align: bottom;
  padding: 0;
  font-weight: inherit;
  border-left: var(--gutter) solid var(--chalk);
}

.col-head > span { display: block; }

.col-name {
  padding: 18px 20px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}

.col-price {
  padding: 10px 20px 18px;
  font-size: clamp(26px, 2.3vw, 36px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.col-head--t1 { background: var(--sage-1); }
.col-head--t2 { background: var(--sage-2); }
.col-head--t3 { background: var(--sage-3); }

.compare tbody th,
.compare tbody td {
  padding: 17px 20px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

.compare tbody th {
  padding-left: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
}

.compare tbody td {
  font-size: 17px;
  border-left: var(--gutter) solid var(--chalk);
  transition: background-color 0.2s var(--ease);
}

.compare tbody tr:first-child > * { padding-top: 22px; }

/* Phones get the same facts as three stacked blocks, one per size. */
.tier-stack { display: none; }

/* Reading down a column: the column takes a light wash of its own chip. */
@media (hover: hover) {
  .compare:has(tr > :nth-child(2):hover) tr > td:nth-child(2) { background: var(--col-wash-1); }
  .compare:has(tr > :nth-child(3):hover) tr > td:nth-child(3) { background: var(--col-wash-2); }
  .compare:has(tr > :nth-child(4):hover) tr > td:nth-child(4) { background: var(--col-wash-3); }
}

.table-note {
  margin-top: 16px;
  font-size: 16px;
  color: var(--ink-soft);
}

/* After launch */
.aftercare {
  margin-top: var(--rule-gap);
  padding-top: var(--rule-gap);
  border-top: 1px solid var(--rule-strong);
  row-gap: 20px;
}

.aftercare .h3 { grid-column: 1 / span 3; }

.terms {
  grid-column: 4 / span 9;
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 24px calc(var(--gutter) * 3);
}

.terms dt {
  font-weight: 600;
  font-size: 17px;
}

.terms dd {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* ---------- Extras ---------- */

.extras {
  row-gap: var(--gutter);
  padding-top: var(--rule-gap);
  border-top: 1px solid var(--rule-strong);
}

.extras-intro { grid-column: 1 / span 4; }
.extras-intro .section-lead { grid-column: auto; margin-top: 20px; }

.chip--extra {
  text-decoration: none;
}

.chip--extra:nth-of-type(1) { grid-column: 5 / span 4; }
.chip--extra:nth-of-type(2) { grid-column: 9 / span 4; }

/* A pencil drawing on warm paper sits on top of each extra. Its top and
   bottom fade into the paper colour. */
.extra-art {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--sketch-paper);
}

.extra-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
  transition: transform 0.6s var(--ease);
}

/* The paper stays light in dark mode, so this text keeps the light-mode ink. */
.chip--extra .field {
  --ink: #1d2b29;
  --ink-soft: #4b5b57;
  color: var(--ink);
  background: var(--sketch-paper);
  padding: 4px clamp(22px, 2.2vw, 32px) clamp(22px, 2.2vw, 28px);
  gap: 8px;
  transition: background-color 0.3s var(--ease);
}

.extra-name {
  font-size: clamp(22px, 1.9vw, 28px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.extra-note {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.45;
  max-width: 26ch;
}

/* ---------- About ---------- */

.about {
  align-items: center;
  row-gap: 32px;
  padding-top: var(--rule-gap);
  border-top: 1px solid var(--rule-strong);
}

.portrait { grid-column: 1 / span 4; }

.portrait picture {
  display: block;
  background: #f4f0e4;
}

.portrait img { width: 100%; }

.label--end { justify-content: flex-end; }

.about-text {
  grid-column: 6 / span 6;
  max-width: 36em;
}

.about-text p {
  margin-top: 18px;
  font-size: clamp(18px, 1.35vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

.about-text .h2 + p { margin-top: 28px; }

/* ---------- Close ---------- */

.close { padding-bottom: var(--gutter); }

.chip--deep .field {
  background: var(--harbour);
  color: var(--on-harbour);
  padding: clamp(40px, 6vw, 96px) clamp(28px, 4.4vw, 72px);
  min-height: clamp(380px, 46vw, 560px);
  justify-content: flex-end;
}

.display--close { max-width: 12ch; }

.close-lead {
  margin-top: 20px;
  max-width: 38ch;
  color: var(--on-harbour-soft);
  font-size: clamp(18px, 1.45vw, 21px);
  line-height: 1.5;
}

.chip--deep .field :focus-visible { outline-color: var(--on-harbour); }
.chip--deep .label a { color: var(--ink); font-weight: 600; }

/* ---------- Footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 32px;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- Tablet ---------- */

@media (max-width: 1080px) {
  .chip--intro { grid-column: 1 / span 7; }
  .chip--sketch { grid-column: 8 / span 5; }

  .section-head .h2 { grid-column: 1 / -1; }
  .section-lead { grid-column: 1 / span 9; }

  .aftercare .h3 { grid-column: 1 / -1; }
  .terms { grid-column: 1 / -1; }

  .extras-intro { grid-column: 1 / -1; margin-bottom: 12px; }
  .chip--extra:nth-of-type(1) { grid-column: 1 / span 6; }
  .chip--extra:nth-of-type(2) { grid-column: 7 / span 6; }

  .portrait { grid-column: 1 / span 5; }
  .about-text { grid-column: 6 / span 7; padding-left: 12px; }
}

/* ---------- Phone ---------- */

@media (max-width: 760px) {
  body { font-size: 17px; }

  .top { min-height: 64px; }
  .top-nav a:not([href^="mailto"]):not(.btn) { display: none; }
  .top-nav { font-size: 15px; }

  .chip--intro,
  .chip--sketch { grid-column: 1 / -1; }

  .chip--intro { min-height: 0; }
  .chip--intro .field { padding: 32px 22px 28px; }
  .chip--intro .display { max-width: 10ch; }
  .lead { margin-top: 18px; }
  .actions { margin-top: 28px; }
  .actions .btn { flex: 1 1 140px; }

  /* Close chip: one full-width button, and "Email me" as a quiet link below it. */
  .close .actions .btn--go { flex: 1 1 100%; }
  .close .actions .btn--line-light {
    flex: 1 1 100%;
    min-height: 44px;
    border-color: transparent;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
  }
  .close .actions .btn--line-light:hover {
    background: transparent;
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }

  .sketch { flex: none; aspect-ratio: 4 / 3; }

  .section-lead { grid-column: 1 / -1; }

  .start .btn { align-self: stretch; margin-top: 28px; }
  .start-facts { display: grid; justify-items: start; gap: 8px; }

  .compare { display: none; }

  .tier-stack {
    display: grid;
    gap: var(--gutter);
  }

  .tier-card { background: var(--white); }

  .tier-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 20px 18px;
  }

  .tier-card-head--t1 { background: var(--sage-1); }
  .tier-card-head--t2 { background: var(--sage-2); }
  .tier-card-head--t3 { background: var(--sage-3); }

  .tier-card-name {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.2;
  }

  .tier-card-price {
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  .tier-card-price .from { vertical-align: 0.28em; }

  .tier-card-list { padding: 4px 18px 8px; }

  .tier-card-list > div {
    display: grid;
    grid-template-columns: 9.5em 1fr;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 16px;
    line-height: 1.4;
  }

  .tier-card-list > div:last-child { border-bottom: 0; }

  .tier-card-list dt { color: var(--ink-soft); font-weight: 500; }

  .terms { grid-template-columns: 1fr; gap: 18px; }

  .chip--extra:nth-of-type(1),
  .chip--extra:nth-of-type(2) { grid-column: 1 / -1; min-height: 0; }

  .portrait,
  .about-text { grid-column: 1 / -1; padding-left: 0; }
  .portrait { max-width: 420px; }

  .chip--deep .field { padding: 48px 22px 40px; min-height: 0; }
}

@media (max-width: 359px) {
  .actions .btn { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 404 ---------- */

.lost { padding-bottom: var(--gutter); }
.lost .chip--intro { grid-column: 1 / -1; min-height: clamp(420px, calc(100svh - 76px - 40px), 640px); }
.lost .display { max-width: 14ch; }

@media (max-width: 760px) {
  .lost .chip--intro { min-height: 0; }
  .lost .chip--intro .field { padding-top: 56px; }
  .lost .actions .btn { flex-basis: 100%; }
}
