/* The Next Draft */

:root {
  --bg: #fcfcfb;
  --surface: #ffffff;
  --soft: #f2f3f6;
  --ink: #0f1216;
  --text: #1f232b;
  --muted: #5b6270;
  --line: #e3e5ea;
  --accent: #1f3a8f;
  --accent-hover: #172c70;
  --accent-soft: #e8ecf8;
  --gold: #c9a227;
  --dark: #0f1a3d;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --gutter: 24px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
section[id], dialog[id] { scroll-margin-top: 84px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 200; }
.skip:focus { left: 8px; }

/* ---------- carved background ----------
   A Greek plaster relief, toned down to almost nothing, fixed behind the page. It drifts
   slowly, and a soft pool of light travels across it so different parts of the carving
   catch the eye over time. Sections with their own background simply cover it. */

body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; }
body::before {
  inset: -6%;
  background: var(--bg) url("/img/relief.webp") center / cover no-repeat;
  animation: relief-drift 90s ease-in-out infinite alternate;
}
body::after {
  inset: -50%;
  background: radial-gradient(closest-side, rgba(252, 252, 251, 0) 0, rgba(252, 252, 251, .62) 72%);
  animation: relief-light 46s ease-in-out infinite alternate;
}
@keyframes relief-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1%, 0) scale(1.04); }
}
@keyframes relief-light {
  from { transform: translate3d(-16%, -9%, 0); }
  to { transform: translate3d(16%, 11%, 0); }
}

/* ---------- type ---------- */

.label {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; }
h3 { font-size: 1.5rem; line-height: 1.2; }
em { font-style: italic; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) { .br-wide { display: none; } }
.line { display: block; text-wrap: balance; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 36em; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 16px/1 var(--sans);
  padding: 16px 24px; border-radius: 10px;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: var(--accent); }
.btn-light:hover { background: var(--accent-soft); }
.btn svg { width: 16px; height: 16px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(252, 252, 251, .9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 32px; height: 68px; }

.wordmark {
  font-family: var(--serif); font-weight: 500; font-size: 1.35rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap;
}
.wordmark::after {  /* a text cursor: the next draft, about to be written */
  content: ""; width: 2px; height: 1.05em; background: var(--gold); margin-left: 3px; transform: translateY(1px);
}

.nav { display: flex; gap: 28px; margin-left: auto; list-style: none; padding: 0; }
.nav a { text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--ink); }
.header-cta { padding: 11px 18px; font-size: 14.5px; }

@media (max-width: 760px) {
  .nav { display: none; }
  .site-header .wrap { justify-content: space-between; }
}

/* ---------- hero ---------- */

.hero { padding: 88px 0 104px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; align-items: center; }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }

.hero h1 { margin-bottom: 26px; }
.hero h1 .mark { position: relative; white-space: nowrap; font-style: italic; }
.hero h1 .mark svg {
  position: absolute; left: -2%; right: 0; bottom: -0.16em; width: 104%; height: .28em;
  color: var(--gold); overflow: visible;
}
.hero .lede { margin-bottom: 36px; }

