/* ============================================================
   Whitefield Projects - hub styling
   A DIRECTORY, not a brochure. The fleet's 159 microsites each
   sell one project; this one compares eighteen, so the design
   is editorial and data-forward rather than promotional:
   serif display type, a paper-toned ground, and a position bar
   on every figure that has a set to be measured against.

   Type is a SYSTEM stack on purpose. A web font would cost a
   request, a FOUT and a CLS risk on a page carrying eighteen
   images, and Georgia is already a real editorial serif on
   every platform we serve.

   Self-contained: a hub spans many developers, so it carries no
   builders/<id>.json brand tokens.
   Mobile-first, token-based, light + dark, WCAG AA.
   ============================================================ */
:root {
  --font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  /* Paper, not white. The ground is warm so photography sits on it
     without the clinical edge a pure #fff gives a page of renders. */
  --bg: #fbfaf7;
  --surface: #f2efe9;
  --surface-2: #ffffff;
  --ink: #14181d;
  --muted: #55606d;
  --border: #ddd8ce;
  --rule: #c8c1b4;

  --accent: #0e4f47;
  --accent-hover: #0a3a34;
  --accent-ink: #ffffff;
  --link: #0e4f47;
  --link-hover: #0a3a34;
  --ghost-bg: rgba(14, 79, 71, 0.09);
  --focus: #0e4f47;

  /* Data ink. The bar track is deliberately low-contrast and the dot
     high: the reader should see the POSITION, not the scale. */
  --bar-track: #ddd8ce;
  --bar-dot: #0e4f47;
  --badge-bg: rgba(14, 79, 71, 0.10);
  --badge-ink: #0a3a34;

  --shadow: 0 1px 2px rgba(20, 24, 29, 0.05), 0 10px 30px rgba(20, 24, 29, 0.07);
  --radius: 10px;
  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151a;
    --surface: #191d24;
    --surface-2: #1e232b;
    --ink: #eceef1;
    --muted: #a9b3c0;
    --border: #2f3742;
    --rule: #3d4756;

    --accent: #74d8c6;
    --accent-hover: #93e4d5;
    --accent-ink: #06231f;
    --link: #74d8c6;
    --link-hover: #93e4d5;
    --ghost-bg: rgba(116, 216, 198, 0.15);
    --focus: #74d8c6;

    --bar-track: #333c48;
    --bar-dot: #74d8c6;
    --badge-bg: rgba(116, 216, 198, 0.14);
    --badge-ink: #a8e8dc;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.6em;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2.05rem, 5vw, 3.1rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
ul, dl { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 68ch; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: var(--accent-ink); }

/* ---- nav ---- */
.site-nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 40;
}
.nav-container { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.nav-logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-logo-img { border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-prefix { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.brand-hub { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink); cursor: pointer;
}
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
  display: block; width: 20px; height: 2px; background: currentColor; content: "";
}
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before { position: absolute; top: -6px; }
.nav-toggle-icon::after { position: absolute; top: 6px; }
.nav-menu { display: none; list-style: none; margin: 0; padding: 0; }
.nav-menu.is-open {
  display: flex; flex-direction: column; gap: 0.25rem;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem 1rem;
}
.nav-menu a { display: block; padding: 0.55rem 0; text-decoration: none; font-weight: 600; }
.nav-menu a.is-active { text-decoration: underline; text-underline-offset: 4px; }

/* Nav collapses at 1024 - the fleet breakpoint standard. */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .nav-menu { display: flex; align-items: center; gap: 1.4rem; }
  .nav-menu a { padding: 0.4rem 0; }
}

