/* ============================================================
   Andrew Arnold Drafting — Launch site
   Theme: Modern
   Palette: Black #111111 · White #FFFFFF · Champagne #D8CBB5 · Burgundy #641C24
   ============================================================ */

:root {
  --black: #111111;
  --white: #ffffff;
  --champagne: #d8cbb5;
  --burgundy: #641c24;

  --ink: #111111;
  --ink-soft: #3d3d3d;
  --muted: #6b6b6b;
  --line: #e7e4dd;
  --bg: #ffffff;
  --bg-alt: #faf8f4;      /* subtle warm off-white */
  --champagne-soft: #f2ece1;

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 48px);

  --shadow: 0 10px 30px rgba(17, 17, 17, 0.08);
  --shadow-lg: 0 24px 60px rgba(17, 17, 17, 0.14);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.1; margin: 0; }
p { margin: 0; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--black); color: var(--white); padding: 10px 16px;
  border-radius: 8px; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--burgundy);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 0.98rem;
  padding: 14px 26px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--burgundy); color: var(--white); }
.btn-primary:hover { background: #7c232d; }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { border-color: var(--champagne); color: var(--champagne); }
.btn-block { width: 100%; }

/* Services "show all" toggle: desktop shows all 6 cards, so this is hidden there
   and only revealed in the mobile/tablet layout. */
.services-toggle {
  display: none;
  margin: 26px auto 0; padding: 13px 26px;
  font-family: var(--font-head); font-weight: 600; font-size: .96rem;
  color: var(--burgundy); background: transparent;
  border: 1.5px solid var(--burgundy); border-radius: 999px; cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.services-toggle:hover { background: var(--burgundy); color: var(--white); }

/* On light sections, ghost buttons need dark ink */
.section .btn-ghost { color: var(--ink); border-color: var(--line); }
.section .btn-ghost:hover { border-color: var(--burgundy); color: var(--burgundy); }

/* ---------- Eyebrow / section heads ---------- */
.eyebrow {
  font-family: var(--font-head); font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; font-size: .76rem; color: var(--champagne);
  margin: 0 0 14px;
}
.eyebrow-dark { color: var(--burgundy); }

.section { position: relative; overflow: hidden; padding: clamp(64px, 9vw, 120px) 0; }
.section > .container { position: relative; z-index: 2; }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 14px; }
.section-lede { color: var(--ink-soft); font-size: 1.08rem; font-weight: 500; }

.section-dark {
  background: var(--black); color: var(--white);
  position: relative; z-index: 3;
  /* Dark sections sit "closer" to the viewer and cast a soft shadow onto the light section above/below */
  box-shadow: 0 -22px 45px -12px rgba(17, 17, 17, .5), 0 22px 45px -12px rgba(17, 17, 17, .5);
}
.section-dark .section-lede { color: rgba(255,255,255,.72); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s var(--ease);
}
.site-header.scrolled { box-shadow: 0 6px 20px rgba(17,17,17,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-head); }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  background: var(--black); color: var(--champagne); border-radius: 10px;
  font-weight: 700; font-size: 1.15rem; position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; left: 9px; right: 9px; bottom: 8px; height: 2px; background: var(--burgundy);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-weight: 600; font-size: 1.05rem; letter-spacing: .01em; }
.brand-text small {
  font-family: var(--font-body); font-weight: 500; font-size: .64rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 4px;
}
.section-dark .brand-text, .site-footer .brand-text { color: var(--white); }
.site-footer .brand-text small { color: var(--champagne); }

/* ---------- Nav ---------- */
.nav-menu {
  list-style: none; display: flex; align-items: center; gap: 30px; margin: 0; padding: 0;
}
.nav-menu a { font-family: var(--font-head); font-weight: 500; font-size: .98rem; color: var(--ink-soft); transition: color .15s var(--ease); }
.nav-menu a:hover { color: var(--burgundy); }
.nav-cta {
  background: var(--black); color: var(--white) !important;
  padding: 10px 20px; border-radius: 999px;
}
.nav-cta:hover { background: var(--burgundy); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line);
  background: var(--white); border-radius: 10px; cursor: pointer; position: relative;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 2px;
  background: var(--ink); transition: transform .2s var(--ease), opacity .2s var(--ease);
}
/* All three centered, then the outer bars offset by an equal ±6px so the
   spacing is symmetric. */