/* rotating headline: three fixed lines, so the page never jumps between phrases */
.hero-title { min-height: 3.12em; }
.rotator, .rotator .hl { display: block; }
.rotator .hl { white-space: nowrap; }
.rotator .hw { display: inline-block; }
.js .rotator .hw { animation: hw-in .75s cubic-bezier(.2, .9, .3, 1.15) both; }
.js .rotator.leaving { animation: line-out .42s ease-in forwards; }
.js .rotator .mark path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line .9s cubic-bezier(.65, 0, .35, 1) .5s forwards; }
@keyframes hw-in { 0% { opacity: 0; transform: translateY(.42em) rotate(2deg); filter: blur(8px); } }
@keyframes line-out { to { opacity: 0; transform: translateY(-.18em); filter: blur(6px); } }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero photo, with the three channels pinned to it */
.hero-visual { position: relative; margin: 0; max-width: 460px; justify-self: end; width: 100%; }
.hero-visual img {  /* engraving on white: multiply drops the paper so the ink sits on the page */
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; mix-blend-mode: multiply;
}
.channels {
  position: absolute; left: -28px; bottom: 36px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; display: grid; gap: 10px;
  box-shadow: 0 1px 2px rgba(15, 18, 22, .04), 0 14px 36px rgba(15, 18, 22, .10);
}
.channels-title { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.chips { display: flex; gap: 6px; }
.chips span { font-size: 13.5px; font-weight: 600; color: var(--ink); background: var(--soft); padding: 6px 10px; border-radius: 999px; }
@media (max-width: 959px) {
  .hero-visual { max-width: 420px; justify-self: center; }
  .channels { left: 12px; bottom: 12px; }
}

/* ---------- positioning ---------- */

.position { background: var(--dark); color: #c9ced8; padding: 112px 0; }
.position h2 { color: #fff; max-width: 15em; margin-bottom: 28px; }
.position h2 em { color: #e3c260; display: block; }
.position p { font-size: 1.2rem; max-width: 34em; }
.position p + p { margin-top: 18px; }

/* ---------- sections ---------- */

.section { padding: 112px 0; }
.section-head { max-width: 42em; margin-bottom: 56px; }
.section-head h2 { margin-bottom: 18px; }
.section-head p:not(.label) { color: var(--muted); font-size: 1.15rem; }

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; list-style: none; padding: 0; }
.pillar { border-top: 1.5px solid var(--ink); padding-top: 22px; }
.pillar-art { width: 168px; height: 168px; object-fit: contain; mix-blend-mode: multiply; margin: 0 0 18px -10px; }
.pillar .num { font: 500 13px/1 var(--mono); color: var(--accent); margin-bottom: 18px; display: block; }
.pillar h3 { margin-bottom: 12px; }
.pillar ul { list-style: none; padding: 0; display: grid; gap: 10px; color: var(--muted); }
.pillar li { position: relative; padding-left: 22px; }
.pillar li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 2px; background: var(--gold); }

.how { background: var(--soft); }
.how .section-head { max-width: none; }
.how .section-head p:not(.label) { max-width: 42em; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; list-style: none; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px 22px 24px; font-weight: 500; color: var(--ink);
}
.steps li::before {
  content: "0" counter(step); display: block; font: 500 12.5px/1 var(--mono); color: var(--accent); margin-bottom: 14px;
}
.steps li span { display: block; font-weight: 400; color: var(--muted); font-size: 15.5px; margin-top: 4px; }

.why .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 900px) { .why .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 72px; } }
.why h2 { margin-bottom: 0; }
.why-body p { font-size: 1.15rem; color: var(--text); margin-bottom: 18px; }
.why-body p + p { color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); text-decoration: none; margin-top: 6px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- first sample ---------- */

.sample { padding: 0 0 112px; }
.sample-card {
  background: var(--accent); color: #dfe5ff; border-radius: 22px;
  padding: clamp(36px, 6vw, 72px); position: relative; overflow: hidden;
}
.sample-card::after {  /* faint ruled lines, like a notepad */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(255, 255, 255, .07) 39px 40px);
}
.sample-card > * { position: relative; z-index: 1; }
.sample-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 900px) { .sample-card { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; align-items: end; } }
.pilot { border-top: 1px solid rgba(255, 255, 255, .22); padding-top: 24px; }
@media (min-width: 900px) { .pilot { border-top: 0; border-left: 1px solid rgba(255, 255, 255, .22); padding: 4px 0 4px 40px; } }
.pilot ul { list-style: none; padding: 0; display: grid; gap: 12px; }
.pilot li { position: relative; padding-left: 22px; color: #fff; }
.pilot li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 2px; background: var(--gold); }