/* ---- buttons ---- */
.btn-primary, .btn-secondary {
  display: inline-block; text-decoration: none; font-weight: 650;
  padding: 0.7rem 1.3rem; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; font-size: 1rem; font-family: inherit;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-secondary { background: transparent; color: var(--link); border-color: var(--accent); }
.btn-secondary:hover { background: var(--ghost-bg); color: var(--link-hover); }
.btn-full { width: 100%; }
.btn-primary[disabled] { opacity: 0.55; cursor: not-allowed; }
.nav-cta { padding: 0.5rem 1rem; }

/* ---- hero ---- */
.hero-home, .page-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
/* A hero carrying a render drops its own top padding: the image is the top of
   the page, and the container below it supplies the breathing room. */
.page-hero--media { padding-top: 0; }
.page-hero__media { margin: 0 0 clamp(1.5rem, 3vw, 2.25rem); line-height: 0; background: var(--surface); }
.page-hero__media img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 16 / 7; object-fit: cover;
  max-height: 60vh;
}
.hero-subtitle { color: var(--muted); font-size: 1.08rem; max-width: 70ch; }
.hero-actions { margin-top: 1.4rem; }
.page-updated { margin: 0.5rem 0 1.1rem; color: var(--muted); font-size: 0.9rem; }
.page-updated time { font-weight: 600; }
.breadcrumb { font-size: 0.9rem; margin-bottom: 0.9rem; color: var(--muted); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { display: inline-block; width: 1.4em; text-align: center; }
.breadcrumb-sep::before { content: "/"; color: var(--muted); }

/* ---- sections ---- */
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section-alt { background: var(--surface); }
.section-actions { margin-top: 1.6rem; }

/* ---- directory ---- */
.hub-directory__header { max-width: 74ch; margin-bottom: 2rem; }
.hub-directory__header p { color: var(--muted); }
.hub-directory__grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .hub-directory__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .hub-directory__grid { grid-template-columns: repeat(3, 1fr); } }
.hub-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  /* Anchor for the title link's stretched hit area. */
  position: relative;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.hub-card:hover { border-color: var(--rule); box-shadow: 0 2px 4px rgba(20,24,29,0.06), 0 14px 38px rgba(20,24,29,0.10); }
/* focus-within, not :focus — the stretched link is the only focusable child,
   and a keyboard user must see the whole card take the ring, not a 0x0 box. */
.hub-card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.hub-card__body { padding: 1.15rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; }

.hub-card__media { margin: 0; background: var(--surface); line-height: 0; }
.hub-card__media img {
  width: 100%; height: auto; display: block;
  /* Covers cropped to a consistent ratio so 18 cards align on a row
     whatever aspect each source render happens to be. */
  aspect-ratio: 16 / 9; object-fit: cover;
}
@media (prefers-reduced-motion: reduce) { .hub-card { transition: none; } }
.hub-card__meta { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.4rem; }
.hub-card__title { margin-bottom: 0.35rem; font-size: 1.22rem; }
.hub-card__title a { text-decoration: none; color: var(--ink); }
/* The card's single link, stretched over the whole card. One link per card
   keeps the keyboard order to eighteen stops rather than thirty-six. */
.hub-card__title a::after { content: ""; position: absolute; inset: 0; }
.hub-card__title a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
.hub-card__blurb { font-size: 0.94rem; color: var(--muted); margin-bottom: 1rem; }
.hub-card__facts { list-style: none; margin: auto 0 0; padding: 0.9rem 0 0; border-top: 1px solid var(--border); }
.hub-card__facts li { font-size: 0.86rem; color: var(--muted); padding: 0.12rem 0; }

/* ---- rank badge ---- */
/* The one comparative fact a card carries. Sits between title and blurb so
   the project name and its position in the set read as a single unit. */
.rank-badge {
  display: inline-block; margin-bottom: 0.6rem;
  background: var(--badge-bg); color: var(--badge-ink);
  font-size: 0.74rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 999px;
}

