/* =========================================================================
   Integrity Contracting Services
   Refined warm-editorial craftsman aesthetic.
   Display: Fraunces · Body: Archivo
   ========================================================================= */

:root {
  /* Warm paper / light surfaces */
  --bone:        #f3efe6;
  --bone-2:      #ebe5d8;
  --bone-3:      #e2dac9;

  /* Warm near-black / dark surfaces */
  --char:        #15120e;
  --char-2:      #1d1812;
  --char-3:      #2a231b;

  /* Ink (text) */
  --ink:         #211c16;
  --ink-soft:    #5d5346;
  --ink-faint:   #8a8071;
  --paper-text:  #ece5d6;   /* body text on dark */
  --paper-soft:  rgba(236,229,214,.62);

  /* Accent — cedar / dusk ember */
  --ember:       #c4682f;
  --ember-2:     #d9863f;
  --ember-deep:  #a4521f;

  /* Lines */
  --line:        rgba(33,28,22,.14);
  --line-strong: rgba(33,28,22,.26);
  --line-dark:   rgba(236,229,214,.14);
  --line-dark-2: rgba(236,229,214,.28);

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3.25rem);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Archivo", -apple-system, BlinkMacSystemFont, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-card: 0 1px 2px rgba(33,28,22,.04), 0 18px 40px -24px rgba(33,28,22,.28);
  --shadow-lift: 0 1px 2px rgba(33,28,22,.06), 0 34px 60px -28px rgba(33,28,22,.40);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font-body);
  background: var(--bone);
  color: var(--ink);
  font-size: clamp(1rem, .96rem + .25vw, 1.075rem);
  line-height: 1.65;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--ember); color: var(--bone); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Anchor offset for sticky header */
section[id], #top { scroll-margin-top: 84px; }

/* ---------- Typography primitives ---------- */
h1, h2, h3, blockquote {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.012em;
  font-optical-sizing: auto;
}
.kicker, .eyebrow {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ember-deep);
}
.kicker.light { color: var(--ember-2); }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s var(--ease);
  border-bottom: 1px solid transparent;
}
/* Dark gradient behind the banner so the logo + nav stay legible over the hero;
   fades out once the solid scrolled state takes over. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(13,11,8,.78) 0%, rgba(13,11,8,.40) 55%, transparent 100%);
  transition: opacity .4s var(--ease);
}
.site-header.scrolled::before { opacity: 0; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand-mark {
  height: 38px;
  width: auto;
  filter: brightness(0) invert(1);          /* logo light over the hero */
  transition: filter .4s var(--ease);
}
.site-header.scrolled {
  background: rgba(243,239,230,.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -24px rgba(33,28,22,.5);
}
.site-header.scrolled .brand-mark { filter: none; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 2.5vw, 2.6rem);
}
.nav a {
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: rgba(236,229,214,.92);
  position: relative;
  transition: color .25s var(--ease);
}
.nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 1.5px;
  background: var(--ember-2);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
.site-header.scrolled .nav a { color: var(--ink); }
.site-header.scrolled .nav a:not(.nav-cta)::after { background: var(--ember); }

.nav-cta {
  padding: .55rem 1.15rem;
  border: 1px solid rgba(236,229,214,.45);
  border-radius: 999px;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.nav-cta:hover { background: var(--ember); border-color: var(--ember); color: var(--bone); }
.site-header.scrolled .nav-cta { border-color: var(--line-strong); }
.site-header.scrolled .nav-cta:hover { color: var(--bone); border-color: var(--ember); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none; border: none;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--bone);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .25s var(--ease), background .4s var(--ease);
}
.site-header.scrolled .nav-toggle span { background: var(--ink); }
.nav-toggle[aria-expanded="true"] span { background: var(--ink); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 76px 0 auto 0;
  background: var(--bone);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: .5rem var(--gutter) 1.5rem;
  box-shadow: 0 30px 50px -30px rgba(33,28,22,.5);
  z-index: 99;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.mobile-menu a:last-child { border-bottom: none; color: var(--ember-deep); }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(2.5rem, 6vh, 5rem);
  color: var(--bone);
  isolation: isolate;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 60%;
  transform: scale(1.08);
  animation: kenburns 18s ease-out forwards;
}
@keyframes kenburns {
  to { transform: scale(1); }
}
.hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(13,11,8,.55) 0%, rgba(13,11,8,.40) 26%, rgba(13,11,8,.60) 60%, rgba(13,11,8,.95) 100%),
    linear-gradient(95deg, rgba(13,11,8,.90) 0%, rgba(13,11,8,.70) 34%, rgba(13,11,8,.34) 58%, rgba(13,11,8,.06) 82%),
    rgba(13, 11, 8, 0.16);
}

