/* roberthopkins.net
   A desert at golden hour in light mode and at dusk in dark mode, following
   the visitor's system setting. Fraunces for display, Hanken Grotesk for text,
   both self-hosted (SIL Open Font License). */

@font-face { font-family: 'Fraunces'; src: url('/assets/fonts/fraunces-latin-opsz-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/assets/fonts/fraunces-latin-opsz-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('/assets/fonts/hanken-grotesk-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Golden hour. */
  --sky-top: #F9E7CC;
  --sky-mid: #F6CFA3;
  --sky-low: #F0AA7C;
  --sun: #FFEFC6;
  --sun-glow: rgba(255, 196, 120, 0.7);
  --dune-far: #E6B48A;
  --dune-mid: #D99A68;
  --dune-near: #C9814F;
  --cactus-far: #B88A6A;
  --cactus-mid: #7C6A4A;
  --pebble: #A86A3F;
  --weed: #6B4426;
  --weed-light: #9A6B40;
  --weed-shadow: rgba(84, 46, 20, 0.35);
  --dust: rgba(248, 226, 196, 0.9);
  --stars: 0;

  --sand: #F3E3CC;
  --sand-deep: #EBD5B6;
  --paper: #FFFAF2;
  --text: #2A1F17;
  --muted: #6B5444;
  --line: #E2CDAE;
  --line-strong: #C9AE8A;
  --accent: #A9482A;
  --accent-hover: #8A3A20;
  --on-accent: #FFFFFF;
  --link: #A0421F;
  --error: #A12A1E;
  --focus: #2F5DA8;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dusk, with the first stars out. */
    --sky-top: #0F0B22;
    --sky-mid: #251A45;
    --sky-low: #5A3561;
    --sun: #F6E8D4;
    --sun-glow: rgba(240, 190, 160, 0.28);
    --dune-far: #3D2A50;
    --dune-mid: #2F2142;
    --dune-near: #241935;
    --cactus-far: #33244A;
    --cactus-mid: #1B1328;
    --pebble: #1A1226;
    --weed: #C9A27A;
    --weed-light: #8F7258;
    --weed-shadow: rgba(0, 0, 0, 0.5);
    --dust: rgba(200, 180, 210, 0.45);
    --stars: 1;

    --sand: #1E1530;
    --sand-deep: #191127;
    --paper: #2A2040;
    --text: #F4EADF;
    --muted: #C3B3C9;
    --line: #3D3058;
    --line-strong: #5C4A80;
    --accent: #F0A867;
    --accent-hover: #F7C08A;
    --on-accent: #22160E;
    --link: #F3B57E;
    --error: #FF9C8C;
    --focus: #9CC0FF;

    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--sand);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; letter-spacing: -0.01em; margin: 0; font-variation-settings: 'opsz' 144; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--accent); }
p { margin: 0; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.wrap.narrow { width: min(760px, 100% - 40px); }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--paper); color: var(--text); padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 16px; }

.eyebrow { font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: 14px 26px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--on-accent); text-decoration: none; cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }
.btn:disabled { opacity: 0.65; cursor: progress; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--text); }
.text-button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

/* ---- The desert ---------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-low) 78%);
}

.sky { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.sun {
  position: absolute; left: 68%; top: 47%;
  width: clamp(110px, 16vw, 210px); aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--sun);
  animation: sink 40s ease-in-out infinite alternate;
}
.sun::before {
  content: ''; position: absolute; inset: -140%; border-radius: 50%;
  background: radial-gradient(circle, var(--sun-glow) 0, transparent 62%);
}
@keyframes sink { from { transform: translate(-50%, -50%); } to { transform: translate(-50%, -38%); } }

/* Stars: a few hundred tiny dots from layered gradients, only at dusk. */
.stars {
  position: absolute; inset: 0 0 40% 0; opacity: var(--stars);
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 33%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 6%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 40%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 44%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 46%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 71% 52%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 18% 62%, #fff 50%, transparent 51%);
  background-size: 420px 300px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { filter: brightness(0.7); } to { filter: brightness(1.15); } }

.scene {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: -1;
  width: 100%; height: min(46%, 520px, max(62vw, 34%));
  pointer-events: none;
}
.dune-far { fill: var(--dune-far); }
.dune-mid { fill: var(--dune-mid); }
.dune-near { fill: var(--dune-near); }
.cactus-far { fill: var(--cactus-far); }
.cactus-mid { fill: var(--cactus-mid); }
.pebbles { fill: var(--pebble); opacity: 0.55; }