.nav-toggle-bar { transform: translate(-50%, -50%); }
.nav-toggle-bar::before { transform: translate(-50%, -50%) translateY(-6px); }
.nav-toggle-bar::after  { transform: translate(-50%, -50%) translateY(6px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translate(-50%, -50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  background: var(--black); color: var(--white);
  position: relative; overflow: hidden;
  padding: clamp(72px, 12vw, 140px) 0 clamp(64px, 9vw, 110px);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 82% 8%, rgba(216,203,181,.16), transparent 60%),
    radial-gradient(50% 50% at 6% 100%, rgba(100,28,36,.4), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 860px; }
.hero h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.6rem); letter-spacing: -0.02em; margin-bottom: 22px;
}
.hero h1 .accent { color: var(--champagne); }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.28rem); color: rgba(255,255,255,.8); max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 34px 0 0; }

.hero-stats {
  list-style: none; margin: clamp(44px, 7vw, 72px) 0 0; padding: 28px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.hero-stats li { display: flex; flex-direction: column; gap: 4px; }
.hero-stats strong { font-family: var(--font-head); font-size: 1.05rem; color: var(--champagne); }
.hero-stats span { font-size: .9rem; color: rgba(255,255,255,.65); }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-services { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px;
}
.service-card {
  position: relative;
  background: var(--white); border-color: rgba(17, 17, 17, .06);
  box-shadow: 0 10px 26px rgba(17, 17, 17, .10), 0 2px 6px rgba(17, 17, 17, .05);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--champagne); }
.service-num {
  font-family: var(--font-head); font-weight: 700; font-size: .82rem;
  color: var(--burgundy); letter-spacing: .1em;
}
.service-card h3 { font-size: 1.22rem; margin: 14px 0 10px; }
.service-card p { color: var(--muted); font-size: .98rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(36px, 6vw, 72px); align-items: start; }
.about-copy h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 20px; }
.about-copy p { color: rgba(255,255,255,.78); margin-bottom: 16px; }
.about-copy .btn { margin-top: 12px; }

.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.trust-list li {
  display: flex; gap: 16px; align-items: flex-start;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius); padding: 20px 22px;
}
.trust-ico {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; background: var(--champagne); color: var(--black);
  font-weight: 700;
}
.trust-list strong { display: block; font-family: var(--font-head); margin-bottom: 4px; }
.trust-list p { color: rgba(255,255,255,.66); font-size: .94rem; margin: 0; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery-item {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 4 / 3; background: var(--champagne-soft); border: 1px solid var(--line);
  margin: 0;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
/* Loop clones exist only for the mobile carousel; hidden everywhere else. */
.gallery-item.is-clone { display: none; }
.gallery-item figcaption {
  position: absolute; inset: auto 0 0 0; padding: 14px 16px;
  background: linear-gradient(to top, rgba(17,17,17,.82), transparent);
  color: var(--white); font-family: var(--font-head); font-size: .92rem; text-align: left;
}

.gallery-hint {
  display: none; text-align: center; margin-top: 14px;
  font-family: var(--font-head); font-size: .82rem; letter-spacing: .04em;
  color: var(--muted);
}

.gallery-empty {
  grid-column: 1 / -1; text-align: center;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: clamp(40px, 8vw, 72px) 24px; background: var(--bg-alt); color: var(--muted);
}
.gallery-empty strong { display: block; font-family: var(--font-head); color: var(--ink); font-size: 1.15rem; margin-bottom: 8px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(36px, 6vw, 64px); align-items: start; }
.contact-intro h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 16px; }
.contact-intro > p { color: rgba(255,255,255,.78); margin-bottom: 28px; }
.contact-details { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.contact-details li { display: flex; flex-direction: column; gap: 3px; }
.contact-label { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--champagne); font-family: var(--font-head); }
.contact-details a:hover { color: var(--champagne); }

.contact-form { padding: clamp(24px, 4vw, 34px); color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { font-family: var(--font-head); font-weight: 500; font-size: .92rem; }
.field .opt { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--burgundy); box-shadow: 0 0 0 3px rgba(100,28,36,.12);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--burgundy); }
.field-error { color: var(--burgundy); font-size: .82rem; min-height: 0; }
.field.invalid .field-error { min-height: 1em; }

