/* Weyland Industries — static brochure site
   Brand tokens aligned with live WordPress (YITH Wonder):
   button yellow #f3cf47, primary teal #007565 for links/hover */

:root {
  --ink: #1d1d22;
  --ink-soft: #3f3f50;
  --muted: #6c6c89;
  --paper: #ffffff;
  --paper-2: #f7f7f8;
  --white: #ffffff;
  /* Primary CTAs — custom-brand-color-button from live site */
  --brand-yellow: #f3cf47;
  --brand-yellow-hover: #e8d833;
  --brand-yellow-deep: #d4b52e;
  /* Primary link/hover teal from live site */
  --brand-primary: #007565;
  --brand-primary-soft: #08a889;
  --accent: var(--brand-primary);
  --accent-2: var(--brand-primary-soft);
  --accent-deep: #121217;
  --line: rgba(18, 18, 23, 0.1);
  --shadow: 0 18px 50px rgba(18, 18, 23, 0.08);
  --radius: 12px;
  --max: 72rem;
  --header-h: 4.5rem;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-size-body: 1.0625rem; /* 17px */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--font-size-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Prefer balanced multi-line titles; prettier paragraph breaks (modern browsers) */
h1,
h2,
h3 {
  text-wrap: balance;
}

p,
.prose,
.mission p,
.person p,
.section-intro p,
.lede {
  text-wrap: pretty;
  overflow-wrap: break-word;
  hyphens: manual;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--brand-yellow);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  z-index: 1000;
  border-radius: 6px;
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: block;
  flex: 0 1 12rem;
}

.brand img {
  width: 100%;
  max-width: 11.5rem;
  height: auto;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem 1.15rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

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

.nav-cta {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: var(--ink) !important;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--brand-yellow-hover);
  color: var(--ink) !important;
  filter: brightness(0.96);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 0.55rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 0.28rem 0;
  background: var(--ink);
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 40rem);
  display: grid;
  align-items: end;
  color: var(--white);
  overflow: hidden;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(180deg, rgba(18, 38, 28, 0.35) 0%, rgba(18, 38, 28, 0.78) 100%),
    linear-gradient(90deg, rgba(18, 38, 28, 0.55), transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 5rem 0 3.5rem;
  /* Wide enough for the headline to wrap at natural phrase breaks */
  max-width: min(52rem, 100%);
  margin-left: max(1rem, calc((100% - var(--max)) / 2));
  margin-right: auto;
  width: min(100% - 2rem, 52rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  font-weight: 700;
  opacity: 0.9;
  max-width: 100%;
  line-height: 1.4;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  /* Intentional break in HTML; keep size so each line stays one clean phrase */
  max-width: 22ch;
}

.lede {
  margin: 0 0 1.5rem;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  max-width: none;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

/* Buttons — yellow fill + dark text (matches live “Get in touch”) */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  transition: background-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}

.button-primary {
  background: var(--brand-yellow);
  color: var(--ink);
}

.button-primary:hover,
.button-primary:focus-visible {
  /* Live site hovers primary buttons toward brand teal */
  background: var(--brand-primary);
  color: var(--white);
}

.button-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}

.button-ghost:hover,
.button-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

/* Sections — explicit bands so adjacent blocks always alternate color.
   (nth-of-type failed here: --paper and --white were both #fff, so Clients
   and Team ran together as one tall white block with double padding.) */
.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--white);
}

.section.band,
.section.trades,
.section.team {
  background: var(--paper-2);
}

/*
 * Content and band photos share the same .wrap width so text edges
 * align with the photo frame above/below them.
 */
.section-intro {
  width: 100%;
  max-width: none;
  margin-bottom: 2rem;
}

.section-intro h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: none;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: none;
  line-height: 1.65;
}

.prose {
  width: 100%;
  max-width: none;
  color: var(--ink-soft);
}

.prose p {
  margin: 0 0 1rem;
  line-height: 1.7;
  max-width: none;
}

.prose p:last-child {
  margin-bottom: 0;
}

.band-image {
  width: 100%;
  margin: 0 0 1.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper-2);
}

/* Last media in a section shouldn't add a false “extra” gap before the next band */
.section > .wrap > .band-image:last-child {
  margin-bottom: 0;
}

.band-image img {
  width: 100%;
}

