/* Opifes — tokens */
:root {
  --paper: #eeede8;
  --surface: #e2e1da;
  --ink: #11110f;
  --muted: #55544e;
  --accent: #ff4d1a;
  --m: clamp(16px, 3vw, 44px);          /* page margin */
  --sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 clamp(1.0625rem, 1rem + .25vw, 1.25rem)/1.5 var(--sans);
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

/* Bar */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 14px var(--m); background: var(--paper);
}
.mark { font-weight: 700; font-size: 1.5rem; letter-spacing: -.04em; text-decoration: none; }
.bar-links { display: flex; gap: 28px; margin-left: auto; font-size: 1rem; }
.bar-links a, .foot nav a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100%/0 2px no-repeat; transition: background-size .35s var(--ease); padding-bottom: 2px; }
.bar-links a:hover, .foot nav a:hover { background-size: 100% 2px; }
.bar-end { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; background: var(--surface); padding: 3px; }
.lang button {
  font: 500 .875rem/1 var(--sans); border: 0; background: none; color: var(--muted);
  padding: 9px 11px; cursor: pointer; min-height: 34px;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px;
  background: var(--ink); color: var(--paper); font-weight: 500; font-size: 1rem;
  text-decoration: none; white-space: nowrap; transition: transform .2s var(--ease), background-color .2s;
}
.btn:hover { background: var(--accent); color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn-accent { background: var(--accent); color: var(--ink); min-height: 54px; padding: 0 26px; font-size: 1.0625rem; }
.btn-accent:hover { background: var(--ink); color: var(--paper); }

/* Hero */
.hero { padding: clamp(20px, 3vw, 48px) var(--m) 0; }
h1 {
  font-weight: 700; font-size: clamp(2.6rem, 11.2vw, 12.5rem); line-height: .9;
  letter-spacing: -.032em; margin-left: -.03em;
}
.hero-row {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: end;
  margin-top: clamp(24px, 3.2vw, 56px);
}
.gloss { grid-column: 1 / 6; font: italic 400 clamp(1.125rem, 1rem + .6vw, 1.5rem)/1.35 var(--serif); color: var(--muted); max-width: 26ch; }
.gloss b { font-weight: 400; color: var(--ink); }
.hero-lead { grid-column: 7 / 13; display: grid; gap: 24px; justify-items: start; }
.hero-lead p { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); line-height: 1.3; letter-spacing: -.015em; max-width: 30ch; }

/* Compare */
.cmp { margin-top: clamp(32px, 4vw, 72px); }
.cmp-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #fff;
  container-type: inline-size; --u: 1cqw; touch-action: pan-y;
}
.lay { position: absolute; inset: 0; overflow: hidden; }
.lay-m { clip-path: inset(0 0 0 var(--pos)); }

