/* ==========================================================================
   DustRefinery — site.css

   THE LOOK LIVES HERE. Change a value in this first block and it changes
   everywhere on the site. Almost every colour, typeface, type size and
   spacing value below refers back to this block.
   ========================================================================== */

:root {
  /* Colour */
  --cream: #f3efe8;      /* page background */
  --ink: #1c1b1a;        /* text, rules, solid buttons, footer */
  --ink-soft: #55504c;   /* secondary text */
  --pink: #f6d7de;       /* brand pink: bands, hero image field */
  --blush: #ecdcd6;      /* image field tint */
  --sage: #dde2bd;       /* image field tint */
  --mist: #dfe5e3;       /* image field tint */

  /* Typefaces */
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type sizes: clamp(smallest, scales with window, largest) */
  --size-hero: clamp(2.85rem, 8.4vw, 6.75rem);   /* home headline */
  --size-h1: clamp(2.6rem, 6.5vw, 5.25rem);      /* inner page titles */
  --size-h2: clamp(2.1rem, 4.6vw, 3.6rem);       /* section headlines */
  --size-h3: clamp(1.5rem, 2.6vw, 2.1rem);       /* card and list titles */
  --size-body: 1rem;
  --size-mono: 0.6875rem;                        /* captions, nav, buttons */

  /* Spacing */
  --page-width: 1280px;
  --gutter: clamp(1.25rem, 2.5vw, 2rem);         /* page side margin */
  --gap: clamp(1.5rem, 3vw, 2.5rem);             /* space between columns */
  --space-section: clamp(4rem, 9vw, 7.5rem);     /* space between sections */
}

/* ---------- Fonts (files in /fonts, no outside requests) ---------- */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-400.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 500; font-display: swap; src: url("../fonts/inter-300-500.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/dm-mono-300.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/dm-mono-400.woff2") format("woff2"); }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 300 var(--size-body)/1.75 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
h1 em, h2 em { font-style: italic; }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); line-height: 1.12; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 500; }

.wrap { max-width: var(--page-width); margin-inline: auto; padding-inline: var(--gutter); }
.mono {
  font: 300 var(--size-mono)/2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lede { max-width: 38ch; }
.statement { font: 400 var(--size-h3)/1.24 var(--font-display); letter-spacing: -0.005em; max-width: 34em; margin: 0; }
.measure { max-width: 34rem; }
.skip { position: absolute; left: -999rem; }
.skip:focus { left: var(--gutter); top: 0.5rem; background: var(--ink); color: var(--cream); padding: 0.5rem 0.75rem; z-index: 5; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.4rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.brand span { font: 400 var(--size-mono)/1 var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; }
.site-header ul { display: flex; flex-wrap: wrap; gap: 0.25rem clamp(1.1rem, 3vw, 2.2rem); list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  font: 300 var(--size-mono)/2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding-block: 0.4rem;
  display: inline-block;
}
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 0.4em; }
.site-header .nav-book { font-weight: 400; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font: 400 var(--size-mono)/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1.05rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink); color: var(--cream); }
.btn--fill { background: var(--ink); color: var(--cream); }
.btn--fill:hover { background: transparent; color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-start; }
.more { font: 400 var(--size-mono)/2 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; text-underline-offset: 0.4em; }

/* ---------- Photos and photo placeholders ---------- */

/* A real photo: <img class="photo" ... style="aspect-ratio: 4/5"> */
.photo { width: 100%; object-fit: cover; }

/* A placeholder: a tinted block that says which photo belongs there. */
.ph {
  display: flex;
  align-items: flex-end;
  width: 100%;
  padding: 0.9rem;
  font: 300 0.625rem/1.6 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background-color: var(--blush);
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 14px);
}
.ph--pink { background-color: var(--pink); }
.ph--sage { background-color: var(--sage); }
.ph--blush { background-color: var(--blush); }
.ph--mist { background-color: var(--mist); }

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

.section { padding-block: var(--space-section); }
.section--tight { padding-block: calc(var(--space-section) * 0.6); }
.band--pink { background: var(--pink); }
.band--blush { background: var(--blush); }

