/* tillrock.com — Section
   A geological cross-section: loose strata above, bedrock below. The form
   rests on the bedrock. Dark is the native state; light mode is limestone. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --s1: #0F0E0C;   /* bitumen */
  --s2: #1A1714;
  --s3: #241F1A;
  --s4: #2F2822;
  --s5: #3A312A;   /* dun */
  --rock: #090A0E; /* bedrock: colder, harder */
  --ink: #CFC6B8;  /* bone */
  --ink-dim: rgba(207, 198, 184, 0.68);
  --rule: rgba(207, 198, 184, 0.5);   /* ≥3:1 on bedrock */
  --accent: #A0714E; /* oxidised iron: focus only */
  --grain-opacity: 0.09;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --s1: #E6E3DC; --s2: #DDD9D0; --s3: #D3CEC4; --s4: #C8C2B7; --s5: #BCB5A9;
    --rock: #A6A39B;
    --ink: #1E1A16; --ink-dim: rgba(30, 26, 22, 0.82);
    --rule: rgba(30, 26, 22, 0.62);   /* ≥3:1 on limestone bedrock */
    --accent: #4A2E1C; --grain-opacity: 0.12;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--s1);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- the section ---------- */
.strata {
  position: relative;
  flex: 1 1 auto;
  min-height: 56dvh;
  overflow: hidden;
  background: var(--s1);
}
.strata svg {
  position: absolute; inset: -4% 0;
  width: 100%; height: 108%;
  display: block;
}
.band { transform-box: fill-box; will-change: transform; }
.band.b2 { fill: var(--s2); animation: drift 86s ease-in-out infinite alternate; }
.band.b3 { fill: var(--s3); animation: drift 112s ease-in-out infinite alternate-reverse; }
.band.b4 { fill: var(--s4); animation: drift 74s ease-in-out infinite alternate; }
.band.b5 { fill: var(--s5); animation: drift 98s ease-in-out infinite alternate-reverse; }
@keyframes drift {
  from { transform: translateY(0); }
  to   { transform: translateY(1.6%); }
}
@media (prefers-reduced-motion: reduce) {
  .band { animation: none !important; }
}

/* grain: paper tooth over everything */
.grain {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 5;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* ---------- identity ---------- */
.brand {
  position: absolute; z-index: 2;
  top: max(11px, calc(env(safe-area-inset-top) - 11px)); left: 24px;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;              /* 44px tall target around a 22px mark */
  color: var(--ink); text-decoration: none;
}
.brand:focus-visible { outline: 1px solid var(--accent); outline-offset: 8px; }
.mark { width: 22px; height: 22px; display: block; flex: none; }
.mark rect { fill: currentColor; }
.mark .outline { fill: none; stroke: currentColor; stroke-width: 1; }
.wordmark {
  font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.3em; text-transform: uppercase;
  padding-top: 1px; /* optical centring against the mark */
}

/* ---------- bedrock: the form rests here ---------- */
.rock {
  position: relative;
  background: var(--rock);
  border-top: 1px solid var(--rule);  /* the only straight edge on the page */
  padding: clamp(28px, 4.5vh, 48px) 24px calc(28px + env(safe-area-inset-bottom));
}
form {
  max-width: 1120px; margin: 0 auto;
  display: grid; gap: 22px 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  form { grid-template-columns: 1fr 1fr 1fr; align-items: end; }
  .field.wide { grid-column: 1 / 3; }
}
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
label {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: 400;
}
input, textarea {
  font: inherit; font-weight: 400; font-size: 16px; line-height: 1.4;
  color: var(--ink); background: transparent; border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 8px 0 10px; border-radius: 0; width: 100%;
  transition: border-color .4s ease;
}
textarea { resize: none; min-height: 1.4em; overflow: hidden; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-bottom-color: var(--accent); }
input:focus-visible, textarea:focus-visible {
  outline: none; border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}
input::placeholder, textarea::placeholder { color: transparent; }
input:-webkit-autofill, textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  transition: background-color 9999s ease-out;
}

/* honeypot: not rendered at all (browsers do not autofill display:none fields) */
.hp { display: none; }

.send {
  display: inline-flex; align-items: center; gap: 14px;
  align-self: end; justify-self: start;
  min-height: 44px;  /* comfortable target */
  background: none; border: 0; padding: 8px 0 10px; cursor: pointer;
  font: inherit; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink);
}
.send .line {
  display: inline-block; width: 36px; height: 1px; background: currentColor;
  transform-origin: left center; transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.send:hover .line, .send:focus-visible .line { transform: scaleX(1.8); }
.send:focus-visible { outline: 1px solid var(--accent); outline-offset: 6px; }
.send[disabled] { cursor: default; opacity: .6; }
.send[disabled] .line { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scaleX(1.8); } }
@media (prefers-reduced-motion: reduce) { .send[disabled] .line { animation: none; } }

.status {
  grid-column: 1 / -1; min-height: 1.4em; margin: 0;
  font-size: 13px; letter-spacing: 0.04em; color: var(--ink-dim);
}
.status.ok { color: var(--ink); }

form.sent .field, form.sent .send { visibility: hidden; opacity: 0; transition: opacity .6s ease; }

/* Turnstile mounts here; invisible mode renders nothing visible. */
.turnstile { grid-column: 1 / -1; min-height: 0; }