/* the template */
.lay-t { background: #fff; color: #222; font-family: Arial, Helvetica, sans-serif; display: flex; flex-direction: column; }
.t-nav { display: flex; align-items: center; gap: calc(1 * var(--u)); padding: calc(1.4 * var(--u)) calc(3 * var(--u)); font-size: calc(1.5 * var(--u)); }
.t-logo { width: calc(2.6 * var(--u)); height: calc(2.6 * var(--u)); border-radius: 50%; background: linear-gradient(135deg, #6d5dfc, #c06bff); }
.t-links { margin-left: auto; display: flex; gap: calc(2.4 * var(--u)); color: #666; font-size: calc(1.25 * var(--u)); }
.t-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: calc(1.3 * var(--u)); background: linear-gradient(135deg, #6d5dfc, #c06bff); color: #fff; padding: 0 calc(8 * var(--u)); }
.t-hero strong { font-size: calc(4.2 * var(--u)); line-height: 1.1; }
.t-hero p { font-size: calc(1.5 * var(--u)); max-width: 34em; opacity: .9; }
.t-btns { display: flex; gap: calc(1.2 * var(--u)); font-size: calc(1.3 * var(--u)); }
.t-btns span { padding: calc(1 * var(--u)) calc(2.2 * var(--u)); border-radius: 99px; background: #fff; color: #6d5dfc; font-weight: 700; }
.t-btns span + span { background: none; color: #fff; box-shadow: inset 0 0 0 calc(.15 * var(--u)) #fff; }
.t-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(2 * var(--u)); padding: calc(2.6 * var(--u)) calc(6 * var(--u)) calc(3 * var(--u)); background: #f7f7fb; }
.t-cards div { background: #fff; border-radius: calc(1.2 * var(--u)); padding: calc(1.8 * var(--u)); text-align: center; box-shadow: 0 calc(.4 * var(--u)) calc(1.6 * var(--u)) rgba(60, 50, 140, .12); display: grid; justify-items: center; gap: calc(.6 * var(--u)); }
.t-cards i { width: calc(3.4 * var(--u)); height: calc(3.4 * var(--u)); border-radius: 50%; background: #ebe8ff; }
.t-cards b { font-size: calc(1.5 * var(--u)); }
.t-cards p { font-size: calc(1.15 * var(--u)); color: #777; line-height: 1.4; }

/* the design */
.lay-m { background: #f2b632; color: #1a1407; font-family: var(--sans); display: flex; flex-direction: column; justify-content: space-between; padding: calc(2.6 * var(--u)) calc(3 * var(--u)) calc(3 * var(--u)); }
.m-loaf { position: absolute; width: 33%; right: 3%; top: 15%; transform: rotate(-14deg); }
.m-top { position: relative; display: flex; justify-content: space-between; align-items: baseline; font-size: calc(1.45 * var(--u)); }
.m-top b { font-size: calc(2.4 * var(--u)); font-weight: 700; letter-spacing: -.04em; }
.m-head { position: relative; font-size: calc(11.6 * var(--u)); line-height: .86; letter-spacing: -.04em; font-weight: 700; margin-left: -.04em; }
.m-foot { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: calc(3 * var(--u)); }
.m-btn { background: #1a1407; color: #f2b632; font-weight: 600; font-size: calc(1.6 * var(--u)); padding: calc(1.3 * var(--u)) calc(2.4 * var(--u)); }
.m-list { width: 38%; font-size: calc(1.6 * var(--u)); font-weight: 500; }
.m-list li { display: flex; justify-content: space-between; padding: calc(.55 * var(--u)) 0; font-variant-numeric: tabular-nums; }
.m-list li + li { box-shadow: 0 calc(-.12 * var(--u)) 0 #1a1407; }

.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 4px; margin-left: -2px; background: var(--accent); pointer-events: none; }
.cmp-handle span {
  position: absolute; top: 50%; left: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px;
  border-radius: 50%; background: var(--accent); color: var(--ink); display: grid; place-items: center;
  transition: transform .2s var(--ease);
}
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp-frame:hover .cmp-handle span, .cmp-range:active ~ .cmp-handle span { transform: scale(1.12); }
.cmp-frame:has(.cmp-range:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }
.cmp-cap { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: baseline; padding-top: 16px; }
.cmp-cap p { text-align: center; color: var(--muted); font-size: 1rem; max-width: 62ch; justify-self: center; }
.cmp-side { font-weight: 600; }

@container (max-width: 620px) {
  .lay { --u: 2.15cqw; }
  .t-links, .t-cards div:nth-child(3) { display: none; }
  .t-cards { grid-template-columns: 1fr 1fr; padding-inline: calc(2 * var(--u)); }
  .t-hero { padding: 0 calc(3 * var(--u)); }
  .m-top { flex-direction: column; gap: calc(.4 * var(--u)); }
  .m-loaf { width: 56%; right: -10%; top: 30%; }
  .m-head { font-size: calc(7 * var(--u)); }
  .m-foot { flex-direction: column-reverse; align-items: stretch; }
  .m-list { width: 100%; }
  .m-btn { text-align: center; }
}

/* Work */
.work { padding: clamp(96px, 13vw, 220px) var(--m) 0; }
.work-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: end; }
h2 { font-weight: 700; font-size: clamp(2.5rem, 7.4vw, 8rem); line-height: .94; letter-spacing: -.035em; margin-left: -.03em; }
.work-head h2 { grid-column: 1 / 7; }
.work-head p { grid-column: 7 / 13; max-width: 34ch; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); line-height: 1.3; letter-spacing: -.015em; }
.work-grid { display: grid; row-gap: clamp(64px, 8vw, 136px); margin-top: clamp(48px, 6vw, 104px); }
.w { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: end; }
.shot { grid-column: 1 / 10; grid-row: 1; overflow: hidden; background: var(--surface); aspect-ratio: 16 / 10; }
.w figcaption { grid-column: 10 / 13; grid-row: 1; }
.w:nth-child(even) .shot { grid-column: 4 / 13; }
.w:nth-child(even) figcaption { grid-column: 1 / 4; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .9s var(--ease); }
.w:hover .shot img { transform: scale(1.03); }
figcaption { display: grid; gap: 6px; }
figcaption b { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.5rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
figcaption span { color: var(--muted); font-size: 1.0625rem; line-height: 1.35; }
figcaption i { font: italic 400 1.125rem/1.2 var(--serif); color: var(--muted); margin-top: 14px; }
/* How */
.how { margin-top: clamp(96px, 13vw, 220px); background: var(--ink); color: var(--paper); padding: clamp(72px, 9vw, 160px) var(--m); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
.how h2 { grid-column: 1 / 6; position: sticky; top: 96px; font-size: clamp(2.5rem, 5.6vw, 6rem); }
.how-list { grid-column: 7 / 13; display: grid; gap: clamp(48px, 5.5vw, 96px); }
.how-list h3 { font-weight: 600; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3.25rem); line-height: 1.02; letter-spacing: -.04em; max-width: 16ch; }
.how-list p { margin-top: 16px; max-width: 44ch; color: #c9c8c1; }

/* Contact */
.contact { background: var(--accent); color: var(--ink); padding: clamp(72px, 9vw, 160px) var(--m) clamp(56px, 6vw, 104px); }
.contact h2 { max-width: 12ch; }
.contact-row { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; margin-top: clamp(40px, 6vw, 112px); }
.contact-side { grid-column: 1 / 5; display: grid; gap: clamp(32px, 4vw, 64px); }
.contact-side p { max-width: 30ch; }
.contact-alt { font-size: 1.0625rem; }
.contact-alt a { font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.contact-alt a:hover { text-decoration-thickness: 4px; }

/* Contact form. Shown only when the script runs; without it the email line beside it is the way in. */
.form { grid-column: 6 / 13; display: none; grid-template-columns: 1fr 1fr; gap: 30px 24px; }
.js .form { display: grid; }
.field { display: grid; gap: 4px; align-content: start; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: .9375rem; font-weight: 600; }
.field label small { font-size: inherit; font-weight: 400; }
.field input, .field textarea {
  font: inherit; font-size: 1.375rem; line-height: 1.35; color: var(--ink);
  width: 100%; padding: 8px 0 12px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
  background: transparent;
}
.field textarea { display: block; min-height: 4.6em; resize: vertical; }
/* The browser paints autofilled fields its own colour. Keep the accent ground. */
.field input:-webkit-autofill, .field textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--accent) inset; caret-color: var(--ink);
}
/* Active field: a thin frame whose bottom edge sits on the field's own line. */
.ctl { display: block; position: relative; }
.ctl :focus-visible { outline: 0; }
.ctl:focus-within::after { content: ""; position: absolute; inset: 0 -10px; border: 2px solid var(--ink); pointer-events: none; }
.field .err { font-size: .9375rem; font-weight: 600; }
.field .err:empty { display: none; }
.hp { position: absolute; left: -9999px; }
.form-end { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.form-end .btn { min-height: 54px; padding: 0 30px; font-size: 1.0625rem; cursor: pointer; border: 0; font-family: inherit; }
.form-end .btn:hover { background: var(--paper); color: var(--ink); }
.form-end .btn[disabled] { opacity: .55; cursor: default; background: var(--ink); color: var(--paper); }
.form-end p { font-size: .9375rem; max-width: 34ch; }
.form-status { grid-column: 1 / -1; font-weight: 600; }
.form-status:empty { display: none; }
.form-ts { grid-column: 1 / -1; }
.form-ts:empty { display: none; }
.form-done { grid-column: 6 / 13; }
.form-done p { font-size: clamp(1.75rem, 3.2vw, 3rem); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; max-width: 18ch; overflow-wrap: anywhere; }
.form-done .sig { display: block; margin-top: 20px; }
.form-done:focus { outline: 0; }
.form[hidden], .form-done[hidden] { display: none; }

/* Footer */
.foot { padding: 28px var(--m) 0; overflow: hidden; }
.foot-row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.sig { font: italic 400 1.25rem/1.2 var(--serif); }
.foot nav { display: flex; gap: 28px; font-size: 1rem; flex-wrap: wrap; }
.foot-mark { font-weight: 700; font-size: 31vw; line-height: .74; letter-spacing: -.045em; margin: .12em 0 -.07em -.05em; white-space: nowrap; }

/* Entrances (only when script runs) */
.js [data-r] { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s); }
.js [data-r].in { opacity: 1; transform: none; }

@media (max-width: 820px) {
  .bar-links { display: none; }
  .bar-end { margin-left: auto; gap: 10px; }
  .bar .btn { min-height: 40px; padding: 0 14px; font-size: .9375rem; }
  .hero-row, .work-head, .contact-row { display: block; }
  .gloss { max-width: none; }
  .hero-lead { margin-top: 24px; }
  .cmp-frame { aspect-ratio: 4 / 5; }
  .cmp-cap { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .cmp-cap p { grid-column: 1 / -1; grid-row: 2; text-align: left; justify-self: start; }
  .cmp-side:last-child { text-align: right; }
  .cmp-handle span { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .work-head p { margin-top: 20px; }
  .work-grid { row-gap: 48px; }
  .w { display: block; }
  .w figcaption { padding-top: 14px; }
  figcaption i { margin-top: 4px; }
  .how { display: block; }
  .how h2 { position: static; margin-bottom: 48px; }
  .contact-side { margin-bottom: 44px; }
  .form { grid-template-columns: 1fr; gap: 26px; }
  .field input, .field textarea { font-size: 1.1875rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-r] { opacity: 1; transform: none; transition: none; }
  .shot img, .btn, .cmp-handle span { transition: none; }
}

/* Focus: ink on light and accent grounds, paper on the dark one (accent on accent was invisible) */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.how :focus-visible, .entry:hover:focus-visible { outline-color: var(--paper); }
.cmp-frame:has(.cmp-range:focus-visible) { outline: 3px solid var(--ink); outline-offset: 4px; }
.skip { position: absolute; left: var(--m); top: -80px; z-index: 30; background: var(--ink); color: var(--paper); padding: 12px 18px; font-weight: 500; text-decoration: none; }
.skip:focus { top: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bar-links a[aria-current="page"] { background-size: 100% 2px; }

/* Journal (home section and the blog list) */
.journal { padding: clamp(96px, 13vw, 220px) var(--m); }
.journal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
.more { font-weight: 500; text-decoration: none; padding-bottom: 3px; background: linear-gradient(currentColor, currentColor) 0 100%/100% 2px no-repeat; transition: background-size .35s var(--ease); }
.more:hover { background-size: 0 2px; background-position: 100% 100%; }
.entry {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 12px;
  padding: clamp(24px, 3vw, 44px) clamp(16px, 2.2vw, 32px); margin-top: clamp(32px, 4vw, 64px);
  background: var(--surface); color: var(--ink); text-decoration: none; transition: background-color .25s, color .25s;
}
.entry time { grid-column: 1 / 4; color: var(--muted); font-size: 1rem; padding-top: .55em; transition: color .25s; }
.entry strong { grid-column: 4 / 13; font-weight: 600; font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.75rem); line-height: 1; letter-spacing: -.04em; }
.entry span { grid-column: 4 / 10; color: var(--muted); max-width: 52ch; transition: color .25s; }
.entry:hover { background: var(--ink); color: var(--paper); }
.entry:hover time, .entry:hover span { color: #c9c8c1; }
.entries .entry + .entry { margin-top: 8px; }

/* Inner pages */
.page { padding: clamp(40px, 6vw, 104px) var(--m) clamp(96px, 12vw, 200px); }
.page-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: end; }
.page-title { grid-column: 1 / 8; }
.page-head p { grid-column: 8 / 13; max-width: 30ch; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); line-height: 1.3; letter-spacing: -.015em; padding-bottom: .5em; }

/* Post */
.post { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
.post-head { grid-column: 1 / 13; display: grid; gap: 22px; justify-items: start; }
.post-title { font-size: clamp(2.5rem, 7.4vw, 8rem); line-height: .94; letter-spacing: -.035em; max-width: 13ch; }
.post-head time { color: var(--muted); }
.post-body { grid-column: 5 / 12; margin-top: clamp(40px, 6vw, 96px); font-size: clamp(1.125rem, 1.05rem + .35vw, 1.375rem); line-height: 1.55; }
.post-body p { max-width: 62ch; }
.post-body p + p { margin-top: 1.1em; }
.post-body .post-lead { font-size: clamp(1.375rem, 1.1rem + 1.1vw, 2rem); line-height: 1.28; letter-spacing: -.02em; max-width: 40ch; }
.post-body h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 600; margin: 2.2em 0 .6em; max-width: 24ch; }
.post-foot { grid-column: 5 / 12; margin-top: clamp(48px, 6vw, 96px); display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .entry { display: block; }
  .entry time, .entry strong, .entry span { display: block; }
  .entry strong { margin: 10px 0 12px; }
  .page-head, .post { display: block; }
  .page-head p { margin-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .entry, .entry time, .entry span, .more { transition: none; }
}
