/* ============================================================
   curtishallatt.com · "Sonoran Editorial" design system
   Locked 2026-07-02 · see /brand/DESIGN.md
   Layers: reset → tokens → base → layout → components → utilities
   ============================================================ */
@layer reset, tokens, base, layout, components, utilities;

/* ---------- SELF-HOSTED VARIABLE FONTS (assets/fonts) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-var.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-var-italic.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- RESET ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; }
  body { min-height: 100svh; }
  img, picture, svg, video { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  h1, h2, h3, h4 { overflow-wrap: break-word; }
  p { overflow-wrap: break-word; }
}

/* ---------- TOKENS ---------- */
@layer tokens {
  :root {
    /* color */
    --bone: #F4EFE7;
    --sand: #E7DCCB;
    --sand-soft: #EFE7D8;
    --ink: #221E19;
    --ink-soft: #362F27;
    --ivory: #F2EEE6;
    --stone: #6E655A;
    --sage: #75806B;
    --terra: #B4633A;
    --terra-deep: #9E4E28;
    --terra-press: #8A431F;
    --hairline: #DCD2C0;
    --hairline-dark: #3A342C;

    /* type */
    --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
    --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
    --brand-serif: "Cinzel", Georgia, serif; /* logo wordmark only */
    --t-1: 0.8125rem;   /* 13 */
    --t0: 1rem;         /* 16 */
    --t1: 1.25rem;      /* 20 */
    --t2: 1.5625rem;    /* 25 */
    --t3: 1.953rem;     /* 31 */
    --t4: clamp(1.953rem, 1.4rem + 2.2vw, 2.441rem);   /* 31→39 */
    --t5: clamp(2.2rem, 1.6rem + 3vw, 3.052rem);        /* 35→49 */
    --t6: clamp(2.6rem, 1.8rem + 4.4vw, 3.815rem);      /* 42→61 */
    --t7: clamp(3rem, 1.9rem + 5.8vw, 4.768rem);        /* 48→76 */

    /* space (8pt) */
    --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
    --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;

    --container: 1200px;
    --radius: 2px;
    --ease: cubic-bezier(.4, 0, .2, 1);
  }
}

/* ---------- BASE ---------- */
@layer base {
  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: .01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .01ms !important;
    }
  }
  body {
    background: var(--bone);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--t0);
    line-height: 1.55;
    font-optical-sizing: auto;
  }
  h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 480;
    line-height: 1.08;
    letter-spacing: -0.015em;
    font-optical-sizing: auto;
  }
  h1 { font-size: var(--t6); }
  h2 { font-size: var(--t5); }
  h3 { font-size: var(--t2); line-height: 1.2; }
  p  { max-width: 68ch; }
  a  { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
  a:hover { text-decoration-color: var(--terra-deep); }
  :focus-visible {
    outline: 2px solid var(--terra-deep);
    outline-offset: 3px;
    border-radius: var(--radius);
  }
  ::selection { background: var(--sand); }
  strong { font-weight: 700; }
  .num, .stat-value { font-variant-numeric: lining-nums; }
}

