/* McWilliams Woodworking Co — shared styles */

:root {
  --forest: #102820;
  --forest-deep: #0a1c16;
  --forest-soft: #16332a;
  --green: #1a6100;
  --green-bright: #2a8410;
  --linen: #caba9c;
  --linen-bright: #e3d6b8;
  --walnut: #8a6240;
  --mahogany: #4d2d18;
  --offwhite: #f1e7d0;
  --rule: rgba(202, 186, 156, 0.18);
  --rule-strong: rgba(202, 186, 156, 0.32);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--forest);
  color: var(--linen);
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

/* ---------- Type system ---------- */
h1, h2, h3, h4, .display, .wordmark {
  font-family: 'Zilla Slab', 'Rockwell', Georgia, serif;
  color: var(--offwhite);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-wrap: balance;
}

h1, .display { font-weight: 700; letter-spacing: -0.02em; }

.eyebrow {
  font-family: 'Zilla Slab', Georgia, serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--linen);
  opacity: 0.85;
}

.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--green-bright);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  transform: translateY(-2px);
}

p { text-wrap: pretty; }
p + p { margin-top: 1em; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 36px;
}
.wrap-narrow {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 36px;
}

/* ---------- Site header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(10, 28, 22, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--rule);
}

.wordmark {
  font-family: 'Zilla Slab', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--offwhite);
  letter-spacing: 0;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.wordmark .wm-main { display: inline-flex; align-items: baseline; gap: 4px; }
.wordmark .wm-co {
  font-style: italic;
  font-weight: 400;
  color: var(--linen);
  font-size: 17px;
}
.wordmark .wm-rule {
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--linen);
  opacity: 0.55;
  transform: translateY(-5px);
}
.wordmark .wm-tag {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
  color: var(--linen);
  opacity: 0.7;
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .wordmark .wm-rule, .wordmark .wm-tag { display: none; }
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-primary a {
  font-family: 'Zilla Slab', serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--linen);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}
.nav-primary a:hover { color: var(--offwhite); }
.nav-primary a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--green-bright);
}
.nav-primary .nav-cta {
  font-family: 'Zilla Slab', serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 18px;
  border: 1px solid var(--linen);
  color: var(--offwhite);
  border-radius: 1px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.nav-primary .nav-cta:hover {
  background: var(--green-bright);
  color: var(--offwhite);
  border-color: var(--green-bright);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--linen);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-primary.is-open + .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-primary.is-open + .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-primary.is-open + .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-primary, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav-primary.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--forest-deep);
    border-top: 1px solid var(--rule);
    padding: 24px 36px;
    gap: 18px;
    align-items: flex-start;
  }
  .nav-primary.is-open .nav-cta {
    display: block;
    border: none;
    padding: 4px 0;
    font-size: 14px;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-family: 'Zilla Slab', serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 1px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn .arr {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width 0.2s ease;
}
.btn .arr::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
.btn:hover .arr { width: 28px; }

.btn-primary {
  background: var(--green);
  color: var(--offwhite);
  border-color: var(--green);
}
.btn-primary:hover { background: var(--green-bright); border-color: var(--green-bright); }

.btn-ghost {
  background: transparent;
  color: var(--offwhite);
  border-color: var(--linen);
}
.btn-ghost:hover { background: var(--linen); color: var(--forest); }

/* ---------- Page hero (non-home pages) ---------- */
.page-hero {
  padding: 180px 0 80px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.page-hero .eyebrow { margin-bottom: 22px; }
.page-hero h1 {
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.98;
  margin-bottom: 22px;
}
.page-hero .lede {
  font-size: clamp(18px, 1.6vw, 21px);
  max-width: 640px;
  color: var(--linen);
  font-style: italic;
}

/* ---------- Section conventions ---------- */
section { position: relative; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--forest-deep);
  border-top: 1px solid var(--rule);
  padding: 72px 0 28px;
  color: var(--linen);
  position: relative;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
.footer-grid h4 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--linen);
  opacity: 0.7;
  margin-bottom: 18px;
}
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 10px; font-size: 15px; }
.footer-grid a:hover { color: var(--offwhite); }

