/* Halden Joinery — editorial, photo-first, warm paper and sage. */
:root {
  --hj-paper: #f6f3ee;
  --hj-paper-2: #ece6dc;
  --hj-ink: #24211d;
  --hj-muted: #6a645b;
  --hj-sage: #3d5442;
  --hj-sage-dark: #263329;
  --hj-wood: #9c7a52;
  --hj-line: #d8d0c2;
  --hj-serif: "Fraunces", Georgia, serif;
  --hj-sans: "Karla", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);

  --ui-font: var(--hj-sans);
  --ui-ink: var(--hj-ink);
  --ui-muted: var(--hj-muted);
  --ui-accent: var(--hj-sage);
  --ui-line: var(--hj-line);
  --ui-field: #fffdf9;
  --ui-surface: #fffdf9;
  --ui-radius: 2px;
}

body {
  background: var(--hj-paper);
  color: var(--hj-ink);
  font-family: var(--hj-sans);
  font-size: 1.0625rem;
}

h1,
h2,
h3 {
  font-family: var(--hj-serif);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 120;
}

h2 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
}

.hj-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hj-wood);
}

/* Header ------------------------------------------------------------------ */
.hj-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem var(--gutter);
  background: color-mix(in srgb, var(--hj-paper) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hj-line);
}

.hj-logo {
  font-family: var(--hj-serif);
  font-size: 1.45rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.hj-logo span {
  font-style: italic;
  font-weight: 400;
  color: var(--hj-wood);
}

.hj-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-weight: 500;
}

.hj-nav a {
  text-decoration: none;
}

.hj-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.hj-header__cta {
  min-height: 2.5rem;
  padding: 0.5em 1em;
}

@media (max-width: 48rem) {
  .hj-nav {
    display: none;
  }

  .hj-header__cta {
    margin-left: auto;
    font-size: 0.92rem;
  }
}

/* Hero: the photo is the page --------------------------------------------- */
.hj-hero {
  position: relative;
}

.hj-hero__photo {
  position: relative;
}

.hj-hero__photo img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: 40% 50%;
}

.hj-hero__photo figcaption {
  padding: 0.6rem var(--gutter) 0;
  font-size: 0.85rem;
  color: var(--hj-muted);
}

.hj-hero__text {
  display: grid;
  gap: 1rem;
  padding: 1.5rem var(--gutter) 2.5rem;
}

.hj-hero__text h1 {
  font-size: clamp(2.3rem, 7.5vw, 4.1rem);
  max-width: 15ch;
}

.hj-hero__lede {
  max-width: 30rem;
  font-size: 1.12rem;
  color: var(--hj-muted);
}

.hj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (min-width: 60rem) {
  .hj-hero__photo img {
    aspect-ratio: auto;
    height: min(84vh, 820px);
    min-height: 560px;
  }

  .hj-hero__photo figcaption {
    position: absolute;
    right: var(--gutter);
    bottom: 1rem;
    padding: 0.35rem 0.7rem;
    background: rgba(20, 18, 15, 0.6);
    color: #f3efe8;
  }

  .hj-hero__text {
    position: absolute;
    left: var(--gutter);
    bottom: 0;
    width: min(36rem, 46vw);
    padding: 2.5rem 2.75rem 2.25rem;
    background: var(--hj-paper);
  }
}

/* Facts ------------------------------------------------------------------- */
.hj-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2.5rem;
  padding: 1.4rem var(--gutter);
  border-bottom: 1px solid var(--hj-line);
  color: var(--hj-muted);
  font-size: 0.97rem;
}

.hj-facts strong {
  font-family: var(--hj-serif);
  font-weight: 550;
  font-size: 1.15rem;
  color: var(--hj-ink);
}

/* Section heads ----------------------------------------------------------- */
.hj-section-head {
  display: grid;
  gap: 0.9rem;
  max-width: 40rem;
  margin-bottom: 2rem;
}

.hj-section-head p {
  color: var(--hj-muted);
  font-size: 1.08rem;
}

/* Work gallery ------------------------------------------------------------ */
.hj-work {
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}

.hj-filters {
  display: flex;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--hj-line);
}

.hj-filter {
  position: relative;
  flex: none;
  padding: 0.7rem 0;
  white-space: nowrap;
  border: 0;
  background: none;
  font-weight: 500;
  color: var(--hj-muted);
}

.hj-filter span {
  margin-left: 0.3rem;
  font-size: 0.8rem;
}

.hj-filter[aria-pressed="true"] {
  color: var(--hj-ink);
  font-weight: 700;
}

.hj-filter[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--hj-ink);
}

.hj-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 15rem;
  grid-auto-flow: dense;
  gap: 1.75rem 1rem;
}

.hj-tile {
  min-height: 0;
}

.hj-tile--feature {
  grid-column: span 2;
}

.hj-tile--tall {
  grid-row: span 2;
}

.hj-tile button {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.hj-tile__img {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: var(--hj-paper-2);
}

.hj-tile__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hj-tile button:hover img {
  transform: scale(1.03);
}

.hj-tile__caption {
  display: grid;
  gap: 0.1rem;
  padding-top: 0.6rem;
}

.hj-tile__title {
  font-family: var(--hj-serif);
  font-size: 1.08rem;
  line-height: 1.2;
}

.hj-tile__meta {
  font-size: 0.85rem;
  color: var(--hj-muted);
}

@media (max-width: 36rem) {
  .hj-gallery {
    grid-auto-rows: 11.5rem;
    gap: 1.5rem 0.75rem;
  }

  .hj-tile__meta {
    display: none;
  }
}

@media (min-width: 52rem) {
  .hj-gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 17rem;
  }

  .hj-tile--feature {
    grid-row: span 2;
  }
}

