/* Hudson Hallmark — lender & investor hub
   Palette: ink navy, warm paper, copper accent. Printed-document feel. */

:root {
  --ink:        #0f1d2a;
  --ink-soft:   #1d3244;
  --paper:      #fcfbf8;
  --paper-warm: #f4f1ea;
  --paper-deep: #ebe6db;
  --line:       #ddd7c9;
  --line-soft:  #e9e4d8;
  --muted:      #6a7480;
  --muted-deep: #4d5762;
  --accent:     #a75f31;
  --accent-mid: #c07a45;
  --accent-pale:#f3e4d6;
  --positive:   #3d6b52;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
           "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.08; margin: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; margin: 0 0 .35em; }
h3 { font-size: 1.16rem; line-height: 1.3; margin: 0 0 .4em; }

p { margin: 0 0 1.05em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  background: var(--ink);
  color: #f2efe8;
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.masthead .wrap {
  display: flex; align-items: center; gap: 26px;
  min-height: 62px; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 1.16rem; font-weight: 600;
  color: #fff; text-decoration: none; letter-spacing: .01em;
  display: flex; align-items: baseline; gap: 9px; margin-right: auto;
}
.brand span {
  font-family: var(--sans); font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(255,255,255,.5); font-weight: 500;
}
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a {
  color: rgba(255,255,255,.72); text-decoration: none;
  font-size: .855rem; letter-spacing: .015em;
  padding: 7px 12px; border-radius: var(--radius);
  display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.13); }
.nav .lock { opacity: .55; font-size: .78em; }

/* -------------------------------------------------------------------- hero */

.hero {
  background: var(--ink);
  color: #f4f1ea;
  padding: 64px 0 0;
  position: relative;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; }
.eyebrow {
  font-size: .715rem; letter-spacing: .19em; text-transform: uppercase;
  color: var(--accent-mid); font-weight: 600; margin: 0 0 18px;
}
.hero h1 { color: #fff; max-width: 15ch; }
.hero-sub {
  font-family: var(--serif); font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: rgba(244,241,234,.78); max-width: 46ch; margin: 20px 0 0; line-height: 1.5;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 26px;
  margin: 28px 0 0; padding: 0; list-style: none;
  font-size: .875rem; color: rgba(244,241,234,.62);
}
.hero-meta li { display: flex; align-items: center; gap: 9px; }
.hero-meta li + li::before {
  content: ""; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(244,241,234,.35); margin-left: -17px;
}
.hero-art {
  margin-top: 42px; line-height: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
}
.hero-art img {
  width: 100%; display: block;
  filter: invert(1);
  opacity: .5;
  mix-blend-mode: screen;
}

/* ------------------------------------------------------------ metric strip */

.metrics {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
}
.metrics ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.metrics li {
  padding: 26px 22px 24px;
  border-left: 1px solid var(--line-soft);
}
.metrics li:first-child { border-left: 0; padding-left: 0; }
.metric-value {
  font-family: var(--serif); font-size: 1.95rem; line-height: 1;
  color: var(--ink); display: block; margin-bottom: 8px;
}
.metric-label {
  font-size: .74rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--muted-deep); font-weight: 600; display: block;
}
.metric-note {
  font-size: .8rem; color: var(--muted); display: block; margin-top: 5px; line-height: 1.4;
}

/* ---------------------------------------------------------------- sections */

section { padding: 62px 0; border-bottom: 1px solid var(--line-soft); }
section:last-of-type { border-bottom: 0; }
section.tint { background: var(--paper-warm); }

.section-head { max-width: 62ch; margin-bottom: 34px; }
.section-head .eyebrow { color: var(--accent); }
.section-head p { color: var(--muted-deep); margin-bottom: 0; }

.lede { font-family: var(--serif); font-size: 1.16rem; line-height: 1.62; color: var(--ink-soft); }

.prose { max-width: 66ch; }
.prose p { color: var(--muted-deep); }
.prose p:first-of-type { color: var(--ink-soft); font-size: 1.06rem; }

/* -------------------------------------------------------------------- grid */

/* minmax(0, …) throughout: a grid child defaults to min-width:auto, which
   stops long content (rent tables, $-figures in a deflist) from shrinking and
   pushes the whole page into horizontal scroll. */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split {
  display: grid; gap: 52px; align-items: start;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
}

/* ------------------------------------------------------------------- cards */

.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 24px 22px;
}
.card.flat { background: transparent; border-color: var(--line-soft); }
.card h3 { margin-bottom: .3em; }
.card p { margin: 0; color: var(--muted-deep); font-size: .93rem; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-pale);
  padding: 22px 26px; border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout .quote { font-family: var(--serif); font-size: 1.08rem; color: var(--ink); line-height: 1.55; }
