/* Ryan Hasselmeier — ryanhasselmeier.com
   Warm paper / sand, deep ink, canyon rust. Serif headlines, sans UI. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/fraunces-latin-500-normal.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;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fraunces-latin-600-normal.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;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/figtree-latin-400-normal.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;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/figtree-latin-500-normal.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;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/figtree-latin-600-normal.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 {
  --paper: #f3ece1;
  --paper-elevated: #faf6ef;
  --sand: #e7dccb;
  --ink: #1c1814;
  --ink-soft: #3a342d;
  --muted: #5c564c;
  --line: #d4c8b4;
  --accent: #8f3f28;
  --accent-hover: #732f1d;
  --accent-text: #7a3420;
  --accent-fg: #faf6ef;
  --hero-fg: #f7f1e6;
  --hero-muted: rgba(247, 241, 230, 0.82);
  --danger: #8a1f1f;
  --ok: #2b5a3e;

  --font-display: "Fraunces", "Liberation Serif", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", "Liberation Sans", "Segoe UI", system-ui, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: clamp(1.35rem, 1.1rem + 1vw, 1.65rem);
  --text-2xl: clamp(1.85rem, 1.2rem + 2.2vw, 2.75rem);
  --text-3xl: clamp(2.4rem, 1.4rem + 4vw, 4.25rem);

  --leading-tight: 1.12;
  --leading-snug: 1.28;
  --leading-normal: 1.55;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --wrap: 1120px;
  --wrap-narrow: 680px;
  --gutter: 20px;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-border:
    0 0 0 1px rgba(28, 24, 20, 0.07),
    0 1px 2px -1px rgba(28, 24, 20, 0.06),
    0 2px 8px rgba(28, 24, 20, 0.04);

  --motion-quick: 150ms;
  --motion-fast: 250ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --header-h: 64px;
  --sticky-h: 64px;
  --cookie-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
}

img, picture, svg, video { max-width: 100%; height: auto; display: block; }
img { outline: 1px solid rgba(28, 24, 20, 0.08); outline-offset: -1px; }
.hero img { outline: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
  text-wrap: balance;
  color: var(--ink);
  margin: 0;
}

p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 0.9em; }

a { color: var(--accent-text); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }

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

button:not(:disabled),
[role="button"]:not(:disabled),
a.btn { cursor: pointer; }

.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;
}
  left: 12px;
  top: -48px;
  z-index: 200;
  background: var(--ink);
  color: var(--hero-fg);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
}
.skip-link:focus { top: 12px; color: var(--hero-fg); }

.wrap {
  width: min(var(--wrap), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}
.wrap-narrow {
  width: min(var(--wrap-narrow), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  color: var(--hero-fg);
  transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.site-header.is-scrolled,
.site-header--solid {
  position: sticky;
  background: rgba(243, 236, 225, 0.94);
  backdrop-filter: blur(10px);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(28, 24, 20, 0.06);
}
.site-header--solid { top: 0; }

.header-inner {
  width: min(var(--wrap), 100% - (var(--gutter) * 2));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-h);
  padding-block: 10px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: inherit; opacity: 0.82; }

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
}
.nav a {
  color: inherit;
  text-decoration: none;
  opacity: 0.88;
  padding: 6px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 374px) {
  .nav { gap: 4px 10px; font-size: 0.75rem; }
  .brand { font-size: 0.95rem; }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  color: var(--hero-fg);
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(22, 18, 14, 0.82) 0%,
    rgba(22, 18, 14, 0.42) 38%,
    rgba(22, 18, 14, 0.14) 68%,
    rgba(22, 18, 14, 0.18) 100%
  );
}
.hero-inner {
  width: min(var(--wrap), 100% - (var(--gutter) * 2));
  margin-inline: auto;
  padding: calc(var(--header-h) + 24px) 0 56px;
}
.hero-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hero-muted);
  margin-bottom: 12px;
}
.hero h1 {
  color: var(--hero-fg);
  font-size: var(--text-3xl);
  font-weight: 500;
  margin-bottom: 10px;
}
.hero-line {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--hero-fg);
  margin-bottom: 16px;
}
.hero-deck {
  max-width: 38rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--hero-muted);
  margin-bottom: 28px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--motion-quick) var(--ease-out), color var(--motion-quick) var(--ease-out), border-color var(--motion-quick) var(--ease-out), transform var(--motion-quick) var(--ease-out);
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.btn-light {
  background: var(--paper-elevated);
  color: var(--ink);
}
.btn-light:hover { background: #fff; color: var(--ink); }

.btn-ghost {
  background: transparent;
  color: var(--hero-fg);
  border-color: rgba(247, 241, 230, 0.55);
}
.btn-ghost:hover { background: rgba(247, 241, 230, 0.12); color: var(--hero-fg); }

.btn-accent {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn-accent:hover { background: var(--accent-hover); color: var(--accent-fg); }

.btn-ink {
  background: var(--ink);
  color: var(--paper);
}
.btn-ink:hover { background: #2a241e; color: var(--paper); }

/* Sections */
.section {
  padding: var(--space-8) 0;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.section-head {
  margin-bottom: var(--space-6);
  max-width: 40rem;
}
.section-head h2 { margin-bottom: 0; }
#about .stack, #agents .stack-lg { margin-top: 14px; }
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.section h2 {
  font-size: var(--text-2xl);
  margin-bottom: 14px;
}
.lede {
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 40rem;
}
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 18px; }