/* Film grain overlay */
.grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero .grain { z-index: -1; }

.hero-content { position: relative; }
.hero .eyebrow {
  color: #f7f2e8;
  margin-bottom: 1.4rem;
  display: inline-flex;
  text-shadow: 0 1px 3px rgba(13, 11, 8, 0.95), 0 2px 16px rgba(13, 11, 8, 0.85);
}
.hero-title {
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: .92;
  margin-bottom: 1.6rem;
  max-width: 14ch;
  text-shadow: 0 2px 30px rgba(13, 11, 8, 0.55), 0 1px 8px rgba(13, 11, 8, 0.4);
}
.hero-sub,
.hero-foot { text-shadow: 0 1px 14px rgba(13, 11, 8, 0.78); }
.hero-title span { display: block; }
.hero-title .accent {
  color: var(--ember-2);
  font-style: italic;
  font-weight: 500;
}
.hero-sub {
  font-size: clamp(1.05rem, 1rem + .55vw, 1.4rem);
  max-width: 46ch;
  color: rgba(236,229,214,.86);
  line-height: 1.55;
  margin-bottom: 2.4rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-foot {
  position: relative;
  margin-top: clamp(2.5rem, 8vh, 5rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(236,229,214,.72);
}
.hero-foot i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ember-2);
  flex: none;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .92rem 1.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .01em;
  border: 1px solid transparent;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
  will-change: transform;
}
.btn-primary {
  background: var(--ember);
  color: #fdf8ef;
  box-shadow: 0 14px 30px -14px rgba(164,82,31,.7);
}
.btn-primary:hover {
  background: var(--ember-deep);
  transform: translateY(-2px);
  box-shadow: 0 20px 38px -14px rgba(164,82,31,.8);
}
.btn-ghost {
  background: rgba(236,229,214,.06);
  border-color: rgba(236,229,214,.45);
  color: var(--bone);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover { background: rgba(236,229,214,.14); border-color: var(--bone); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* =========================================================================
   Section scaffolding
   ========================================================================= */
.section { padding-block: clamp(4.5rem, 11vh, 9rem); position: relative; }
.section-head { max-width: 40ch; margin-bottom: clamp(2.5rem, 5vh, 4rem); }
.section-head .kicker { display: inline-block; margin-bottom: 1rem; }
.section-head h2 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
}
.section-lead {
  margin-top: 1.1rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 52ch;
}

/* ---------- Build (light) ---------- */
.build { background: var(--bone); }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
}
.card {
  position: relative;
  background: linear-gradient(180deg, #fbf8f1, #f1ebdd);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.4rem 1.9rem 2.1rem;
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--ember), var(--ember-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}
.card:hover::before { transform: scaleX(1); }
.card-num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ember);
  letter-spacing: .04em;
  display: block;
  margin-bottom: 2.6rem;
}
.card h3 {
  font-size: 1.5rem;
  margin-bottom: .85rem;
  letter-spacing: -0.01em;
}
.card p { color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }
.card em { font-style: italic; color: var(--ember-deep); }

/* ---------- The Standard (dark) ---------- */
.standard {
  background: var(--char);
  color: var(--paper-text);
  isolation: isolate;
  overflow: hidden;
}
.standard .grain { opacity: .35; z-index: 0; }
.standard-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.standard-quote .kicker { display: inline-block; margin-bottom: 1.4rem; }
.standard-quote blockquote {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--bone);
}
.standard-body p { color: var(--paper-soft); margin-bottom: 1.2rem; max-width: 46ch; }
.standard-body p:first-child { color: var(--paper-text); }
.marks {
  list-style: none;
  padding: 0;
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  border-top: 1px solid var(--line-dark);
  padding-top: 2rem;
}
.marks li { display: flex; flex-direction: column; gap: .25rem; }
.marks strong {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ember-2);
}
.marks span { font-size: .82rem; color: var(--paper-soft); letter-spacing: .01em; }