/* ---- fact table ---- */
.fact-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.fact-table dl { margin: 0; }
.fact-row { display: grid; grid-template-columns: 1fr; gap: 0.15rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
.fact-row:last-child { border-bottom: 0; }
.fact-row dt { font-weight: 650; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.fact-row dd { margin: 0; }
@media (min-width: 640px) {
  .fact-row { grid-template-columns: 13rem 1fr; align-items: baseline; gap: 1rem 1.25rem; }
  /* A ranked row adds a third column for the bar; an unranked row must NOT
     reserve it, or the table grows a permanently empty gutter. */
  .fact-row--ranked { grid-template-columns: 13rem minmax(0, 1fr) 12rem; }
  .fact-row--ranked .fact-rank { grid-column: 3; grid-row: 1; margin: 0; text-align: right; }
  .fact-row--ranked .fact-bar { grid-column: 3; grid-row: 2; margin-top: 0.35rem; }
}
.fact-note { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.1rem; }
.fact-rank { font-size: 0.8rem; color: var(--muted); margin: 0.3rem 0 0; font-variant-numeric: tabular-nums; }

/* Position bar. Decorative and aria-hidden: the rank beside it already says
   the same thing in words, so this adds shape, never information. */
.fact-bar { position: relative; height: 0.75rem; }
.fact-bar__track {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  transform: translateY(-50%); background: var(--bar-track); border-radius: 2px;
}
.fact-bar__dot {
  position: absolute; top: 50%; width: 0.6rem; height: 0.6rem;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--bar-dot); border: 2px solid var(--surface-2);
}

/* ---- gallery ---- */
.section-gallery { padding-top: 0; }
.gallery-note { color: var(--muted); font-size: 0.9rem; max-width: 68ch; margin-bottom: 1.4rem; }
.gallery-grid { display: grid; gap: 0.9rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-item { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.gallery-item img { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.gallery-item figcaption { padding: 0.6rem 0.8rem; font-size: 0.84rem; color: var(--muted); line-height: 1.45; }

/* ---- faq ---- */
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item > summary {
  cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0;
  font-weight: 650; position: relative;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 0.85rem;
  font-size: 1.35rem; line-height: 1; color: var(--link);
}
.faq-item[open] > summary::after { content: "\2212"; }
.faq-answer-inner { padding: 0 0 1rem; color: var(--muted); max-width: 74ch; }
.faq-answer-inner p:last-child { margin-bottom: 0; }

/* ---- cta ---- */
.cta-banner { background: var(--accent); color: var(--accent-ink); padding: clamp(2.5rem, 5vw, 3.5rem) 0; }
.cta-banner h2 { color: var(--accent-ink); }
.cta-banner p { color: var(--accent-ink); max-width: 66ch; }
.cta-banner .btn-primary { background: var(--accent-ink); color: var(--accent); }
.cta-banner .btn-primary:hover { background: var(--accent-ink); color: var(--accent-hover); text-decoration: underline; }
.cta-actions { margin-top: 1.4rem; margin-bottom: 0; }

/* ---- contact ---- */
.contact-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .contact-layout { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.contact-form-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 650; font-size: 0.92rem; margin-bottom: 0.35rem; }
.form-input, .form-textarea {
  width: 100%; padding: 0.7rem 0.85rem; font: inherit; font-size: 1rem;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.form-input:focus, .form-textarea:focus { border-color: var(--accent); outline: 3px solid var(--focus); outline-offset: 1px; }
.form-textarea { resize: vertical; min-height: 6rem; }
.field-error { display: block; margin-top: 0.3rem; font-size: 0.86rem; color: #a3161a; }
@media (prefers-color-scheme: dark) { .field-error { color: #ff9ea1; } }
.form-status { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border-radius: 8px; font-size: 0.94rem; }
.form-status.success { background: var(--ghost-bg); color: var(--link); border: 1px solid var(--accent); }
.form-status.error { background: rgba(163, 22, 26, 0.10); color: #a3161a; border: 1px solid #a3161a; }
@media (prefers-color-scheme: dark) {
  .form-status.error { background: rgba(255, 158, 161, 0.12); color: #ff9ea1; border-color: #ff9ea1; }
}
[hidden] { display: none !important; }

/* ---- footer ---- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: clamp(2.5rem, 5vw, 3.5rem) 0 2rem; font-size: 0.94rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; } }
.footer-logo { display: inline-flex; text-decoration: none; color: var(--ink); margin-bottom: 0.8rem; }
.site-footer h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.site-footer p { color: var(--muted); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { padding: 0.2rem 0; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-plain li { color: var(--muted); }
.footer-note { font-size: 0.88rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.footer-disclaimer p { font-size: 0.82rem; line-height: 1.6; color: var(--muted); }

/* ---- staging ---- */
.staging-banner { background: #7a3d00; color: #ffffff; text-align: center; padding: 0.5rem 1rem; font-weight: 650; font-size: 0.9rem; }