.callout cite {
  display: block; margin-top: 12px; font-style: normal;
  font-size: .8rem; letter-spacing: .05em; color: var(--accent);
}

/* -------------------------------------------------------------- definition */

.deflist { margin: 0; }
.deflist div {
  display: grid; gap: 20px;
  grid-template-columns: minmax(7rem, 15.5rem) minmax(0, 1fr);
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.deflist div:last-child { border-bottom: 0; }
.deflist dt { color: var(--muted-deep); font-size: .875rem; font-weight: 600; min-width: 0; }
.deflist dd {
  margin: 0; color: var(--ink-soft); font-size: .945rem;
  min-width: 0; overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: .91rem; }
caption {
  text-align: left; font-size: .74rem; letter-spacing: .11em;
  text-transform: uppercase; color: var(--muted-deep); font-weight: 600;
  padding-bottom: 12px;
}
thead th {
  text-align: right; font-size: .715rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  padding: 0 14px 9px; border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
thead th:first-child { text-align: left; padding-left: 0; }
tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  text-align: right; white-space: nowrap;
}
tbody td:first-child { text-align: left; padding-left: 0; white-space: normal; }
tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }
.row-total td {
  border-top: 1.5px solid var(--ink); border-bottom: 0;
  font-weight: 600; padding-top: 13px;
}
.row-sub td { background: var(--paper-warm); font-weight: 600; }
.row-emph td { font-weight: 600; color: var(--ink); }
.cell-note { display: block; font-size: .81rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.deduct { color: var(--accent); }

.bar-cell { min-width: 132px; }
.bar { height: 5px; background: var(--paper-deep); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent-mid); border-radius: 3px; }
.bar.alt i { background: var(--ink-soft); }