/* Section heading: a thin rule, a small label on the left, content on the right */
.section-head {
  display: grid;
  grid-template-columns: 2fr 10fr;
  gap: var(--gap);
  border-top: 1px solid var(--ink);
  padding-top: 1.1rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.section-head h2 + p { margin-top: 1.25rem; }

.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.split--center { align-items: center; }

/* ---------- Home: hero ---------- */

.hero { display: grid; grid-template-columns: 7fr 5fr; gap: var(--gap); align-items: end; padding-top: clamp(1.5rem, 5vw, 4rem); }
.hero h1 { font-size: var(--size-hero); line-height: 0.96; letter-spacing: -0.01em; }
/* Same two columns as the hero above, so the buttons line up with the left edge of the photo. */
.intro { display: grid; grid-template-columns: 7fr 5fr; gap: var(--gap); padding-top: clamp(2rem, 4vw, 3.25rem); }
.intro-text { display: grid; grid-template-columns: 2fr 5fr; gap: var(--gap); }

/* ---------- Cards (services) ---------- */

.card .ph, .card .photo { margin-bottom: 1.1rem; }
.card h3 { margin: 0.5rem 0 0.75rem; }
.card p { max-width: 34ch; }
.card .more { display: inline-block; margin-top: 0.4rem; }

/* ---------- Lists ---------- */

.numbered { list-style: none; margin: 0; padding: 0; counter-reset: n; border-bottom: 1px solid var(--ink); }
.numbered li {
  counter-increment: n;
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  border-top: 1px solid var(--ink);
  padding: 0.95rem 0;
  font: 400 var(--size-h3)/1.15 var(--font-display);
  letter-spacing: -0.005em;
}
.numbered li::before { content: counter(n, decimal-leading-zero); font: 300 var(--size-mono)/1 var(--font-mono); letter-spacing: 0.14em; }

.biglist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.45em;
  font: 400 clamp(1.8rem, 4.4vw, 3.6rem)/1.18 var(--font-display);
  letter-spacing: -0.005em;
}
.biglist li:not(:last-child)::after { content: "/"; margin-left: 0.45em; opacity: 0.3; font-style: normal; }
.biglist li:nth-child(even) { font-style: italic; }

/* ---------- Testimonial ---------- */

.quote { margin: 0 auto; max-width: 56rem; text-align: center; }
.quote p { font: italic 400 clamp(1.8rem, 4vw, 3.25rem)/1.16 var(--font-display); letter-spacing: -0.005em; text-wrap: balance; }
.quote footer { margin-top: 1.75rem; }

/* ---------- Journal list ---------- */

.post-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--ink); }
.post-list a {
  display: grid;
  grid-template-columns: 2fr 9fr 1fr;
  gap: var(--gap);
  align-items: baseline;
  border-top: 1px solid var(--ink);
  padding: 1.4rem 0;
  text-decoration: none;
}
/* Hover: the title gets a hairline underline and the arrow slides. Nothing changes size. */
.post-list h2, .post-list h3 { text-decoration-line: underline; text-decoration-thickness: 1px; text-decoration-color: transparent; text-underline-offset: 0.14em; transition: text-decoration-color 0.2s; }
.post-list a:hover h2, .post-list a:hover h3, .post-list a:focus-visible h2, .post-list a:focus-visible h3 { text-decoration-color: currentColor; }
.post-list .arrow { text-align: right; transition: transform 0.2s; }
.post-list a:hover .arrow, .post-list a:focus-visible .arrow { transform: translateX(0.35rem); }
@media (prefers-reduced-motion: reduce) { .post-list h2, .post-list h3, .post-list .arrow { transition: none; } }
.section-head .post-list li:first-child a { border-top: 0; padding-top: 0.4rem; }

/* ---------- Closing call to action ---------- */

.cta { text-align: center; }
.cta h2 { font-size: var(--size-h1); }
.cta p { margin: 1.25rem auto 2rem; max-width: 34ch; }
.cta .btn-row { justify-content: center; }