/* ---------- LAYOUT ---------- */
@layer layout {
  .container {
    width: min(100% - 48px, var(--container));
    margin-inline: auto;
  }
  .section { padding-block: var(--s7); }
  .section--tight { padding-block: var(--s6); }
  @media (min-width: 1024px) {
    .section { padding-block: var(--s8); }
  }
  .grid-2 { display: grid; gap: var(--s5); }
  .grid-3 { display: grid; gap: var(--s4); }
  @media (min-width: 900px) {
    .grid-2 { grid-template-columns: 1fr 1fr; align-items: center; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
  }
  .rule { border: 0; border-top: 1px solid var(--hairline); margin-block: var(--s4); }
  .prose > * + * { margin-top: var(--s3); }
}

/* ---------- COMPONENTS ---------- */
@layer components {

  /* Skip link */
  .skip-link {
    position: absolute; left: -999px; top: 8px; z-index: 100;
    background: var(--ink); color: var(--ivory);
    padding: 10px 16px; border-radius: var(--radius);
  }
  .skip-link:focus { left: 8px; }

  /* ---- Header (sticky · ADRE R4-28-502(J): broker visible without scrolling) ---- */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in oklab, var(--bone) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hairline);
  }
  .site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s3); padding-block: 10px;
  }
  .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
  .brand__mark { width: 44px; height: 44px; flex: none; color: var(--ink); }
  /* Logo wordmark: original engraved style — Cinzel caps, letterspaced */
  .brand__name {
    font-family: var(--brand-serif); font-size: 14px; font-weight: 560;
    letter-spacing: .18em; text-transform: uppercase; line-height: 1.1;
  }
  .wordmark {
    font-family: var(--brand-serif); font-weight: 560;
    letter-spacing: .18em; text-transform: uppercase;
  }
  /* Brokerage ≥ team size everywhere the team name appears (ADRE SPS 2025.03) */
  .brand__lic { margin-top: 2px; line-height: 1.25; }
  .brand__broker {
    display: block; font-size: 11.5px; font-weight: 700;
    letter-spacing: .13em; text-transform: uppercase; color: var(--ink);
  }
  .brand__team {
    display: block; font-size: 10.5px; letter-spacing: .06em; color: var(--stone);
  }

  .site-nav { display: flex; align-items: center; gap: var(--s3); }
  .site-nav a { text-decoration: none; font-size: 15px; font-weight: 500; }
  .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--terra-deep); text-underline-offset: 6px; }
  .site-nav .btn { margin-left: 4px; }
  .nav-phone { color: var(--stone); font-size: 14.5px; }

  .nav-toggle {
    display: none; background: none; border: 1px solid var(--hairline);
    border-radius: var(--radius); padding: 9px 12px; cursor: pointer;
  }
  @media (max-width: 919px) {
    .nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
    .site-nav {
      position: absolute; top: 100%; left: 0; right: 0;
      display: none; flex-direction: column; align-items: stretch; gap: 0;
      background: var(--bone); border-bottom: 1px solid var(--hairline);
      padding: var(--s2) var(--s3) var(--s3);
    }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--hairline); }
    .site-nav a:last-of-type { border-bottom: 0; }
    .nav-phone { padding: 12px 4px; }
  }

  /* ---- Buttons ---- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: var(--terra-deep); color: var(--bone);
    font-weight: 700; font-size: 15.5px; letter-spacing: .01em;
    padding: 15px 28px; border: 0; border-radius: var(--radius);
    text-decoration: none; cursor: pointer;
    transition: background 150ms var(--ease), transform 150ms var(--ease);
  }
  .btn:hover { background: var(--terra-press); }
  .btn:active { transform: translateY(1px); }
  .btn--ghost {
    background: transparent; color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
  }
  .btn--ghost:hover { background: var(--sand-soft); }
  .btn--light { background: var(--ivory); color: var(--ink); }
  .btn--light:hover { background: #fff; }
  .btn--lg { padding: 18px 34px; font-size: 16.5px; }
  .btn--sm { padding: 11px 18px; font-size: 14px; }

  /* ---- Eyebrow / labels ---- */
  .eyebrow {
    font-family: var(--sans); font-size: 12.5px; font-weight: 500;
    letter-spacing: .15em; text-transform: uppercase; color: var(--stone);
    display: block; margin: 0 0 var(--s2);
  }
  .eyebrow--rule { display: flex; align-items: center; gap: 14px; }
  .eyebrow--rule::before { content: ""; width: 40px; height: 1px; background: var(--terra); }

  /* ---- Hero ---- */
  .hero { position: relative; overflow: clip; }
  .hero--dusk {
    background:
      radial-gradient(120% 90% at 78% 110%, rgba(180, 99, 58, .16) 0%, rgba(180, 99, 58, 0) 55%),
      radial-gradient(100% 70% at 20% 0%, #FAF7F1 0%, rgba(250, 247, 241, 0) 60%),
      linear-gradient(180deg, var(--bone) 0%, var(--sand) 130%);
  }
  .hero--dusk::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.13 0 0 0 0 0.11 0 0 0 0 0.09 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  .hero__inner { position: relative; z-index: 1; padding-block: var(--s7); }
  @media (min-width: 1024px) { .hero__inner { padding-block: var(--s8); } }
  .hero__title { font-size: var(--t7); max-width: 14ch; text-wrap: balance; }
  .hero__title em { font-style: italic; color: var(--terra-deep); }
  .hero__lede { margin-top: var(--s3); font-size: var(--t1); color: var(--stone); max-width: 46ch; }
  .hero__actions { margin-top: var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

  /* ---- Address / valuation form ---- */
  .val-form { margin-top: var(--s4); max-width: 620px; }
  .val-form__row { display: flex; gap: 10px; }
  .val-form__row input {
    flex: 1; min-width: 0; background: #FDFBF7;
    border: 1px solid var(--hairline); border-radius: var(--radius);
    padding: 16px 18px; font-size: 16px;
  }
  .val-form__row input::placeholder { color: var(--stone); }
  .val-form__row input:focus-visible { outline-offset: 0; border-color: var(--terra-deep); }
  .val-form__hint { margin-top: 10px; font-size: 13px; color: var(--stone); }
  @media (max-width: 560px) {
    .val-form__row { flex-direction: column; }
    .val-form__row .btn { width: 100%; }
  }

  /* ---- Generic forms ---- */
  .form { display: grid; gap: var(--s2); max-width: 620px; }
  .form label { font-size: 14px; font-weight: 500; display: grid; gap: 6px; }
  .form input, .form select, .form textarea {
    background: #FDFBF7; border: 1px solid var(--hairline);
    border-radius: var(--radius); padding: 14px 16px; font-size: 16px; width: 100%;
  }
  .form textarea { min-height: 120px; resize: vertical; }
  .form__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--stone); font-weight: 400; }
  .form__consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
  .form__fine { font-size: 12.5px; color: var(--stone); }
  .hp-field { position: absolute !important; left: -9999px !important; opacity: 0; pointer-events: none; }

  /* Two-step form */
  .steps { counter-reset: step; }
  .step[hidden] { display: none; }
  .step__label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); margin-bottom: var(--s2); display: block; }

  /* ---- Stats ---- */
  .stat-row { display: grid; gap: var(--s4); grid-template-columns: repeat(2, 1fr); }
  @media (min-width: 720px) { .stat-row { grid-template-columns: repeat(var(--stat-cols, 4), 1fr); } }
  .stat-value {
    font-family: var(--serif); font-size: var(--t5); font-weight: 460;
    line-height: 1; letter-spacing: -0.01em;
  }
  .stat-value sup { font-size: .45em; vertical-align: super; }
  .stat-label { margin-top: 8px; font-size: 13.5px; color: var(--stone); }
  .panel--ink .stat-label { color: #B7B0A4; }
  .stat--terra .stat-value { color: var(--terra); }

  /* ---- Dark panel ---- */
  .panel--ink {
    background: var(--ink); color: var(--ivory);
  }
  .panel--ink .eyebrow { color: #B7B0A4; }
  .panel--ink .rule { border-color: var(--hairline-dark); }
  .panel--ink p { color: #CFC8BC; }
  .panel--ink h2, .panel--ink h3, .panel--ink .stat-value { color: var(--ivory); }

  /* ---- Cards (neighborhoods, guides) ---- */
  .card {
    background: transparent; text-decoration: none; display: block;
  }
  .card__media {
    aspect-ratio: 4 / 4.6; border-radius: 999px 999px 0 0; overflow: hidden;
    background: linear-gradient(180deg, var(--sand) 0%, #D9CBB2 100%);
    position: relative; border: 1px solid var(--hairline);
  }
  .card__media img { width: 100%; height: 100%; object-fit: cover; }
  .card__art {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: var(--ink);
  }
  .card__art svg { width: 66%; height: auto; }
  .hero__ridge {
    position: absolute; inset: auto 0 -2px 0; width: 100%; height: 90px;
    color: var(--sage); opacity: .4; pointer-events: none;
  }
  .card__media--ridge::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
    background:
      linear-gradient(160deg, transparent 55%, rgba(34,30,25,.08) 55.5%),
      linear-gradient(200deg, transparent 63%, rgba(34,30,25,.12) 63.5%);
  }
  .card__body { padding-top: var(--s3); }
  .card h3 { font-size: var(--t2); }
  .card__meta { margin-top: 6px; color: var(--stone); font-size: 14.5px; }
  .card__cta { margin-top: 12px; font-weight: 700; font-size: 14.5px; color: var(--terra-deep); }
  .card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

  /* ---- Testimonials ---- */
  .quote {
    border-top: 1px solid var(--hairline); padding-top: var(--s3);
  }
  .quote p { font-family: var(--serif); font-size: var(--t1); line-height: 1.45; font-weight: 420; }
  .quote footer { margin-top: var(--s2); font-size: 14px; color: var(--stone); }
  .quote footer strong { color: var(--ink); font-weight: 700; }

  /* ---- Steps / process ---- */
  .process { counter-reset: proc; display: grid; gap: var(--s4); }
  @media (min-width: 900px) { .process { grid-template-columns: repeat(3, 1fr); } }
  .process__item { border-top: 1px solid var(--hairline); padding-top: var(--s3); }
  .process__item::before {
    counter-increment: proc; content: "0" counter(proc);
    font-family: var(--serif); font-size: var(--t3); color: var(--terra);
    display: block; margin-bottom: var(--s2); line-height: 1;
  }

  /* ---- FAQ ---- */
  .faq details { border-top: 1px solid var(--hairline); }
  .faq details:last-child { border-bottom: 1px solid var(--hairline); }
  .faq summary {
    cursor: pointer; list-style: none; display: flex; justify-content: space-between;
    align-items: center; gap: var(--s3); padding: 18px 2px;
    font-weight: 500; font-size: 17px;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after { content: "+"; font-family: var(--serif); font-size: 22px; color: var(--terra-deep); flex: none; }
  .faq details[open] summary::after { content: "−"; }
  .faq .faq__a { padding: 0 2px 20px; color: var(--stone); max-width: 68ch; }

  /* ---- CTA band ---- */
  .cta-band { text-align: center; }
  .cta-band h2 { max-width: 22ch; margin-inline: auto; text-wrap: balance; }
  .cta-band .btn { margin-top: var(--s4); }
  .cta-band__sub { margin-top: var(--s2); color: var(--stone); font-size: 15px; }

  /* ---- Footer ---- */
  .site-footer { background: var(--ink); color: #CFC8BC; font-size: 14px; }
  .site-footer a { color: var(--ivory); }
  .site-footer__grid {
    display: grid; gap: var(--s5); padding-block: var(--s6);
  }
  @media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
  .site-footer h2 { font-size: 15px; color: var(--ivory); font-family: var(--sans); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: var(--s2); }
  .site-footer ul { list-style: none; padding: 0; display: grid; gap: 10px; }
  .site-footer__brand .brand__mark { color: var(--ivory); width: 52px; height: 52px; }
  .site-footer__legal {
    border-top: 1px solid var(--hairline-dark); padding-block: var(--s4);
    font-size: 12.5px; line-height: 1.7; color: #A69F92;
  }
  .site-footer__legal p { max-width: none; }
  .site-footer__marks { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
  .site-footer__marks img, .site-footer__marks svg { height: 34px; width: auto; }
  .eho { display: inline-flex; align-items: center; gap: 10px; }

  /* ---- Sticky mobile action bar ---- */
  .action-bar {
    position: fixed; inset: auto 0 0 0; z-index: 60;
    display: none; grid-template-columns: 1fr 1fr 1.4fr;
    background: var(--ink); color: var(--ivory);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--hairline-dark);
  }
  .action-bar a {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 15px 8px; text-decoration: none; font-size: 14.5px; font-weight: 700;
  }
  .action-bar a + a { border-left: 1px solid var(--hairline-dark); }
  .action-bar .is-primary { background: var(--terra-deep); color: var(--bone); }
  @media (max-width: 719px) {
    .action-bar { display: grid; }
    body { padding-bottom: 56px; }
  }

  /* ---- Notice / disclaimer ---- */
  .notice { font-size: 12.5px; color: var(--stone); max-width: 70ch; }
  .panel--ink .notice { color: #A69F92; }
}

/* ---------- UTILITIES ---------- */
@layer utilities {
  .visually-hidden {
    position: absolute !important; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .center { text-align: center; }
  .mt-0 { margin-top: 0 !important; }
  .mt-2 { margin-top: var(--s2); }
  .mt-3 { margin-top: var(--s3); }
  .mt-4 { margin-top: var(--s4); }
  .mt-5 { margin-top: var(--s5); }
  .measure { max-width: 68ch; }
  .measure-narrow { max-width: 46ch; }
  .text-stone { color: var(--stone); }
  .serif { font-family: var(--serif); }
  .nowrap { white-space: nowrap; }
}