/* ------------------------------------------------------------------- chips */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  font-size: .8rem; padding: 5px 11px; border-radius: 100px;
  background: var(--paper-deep); color: var(--muted-deep);
}
.chip strong { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; letter-spacing: .04em; font-weight: 600;
  padding: 5px 12px; border-radius: 100px;
}
.badge-clean { background: #e7f0e9; color: var(--positive); }
.badge-watch { background: var(--accent-pale); color: var(--accent); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* -------------------------------------------------------------- conditions */

.conditions { margin: 0; padding: 0; list-style: none; counter-reset: cond; }
.conditions li {
  counter-increment: cond;
  position: relative; padding: 13px 0 13px 42px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .93rem; color: var(--muted-deep);
}
.conditions li:last-child { border-bottom: 0; }
.conditions li::before {
  content: counter(cond);
  position: absolute; left: 0; top: 13px;
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--paper-deep); color: var(--muted-deep);
  display: grid; place-items: center;
  font-size: .74rem; font-weight: 700;
}

/* A cell TDHCA restated away from the applicant's figure. */
.cell-adjusted { font-weight: 600; color: var(--accent); }

/* ----------------------------------------------------------------- gallery */

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.sheet {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; overflow: hidden; display: block;
  text-decoration: none; color: inherit; transition: border-color .15s, transform .15s;
}
.sheet:hover { border-color: var(--accent-mid); transform: translateY(-2px); }
.sheet-img { background: #fff; border-bottom: 1px solid var(--line-soft); line-height: 0; }
.sheet-img img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; object-position: top left; }
.sheet-body { padding: 15px 17px 17px; }
.sheet-no {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em;
  color: var(--accent); display: block; margin-bottom: 5px;
}
.sheet-title { font-family: var(--serif); font-size: 1rem; color: var(--ink); display: block; margin-bottom: 5px; }
.sheet-note { font-size: .83rem; color: var(--muted); line-height: 1.45; }

/* --------------------------------------------------------------- documents */

.doc-group { margin-bottom: 40px; }
.doc-group > h3 {
  font-family: var(--sans); font-size: .74rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted-deep); font-weight: 600;
  padding-bottom: 11px; border-bottom: 1px solid var(--ink); margin-bottom: 0;
}
.doc {
  display: flex; align-items: center; gap: 20px;
  padding: 17px 4px; border-bottom: 1px solid var(--line-soft);
  text-decoration: none; color: inherit;
}
.doc:hover { background: var(--paper-warm); }
.doc.missing { opacity: .5; pointer-events: none; }
.doc-ext {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: var(--radius);
  background: var(--paper-deep); color: var(--muted-deep);
  display: grid; place-items: center;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em;
}
.doc-main { flex: 1 1 auto; min-width: 0; }
.doc-title { font-family: var(--serif); font-size: 1.04rem; color: var(--ink); display: block; }
.doc-note { font-size: .855rem; color: var(--muted); display: block; margin-top: 2px; }
.doc-meta {
  flex: 0 0 auto; text-align: right; font-size: .8rem;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.doc-action { flex: 0 0 auto; color: var(--accent); font-size: .85rem; font-weight: 600; }

/* -------------------------------------------------------------- lock / cta */

.locked-cta {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: 34px 32px; display: flex;
  gap: 26px; align-items: center; flex-wrap: wrap;
}
.locked-cta h3 { margin-bottom: .25em; }
.locked-cta p { margin: 0; color: var(--muted-deep); font-size: .95rem; max-width: 54ch; }
.locked-cta .grow { flex: 1 1 320px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: .9rem; font-weight: 600; letter-spacing: .01em;
  padding: 12px 22px; border-radius: var(--radius); border: 0;
  cursor: pointer; font-family: var(--sans);
}
.btn:hover { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ------------------------------------------------------------------- login */

.login-page { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 56px 24px; }
.login-card {
  width: 100%; max-width: 430px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: 40px 38px 34px;
}
.login-card .eyebrow { color: var(--accent); }
.login-card h1 { font-size: 1.72rem; margin-bottom: .35em; }
.login-card > p { color: var(--muted-deep); font-size: .93rem; }
.field { margin: 24px 0 18px; }
.field label {
  display: block; font-size: .74rem; letter-spacing: .11em;
  text-transform: uppercase; color: var(--muted-deep); font-weight: 600; margin-bottom: 8px;
}
.field input {
  width: 100%; font-family: var(--sans); font-size: 1rem;
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent-mid); outline-offset: -1px; border-color: transparent; }
.form-error {
  background: #fbeae4; color: #8f3d1c; border-left: 3px solid #8f3d1c;
  padding: 11px 15px; font-size: .88rem; border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 4px;
}
.login-foot { margin: 22px 0 0; font-size: .84rem; color: var(--muted); }

/* ------------------------------------------------------------------ footer */

.footer {
  background: var(--ink); color: rgba(244,241,234,.6);
  padding: 46px 0 40px; font-size: .875rem;
}
.footer a { color: rgba(244,241,234,.85); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; }
.footer h4 {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .13em;
  text-transform: uppercase; color: rgba(244,241,234,.42);
  font-weight: 600; margin: 0 0 12px;
}
.footer p { margin: 0 0 .6em; }
.footer .brandline { font-family: var(--serif); font-size: 1.15rem; color: #fff; margin-bottom: .4em; }
.footer-note {
  margin-top: 36px; padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .79rem; color: rgba(244,241,234,.42); line-height: 1.6;
}

/* ------------------------------------------------------------- source note */

.source-note {
  font-size: .79rem; color: var(--muted); margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.source-note strong { color: var(--muted-deep); font-weight: 600; }

/* ------------------------------------------------------------------ figure */

.figure { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.figure img { width: 100%; display: block; }
.figure figcaption {
  padding: 13px 17px; font-size: .83rem; color: var(--muted);
  border-top: 1px solid var(--line-soft); background: var(--paper);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 960px) {
  .metrics ul { grid-template-columns: repeat(3, 1fr); }
  .metrics li:nth-child(4) { border-left: 0; padding-left: 0; }
  .split { grid-template-columns: 1fr; gap: 34px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  section { padding: 44px 0; }
  .hero { padding-top: 44px; }
  .metrics ul { grid-template-columns: repeat(2, 1fr); }
  .metrics li { border-left: 0; padding: 20px 0; border-top: 1px solid var(--line-soft); }
  .metrics li:nth-child(-n+2) { border-top: 0; }
  .grid-2, .grid-3, .gallery { grid-template-columns: 1fr; }
  .deflist div { grid-template-columns: 1fr; gap: 3px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .doc { flex-wrap: wrap; gap: 14px; }
  .doc-meta, .doc-action { text-align: left; }
  .masthead .wrap { padding-top: 10px; padding-bottom: 10px; }
}

@media print {
  .masthead, .footer, .locked-cta, .btn { display: none; }
  body { background: #fff; font-size: 11pt; }
  section { padding: 18pt 0; break-inside: avoid; }
  .hero { background: #fff; color: #000; }
  .hero h1, .hero-sub { color: #000; }
}