/* About */
#about .lede, #about p { max-width: 38rem; color: var(--ink-soft); }

/* Agents */
.toolkit {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.toolkit li {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper-elevated);
  box-shadow: var(--shadow-border);
  padding: 8px 12px;
  border-radius: 999px;
}
.github-link {
  display: inline-block;
  margin-top: 22px;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Work */
.work-block + .work-block { margin-top: var(--space-7); }
.work-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.work-grid {
  display: grid;
  gap: 12px;
}
.work-card {
  display: block;
  background: var(--paper-elevated);
  box-shadow: var(--shadow-border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}
.work-card:hover {
  box-shadow:
    0 0 0 1px rgba(28, 24, 20, 0.1),
    0 6px 18px rgba(28, 24, 20, 0.06);
  color: inherit;
}
.work-card h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.work-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.work-url {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

/* Notary */
#notary {
  background: #ebe2d2;
}
.notary-panel {
  display: grid;
  gap: var(--space-5);
  background: var(--paper-elevated);
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  box-shadow: var(--shadow-border);
  border-left: 6px solid var(--accent);
}
.notary-panel h2 { font-size: var(--text-2xl); }
.notary-phone {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--accent-text);
  text-decoration: none;
  min-height: 48px;
  line-height: 1.1;
}
.notary-phone:hover { color: var(--accent-hover); }
.notary-note { color: var(--ink-soft); max-width: 36rem; }
.notary-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Field notes */
.field-grid {
  display: grid;
  gap: 20px;
}
.field-card picture,
.field-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--sand);
}
.field-caption {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* Contact */
.contact-grid {
  display: grid;
  gap: var(--space-7);
}
.field {
  display: grid;
  gap: 6px;
}
.field label,
.consent {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}
.req { color: var(--accent-text); }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c9bda8;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin: 0;
  min-height: 1.1em;
}
.field-error:empty { display: none; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.45;
}
.consent input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  font-size: 0.92rem;
  color: var(--ink-soft);
  min-height: 1.3em;
}
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--ok); }
.turnstile-slot { min-height: 65px; }

