/* HKR Contracts — clean, minimal editorial theme */

:root {
  --ink: #111111;
  --ink-soft: #2e2e2b;
  --text: #1a1a18;
  --muted: #5c5c58;
  --line: #e6e6e3;
  --paper: #f6f6f4;
  --white: #ffffff;
  --btn: #2e2e2b;
  --btn-hover: #1a1a18;
  --header-h: 72px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --wrap: 1120px;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Public Sans", Helvetica, Arial, sans-serif;
  --space: clamp(4.5rem, 8vw, 7.5rem);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 4.2vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.65rem, 2.8vw, 2.75rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--ink-soft); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: var(--ink);
  color: var(--white);
  padding: 0.55rem 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  height: var(--header-h);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1.5rem;
}
.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}
.logo-word {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}
.logo-sub {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.55rem;
}
.nav > a {
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--ink);
  border: 0;
}
.nav > a:hover { color: var(--muted); }
.nav-drawer-foot { display: none; }

.menu-toggle {
  display: none;
  position: relative;
  z-index: 60;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 1.05rem;
  height: 1.5px;
  background: var(--ink);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.menu-toggle-bars::before,
.menu-toggle-bars::after { content: ""; }
.menu-toggle-bars::before { transform: translate(-50%, calc(-50% - 5px)); }
.menu-toggle-bars::after { transform: translate(-50%, calc(-50% + 5px)); }
.menu-toggle.is-open .menu-toggle-bars { background: transparent; }
.menu-toggle.is-open .menu-toggle-bars::before { transform: translate(-50%, -50%) rotate(45deg); }
.menu-toggle.is-open .menu-toggle-bars::after { transform: translate(-50%, -50%) rotate(-45deg); }

.nav-overlay { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn-solid {
  background: var(--btn);
  color: var(--white);
  border-color: var(--btn);
}
.btn-solid:hover {
  background: var(--btn-hover);
  border-color: var(--btn-hover);
  color: var(--white);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover { background: var(--paper); }
.btn-block { width: 100%; }

.text-link {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}
.text-link span[aria-hidden="true"] { margin-left: 0.3em; }

/* Hero */
.hero {
  position: relative;
  margin-top: calc(-1 * var(--header-h));
  height: clamp(560px, 58vw, 100svh);
  overflow: hidden;
  background: #cfd3d6;
  color: var(--ink);
}
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(#fff9, #ffffff40 26%, #fff0 44%);
  pointer-events: none;
}
.hero-txt {
  position: relative;
  z-index: 2;
  padding-top: calc(var(--header-h) + clamp(8px, 2vw, 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-kicker { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
.hero-txt h1 { max-width: 13em; margin: 0; }
.hero-cap {
  position: absolute;
  z-index: 2;
  right: var(--pad);
  bottom: 24px;
  font-size: 0.8rem;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.intro-band { padding: 2.25rem 0 0; }
.intro-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem 3rem;
  flex-wrap: wrap;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.lead {
  max-width: 46ch;
  font-size: 1.12rem;
  margin: 0;
  color: var(--text);
}
.intro-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Sections */
.section { padding: var(--space) 0; }
.section-split {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  gap: 1.5rem 2rem;
  margin-bottom: 3rem;
  align-items: start;
}
.eyebrow {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}
.section-intro {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 46rem;
  margin: 0;
}
.section-follow { margin: 2.25rem 0 0; }

.service-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 1.5rem;
}
.service-photo {
  height: 200px;
  overflow: hidden;
  background: var(--paper);
  margin-bottom: 1rem;
}
.service-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.service h3 { margin-bottom: 0.4rem; }
.service p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* Estimator */
.estimator { border-top: 1px solid var(--line); }
.est-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3rem;
  align-items: stretch;
}
.est-panel,
.est-results { padding: 0; }
.est-results {
  display: flex;
  flex-direction: column;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--ink);
}
.est-field { margin-bottom: 1.25rem; }
.est-field:last-child { margin-bottom: 0; }
.est-field label,
.est-field legend {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink);
  margin: 0 0 0.45rem;
}
.est-field fieldset,
fieldset.est-field {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  min-width: 0;
}
.est-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.45rem;
}
.est-label-row label { margin: 0; }
.est-area-value {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 500;
}
.est-area-value input {
  width: 4.8rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--white);
  padding: 0.2rem 0.35rem;
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}
.est-area-value input::-webkit-outer-spin-button,
.est-area-value input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.est-field select,
.est-field input[type="range"] { width: 100%; }
.est-field select,
.quote-form input,
.quote-form select,
.quote-form textarea {
  font: inherit;
  color: var(--text);
  background: var(--white);
  border: 1px solid #cfcfc9;
  border-radius: 0;
  padding: 0.65rem 0.7rem;
  width: 100%;
}
.est-hint { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: #cfcfc9;
  border-radius: 1px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ink);
}
.segmented-option {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.55rem 0.3rem;
  cursor: pointer;
  border-right: 1px solid var(--ink);
  color: var(--text);
  margin: 0;
}
.segmented-option:last-child { border-right: 0; }
.segmented-option input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-option:has(input:checked) {
  background: var(--ink);
  color: var(--white);
}
.segmented-option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: -2px; }

