/* Jackson & Grear Cornerstone Construction — styles */

/* ===== 1. Custom properties ===== */
:root {
  /* Color tokens */
  --color-base: #F2EDE0;
  --color-ink: #1C2620;
  --color-accent: #8B3A1F;
  --color-accent-dark: #6B2A15;
  --color-secondary: #6E6A5F;
  --color-sage: #8A8F72;
  --color-focus: #80856A;

  /* Type tokens */
  --font-display: 'Libre Caslon Text', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-section-desktop: 6rem;
  --space-section-mobile: 3rem;
  --content-max-width: 1200px;

  /* Breakpoints — reference only; @media requires literal values: 640px / 1024px / 1280px */
}

/* ===== 2. Reset / base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

input, button, textarea, select {
  font: inherit;
}

a {
  text-decoration: none;
}

ul {
  list-style: none;
  padding: 0;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ===== 3. Base typography ===== */
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--color-ink);
  background-color: var(--color-base);
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-ink);
  line-height: 1.2;
  overflow-wrap: break-word;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
}

h2 {
  font-size: 1.75rem;
  font-weight: 400;
}

h3 {
  font-size: 1.5rem;
  font-weight: 400;
}

@media (min-width: 1024px) {
  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.25rem; }
}

p {
  overflow-wrap: break-word;
}

a {
  color: var(--color-accent);
}

a:hover {
  color: var(--color-accent-dark);
}

/* ===== 4. Layout primitives ===== */
.container {
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.section {
  padding-block: var(--space-section-mobile);
}

@media (min-width: 1024px) {
  .section {
    padding-block: var(--space-section-desktop);
  }
}

/* ===== 5. Nav bar ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-base);
  border-bottom: 1px solid var(--color-secondary);
}

.site-header__inner {
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  color: var(--color-ink);
}

.site-logo__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.site-logo__tagline {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-ink);
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.site-nav {
  position: fixed;
  inset: 0;
  background: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-100%);
  transition: transform 200ms ease;
}

.site-nav.is-open {
  transform: translateY(0);
}

.site-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-base);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (min-width: 1024px) {
  .site-nav {
    position: static;
    transform: none;
    background: none;
    display: block;
  }

  .site-nav__list {
    flex-direction: row;
    gap: 2rem;
  }

  .site-nav a {
    color: var(--color-ink);
  }
}

/* ===== 6. Footer ===== */
.site-footer {
  background: var(--color-ink);
  color: var(--color-base);
  padding: 3rem 1.5rem 1.5rem;
}

.site-footer__inner {
  max-width: var(--content-max-width);
  margin-inline: auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .site-footer__inner {
    grid-template-columns: repeat(3, 1fr);
  }
}

.site-footer a {
  color: var(--color-base);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 3px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.site-footer__name {
  font-family: var(--font-display);
  font-weight: 700;
}

.site-footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer__legal {
  text-align: center;
  font-size: 0.875rem;
  margin-top: 2rem;
  color: var(--color-base);
  opacity: 0.6;
}

/* ===== 7. Buttons ===== */
.button {
  display: inline-block;
  background-color: var(--color-accent);
  color: var(--color-base);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 150ms ease, transform 100ms ease;
}

.button:hover {
  background-color: var(--color-accent-dark);
  color: var(--color-base);
}

.button:active {
  transform: scale(0.98);
}

/* ===== 8. Signature divider ===== */
.section-divider {
  display: block;
  width: 100%;
  height: 16px;
  color: var(--color-accent);
  margin-block: 2rem;
}

/* ===== 9. Skip-to-content + visually-hidden utility ===== */
.visually-hidden {
  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;
  top: -100%;
  left: 0;
  background: var(--color-ink);
  color: var(--color-base);
  padding: 1rem 1.5rem;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ===== 10. Print styles ===== */
@media print {
  .site-header,
  .site-footer,
  .button,
  .skip-link {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  a[href^="tel:"],
  a[href^="mailto:"] {
    color: #000;
    text-decoration: none;
  }
}

/* ===== 11. Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }

  .button:active {
    transform: none !important;
  }
}

/* ===== 12. Hero (Home) ===== */
.home-hero {
  position: relative;
  height: 70vh;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .home-hero {
    height: 85vh;
  }
}

.home-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.home-hero__overlay {
  position: absolute;
  inset: 0;
  background-color: var(--color-ink);
  opacity: 0.35;
  z-index: 1;
}

.home-hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 40rem;
  padding-inline: 1.5rem;
  text-align: center;
}

.home-hero__name {
  color: var(--color-base);
}

.home-hero__tagline {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--color-base);
  opacity: 0.9;
}

@media (min-width: 1024px) {
  .home-hero__tagline {
    font-size: 1.25rem;
  }
}

.home-hero__phone {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  color: var(--color-base);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 4px;
}

@media (min-width: 1024px) {
  .home-hero__phone {
    font-size: 2.25rem;
  }
}

.home-hero__phone:hover,
.home-hero__phone:focus-visible {
  color: var(--color-accent);
}

.service-area__text {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
  color: var(--color-secondary);
}

/* ===== 13. Services ===== */
.services-intro {
  text-align: center;
}

.services-intro .container {
  max-width: 40rem;
}

.services-list .container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .services-list .container {
    gap: 4rem;
  }
}

.service-block {
  max-width: 40rem;
}

@media (min-width: 1024px) {
  .service-block {
    max-width: 48rem;
  }
}

.service-block h2 {
  margin-bottom: 0.75rem;
}

.service-block__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.service-block__list li {
  position: relative;
  padding-left: 1.25rem;
}

.service-block__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--color-accent);
}

.services-cta .container {
  display: flex;
  justify-content: center;
  text-align: center;
}

/* ===== 14. Projects ===== */
.projects-intro {
  text-align: center;
}

.projects-intro .container {
  max-width: 40rem;
}

.project-gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .project-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .project-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-gallery__item {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: var(--color-base);
  border: 1px solid var(--color-secondary);
}

.project-gallery__empty-message {
  max-width: 30rem;
  margin-inline: auto;
  padding-block: 3rem;
  text-align: center;
  font-size: 1.25rem;
  color: var(--color-secondary);
}

.projects-cta .container {
  display: flex;
  justify-content: center;
  text-align: center;
}

/* ===== 15. About ===== */
.about-intro .container,
.about-story .container {
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-intro p {
  font-size: 1.25rem;
}

.about-cta .container {
  display: flex;
  justify-content: center;
  text-align: center;
}

/* ===== 16. Contact ===== */
.contact-cta {
  text-align: center;
}

.contact-cta .container {
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.contact-details .container {
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.contact-details__phone a {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.75rem;
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 4px;
}

@media (min-width: 1024px) {
  .contact-details__phone a {
    font-size: 2.25rem;
  }
}

.contact-details__phone a:hover,
.contact-details__phone a:focus-visible {
  color: var(--color-accent);
}

.contact-details__email {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 2px;
}

.contact-details__email:hover,
.contact-details__email:focus-visible {
  color: var(--color-accent);
}

.contact-close .container {
  display: flex;
  justify-content: center;
  text-align: center;
}

/* -----------------------------------------------------------------
   17. 404 (Not Found)
----------------------------------------------------------------- */
.not-found {
  text-align: center;
}

.not-found .container {
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
