/* ==========================================================================
   Castro Enterprises Inc
   Built to BRAND SPEC v1.0 — square corners, no gradients, no accent tints.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Color */
  --ink:        #0A0B0D;
  --panel:      #0E1013;
  --rule:       #1E2126;
  --edge:       #2A2E35;
  --slate:      #8B9099;
  --paper:      #F2F3F5;
  --oxide:      #D93E1E;
  --oxide-deep: #B93016;

  /* Type families */
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "Courier New", monospace;
  --font-mark:    "Big Shoulders Display", "Arial Narrow", sans-serif;

  /* Type scale — mobile floor / desktop ceiling.
     Display floor is 40px per spec. */
  --size-display:    clamp(40px, 9.4vw, 116px);
  --size-section:    clamp(32px, 5.2vw, 50px);
  --size-lead:       clamp(19px, 1.9vw, 25px);
  --size-card-title: clamp(20px, 1.8vw, 23px);
  --size-body:       17px;
  --size-small:      15px;
  --size-label:      12px;

  /* Rhythm */
  --pad-section: 80px;   /* desktop */
  --gutter:      40px;
  --shell:       1240px;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

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

body,
h1, h2, h3, p, dl, dd, dt, figure, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

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

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

/* Radius 0 throughout — no exceptions. */
a, button, input, textarea, img, .card, .btn { border-radius: 0; }

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

:focus-visible {
  outline: 2px solid var(--oxide);
  outline-offset: 3px;
}

::selection {
  background: var(--oxide);
  color: var(--paper);
}

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

.section {
  padding-block: var(--pad-section);
  border-top: 1px solid var(--rule);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--oxide);
  color: var(--paper);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: var(--size-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

/* --------------------------------------------------------------------------
   4. Type primitives
   -------------------------------------------------------------------------- */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--size-display);
  line-height: 0.90;
  letter-spacing: -0.04em;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--size-section);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.lead {
  font-size: var(--size-lead);
  line-height: 1.50;
  letter-spacing: -0.01em;
  font-weight: 400;
}

.label,
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--size-label);
  line-height: 1.20;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  border: 1px solid transparent;
  padding: 17px 34px;
  font-family: var(--font-mono);
  font-size: var(--size-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 140ms linear, border-color 140ms linear;
}

.btn-primary {
  background: var(--oxide);
  border-color: var(--oxide);
  color: var(--paper);
}

.btn-primary:hover,
.btn-primary:active {
  background: var(--oxide-deep);
  border-color: var(--oxide-deep);
}

/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 84px;
}

.brand {
  flex: none;
  display: block;
}

/* The lockup PNG ships with transparent clear space baked in; the fixed box
   plus object-fit crops it to the mark while keeping the mark above the
   120px minimum width from the spec. */
.brand img {
  width: 176px;
  height: 44px;
  object-fit: cover;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 44px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-list a {
  font-size: var(--size-small);
  font-weight: 500;
  color: var(--slate);
  padding-block: 6px;
  border-bottom: 1px solid transparent;
  transition: color 140ms linear, border-color 140ms linear;
}

.nav-list a:hover {
  color: var(--paper);
  border-bottom-color: var(--oxide);
}

.header-phone {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 44px;
  border-left: 1px solid var(--rule);
}

.header-phone-label {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}

.header-phone-number {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.header-phone:hover .header-phone-number { color: var(--oxide); }

/* Toggle — mobile only */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid var(--edge);
  padding: 11px 14px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--paper);
}

.nav-toggle-bar + .nav-toggle-bar { margin-top: 5px; }

.nav-toggle-label {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-top: clamp(64px, 9vw, 132px);
  padding-bottom: clamp(64px, 9vw, 124px);
}

.hero .eyebrow { margin-bottom: 28px; }

.hero .display { max-width: 15ch; }

.hero-lead {
  margin-top: 34px;
  max-width: 58ch;
  color: var(--slate);
}

.hero-lead::first-line { color: var(--paper); }

.hero-actions { margin-top: 44px; }

/* --------------------------------------------------------------------------
   8. Proof strip
   -------------------------------------------------------------------------- */

.proof {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.proof-item {
  display: flex;
  flex-direction: column-reverse; /* value reads above its label */
  gap: 14px;
  padding: 44px 0 46px;
}

.proof-item + .proof-item {
  border-left: 1px solid var(--rule);
  padding-left: 44px;
}

.proof-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 4.4vw, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--paper);
}

.proof-label {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}

/* --------------------------------------------------------------------------
   9. Section heads
   -------------------------------------------------------------------------- */

.section-head { margin-bottom: 56px; }
.section-head .eyebrow { margin-bottom: 22px; }

/* --------------------------------------------------------------------------
   10. Divisions
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;                      /* the rule shows through as a hairline */
  background: var(--rule);
  border: 1px solid var(--rule);
}

/* Five cards never fill a 3- or 2-column grid evenly. This closes the last
   cell so the leftover square reads as panel, not as a slab of rule colour. */
.card-grid::after {
  content: "";
  background: var(--panel);
}

.card {
  background: var(--panel);
  padding: 40px 36px 44px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.card-icon {
  display: block;
  width: 32px;
  height: 32px;
  color: var(--oxide);
  margin-bottom: 34px;
}

.card-icon svg { width: 100%; height: 100%; }

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--size-card-title);
  line-height: 1.20;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.card-body {
  font-size: var(--size-small);
  line-height: 1.50;
  color: var(--slate);
  max-width: 34ch;
}