.contact-aside {
  display: grid;
  gap: 18px;
  align-content: start;
}
.contact-intro { margin: 12px 0 24px; }
.contact-vcard {
  color: var(--ink-soft);
}
.contact-vcard a { color: var(--accent-text); font-weight: 600; }
.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.social-list a { font-weight: 500; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-inner {
  width: min(var(--wrap), 100% - (var(--gutter) * 2));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  align-items: center;
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.footer-legal a,
.footer-legal button {
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px 0;
  min-height: 44px;
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.footer-legal a:hover,
.footer-legal button:hover { color: var(--ink); }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--ink);
  color: var(--hero-fg);
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(28, 24, 20, 0.18);
}
.cookie-banner[hidden] { display: none; }
.cookie-inner {
  width: min(var(--wrap), 100% - (var(--gutter) * 2));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: space-between;
}
.cookie-copy {
  flex: 1 1 16rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--hero-muted);
}
.cookie-copy a { color: var(--hero-fg); }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-actions .btn { min-width: 7rem; }

/* Sticky mobile CTA */
.sticky-cta {
  display: none;
}
@media (max-width: 767px) {
  .sticky-cta.is-visible {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--ink);
    color: var(--hero-fg);
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(28, 24, 20, 0.2);
  }
  .sticky-cta.is-visible a {
    color: var(--hero-fg);
    text-decoration: none;
    font-weight: 600;
  }
  .sticky-cta .sticky-phone {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: -0.01em;
  }
  .sticky-cta .btn {
    background: var(--accent);
    color: var(--accent-fg);
    min-height: 44px;
    padding: 8px 14px;
    font-size: 0.85rem;
  }
  body.has-sticky-cta {
    padding-bottom: calc(var(--sticky-h) + env(safe-area-inset-bottom));
  }
  body.cookie-open .sticky-cta.is-visible {
    bottom: var(--cookie-h);
  }
  body.cookie-open {
    padding-bottom: calc(var(--sticky-h) + var(--cookie-h) + env(safe-area-inset-bottom));
  }
  .site-footer { padding-bottom: 20px; }
}

/* Inner pages */
.page-hero {
  padding: calc(var(--header-h) + 36px) 0 32px;
}
.page-hero h1 { font-size: var(--text-2xl); margin-bottom: 8px; }
.page-meta { color: var(--muted); font-size: 0.9rem; }
.prose {
  padding-bottom: var(--space-8);
  color: var(--ink-soft);
}
.prose h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}
.prose ul { padding-left: 1.15rem; }
.prose li { margin: 0.35rem 0; }
.prose a { font-weight: 500; }

/* 404 / 500 */
.fail-page {
  min-height: 70dvh;
  display: grid;
  align-content: center;
  padding: 48px 0 80px;
}
.fail-page h1 { font-size: var(--text-2xl); margin: 8px 0 12px; }
.fail-page p { color: var(--ink-soft); max-width: 36rem; }
.fail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.offline-note {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--ink);
  color: var(--hero-fg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  max-width: min(92vw, 28rem);
  text-align: center;
}
.offline-note[hidden] { display: none; }

/* Motion */
.hero-kicker, .hero h1, .hero-line, .hero-deck, .hero-actions {
  animation: rise 500ms var(--ease-out) both;
}
.hero h1 { animation-delay: 40ms; }
.hero-line { animation-delay: 80ms; }
.hero-deck { animation-delay: 120ms; }
.hero-actions { animation-delay: 160ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-kicker, .hero h1, .hero-line, .hero-deck, .hero-actions {
    animation: none;
  }
  .btn:active { transform: none; }
}

/* Breakpoints ~375, 768, 1024, 1280 */
@media (min-width: 375px) {
  :root { --gutter: 22px; }
}
@media (min-width: 768px) {
  :root { --gutter: 32px; --header-h: 72px; }
  .section { padding: var(--space-9) 0; }
  .hero-inner { padding-bottom: 72px; }
  .work-grid { grid-template-columns: 1fr 1fr; }
  .field-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .contact-grid { grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: start; }
  .notary-panel { padding: 36px 40px; }
  .nav { font-size: 0.875rem; gap: 8px 20px; }
}
@media (min-width: 1024px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-deck { font-size: 1.12rem; }
}
@media (min-width: 1280px) {
  :root { --gutter: 40px; }
}

@media (max-width: 319px) {
  .hero h1 { font-size: 2rem; }
  .btn { width: 100%; }
}