/* ---------- Inner pages ---------- */

.page-head { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3.25rem); }
.page-head h1 { font-size: var(--size-h1); max-width: 16ch; margin-top: 0.75rem; }
.page-head .lede { margin-top: 1.5rem; }

.service { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.service h2 { margin: 0.5rem 0 1.25rem; }
.service .btn { margin-top: 1.5rem; }

.includes { margin: clamp(2.5rem, 5vw, 4rem) 0 0; border-bottom: 1px solid var(--ink); }
.includes > div { display: grid; grid-template-columns: 3fr 9fr; gap: var(--gap); border-top: 1px solid var(--ink); padding: 1.15rem 0; }
.includes dt { font: 400 clamp(1.25rem, 2vw, 1.6rem)/1.2 var(--font-display); }
.includes dd { margin: 0; max-width: 40rem; }
.includes dd p + p { margin-top: 0.75rem; }
.includes-title { margin-top: clamp(2.5rem, 5vw, 4rem); }
.includes-title + .includes { margin-top: 0.75rem; }
.after-includes { margin-top: 2rem; }

.article { display: grid; grid-template-columns: 2fr 8fr 2fr; gap: var(--gap); padding-bottom: var(--space-section); }
.article-meta a { text-underline-offset: 0.4em; }
.prose { max-width: 42rem; }
.prose > .photo, .prose > .ph { margin-bottom: 2.5rem; }
.prose h2 { font-size: var(--size-h3); line-height: 1.15; margin: 2.2em 0 0.6em; }
.prose ul { margin: 0 0 1em; padding-left: 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose a { text-underline-offset: 0.2em; }

/* ---------- Quote form ---------- */

.form fieldset { border: 0; border-top: 1px solid var(--ink); margin: 0; padding: 1.1rem 0 clamp(2rem, 4vw, 3rem); min-width: 0; }
.form legend { float: left; width: 100%; padding: 0; margin-bottom: 1.5rem; }
.form .fields { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem var(--gap); max-width: 52rem; }
.field--wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%;
  font: 300 1rem/1.5 var(--font-body);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.8rem 0.9rem;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - 0.8rem) 50%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field .hint { display: block; margin-top: 0.35rem; font-size: 0.875rem; color: var(--ink-soft); }
.form .submit { border-top: 1px solid var(--ink); padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.hp { position: absolute; left: -999rem; width: 1px; height: 1px; overflow: hidden; }

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

.site-footer { background: var(--ink); color: var(--cream); padding-block: clamp(3rem, 7vw, 5.5rem) 1.75rem; }
.site-footer .wordmark { width: min(100%, 40rem); height: auto; }
.footer-row { display: grid; grid-template-columns: 6fr 3fr 3fr; gap: var(--gap); margin-top: clamp(2.5rem, 5vw, 4rem); }
.footer-row ul { list-style: none; margin: 0; padding: 0; }
.footer-row a { text-decoration: none; }
.footer-row a:hover { text-decoration: underline; text-underline-offset: 0.4em; }
.footer-note { font: 400 var(--size-h3)/1.15 var(--font-display); letter-spacing: -0.005em; max-width: 16ch; margin: 0; }
.footer-legal { margin-top: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid color-mix(in srgb, var(--cream) 25%, transparent); padding-top: 1rem; color: var(--cream); }

/* ---------- Phones and narrow windows ---------- */

@media (max-width: 760px) {
  .hero, .intro, .intro-text, .split, .service, .cols-3, .section-head, .article, .footer-row, .form .fields { grid-template-columns: 1fr; }
  .includes > div { grid-template-columns: 1fr; gap: 0.4rem; }
  .post-list a { grid-template-columns: 1fr auto; gap: 0.25rem 1rem; }
  .post-list a > .mono:first-child { grid-column: 1 / -1; }
  .section-head { gap: 0.5rem; }
  .hero .ph, .hero .photo { max-height: 70vh; }
  .numbered li { gap: 1rem; }
  .btn-row .btn { flex: 1 1 auto; text-align: center; }
}