.footer-blurb {
  font-style: italic;
  color: var(--linen);
  max-width: 360px;
  margin-top: 16px;
  font-size: 15px;
}

.footer-mark {
  font-family: 'Zilla Slab', serif;
  font-size: 22px;
  color: var(--offwhite);
  font-weight: 600;
}

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--linen);
  opacity: 0.7;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Placeholder image utility ---------- */
.ph {
  background-color: var(--forest-soft);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  bottom: 14px;
  left: 14px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(241, 231, 208, 0.7);
  background: rgba(10, 28, 22, 0.55);
  padding: 4px 8px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ph[data-label]:hover::after { opacity: 1; }

/* ---------- Wood-grain styled placeholder ----------
   Used wherever an Unsplash photo hasn't been verified or selected yet.
   Reads as an intentional "drop photo here" affordance for the client.
   Variants tone-shift to walnut / oak / cherry / maple / shop / mahogany. */
.ph-wood {
  position: relative;
  overflow: hidden;
  background-color: #2a1a0e;
  background-image:
    radial-gradient(140% 90% at 50% 0%, rgba(241,231,208,0.06), transparent 60%),
    linear-gradient(180deg, rgba(10,28,22,0.32) 0%, rgba(10,28,22,0.06) 35%, rgba(10,28,22,0.62) 100%),
    repeating-linear-gradient(86deg,
      rgba(255,255,255,0.00) 0px,
      rgba(255,255,255,0.045) 2px,
      rgba(0,0,0,0.11) 5px,
      rgba(255,255,255,0.025) 9px,
      rgba(0,0,0,0.07) 14px,
      rgba(255,255,255,0.035) 21px,
      rgba(0,0,0,0.085) 26px,
      rgba(255,255,255,0.02) 33px);
  isolation: isolate;
}
.ph-wood::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.012 0.55' numOctaves='3' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0   0 0 0 0 0   0 0 0 0 0   0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 900px 900px;
  mix-blend-mode: overlay;
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
}
.ph-wood::after {
  content: attr(data-label);
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(241,231,208,0.92);
  background: rgba(10,28,22,0.7);
  padding: 6px 10px 6px 22px;
  backdrop-filter: blur(6px);
  border-left: 2px solid var(--green-bright);
  opacity: 1;
  pointer-events: none;
  max-width: calc(100% - 28px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ph-wood--walnut   { background-color: #3a2410; }
.ph-wood--oak      { background-color: #6e4f2c; }
.ph-wood--cherry   { background-color: #5a2c1c; }
.ph-wood--maple    { background-color: #8a6240; }
.ph-wood--mahog    { background-color: #4d2d18; }
.ph-wood--shop     { background-color: #1a1208; }
.ph-wood--shop > .glow {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 32% 28%, rgba(241,231,208,0.22), transparent 38%),
    radial-gradient(circle at 78% 70%, rgba(26,97,0,0.18), transparent 45%);
  z-index: 1;
  pointer-events: none;
}
.ph-wood--portrait {
  background-color: #2a1a0e;
}
.ph-wood--portrait > .glow {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 55% at 50% 38%, rgba(241,231,208,0.18), transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 40%, rgba(202,186,156,0.12), transparent 70%);
  z-index: 1;
  pointer-events: none;
}

/* ---------- Reveal-on-scroll utility ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Mobile — shared overrides ---------- */
@media (max-width: 540px) {
  .wrap, .wrap-narrow { padding: 0 20px; }
  .site-header { padding: 18px 20px; }
  .nav-primary.is-open { padding: 20px 20px; }
  .page-hero { padding: 120px 0 52px; }
  .footer-grid li { word-break: break-word; overflow-wrap: break-word; }
}

/* ---------- Misc ---------- */
::selection { background: var(--green); color: var(--offwhite); }