/* --------------------------------------------------------------------------
   11. About
   -------------------------------------------------------------------------- */

.about-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
  max-width: 1000px;
}

.about-column p + p { margin-top: 22px; }

.about-column p {
  color: var(--slate);
  max-width: 54ch;
}

.about-column:first-child p:first-child { color: var(--paper); }

/* --------------------------------------------------------------------------
   12. Contact
   -------------------------------------------------------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 72px;
  align-items: start;
}

.contact-detail + .contact-detail {
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--rule);
}

.contact-detail .label { margin-bottom: 12px; }

.contact-detail-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(21px, 2.2vw, 27px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.contact-detail-value a:hover { color: var(--oxide); }

.contact-detail-muted {
  font-family: var(--font-body);
  font-size: var(--size-small);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--slate);
}

/* Form */
.field + .field { margin-top: 22px; }

.field .label {
  display: block;
  margin-bottom: 10px;
}

.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--edge);
  color: var(--paper);
  font-size: var(--size-body);
  padding: 15px 16px;
  transition: border-color 140ms linear;
}

.contact-form textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.55;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--slate); }

.contact-form input:hover,
.contact-form textarea:hover { border-color: var(--slate); }

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--paper);
  outline: none;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid var(--oxide);
  outline-offset: 2px;
}

.contact-form [aria-invalid="true"] { border-color: var(--oxide); }

.form-footer {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.form-status {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--slate);
  max-width: 40ch;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 64px 56px;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px 64px;
  align-items: start;
}

.footer-mark { display: block; }

/* Stacked wordmark, set live in the brand face: two flush-left lines with
   line 2 tracked out to the width of line 1 (main.js measures and fits it). */
.wordmark {
  /* Column flex so each line shrink-wraps its own text — the fitter in
     main.js measures those widths to track line 2 out to line 1. */
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-mark);
  font-weight: 700;
  color: var(--paper);
  text-transform: uppercase;
  line-height: 0.82;
}

.wordmark-line-1 {
  font-size: 58px;
  letter-spacing: 0.01em;
}

.wordmark-line-2 {
  font-size: 25px;
  letter-spacing: 0.30em;  /* refined at runtime to match line 1 exactly */
  margin-top: 8px;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: flex-end;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 140ms linear, border-color 140ms linear;
}

.footer-nav a:hover {
  color: var(--paper);
  border-bottom-color: var(--oxide);
}

.footer-legal {
  grid-column: 1 / -1;
  padding-top: 34px;
  border-top: 1px solid var(--rule);
  font-size: var(--size-small);
  color: var(--slate);
}

/* --------------------------------------------------------------------------
   14. Breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  :root {
    --gutter: 32px;
    --pad-section: 64px;
  }

  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { gap: 48px; }
  .primary-nav { gap: 28px; }
  .nav-list { gap: 26px; }
  .header-phone { padding-left: 28px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 28px;
  }

  .primary-nav.is-open { display: flex; }

  .header-inner { position: relative; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list a {
    display: block;
    padding: 18px 0;
    font-size: 19px;
    border-bottom: 1px solid var(--rule);
  }

  .nav-list a:hover { border-bottom-color: var(--rule); }

  .header-phone {
    padding-left: 0;
    border-left: 0;
    margin-top: 26px;
  }

  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .about-columns { gap: 28px; }
}

@media (max-width: 720px) {
  :root {
    --gutter: 24px;
    --pad-section: 24px;   /* spec: 24px section padding on mobile */
  }

  .header-inner { min-height: 72px; }

  .hero {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .hero .eyebrow { margin-bottom: 20px; }
  .hero-lead { margin-top: 26px; }
  .hero-actions { margin-top: 34px; }

  .btn {
    display: block;
    width: 100%;
    text-align: center;
  }

  .proof-grid { grid-template-columns: minmax(0, 1fr); }

  .proof-item { padding: 26px 0; }

  .proof-item + .proof-item {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--rule);   /* hairline between, stacked */
  }

  .section-head { margin-bottom: 32px; }

  .card-grid { grid-template-columns: minmax(0, 1fr); }

  /* One column stacks evenly — no leftover cell to close. */
  .card-grid::after { display: none; }

  .card {
    padding: 30px 24px 34px;
    min-height: 0;
  }

  .card-icon { margin-bottom: 24px; }

  .about-columns { grid-template-columns: minmax(0, 1fr); }

  .site-footer { padding-block: 40px 32px; }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .footer-nav ul {
    justify-content: flex-start;
    gap: 12px 28px;
  }

  /* Roomier hit areas for touch. */
  .footer-nav a { padding: 9px 0 7px; }

  .wordmark-line-1 { font-size: 44px; }
  .wordmark-line-2 { font-size: 19px; }
}

@media (max-width: 380px) {
  /* The lockup holds its size here — 176px keeps the mark itself above the
     120px minimum width in the spec. */
  .footer-nav ul { flex-direction: column; gap: 16px; }
}

/* --------------------------------------------------------------------------
   15. Motion
   -------------------------------------------------------------------------- */

html { scroll-behavior: smooth; }

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms linear, transform 420ms cubic-bezier(0.2, 0, 0, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   16. Print
   -------------------------------------------------------------------------- */

@media print {
  body { background: #fff; color: #000; }
  .site-header, .nav-toggle, .contact-form, .hero-actions { display: none; }
  .card, .contact-form input { background: #fff; }
}