/* Finishes ---------------------------------------------------------------- */
.hj-finishes {
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  background: var(--hj-paper-2);
}

.hj-swatches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1.25rem;
}

@media (min-width: 52rem) {
  .hj-swatches {
    grid-template-columns: repeat(4, 1fr);
  }
}

.hj-swatch__chip {
  aspect-ratio: 4 / 3;
  margin-bottom: 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.hj-swatch__chip--grain {
  background-image: repeating-linear-gradient(
    92deg,
    rgba(255, 255, 255, 0.07) 0 2px,
    transparent 2px 9px,
    rgba(0, 0, 0, 0.06) 9px 10px,
    transparent 10px 17px
  );
}

.hj-swatch__name {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--hj-serif);
  font-size: 1.25rem;
}

.hj-swatch__tier {
  font-family: var(--hj-sans);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--hj-wood);
}

.hj-swatch__note {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: var(--hj-muted);
}

/* Process ----------------------------------------------------------------- */
.hj-process {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}

@media (min-width: 60rem) {
  .hj-process {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.hj-process__photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.hj-process__photos img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hj-process__main {
  grid-column: span 2;
  aspect-ratio: 16 / 9 !important;
}

.hj-steps {
  counter-reset: step;
  display: grid;
  margin-top: 2rem;
}

.hj-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  gap: 0.2rem 0.75rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--hj-line);
}

.hj-steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--hj-serif);
  font-style: italic;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--hj-wood);
}

.hj-steps h3 {
  font-size: 1.3rem;
}

.hj-steps__duration {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hj-sage);
  white-space: nowrap;
}

.hj-steps p {
  grid-column: 2 / -1;
  color: var(--hj-muted);
}

/* Quote ------------------------------------------------------------------- */
.hj-quote {
  display: grid;
  gap: 2.5rem;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  background: var(--hj-sage-dark);
  color: #efeae1;
}

@media (min-width: 60rem) {
  .hj-quote {
    grid-template-columns: 0.8fr 1.2fr;
    align-items: start;
  }

  .hj-quote__intro {
    position: sticky;
    top: 6rem;
  }
}

.hj-quote__intro > p {
  margin-top: 1rem;
  max-width: 28rem;
  font-size: 1.1rem;
  color: #cfd6cd;
}

.hj-next {
  counter-reset: next;
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
  max-width: 28rem;
}

.hj-next li {
  counter-increment: next;
  display: grid;
  grid-template-columns: 2rem 1fr;
  color: #cfd6cd;
}

.hj-next li::before {
  content: counter(next);
  font-family: var(--hj-serif);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.1;
  color: #e4c99f;
}

.hj-next strong {
  display: block;
  color: #fff;
}

.hj-quote__phone {
  font-size: 0.97rem;
  color: #cfd6cd;
}

.hj-quote__phone a {
  color: #fff;
  font-weight: 700;
}

.hj-quote__panel {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--hj-paper);
  color: var(--hj-ink);
}

.hj-form {
  display: grid;
  gap: 1.6rem;
}

.hj-form__submit {
  justify-self: start;
  min-width: 14rem;
}

.hj-dot {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.hj-finish-choices .choice {
  align-items: center;
}

/* File upload */
.hj-upload {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem;
  border: 1.5px dashed var(--hj-line);
  background: var(--ui-field);
  cursor: pointer;
}

.hj-upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.hj-upload:has(input:focus-visible) {
  outline: 2px solid var(--hj-sage);
  outline-offset: 2px;
}

.hj-upload:hover {
  border-color: var(--hj-sage);
}

.hj-upload__button {
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--hj-ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.hj-upload__text {
  font-size: 0.92rem;
  color: var(--hj-muted);
}

.hj-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hj-thumbs:empty {
  display: none;
}

.hj-thumbs li {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
}

.hj-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hj-thumbs button {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--hj-ink);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}

.hj-estimate {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--hj-wood);
  background: var(--hj-paper-2);
}

.hj-estimate strong {
  font-family: var(--hj-serif);
  font-size: 1.6rem;
  font-weight: 500;
}

.hj-estimate span {
  font-size: 0.92rem;
  color: var(--hj-muted);
}

.hj-summary-thumbs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.hj-summary-thumbs img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
}

/* Viewer ------------------------------------------------------------------ */
.hj-viewer {
  width: min(70rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 0;
  background: var(--hj-paper);
  color: var(--hj-ink);
}

.hj-viewer::backdrop {
  background: rgba(20, 18, 15, 0.75);
}

.hj-viewer__inner {
  position: relative;
  display: grid;
}

@media (min-width: 52rem) {
  .hj-viewer__inner {
    grid-template-columns: 1.6fr 1fr;
  }
}

.hj-viewer__img {
  width: 100%;
  height: 100%;
  max-height: 72vh;
  object-fit: cover;
}

.hj-viewer__info {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1.75rem;
}

.hj-viewer__info h3 {
  font-size: 1.8rem;
}

.hj-viewer__specs {
  display: grid;
  gap: 0.5rem;
}

.hj-viewer__specs div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hj-line);
}

.hj-viewer__specs dt {
  color: var(--hj-muted);
}

.hj-viewer__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--hj-ink);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

/* Footer ------------------------------------------------------------------ */
.hj-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.25rem 2rem;
  padding: 2.5rem var(--gutter) 3rem;
  font-size: 0.95rem;
  color: var(--hj-muted);
}

.hj-footer .hj-logo {
  color: var(--hj-ink);
}

.hj-footer__fine {
  font-size: 0.85rem;
}