.est-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.92rem;
  margin: 0 0 0.45rem;
  color: var(--text);
  cursor: pointer;
}
.est-check input { margin-top: 0.2rem; accent-color: var(--ink); }

.est-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.est-range {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 0.5rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.est-dash { margin: 0 0.3rem; color: var(--muted); font-weight: 400; }
.est-rate, .est-timeline { margin: 0 0 0.35rem; color: var(--text); font-size: 0.95rem; }
.est-timeline { margin-bottom: 1.15rem; }
.est-bar {
  display: flex;
  height: 8px;
  width: 100%;
  margin: 0 0 1rem;
  overflow: hidden;
  background: var(--line);
}
.est-bar span { display: block; height: 100%; }
.est-bar .seg-materials { background: var(--ink); }
.est-bar .seg-labor { background: #4a4a46; }
.est-bar .seg-permits { background: #7a7a74; }
.est-bar .seg-contingency { background: #b5b5ae; }
.est-breakdown {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  border-top: 1px solid var(--line);
}
.est-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.est-breakdown .swatch {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.45rem;
  vertical-align: middle;
}
.est-breakdown .amt {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
.est-disclaimer {
  font-size: 0.8rem;
  color: var(--muted);
  margin: auto 0 1.15rem;
  line-height: 1.5;
}

/* Projects */
.projects { background: var(--paper); }
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.25rem 1.25rem;
}
.project-card { background: transparent; }
.project-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  background: #ddd;
}
.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 0.85rem;
}
.project-meta h3 {
  font-size: 1.35rem;
  margin: 0;
}
.project-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Approach */
.process-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}
.process-list li { border-top: 1px solid var(--ink); padding-top: 0.9rem; }
.process-num { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.45rem; }
.process-list h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin-bottom: 0.4rem; }
.process-list p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.values { margin-top: 5rem; }
.values h2 { max-width: 18em; }
.values-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.values-list li { border-top: 1px solid var(--line); padding-top: 1rem; }
.values-list h3 { font-family: var(--font-sans); font-size: 1.02rem; font-weight: 600; letter-spacing: 0; }
.values-list p { margin: 0; color: var(--muted); }

/* Contact */
.contact { border-top: 1px solid var(--line); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.contact-details {
  margin: 2rem 0 0;
  padding: 0;
}
.contact-details > div { margin: 0 0 1.25rem; }
.contact-details dt {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.contact-details dd { margin: 0; }

.quote-form { display: grid; gap: 1rem; }
.quote-form[hidden],
.form-success[hidden] { display: none !important; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.field label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.35rem; }
.optional { font-weight: 400; color: var(--muted); }
.field-error { color: #8b1e1e; font-size: 0.82rem; margin: 0.3rem 0 0; }
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea { border-color: #8b1e1e; }
.form-note { font-size: 0.82rem; color: var(--muted); margin: 0; }
.form-success { border-top: 1px solid var(--ink); padding-top: 1.5rem; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #d8d8d4;
  padding: 3.5rem 0 1.75rem;
  font-size: 0.95rem;
}
.site-footer a { color: #f2f2ee; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--white);
  margin: 0 0 0.6rem;
}
.footer-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a9a94;
  margin: 0 0 0.7rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 0 0 0.35rem; }
.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #3a3a36;
  font-size: 0.82rem;
  color: #9a9a94;
}

@media (max-width: 980px) {
  .service-list,
  .process-list,
  .values-list { grid-template-columns: 1fr 1fr; }
  .est-layout,
  .contact-grid,
  .footer-grid,
  .section-split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .process-list { grid-template-columns: repeat(3, 1fr); }
  .menu-toggle { display: block; }
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(22rem, 100vw);
    margin: 0;
    background: var(--white);
    border-left: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 5rem 1.5rem 1.5rem;
    overflow-y: auto;
    transform: translateX(105%);
    transition: transform 0.28s ease;
    z-index: 45;
    display: flex;
  }
  .nav.is-open { transform: translateX(0); }
  .nav > a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
  }
  .nav-drawer-foot {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 1.4rem;
  }
  .nav-drawer-mail { font-size: 0.95rem; }
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.4);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .nav-overlay.is-visible { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .hero::before {
    background: linear-gradient(#ffffffee 0%, #fff9 22%, #ffffff40 42%, #fff0 60%);
  }
  .hero {
    height: clamp(500px, 140vw, 640px);
  }
  .hero-media img { object-position: 50% 50%; }
  .intro-inner { align-items: stretch; }
  .intro-actions { width: 100%; }
  .intro-actions .btn { flex: 1; }
  .service-list,
  .process-list,
  .values-list,
  .project-grid,
  .field-row { grid-template-columns: 1fr; }
  .segmented-option { font-size: 0.8rem; padding: 0.5rem 0.2rem; }
  .project-card img { height: 220px; }
  .project-meta { flex-direction: column; gap: 0.15rem; }
  .project-meta p { white-space: normal; }
  .service-photo { height: 200px; }
  .est-range { font-size: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