/* Trades — always even rows of 6 items (never 5+1) */
.trade-grid {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  /* One even row of all 6 on wide screens */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.trade-grid li {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 0.65rem;
  font-weight: 700;
  font-size: clamp(0.82rem, 1.15vw, 0.98rem);
  color: var(--ink);
  text-align: center;
  line-height: 1.3;
  /* Allow two lines only if needed; avoid orphan 5+1 layout via fixed columns */
  hyphens: manual;
}

/* Tablet: balanced 3 × 2 */
@media (max-width: 960px) {
  .trade-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trade-grid li {
    padding: 1rem 0.9rem;
    font-size: 0.95rem;
  }
}

/* Phone: balanced 2 × 3 */
@media (max-width: 560px) {
  .trade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mission {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.5rem 1.5rem 1.5rem 1.35rem;
  border-left: 4px solid var(--brand-yellow);
  background: var(--white);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  box-sizing: border-box;
}

.mission p {
  margin: 0;
  line-height: 1.7;
  font-size: 1.05rem;
  max-width: none;
}

/* Clients — single row, no boxes (matches live WP gallery) */
.logo-row {
  list-style: none;
  margin: 0 0 2.25rem;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
}

.logo-row li {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.25rem;
}

.logo-row img {
  width: 100%;
  max-width: 15.5rem; /* ~248px — live uses ~245–316px (Hayward ~382px) */
  height: auto;
  max-height: 12rem;
  object-fit: contain;
  filter: none;
}

.logo-row li:nth-child(4) img {
  /* Hayward mark is wider on the live site */
  max-width: 20rem;
}

@media (max-width: 900px) {
  .logo-row {
    flex-wrap: wrap;
    justify-content: center;
  }

  .logo-row li {
    flex: 1 1 28%;
  }

  .logo-row img {
    max-width: 13rem;
    max-height: 10rem;
  }
}

@media (max-width: 560px) {
  .logo-row li {
    flex: 1 1 42%;
  }

  .logo-row img {
    max-width: 11rem;
    max-height: 8.5rem;
  }
}

/* Team */
.team-grid {
  display: grid;
  /* Prefer 3 equal columns on desktop; avoid skinny cards that chop sentences */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.person {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.55rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.person h3 {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

.person .role {
  margin: 0 0 0.85rem;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.95rem;
}

.person p {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

.person p:last-child {
  margin-bottom: 0;
}

.person a[href^="mailto:"] {
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

@media (max-width: 960px) {
  .team-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

/* Contact */
.contact {
  background:
    radial-gradient(circle at top right, rgba(47, 107, 79, 0.12), transparent 40%),
    var(--paper);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2rem;
  align-items: start;
}

.contact-info h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  line-height: 1.25;
}

.contact-logo {
  max-width: 14rem;
  margin-bottom: 1rem;
}

.company-name {
  margin: 0 0 0.5rem;
  font-weight: 700;
  line-height: 1.35;
  max-width: 22ch;
}

address {
  font-style: normal;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  line-height: 1.55;
}

.contact-note {
  color: var(--muted);
}

.contact-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.65rem;
}

.contact-form label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Keep field name + * on one line (grid was stacking them) */
.contact-form .label-text {
  display: inline;
  line-height: 1.3;
}

.contact-form .req {
  margin-left: 0.15em;
  color: var(--brand-primary);
  font-weight: 700;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  font-size: 0.98rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.contact-form textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(243, 207, 71, 0.55);
  border-color: var(--brand-yellow-deep);
  background: var(--white);
}

.form-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.contact-form .button {
  justify-self: start;
  margin-top: 0.15rem;
  padding: 0.6rem 1.15rem;
}

.turnstile-wrap {
  margin: 0.15rem 0 0.1rem;
  min-height: 65px;
}

.turnstile-wrap .cf-turnstile {
  display: inline-block;
}

.form-status {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
}

.form-status.is-success {
  background: #fff8d6;
  color: var(--ink);
}

.form-status.is-error {
  background: #fdecea;
  color: #8a1f11;
}

.contact-form .button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.honey {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #121217;
  color: rgba(255, 255, 255, 0.78);
  padding: 1.5rem 0;
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

/* Responsive */
@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1rem;
    gap: 0.25rem;
  }

  .site-nav a {
    display: block;
    padding: 0.7rem 0.5rem;
  }

  .nav-cta {
    text-align: center;
  }
}

@media (max-width: 560px) {
  .form-row.two {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding-top: 4rem;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.7rem, 7.5vw, 2.1rem);
  }

  /* Soften forced breaks on very small screens if needed */
  .hero-break,
  .title-break {
    display: block;
  }
}

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