/* ---------- Work (light) ---------- */
.work { background: var(--bone-2); }
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 300px;
  gap: clamp(.9rem, 1.6vw, 1.4rem);
}
.g-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin: 0;
}
.g-item.g-tall { grid-row: span 2; }
.g-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}
.g-item:hover img { transform: scale(1.06); }
.g-item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(13,11,8,.82) 100%);
  opacity: .85;
  transition: opacity .4s var(--ease);
}
.g-item figcaption {
  position: absolute;
  left: 1.4rem; right: 1.4rem; bottom: 1.3rem;
  z-index: 2;
  color: var(--bone);
  font-size: .92rem;
  line-height: 1.4;
  transform: translateY(6px);
  opacity: 0;
  transition: transform .45s var(--ease), opacity .45s var(--ease);
}
.g-item:hover figcaption { transform: translateY(0); opacity: 1; }
.g-item figcaption span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: .15rem;
}

/* ---------- Contact (dark) ---------- */
.contact { background: var(--char); color: var(--paper-text); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.contact-intro .kicker { display: inline-block; margin-bottom: 1.2rem; }
.contact-intro h2 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
  color: var(--bone);
  margin-bottom: 1.2rem;
}
.contact-intro p { color: var(--paper-soft); max-width: 42ch; }
.contact-meta {
  margin-top: 2.2rem;
  display: grid;
  gap: 1.3rem;
  border-top: 1px solid var(--line-dark);
  padding-top: 1.8rem;
}
.contact-meta dt {
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .3rem;
}
.contact-meta dd { font-size: 1.05rem; color: var(--paper-text); }
.contact-meta a:hover { color: var(--ember-2); }

/* Form */
.contact-form {
  background: var(--char-2);
  border: 1px solid var(--line-dark);
  border-radius: 20px;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  display: grid;
  gap: 1.1rem;
}
.field { display: grid; gap: .5rem; }
.field label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--paper-soft);
}
.field .opt { color: var(--ink-faint); font-weight: 400; text-transform: none; letter-spacing: 0; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(236,229,214,.04);
  border: 1px solid var(--line-dark-2);
  border-radius: 11px;
  padding: .85rem 1rem;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(236,229,214,.34); }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--ember-2);
  background: rgba(236,229,214,.07);
  box-shadow: 0 0 0 3px rgba(196,104,47,.18);
}
/* Honeypot */
.hp { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; width: 0; }
.form-status {
  font-size: .9rem;
  min-height: 1.2em;
  margin-top: .2rem;
}
.form-status.is-ok { color: var(--ember-2); }
.form-status.is-err { color: #e07a5f; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  background: var(--char-2);
  color: var(--paper-soft);
  border-top: 1px solid var(--line-dark);
  padding-block: clamp(2.5rem, 5vh, 4rem);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 2rem;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  color: var(--bone);
}
.wordmark span { font-size: 1.1rem; font-weight: 400; color: var(--paper-soft); }
.footer-tag {
  margin-top: .7rem;
  font-style: italic;
  font-family: var(--font-display);
  color: var(--ember-2);
}
.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
  text-align: right;
  font-size: .9rem;
}
.footer-meta a:hover { color: var(--ember-2); }
.footer-meta .copy { color: var(--ink-faint); margin-top: .4rem; }

/* =========================================================================
   Motion — load reveals + scroll reveals
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: rise .9s var(--ease) forwards;
}
.reveal[data-d="0"] { animation-delay: .15s; }
.reveal[data-d="1"] { animation-delay: .28s; }
.reveal[data-d="2"] { animation-delay: .40s; }
.reveal[data-d="3"] { animation-delay: .54s; }
.reveal[data-d="4"] { animation-delay: .68s; }
.reveal[data-d="5"] { animation-delay: .9s; }
@keyframes rise {
  to { opacity: 1; transform: none; }
}

.sr {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
.sr.in { opacity: 1; transform: none; }
/* stagger grouped children */
.cards .card:nth-child(2) { transition-delay: .1s; }
.cards .card:nth-child(3) { transition-delay: .2s; }
.gallery .g-item:nth-child(2) { transition-delay: .1s; }
.gallery .g-item:nth-child(3) { transition-delay: .2s; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .cards { grid-template-columns: 1fr; }
  .standard-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; grid-auto-rows: 260px; }
  .g-item.g-tall { grid-row: span 1; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { align-items: flex-start; text-align: left; }
}
@media (max-width: 540px) {
  .contact-form .row { grid-template-columns: 1fr; }
  .marks { grid-template-columns: 1fr; gap: 1rem; }
  .hero-foot { flex-wrap: wrap; row-gap: .4rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal, .sr { opacity: 1; transform: none; }
  .hero-media img { transform: none; }
}