.work { padding-top: 0; padding-bottom: 0; }
.work-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.work-list li > * { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 24px; background: var(--surface); text-decoration: none; transition: border-color .15s; }
.work-list a:hover { border-color: var(--ink); }
.work-what { font: 500 12.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.work-list h3 { margin-bottom: 8px; }
.work-list p:not(.work-what) { color: var(--muted); }
.work-cta { margin-top: auto; padding-top: 20px; font-weight: 600; font-size: 15px; color: var(--accent); }
.work-list a:hover .work-cta { text-decoration: underline; text-underline-offset: 3px; }
.sample-card .label { color: #c7d0ff; }
.sample-card h2 { color: #fff; margin-bottom: 18px; }
.sample-card p:not(.label) { font-size: 1.2rem; max-width: 34em; margin-bottom: 32px; }

/* ---------- contact ---------- */

.closing { padding: 24px 0 136px; text-align: center; }
.closing h2 { margin-bottom: 28px; }
.closing-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-style: italic; font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  color: var(--accent); text-decoration: none;
  padding-bottom: 6px; border-bottom: 1.5px solid currentColor;
  transition: color .15s, gap .2s;
}
.closing-link:hover { color: var(--accent-hover); gap: 16px; }
.closing-link svg { width: 18px; height: 18px; }

.contact-dialog {
  border: 0; padding: 0; margin: auto; text-align: left;
  width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--surface); color: var(--text); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 18, 22, .06), 0 32px 80px rgba(15, 18, 22, .28);
}
.contact-dialog::backdrop { background: rgba(15, 26, 61, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.contact-dialog:focus, .contact-dialog:focus-visible { outline: none; }
.contact-dialog[open] { animation: dialog-in .25s ease; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px); } }
html:has(.contact-dialog[open]) { overflow: hidden; }
.dialog-inner { position: relative; padding: clamp(24px, 5vw, 40px); }
.dialog-inner h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: 10px; padding-right: 40px; }
.dialog-sub { color: var(--muted); margin-bottom: 24px; }
.dialog-close {
  position: absolute; top: 18px; right: 18px; width: 36px; height: 36px;
  display: grid; place-items: center; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.dialog-close:hover { background: var(--soft); color: var(--ink); }
.dialog-close svg { width: 16px; height: 16px; }
.dialog-book {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  border: 1.5px solid var(--line); border-radius: 12px;
  color: var(--ink); font-weight: 600; text-decoration: none; transition: border-color .15s;
}
.dialog-book:hover { border-color: var(--ink); }
.dialog-book svg { width: 18px; height: 18px; flex: none; }
.dialog-book .go { margin-left: auto; color: var(--accent); }
.dialog-or {
  display: flex; align-items: center; gap: 14px; margin: 22px 0;
  font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.dialog-or::before, .dialog-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.contact-dialog .field textarea { min-height: 120px; }
.contact-dialog .form-done { border: 0; padding: 0; }

/* No JavaScript or no <dialog> support: the same panel sits inline at the end of the page. */
html:not(.dialog-ok) .contact-dialog {
  display: block; position: static; margin: 48px auto 0; max-height: none;
  border: 1px solid var(--line); box-shadow: none;
}
html:not(.dialog-ok) .dialog-close { display: none; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 13px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-row { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-note { font-size: 14px; color: var(--muted); max-width: 30em; }
.form-status { font-size: 15px; padding: 14px 16px; border-radius: 10px; }
.form-status.ok { background: #e8f6ee; color: #14532d; }
.form-status.error { background: #fdecec; color: #7f1d1d; }
.form-status a { font-weight: 600; }
.btn[disabled] { opacity: .6; cursor: progress; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; }
.tags li { font: 500 12.5px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 8px 11px; border-radius: 999px; }

/* ---------- blog ---------- */

.posts { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.posts li { border-bottom: 1px solid var(--line); }
.posts a { display: grid; gap: 6px; padding: 24px 0; text-decoration: none; }
.posts a:hover h3 { color: var(--accent); }
.posts time { font: 500 12.5px/1 var(--mono); color: var(--muted); letter-spacing: .04em; }
.posts p { color: var(--muted); }
.page-head { padding: 88px 0 48px; }
.page-head p { color: var(--muted); font-size: 1.15rem; margin-top: 16px; max-width: 34em; }
.empty-note { color: var(--muted); padding-bottom: 112px; }

.article { max-width: 680px; margin: 0 auto; padding: 72px 0 112px; }
.article h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 18px; }
.article time { font: 500 12.5px/1 var(--mono); color: var(--muted); letter-spacing: .04em; }
.article .body { margin-top: 40px; font-size: 1.12rem; }
.article .body p, .article .body ul, .article .body ol { margin-bottom: 1.2em; }
.article .body li { margin-bottom: .4em; }
.article .body h2 { font-size: 1.8rem; margin: 1.6em 0 .6em; }
.article .body a { color: var(--accent); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 15px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 22px; list-style: none; padding: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- small screens ---------- */

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .hero { padding: 56px 0 72px; }
  .lede, .position p, .sample-card p:not(.label) { font-size: 1.1rem; }
  .position, .section { padding: 80px 0; }
  .sample { padding-bottom: 80px; }
  .closing { padding: 8px 0 96px; }
  .cta-row .btn, .form-foot .btn, .sample-card .btn { width: 100%; }
  .header-cta { padding: 10px 14px; font-size: 14px; }
}

/* ---------- gentle reveal (only with JS, never for reduced motion) ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .contact-dialog[open] { animation: none; }
  body::before, body::after { animation: none; }
  .js .rotator .hw, .js .rotator.leaving { animation: none; }
  .js .rotator .mark path { animation: none; stroke-dashoffset: 0; }
}

/* contact: shown after the server confirms the email went out */
.form-done { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.form-done h3 { margin-bottom: 8px; }
.form-done p { color: var(--muted); }
