/*
Theme Name: Mitchell's Industries
Author: Randall Mitchell
Description: Hub site for The Mitchell's Industries and its companies.
Version: 1.1
*/

/* ==========================================================
   1. COLORS, FONTS, SIZES
   Change a value here and it changes across the whole site.
   ========================================================== */
:root {
  --charcoal: #17181a;       /* page background */
  --graphite: #212225;       /* card background (shows while images load) */
  --silver: #c9ccd1;         /* body text on dark */
  --silver-bright: #eef0f2;  /* headings and strongest text */
  --muted: #a7aaaf;          /* secondary text */
  --walnut: #7a4a2b;         /* hardwood brown */
  --walnut-light: #c08a5c;   /* lighter brown, readable on dark */

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;

  --page-width: 1180px;
  --radius-card: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--charcoal);
  color: var(--silver-bright);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: min(100% - 2.5rem, var(--page-width));
  margin-inline: auto;
}

/* Hidden link that lets keyboard users jump past the header */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--silver-bright);
  color: var(--charcoal);
}

/* Visible outline when someone tabs through with a keyboard */
:focus-visible {
  outline: 2px solid var(--walnut-light);
  outline-offset: 3px;
}

/* ==========================================================
   3. HEADER
   ========================================================== */
.site-header { border-bottom: 1px solid rgba(201, 204, 209, 0.14); }

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-block: 1.25rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav { display: flex; gap: 1.75rem; }

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--silver-bright); }

/* ==========================================================
   4. HERO (the introduction at the top)
   ========================================================== */
.hero {
  padding-block: clamp(4rem, 10vw, 7.5rem) clamp(3rem, 6vw, 4.5rem);
}

.hero h1 {
  max-width: 14ch;
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-lead {
  max-width: 34em;
  margin: 0;
  color: var(--silver);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
}

/* ==========================================================
   5. THE HUB GRID (the company cards)
   Desktop: 2 wide cards on top, 3 cards below.
   ========================================================== */
.hub { padding-bottom: clamp(4rem, 8vw, 6rem); }

.hub-heading {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
}

.hub-intro { margin: 0 0 2rem; color: var(--muted); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

.card {
  grid-column: span 2;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(201, 204, 209, 0.18);
  border-radius: var(--radius-card);
  background: var(--graphite);
  text-decoration: none;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* First two cards are wider and taller */
.card:nth-child(-n+2) {
  grid-column: span 3;
  min-height: 420px;
}

/* The photo fills the whole card, behind the text */
.card img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
  transition: transform 0.6s ease;
}

/* Dark fade over the photo so the text stays sharp */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(14, 14, 15, 0.94) 0%,
    rgba(14, 14, 15, 0.7) 40%,
    rgba(14, 14, 15, 0.15) 75%
  );
}

.card-body { padding: 1.75rem; }

.card-type {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--walnut-light);
  font-size: 0.85rem;
  font-weight: 600;
}

.card-name {
  margin: 0 0 0.5rem;
  color: var(--silver-bright);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 500;
  line-height: 1.1;
}

.card-desc {
  max-width: 36ch;
  margin: 0 0 1rem;
  color: var(--silver);
}

.card-domain {
  display: block;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(201, 204, 209, 0.2);
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.35s ease;
}

/* Hover (mouse) and focus (keyboard): lift, brown glow, photo zoom */
.card:hover,
.card:focus-visible {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(192, 138, 92, 0.7);
  box-shadow:
    0 18px 40px -18px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(192, 138, 92, 0.35),
    0 0 32px -6px rgba(122, 74, 43, 0.55);
}
.card:hover img,
.card:focus-visible img { transform: scale(1.06); }
.card:hover .card-domain,
.card:focus-visible .card-domain { color: var(--silver-bright); }

/* ==========================================================
   6. FOOTER
   ========================================================== */
.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid rgba(201, 204, 209, 0.14);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer p { margin: 0; }

.site-footer a {
  color: var(--silver-bright);
  text-decoration-color: var(--walnut-light);
  text-underline-offset: 3px;
}

/* ==========================================================
   7. TABLETS AND PHONES
   ========================================================== */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .card,
  .card:nth-child(-n+2) { grid-column: span 1; min-height: 340px; }
  .card:last-child { grid-column: span 2; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .card,
  .card:nth-child(-n+2),
  .card:last-child { grid-column: auto; min-height: 300px; }
  .site-nav { gap: 1.25rem; }
}

/* ==========================================================
   8. REDUCED MOTION
   Respects visitors who turn off animations on their device.
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .card:hover,
  .card:focus-visible,
  .card:hover img,
  .card:focus-visible img { transform: none; }
}