.hero-copy { position: relative; z-index: 20; padding-top: clamp(72px, 15vh, 170px); }
.hero-copy > * { max-width: 760px; }
.hero-copy .eyebrow { margin-bottom: 18px; color: var(--muted); }
.hero h1 { font-size: clamp(2.8rem, 8.2vw, 6.4rem); font-weight: 300; }
.hero .lede { margin-top: 22px; max-width: 34ch; font-size: clamp(1.08rem, 1.8vw, 1.3rem); color: var(--muted); }
.tally { margin-top: 18px; font-size: 0.92rem; color: var(--muted); animation: fade-in 0.6s ease both; }
.tally [data-tally-count] { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Tumbleweeds (js/tumbleweeds.js). */
.tumbleweeds { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.weed { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: grab; touch-action: manipulation; will-change: transform; -webkit-tap-highlight-color: transparent; }
.weed:active { cursor: grabbing; }
.weed.far { filter: blur(0.6px) saturate(0.8); opacity: 0.85; }
.weed-body { position: absolute; inset: 0; will-change: transform; transform-origin: 50% 50%; }
.weed-art { width: 100%; height: 100%; overflow: visible; }
.weed-art path { fill: none; stroke-linecap: round; }
.weed-back { stroke: var(--weed-light); stroke-width: 1.6; opacity: 0.8; }
.weed-front { stroke: var(--weed); stroke-width: 2.1; }
.weed-twigs { stroke: var(--weed); stroke-width: 1.8; }
.weed-shadow {
  position: absolute; left: 12%; right: 12%; bottom: -5%; height: 14%;
  border-radius: 50%; background: radial-gradient(closest-side, var(--weed-shadow), transparent);
}
.dust {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, var(--dust), transparent);
  animation: puff 1s ease-out forwards;
}
@keyframes puff { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(1.8) translateY(-6px); } }

/* "Say hello": appears once the first tumbleweed has rolled by. */
.scroll-cue {
  position: absolute; left: 50%; bottom: clamp(18px, 4vh, 40px); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translateX(-50%);
  color: var(--paper); text-decoration: none; font-weight: 600; letter-spacing: 0.08em; font-size: 0.95rem;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
@media (prefers-color-scheme: dark) { .scroll-cue { color: var(--text); } }
.scroll-cue span { padding: 6px 16px; border-radius: 999px; background: rgba(42, 31, 23, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@media (prefers-color-scheme: dark) { .scroll-cue span { background: rgba(255, 255, 255, 0.08); } }
.cue-arrow { width: 22px; height: 38px; animation: nudge 1.8s ease-in-out infinite; }
.cue-arrow path { stroke-dasharray: 60; stroke-dashoffset: 60; }
.scroll-cue.is-visible .cue-arrow path, .no-js .cue-arrow path { animation: draw 0.9s 0.2s ease forwards; }
.tw-waiting .scroll-cue { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.scroll-cue:hover span { background: rgba(42, 31, 23, 0.5); }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .sun, .stars, .cue-arrow { animation: none; }
  .cue-arrow path { stroke-dashoffset: 0; animation: none !important; }
  .scroll-cue { transition: none; }
}

/* ---- Contact ------------------------------------------------------------- */

.contact {
  position: relative;
  padding: clamp(64px, 10vw, 120px) 0 clamp(72px, 10vw, 120px);
  background: linear-gradient(180deg, var(--dune-near) 0, var(--sand) 220px);
  scroll-margin-top: 0;
}
.contact-grid { display: grid; gap: clamp(32px, 6vw, 72px); grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; }
.contact-intro { padding-top: 12px; }
.contact-intro h2 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); margin: 14px 0 20px; }
.contact-intro p { color: var(--muted); max-width: 42ch; }
.contact-intro p + p { margin-top: 14px; }
.contact-intro .small { font-size: 0.92rem; }
.contact .eyebrow { color: var(--text); opacity: 0.75; }

.contact-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(22px, 4vw, 40px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 30px 60px -30px rgba(80, 40, 10, 0.35);
}
@media (prefers-color-scheme: dark) { .contact-card { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6); } }

