/* GharCost — construction cost calculators
   Visual model: an architect's drawing set. Deep green ground with a blueprint
   hero, gold dimension accents, tools as a numbered schedule with drawn icons.
   Shares no structure with the other two sites in this portfolio. */

:root {
  --paper:      #FBFAF8;
  --sheet:      #FFFFFF;
  --sheet-2:    #F5F3EE;
  --ink:        #14181B;
  --ink-2:      #4E565E;
  --ink-3:      #838C95;
  --rule:       #E4E1DA;
  --rule-2:     #CBC7BE;
  --rule-ink:   #14181B;

  --deep:       #123027;
  --deep-2:     #1B4638;
  --brand:      #1F4B3F;
  --brand-2:    #2C6553;
  --brand-bg:   #E9F0EC;

  --gold:       #A9761A;
  --gold-2:     #D8A03C;
  --gold-bg:    #FAF2E2;

  --stop:       #8C2F22;
  --stop-bg:    #FAECEA;

  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --sans: system-ui, "Segoe UI", Roboto, -apple-system, sans-serif;

  --sheet-w: 62rem;
  --shadow-1: 0 1px 2px rgba(20,24,27,.05);
  --shadow-2: 0 2px 4px rgba(20,24,27,.05), 0 10px 28px rgba(20,24,27,.07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

a { color: var(--brand); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { max-width: var(--sheet-w); margin: 0 auto; padding: 0 1.75rem; }

.ico { width: 22px; height: 22px; flex: none; }

/* ================= HEADER ================= */

.site-header {
  background: var(--deep); color: #fff;
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 2rem; min-height: 4.1rem; flex-wrap: wrap;
}

.brand {
  font-family: var(--mono); font-size: 1.16rem; font-weight: 700;
  letter-spacing: -0.025em; color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: .55rem;
}
.brand span { color: var(--gold-2); }
.brand::before {
  content: ""; width: 1.55rem; height: 1.55rem; flex: none;
  background: var(--gold-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.5 10.5 12 3.2l9.5 7.3' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M5 9.6V21h14V9.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.5 10.5 12 3.2l9.5 7.3' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M5 9.6V21h14V9.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}

.nav { display: flex; gap: .35rem; margin-left: auto; flex-wrap: wrap; }
.nav a {
  font-size: .855rem; font-weight: 550; color: rgba(255,255,255,.72);
  text-decoration: none; padding: .45rem .8rem; border-radius: 4px;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.09); }
.nav a[aria-current="page"] { color: var(--deep); background: var(--gold-2); font-weight: 650; }

/* ================= HERO ================= */

.hero {
  background: linear-gradient(160deg, var(--deep) 0%, var(--deep-2) 55%, #14382D 100%);
  color: #fff; padding: 3.25rem 0 3rem;
}
.hero .wrap {
  display: grid; grid-template-columns: 1.02fr .98fr; gap: 3rem; align-items: center;
}
.hero h1 {
  /* Sans, not mono. A mono display headline at this size reads as clunky. */
  font-size: clamp(2rem, 4.4vw, 3.05rem); font-weight: 750;
  letter-spacing: -0.035em; line-height: 1.06; margin: 0 0 1rem; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero p { font-size: 1.05rem; color: rgba(255,255,255,.78); max-width: 32rem; margin: 0; }

.hero-art { width: 100%; height: auto; display: block; }

/* Four cells, always in one row on desktop, two on tablet, two on phone. */
.titleblock {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; border-top: 1px solid rgba(255,255,255,.16); margin-top: 2rem;
}
.titleblock div {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1rem .9rem 0 0; min-width: 0;
}
.titleblock dt, .eyebrow, .lbl {
  font-family: var(--mono); font-size: .63rem; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(255,255,255,.5); margin: 0;
}
.titleblock dd {
  margin: 0; font-family: var(--mono); font-size: 1.15rem; font-weight: 700;
  color: var(--gold-2); letter-spacing: -0.02em;
}

/* eyebrow outside the hero is dark-on-light */
.page-head .eyebrow, .prose .lbl { color: var(--gold); }

/* ================= PAGE HEAD ================= */

.page-head { padding: 2.5rem 0 1.5rem; }
.page-head h1 {
  font-family: var(--mono); font-size: clamp(1.5rem, 3.2vw, 2.15rem); font-weight: 700;
  letter-spacing: -0.035em; line-height: 1.14; margin: .4rem 0 .7rem; text-wrap: balance;
}
.page-head .sub { color: var(--ink-2); max-width: 44rem; margin: 0; font-size: 1.05rem; }

.breadcrumb {
  font-family: var(--mono); font-size: .71rem; letter-spacing: .07em;
  color: var(--ink-3); padding: 1.1rem 0 0;
}
.breadcrumb a { color: var(--ink-2); text-decoration: none; }

/* ================= SECTIONS ================= */

.section { padding: 3rem 0; }
.section-title {
  font-family: var(--mono); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 1.4rem; padding-bottom: .65rem; border-bottom: 2px solid var(--rule-ink);
  display: flex; align-items: baseline; gap: .85rem;
}
.section-title::before {
  content: attr(data-n); font-family: var(--mono); font-size: .7rem;
  color: #fff; background: var(--brand); font-weight: 700; letter-spacing: .06em;
  padding: .22rem .45rem; border-radius: 3px;
}

/* ================= TOOL SCHEDULE ================= */

.schedule { width: 100%; border-collapse: collapse; }
.schedule th {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--ink-3); text-align: left; font-weight: 600;
  padding: 0 1rem .6rem 0; border-bottom: 1px solid var(--rule-ink);
}
.schedule td { padding: 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.schedule tr:last-child td { border-bottom: none; }
.schedule tr { transition: background .12s ease; }
.schedule tbody tr:hover { background: var(--sheet); }

.schedule .ref {
  font-family: var(--mono); font-size: .75rem; color: var(--brand); font-weight: 700;
  white-space: nowrap; width: 4.5rem; padding: 1rem 0;
}
.sch-item { display: flex; align-items: flex-start; gap: .95rem; padding: 1rem 1rem 1rem 0; }
.sch-ico {
  width: 2.6rem; height: 2.6rem; flex: none; border-radius: 7px;
  background: var(--brand-bg); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.schedule tr:hover .sch-ico { background: var(--brand); color: #fff; }
.schedule .title a {
  font-family: var(--mono); font-size: 1rem; font-weight: 650;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.schedule tr:hover .title a { color: var(--brand); }
.schedule .desc { font-size: .875rem; color: var(--ink-2); margin: .2rem 0 0; line-height: 1.52; }

/* ================= CARDS ================= */

.grid { display: grid; gap: .9rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }

/* Flex column so a trailing badge or meta line sits below the copy and the
   cards in a row share a height. */
.card {
  display: flex; flex-direction: column; align-items: flex-start; gap: .35rem;
  height: 100%; padding: 1.25rem 1.35rem; text-decoration: none; color: inherit;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: var(--shadow-1); transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}
.grid { align-items: stretch; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--rule-2); }
.card h3 {
  font-family: var(--mono); margin: 0; font-size: 1rem; font-weight: 650;
  letter-spacing: -0.02em; color: var(--ink);
}
a.card:hover h3 { color: var(--brand); }
.card p { margin: 0; font-size: .88rem; color: var(--ink-2); line-height: 1.55; }
.card .meta {
  margin-top: auto; padding-top: .6rem; font-family: var(--mono);
  font-size: .68rem; letter-spacing: .07em; color: var(--ink-3);
}
.card .pill { margin-top: auto; }

/* ================= FORMS ================= */

.calc {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px;
  border-top: 3px solid var(--brand); padding: 1.7rem; margin: 1.6rem 0;
  box-shadow: var(--shadow-1);
}
.calc h2 {
  font-family: var(--mono); margin: 0 0 1.2rem; font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}

.fields { display: grid; gap: 1.05rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.field { display: flex; flex-direction: column; gap: .32rem; min-width: 0; }
.field label { font-family: var(--mono); font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.field .hint { font-size: .75rem; color: var(--ink-3); }

/* Fields whose option labels are long enough to truncate in a single column. */
.field-wide { grid-column: span 2; }
@media (max-width: 560px) { .field-wide { grid-column: span 1; } }

input[type="number"], input[type="text"], input[type="email"], input[type="password"], select {
  font: inherit; font-size: .93rem; padding: .58rem .7rem; width: 100%;
  border: 1px solid var(--rule-2); border-radius: 6px;
  background: var(--sheet); color: var(--ink); font-family: var(--mono);
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-bg); }

.checks { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-top: 1.1rem; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
.check input { width: auto; }

/* Optional extras. Stacked label / input / unit — a flex row cramming all three
   into one line wraps into a mess at anything under a very wide column. */
.addons {
  display: grid; gap: 1rem 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
}
.addon { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.addon label {
  font-family: var(--mono); font-size: .69rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2); line-height: 1.35;
}
.addon .hint { font-size: .72rem; color: var(--ink-3); }

.actions { display: flex; gap: .7rem; align-items: center; margin-top: 1.4rem; flex-wrap: wrap; }
.btn {
  font-family: var(--sans); font-size: .88rem; font-weight: 650; letter-spacing: .01em;
  padding: .68rem 1.5rem; border-radius: 6px;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  cursor: pointer; text-decoration: none; display: inline-block;
  box-shadow: var(--shadow-1); transition: background .12s ease;
}
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--rule-2); box-shadow: none; }
.btn-ghost:hover { background: var(--sheet-2); color: var(--brand); border-color: var(--rule-2); }

/* ================= RESULT ================= */

.result {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1.9rem; margin: 1.6rem 0; box-shadow: var(--shadow-2);
  border-top: 3px solid var(--gold-2);
}
.result h2 {
  font-family: var(--mono); margin: 0 0 1.1rem; font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.headline {
  font-family: var(--mono); font-size: clamp(2.1rem, 6vw, 3.2rem); font-weight: 700;
  letter-spacing: -0.045em; color: var(--brand); line-height: 1.02;
  font-variant-numeric: tabular-nums;
}
.headline-sub { font-size: .95rem; color: var(--ink-2); margin-top: .55rem; }

.stats {
  display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  margin: 1.5rem 0;
}
.stat {
  background: var(--sheet-2); border: 1px solid var(--rule); border-radius: 7px;
  padding: .75rem .9rem; display: flex; flex-direction: column; gap: .22rem;
}
.stat .k { font-family: var(--mono); font-size: .61rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-family: var(--mono); font-size: 1.12rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ================= CHARTS ================= */

.chart {
  margin: 0 0 1rem; padding: 1.3rem 1.4rem;
  background: var(--sheet-2); border: 1px solid var(--rule); border-radius: 8px;
  overflow-x: auto;
}
.chart svg { display: block; min-width: 26rem; }
.chart rect[rx] { transition: opacity .12s ease; }
.chart:hover rect[rx] { opacity: .8; }
.chart rect[rx]:hover { opacity: 1; }

.bar { background: var(--rule); height: 7px; width: 100%; position: relative; border-radius: 4px; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 4px; }

/* ================= TABLES ================= */

.scroll { overflow-x: auto; margin: 1.2rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 29rem; }
th {
  text-align: left; font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
  padding: 0 .8rem .5rem 0; border-bottom: 1px solid var(--rule-ink); white-space: nowrap;
}
td { padding: .58rem .8rem .58rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
th.num { text-align: right; }
tfoot td { font-weight: 700; border-top: 2px solid var(--rule-ink); border-bottom: none; padding-top: .65rem; font-family: var(--mono); }
tbody tr.highlight td { background: var(--gold-bg); }
tbody tr.win td { background: var(--brand-bg); }

/* ================= PROSE ================= */

.prose { max-width: 41rem; }
.prose h2 {
  font-family: var(--mono); font-size: 1.12rem; letter-spacing: -0.025em;
  margin: 2.2rem 0 .7rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rule);
}
.prose h3 { font-family: var(--mono); font-size: .96rem; margin: 1.7rem 0 .45rem; letter-spacing: -0.02em; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--brand-bg); padding: .12rem .32rem; border-radius: 3px; }

/* Code-style block for formulas. `display: block` is load-bearing: on an inline
   element the vertical padding would spill over the line above instead of
   pushing it, which silently buries whatever sits above it. */
.formula-block, .formula {
  display: block;
  font-family: var(--mono); font-size: .81rem; line-height: 1.7;
  background: var(--deep); color: #C6D6CE; border-radius: 8px;
  padding: 1.15rem 1.3rem; margin: 1.25rem 0; overflow-x: auto; white-space: pre;
}

.note { background: var(--gold-bg); border-left: 3px solid var(--gold-2); border-radius: 0 7px 7px 0; padding: .95rem 1.15rem; margin: 1.25rem 0; font-size: .9rem; }
.note strong { color: #6E4B0F; }
.good { background: var(--brand-bg); border-left: 3px solid var(--brand); border-radius: 0 7px 7px 0; padding: .95rem 1.15rem; margin: 1.25rem 0; font-size: .9rem; }
.good strong { color: var(--brand); }
.error { background: var(--stop-bg); border-left: 3px solid var(--stop); border-radius: 0 7px 7px 0; padding: .95rem 1.15rem; margin: 1.25rem 0; font-size: .9rem; color: #6B241A; }

.faq details {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 7px;
  padding: .85rem 1.05rem; margin-bottom: .5rem;
}
.faq summary {
  cursor: pointer; font-weight: 650; font-size: .94rem; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 1.15rem; color: var(--brand); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: .65rem 0 0; font-size: .89rem; color: var(--ink-2); }

.pill {
  display: inline-block; font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; background: var(--gold-bg); color: #6E4B0F;
  padding: .2rem .5rem; border-radius: 3px;
}
.meta-strip {
  display: flex; gap: 1.2rem; flex-wrap: wrap; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .07em; color: var(--ink-3);
  padding: .85rem 0; border-top: 1px solid var(--rule); margin-top: 1.5rem;
}

/* ================= FOOTER ================= */

.site-footer {
  background: var(--deep); color: rgba(255,255,255,.72);
  margin-top: 4rem; padding: 2.6rem 0 2.2rem;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; }
.footer-grid h4 { display: none; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; }
.footer-grid a { font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; color: rgba(255,255,255,.62); text-decoration: none; }
.footer-grid a:hover { color: var(--gold-2); }
.footer-note {
  margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.14);
  font-size: .78rem; line-height: 1.65; color: rgba(255,255,255,.5); max-width: 48rem;
}
.footer-note strong { color: rgba(255,255,255,.78); }

/* ================= RESPONSIVE ================= */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero-art { max-width: 30rem; margin: 0 auto; }
}
@media (max-width: 560px) {
  .titleblock { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 1.15rem; }
  .site-header .wrap { min-height: auto; padding-top: .8rem; padding-bottom: .8rem; }
  .nav { margin-left: 0; width: 100%; }
  .calc, .result { padding: 1.2rem; }
  .schedule .ref { width: 3rem; font-size: .68rem; }
  .sch-ico { width: 2.1rem; height: 2.1rem; }
  .ico { width: 18px; height: 18px; }
}

@media print {
  .site-header, .site-footer, .actions, .nav { display: none; }
  body { background: #fff; }
  .hero { background: none; color: #000; }
}

/* ---------- author byline ---------- */
.byline {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--sheet); border: 1px solid var(--rule); border-left: 3px solid var(--brand);
  border-radius: 8px; padding: 1.15rem 1.3rem; margin: 2.25rem 0 0; max-width: 41rem;
}
.byline-mark {
  width: 2.6rem; height: 2.6rem; flex: none; border-radius: 50%;
  background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 1.1rem; font-weight: 700;
}
.byline-body { min-width: 0; }
.byline-name {
  margin: 0 0 .3rem; font-family: var(--mono); font-size: .86rem; font-weight: 650;
  letter-spacing: -0.01em; color: var(--ink);
}
.byline-note { margin: 0; font-size: .855rem; line-height: 1.6; color: var(--ink-2); }
.byline-date {
  margin: .5rem 0 0; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .07em; color: var(--ink-3);
}