.contact-form .btn-block { margin-top: 6px; }
.form-status { margin: 14px 0 0; font-size: .95rem; text-align: center; min-height: 1.2em; }
.form-status.ok { color: #1c6b3a; }
.form-status.err { color: var(--burgundy); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: #0c0c0c; color: rgba(255,255,255,.7); padding: 54px 0 40px; }
.footer-inner { display: grid; gap: 22px; text-align: center; justify-items: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 12px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.footer-nav a { font-family: var(--font-head); font-size: .95rem; color: rgba(255,255,255,.72); }
.footer-nav a:hover { color: var(--champagne); }
.footer-copy { font-size: .86rem; color: rgba(255,255,255,.5); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Depth / scroll FX  ("3D" add-on)
   Decorative layers that drift on scroll to add depth. Purely
   visual, aria-hidden, and disabled under prefers-reduced-motion.
   ============================================================ */
.fx {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden; pointer-events: none;
}
/* JS drives parallax through the --py variable so it composes with the
   base transform (rotation) instead of overwriting it. */

/* Blueprint / drafting grid on light sections. It lives in the .fx layer as a
   real element (oversized) so it can parallax and sit "far behind" the cards.
   Kept light so it does not fight the burgundy eyebrow labels. */
.section-grid { background: var(--bg-alt); }
.fx-grid--light {
  position: absolute; top: -45%; left: -12%; right: -12%; height: 190%;
  background-image:
    linear-gradient(rgba(100, 28, 36, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 28, 36, .045) 1px, transparent 1px),
    linear-gradient(rgba(100, 28, 36, .085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 28, 36, .085) 1px, transparent 1px);
  background-size: 38px 38px, 38px 38px, 190px 190px, 190px 190px;
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}

/* Burgundy diagonal strips that parallax on light sections */
.fx-strip {
  position: absolute; top: -40%; right: -6%;
  width: 240px; height: 180%;
  background: linear-gradient(180deg, rgba(100,28,36,.22), rgba(100,28,36,.05));
  transform: translate3d(0, var(--py, 0px), 0) rotate(16deg);
  transform-origin: top center;
  border-radius: 60px; will-change: transform;
}
.fx-strip--soft {
  right: auto; left: -8%; width: 170px;
  background: linear-gradient(180deg, rgba(216,203,181,.65), rgba(216,203,181,.14));
}

/* Thin accent lines that parallax on dark sections + hero */
.fx-line {
  position: absolute; top: -40%; right: 10%;
  width: 2px; height: 180%;
  background: linear-gradient(180deg, transparent, rgba(216,203,181,.6), transparent);
  transform: translate3d(0, var(--py, 0px), 0) rotate(18deg);
  will-change: transform;
}
.fx-line--champagne { background: linear-gradient(180deg, transparent, rgba(216,203,181,.7), transparent); }

/* Hero grid drifts for depth */
.fx-hero { z-index: 0; }
.fx-hero .fx-grid {
  position: absolute; inset: -12% -12% 0 -12%;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(88% 78% at 80% 12%, #000, transparent 80%);
  -webkit-mask-image: radial-gradient(88% 78% at 80% 12%, #000, transparent 80%);
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}
.hero .hero-inner { position: relative; z-index: 2; }

/* ---------- Responsive ---------- */

/* Intermediate (large tablet / small laptop): keep the desktop feel, fewer columns */
@media (max-width: 900px) {
  .grid-services { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Mobile + tablet (<=768px): a focused, centered "selling page".
   Desktop above 768px is unchanged (except the service-card order,
   which is in the markup and applies everywhere).
   ============================================================ */
@media (max-width: 768px) {
  /* ----- Nav: hamburger menu ----- */
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: 8px 0 16px; box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform .22s var(--ease), opacity .22s var(--ease);
  }
  .nav-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-menu li { border-top: 1px solid var(--line); }
  .nav-menu li:first-child { border-top: none; }
  .nav-menu a { display: block; padding: 15px var(--gutter); font-size: 1.05rem; }
  .nav-cta { margin: 12px var(--gutter) 0; text-align: center; border-radius: 999px; }

  /* ----- Tighter vertical rhythm so the page reads shorter ----- */
  .section { padding: clamp(46px, 11vw, 68px) 0; }
  .hero { padding: clamp(64px, 16vw, 96px) 0 clamp(48px, 12vw, 72px); }

  /* ----- Center everything (reads cleaner on a phone) ----- */
  .hero-inner { text-align: center; margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .section-head { text-align: center; margin-inline: auto; }
  .about-copy { text-align: center; }
  .contact-intro { text-align: center; }
  .contact-details { justify-items: center; }

  /* ----- Hero stats: 10+ Years (L) · St. Louis (R), Built to Code centered below ----- */
  .hero-stats {
    grid-template-columns: 1fr 1fr; gap: 22px 18px;
    max-width: 400px; margin-inline: auto; padding-top: 24px;
  }
  .hero-stats li { align-items: center; text-align: center; }
  .hero-stats li:last-child { grid-column: 1 / -1; }

  /* ----- Services: show the top 3, smoothly reveal the rest with the button -----
     Uses margins (not grid gap) so a collapsed card takes up no space, and
     animates max-height/padding/opacity so expand + collapse glide instead of
     snapping. */
  .grid-services { grid-template-columns: 1fr; gap: 0; }
  .grid-services .service-card { margin-bottom: 18px; }
  .grid-services .service-card:last-child { margin-bottom: 0; }
  .grid-services .service-card--more {
    max-height: 0; opacity: 0; margin-bottom: 0;
    padding-top: 0; padding-bottom: 0; border-width: 0;
    overflow: hidden; transform: translateY(-6px);
    transition: max-height .4s var(--ease), opacity .35s var(--ease),
                margin .4s var(--ease), padding .4s var(--ease),
                border-width .4s var(--ease), transform .4s var(--ease);
  }
  .grid-services.show-all .service-card--more {
    max-height: 340px; opacity: 1; margin-bottom: 18px;
    padding-top: 30px; padding-bottom: 30px; border-width: 1px;
    transform: none;
  }
  .grid-services.show-all .service-card--more:last-child { margin-bottom: 0; }
  .services-toggle { display: block; }

  /* ----- About: drop the qualification cards (already covered in the hero) ----- */
  .trust-list { display: none; }
  .about-grid { gap: 0; }

  /* ----- Recent work: iMessage-style swipe carousel -----
     Full-bleed row; each photo snaps to center with the neighbours peeking.
     The 9% inline padding lets the first and last photo center too. */
  .gallery {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding: 6px 9% 10px;
    scroll-padding-inline: 9%;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery-item { flex: 0 0 82%; scroll-snap-align: center; aspect-ratio: 4 / 3; }
  .gallery-item.is-clone { display: block; } /* shown as part of the loop on mobile */
  .gallery-empty { flex: 0 0 100%; }
  .gallery-hint { display: block; }

  /* ----- Contact form: tighter, less scrolling ----- */
  .contact-grid { gap: 30px; }
  .contact-form { padding: 22px; }
  .field { margin-bottom: 13px; gap: 6px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-form textarea { min-height: 92px; }
  .form-status { margin-top: 10px; }

  /* ----- Full-width hero buttons ----- */
  .hero-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