.form { display: grid; gap: 18px; }
.form .row { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--sand);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea { min-height: 150px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
[aria-invalid="true"] { border-color: var(--error) !important; }
.error { color: var(--error); font-size: 0.88rem; min-height: 0; }
.error:empty { display: none; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 0.95rem; color: var(--muted); }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { min-height: 65px; }
.form-alert { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--error); color: var(--error); font-size: 0.95rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.fine { font-size: 0.85rem; color: var(--muted); }
.notice h3 { font-size: 2rem; margin: 10px 0 12px; }
.notice p:not(.eyebrow) { color: var(--muted); }
.notice:focus { outline: none; }

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

.site-footer { background: var(--sand-deep); border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 28px; padding: 26px 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.site-footer a, .site-footer .text-button { color: var(--muted); }
.site-footer a:hover, .site-footer .text-button:hover { color: var(--text); }
.cookie-settings { display: none; }
.has-consent .cookie-settings { display: inline; }

/* ---- Policies ------------------------------------------------------------ */

.legal main { padding-bottom: 80px; }
.page-head { padding: clamp(48px, 8vw, 96px) 0 36px; background: linear-gradient(180deg, var(--sky-mid), var(--sand)); margin-bottom: 24px; }
.home-link { display: inline-flex; gap: 8px; font-weight: 600; text-decoration: none; color: var(--text); margin-bottom: 30px; }
.home-link:hover { color: var(--link); }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 300; }
.page-head .lede { margin-top: 16px; font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.updated { margin-top: 18px; font-size: 0.88rem; color: var(--muted); }
.toc { border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; background: var(--paper); margin-bottom: 40px; }
.toc ol { margin: 10px 0 0; padding-left: 1.2em; columns: 2 220px; column-gap: 32px; font-size: 0.95rem; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.prose h2 { font-size: 1.75rem; margin: 48px 0 14px; scroll-margin-top: 24px; }
.prose h3 { font-size: 1.25rem; margin: 28px 0 10px; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { font-weight: 700; background: var(--sand-deep); }
.ask { margin-top: 48px; }

/* ---- Not found ----------------------------------------------------------- */

.lost-page { min-height: 72vh; display: flex; align-items: center; padding: 64px 0; background: linear-gradient(180deg, var(--sky-top), var(--sky-low)); }
.lost-page .big { font-family: var(--display); font-style: italic; font-weight: 300; font-size: clamp(6rem, 20vw, 12rem); line-height: 0.9; color: var(--accent); opacity: 0.85; }
.lost-page h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 14px 0; font-weight: 300; }
.lost-page .lede { color: var(--muted); margin-bottom: 30px; font-size: 1.15rem; }

/* ---- Small screens ------------------------------------------------------- */

@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* A tall, narrow sky: let the sun sit low, half behind the dunes. */
  .sun { top: 74%; left: 74%; }
  .form .row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .hero-copy { padding-top: 64px; }
}

/* ---- Cookie banner, in the site's colours and type ----------------------- */

#cc-main {
  --cc-font-family: var(--sans);
  --cc-modal-border-radius: 18px;
  --cc-btn-border-radius: 999px;
  --cc-bg: var(--paper);
  --cc-primary-color: var(--text);
  --cc-secondary-color: var(--muted);
  --cc-btn-primary-bg: var(--accent);
  --cc-btn-primary-color: var(--on-accent);
  --cc-btn-primary-border-color: var(--accent);
  --cc-btn-primary-hover-bg: var(--accent-hover);
  --cc-btn-primary-hover-color: var(--on-accent);
  --cc-btn-primary-hover-border-color: var(--accent-hover);
  --cc-btn-secondary-bg: var(--accent);
  --cc-btn-secondary-color: var(--on-accent);
  --cc-btn-secondary-border-color: var(--accent);
  --cc-btn-secondary-hover-bg: var(--accent-hover);
  --cc-btn-secondary-hover-color: var(--on-accent);
  --cc-btn-secondary-hover-border-color: var(--accent-hover);
  --cc-separator-border-color: var(--line);
  --cc-toggle-on-bg: var(--accent);
  --cc-toggle-off-bg: var(--line-strong);
  --cc-toggle-readonly-bg: var(--line);
  --cc-cookie-category-block-bg: var(--sand);
  --cc-cookie-category-block-border: var(--line);
  --cc-cookie-category-block-hover-bg: var(--sand-deep);
  --cc-cookie-category-block-hover-border: var(--line-strong);
  --cc-section-category-border: var(--line);
  --cc-overlay-bg: rgba(20, 12, 6, 0.6);
  --cc-footer-bg: var(--sand);
  --cc-footer-color: var(--muted);
  --cc-footer-border-color: var(--line);
  --cc-link-color: var(--link);
}
#cc-main .cm, #cc-main .pm { border: 1px solid var(--line); }
#cc-main .cm__title, #cc-main .pm__title { font-family: var(--display); font-weight: 400; font-size: 1.35rem; }
/* "Choose cookies" stays quieter than the two equal-weight choices. */
#cc-main .cm__btn--secondary[data-role="show"] { background: transparent; color: var(--text); border-color: var(--line-strong); }
