/* ==========================================================================
   IES Electric - site styles
   Design: Figma "IES Electric (Copy)" > Home + Internal Page
   Tokens first; adjust here to retune the whole site.
   ========================================================================== */
:root {
  --yellow: #f1ad00;
  --yellow-dark: #c98f00;
  --yellow-soft: rgba(241, 173, 0, .6);   /* decorative stripes */
  --dark: #222222;
  --dark-2: #2a2a2a;
  --navy: #0c3543;                        /* "dark navy" from Figma: Apply Now button, small rules */
  --stripe-grey: #808080;
  --white: #ffffff;
  --grey-100: #f5f5f3;
  --grey-300: #d9d9d9;
  --grey-600: #5b5b5b;
  --text: #222222;

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wide: 1536px;
  --gutter: clamp(20px, 5.7vw, 88px);

  /* Sticky geometry. The sub-page hero is --hero-h tall (it starts at the very top of the page,
     with the nav floating over it). On scroll it slides up until only its bottom --bar-h strip
     (bottom of the image + the page title) remains pinned directly under the nav. */
  --nav-h: 88px;
  --hero-h: 440px;
  --bar-h: 150px;
}
@media (max-width: 960px) { :root { --nav-h: 72px; --hero-h: 340px; --bar-h: 112px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + var(--bar-h) + 12px); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { margin: 0; font-family: var(--font); font-size: 1.125rem; line-height: 1.65; color: var(--text); background: var(--white); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.1; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
ul { padding-left: 1.3em; }

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 24px; }
.wide { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -80px; background: var(--yellow); color: var(--dark); padding: 10px 16px; z-index: 300; font-weight: 600; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  padding: .8em 1.4em; border: 2px solid var(--yellow); border-radius: 3px;
  background: var(--yellow); color: var(--dark);
  font: 600 1rem/1.1 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--yellow-dark); border-color: var(--yellow-dark); }
.btn--white { background: var(--white); border-color: var(--white); }
.btn--white:hover { background: var(--grey-300); border-color: var(--grey-300); }
.btn--navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn--navy:hover { background: #072730; border-color: #072730; }
.btn--outline { background: transparent; color: var(--dark); border-color: var(--dark); }
.btn--outline:hover { background: var(--dark); border-color: var(--dark); color: var(--white); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn-stack { display: grid; gap: 18px; justify-items: start; }

/* ---------- Header: sticky on every page, floats over the hero ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  margin-bottom: calc(var(--nav-h) * -1);   /* lets the hero start at the top of the page */
  transition: background .2s, box-shadow .2s;
}
/* Mostly transparent once scrolled; a light blur keeps the pills readable over content. */
.site-header.is-scrolled { background: rgba(34, 34, 34, .22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { width: 54px; height: 54px; }

.primary-nav { display: flex; align-items: center; flex: 1; gap: 16px; }
.primary-nav__links { list-style: none; margin: 0 auto 0 0; padding: 0; display: flex; background: var(--yellow); }
.primary-nav__links a {
  display: block; padding: 14px 30px; color: var(--dark); text-decoration: none; font-weight: 500; font-size: 1.05rem;
}
.primary-nav__links a:hover, .primary-nav__links a.is-active { background: rgba(0, 0, 0, .12); }
.primary-nav__actions { display: flex; gap: 14px; }
.primary-nav__actions .btn { border-radius: 0; padding: .85em 1.3em; font-weight: 500; }

.nav-toggle { display: none; background: none; border: 0; width: 48px; height: 48px; cursor: pointer; padding: 0; }
.nav-toggle span:not(.visually-hidden) { display: block; width: 28px; height: 3px; margin: 6px auto; background: var(--white); border-radius: 2px; transition: transform .2s, opacity .2s; }
.site-header:not(.is-scrolled) .nav-toggle span:not(.visually-hidden) { background: var(--white); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: block; background: var(--dark); border-radius: 3px; }
  .primary-nav {
    position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 14px;
    background: var(--dark); padding: 12px var(--gutter) 28px; border-bottom: 4px solid var(--yellow);
    display: none;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav__links { flex-direction: column; margin: 0; }
  .primary-nav__links a { padding: 16px 20px; }
  .primary-nav__actions { flex-direction: column; }
  .primary-nav__actions .btn { width: 100%; }
}

/* ---------- Home hero ---------- */
.hero {
  position: relative; color: var(--white);
  min-height: min(92vh, 840px);
  display: flex; align-items: flex-end;
  background:
    linear-gradient(90deg, rgba(20, 20, 20, .82), rgba(20, 20, 20, .25) 70%),
    linear-gradient(180deg, rgba(20, 20, 20, .5), rgba(20, 20, 20, 0) 30%),
    url('/images/hero-bg.jpg') center / cover no-repeat;
}
.hero__inner { padding-block: calc(var(--nav-h) + 40px) clamp(56px, 9vw, 120px); }
.hero h1 { font-size: clamp(3rem, 7.4vw, 6.6rem); max-width: 9.5em; margin-bottom: .28em; letter-spacing: -.025em; }
.hero__rule { display: block; width: min(100%, 460px); height: 10px; background: var(--yellow); border: 0; margin: 0 0 .9em; }
.hero__sub { font-size: clamp(1.15rem, 2.2vw, 1.75rem); font-weight: 500; max-width: 30ch; margin: 0; }

/* ---------- Decorative stripes (from the Figma) ---------- */
.stripes-h { position: relative; height: 92px; background: repeating-linear-gradient(180deg, var(--yellow-soft) 0 20px, transparent 20px 36px); }
.stripes-v { position: absolute; top: 0; bottom: 0; width: 108px; background: repeating-linear-gradient(90deg, var(--stripe-grey) 0 20px, transparent 20px 44px); pointer-events: none; }
.stripes-v--right { right: 6%; }
.stripes-v--left { left: 4%; }
@media (max-width: 860px) { .stripes-v { display: none; } .stripes-h { height: 56px; background: repeating-linear-gradient(180deg, var(--yellow-soft) 0 12px, transparent 12px 22px); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(48px, 7vw, 96px) 0; }
.section--dark { background: var(--dark); color: var(--white); }
.section--grey { background: var(--grey-100); }
.eyebrow { font-size: clamp(1rem, 1.5vw, 1.35rem); font-weight: 400; margin-bottom: .1em; }
.section-title { font-size: clamp(2.2rem, 5vw, 4.2rem); margin-bottom: .3em; }
.rule { display: block; width: 110px; height: 12px; background: var(--navy); border: 0; margin: 0 0 1.4em; }
.rule--white { background: var(--white); }
.rule--yellow { background: var(--yellow); width: 100%; height: 16px; margin: 0 0 2.2em; }
.lead { font-size: 1.3rem; }
.section-pad { padding-inline: var(--gutter); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Home: intro (copy left, tall photo right) */
.intro__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding-block: clamp(32px, 5vw, 64px) clamp(56px, 8vw, 110px); }
.intro__grid p { max-width: 36em; }
.intro__photo { position: relative; z-index: 1; }
.intro__photo img { width: 100%; aspect-ratio: 5 / 8; object-fit: cover; }
@media (max-width: 860px) { .intro__grid { grid-template-columns: 1fr; } .intro__photo img { aspect-ratio: 4 / 3; } }
.intro, .touch { position: relative; overflow: hidden; }
.intro .stripes-v { top: 92px; }

/* Home: core values (dark | yellow with 2x2 photos) */
.values { display: grid; grid-template-columns: 1fr 1fr; background: var(--dark); color: var(--white); }
.values__copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 6vw, 96px) var(--gutter); }
.values__copy h2 { font-size: clamp(2.8rem, 6.2vw, 5.8rem); margin-bottom: .35em; }
.values__copy p { font-size: 1.15rem; max-width: 30em; }
.values__copy a:not(.btn) { color: var(--yellow); }
.values__panel { background: var(--yellow); color: var(--dark); display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; padding: clamp(24px, 3.2vw, 40px); align-content: center; }
.values__panel a { text-decoration: none; text-align: center; font-size: .92rem; line-height: 1.5; }
.values__panel img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; border-radius: 6px; margin-bottom: 12px; }
.values__panel span { display: block; }
@media (max-width: 860px) { .values { grid-template-columns: 1fr; } }

/* Home: get in touch (photo left, details right) */
.touch .stripes-v { top: 92px; }
.touch__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding-block: clamp(32px, 5vw, 64px) clamp(56px, 8vw, 110px); }
.touch__photo { position: relative; z-index: 1; margin-left: clamp(0px, 8vw, 128px); }
.touch__photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.touch address { font-style: normal; font-size: 1.25rem; margin-bottom: 1.6em; }
@media (max-width: 860px) { .touch__grid { grid-template-columns: 1fr; } .touch__photo { margin-left: 0; } }

/* ---------- Internal page hero (sticky) ----------
   Direct child of <main>. Its sticky `top` is negative, so it scrolls up (the photo shrinking away)
   until only the bottom --bar-h strip remains pinned under the nav. */
.sub-hero {
  position: sticky;
  top: calc(var(--nav-h) - (var(--hero-h) - var(--bar-h)));
  z-index: 50;
  height: var(--hero-h);
  display: flex; align-items: flex-end;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(34, 34, 34, .55), rgba(34, 34, 34, .25) 45%, rgba(34, 34, 34, .8)),
    var(--hero-img) center / cover no-repeat;
  border-bottom: 6px solid var(--yellow);
}
.sub-hero__bar { width: 100%; height: var(--bar-h); display: flex; align-items: center; }
.sub-hero h1 { margin: 0; font-size: clamp(3rem, 7vw, 6.2rem); letter-spacing: -.025em; }

.intro-band { background: var(--dark); color: var(--white); padding: clamp(28px, 4vw, 52px) 0; }
.intro-band p { margin: 0; max-width: 62em; font-size: 1.15rem; }

/* Content block with grey stripes down the right edge */
.has-stripes-right > .stripes-v { right: 6%; }
.content-pad { padding-block: clamp(40px, 6vw, 88px); }
.kicker { font-size: 1.1rem; margin-bottom: .1em; }
.block-title { font-size: clamp(2rem, 4vw, 3.4rem); margin-bottom: .3em; }

.check-list { padding-left: 1.2em; font-size: 1.15rem; margin: 0 0 1.4em; display: grid; gap: .35em; }
.check-list li::marker { color: var(--yellow-dark); }

/* Split call-to-action: yellow copy | dark photo */
.split-cta { display: grid; grid-template-columns: 1fr 1fr; background: var(--dark); }
.split-cta__copy { background: var(--yellow); color: var(--dark); padding: clamp(36px, 5vw, 72px) var(--gutter); display: flex; flex-direction: column; justify-content: center; }
.split-cta__copy .eyebrow { margin-bottom: 0; }
.split-cta__copy h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.split-cta__photo { padding: clamp(24px, 3.5vw, 48px); display: grid; align-items: center; }
.split-cta__photo img { width: 100%; max-height: 380px; object-fit: cover; }
@media (max-width: 860px) { .split-cta { grid-template-columns: 1fr; } }

/* Centered feature grid (e.g. apprenticeship benefits) */
.feature-section { padding: clamp(40px, 6vw, 88px) var(--gutter); }
.feature-section__box { max-width: 1280px; margin-inline: auto; }
.feature-section h2 { text-align: center; font-size: clamp(1.9rem, 3.4vw, 3rem); margin-bottom: .45em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px clamp(24px, 4vw, 64px); padding-inline: clamp(0px, 3vw, 48px); }
.feature h3 { font-size: 1.5rem; font-weight: 500; margin-bottom: .6em; letter-spacing: 0; }
.feature p { font-size: 1rem; line-height: 1.75; }
.feature__icon { width: 56px; height: 40px; margin-bottom: 18px; color: var(--yellow); }
@media (max-width: 960px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .feature-grid { grid-template-columns: 1fr; } }

/* Values, details, prose */
.value-list { display: grid; gap: 22px; margin-top: 2em; }
.value { border-left: 8px solid var(--yellow); padding: 4px 0 4px 22px; }
.value h3 { font-size: 1.3rem; margin-bottom: .2em; }
.value p { margin: 0; }

.contact-details { display: grid; gap: 22px; margin: 1.5em 0; }
.contact-details dt { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; color: var(--yellow-dark); }
.contact-details dd { margin: 2px 0 0; font-size: 1.2rem; }

.prose { max-width: 860px; }
.prose h2 { font-size: 1.7rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.4em; }
.prose a { color: var(--navy); }

/* Cards / projects */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 32px; }
.card { background: var(--white); text-decoration: none; display: flex; flex-direction: column; border-bottom: 8px solid var(--yellow); box-shadow: 0 2px 14px rgba(0, 0, 0, .1); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0, 0, 0, .18); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card__body { padding: 20px 22px 24px; }
.card h3 { font-size: 1.3rem; margin-bottom: .25em; letter-spacing: 0; }
.card p { margin: 0; color: var(--grey-600); font-size: .98rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 36px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.project-photo { width: 100%; max-height: 560px; object-fit: cover; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
.field label, .field legend { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 6px; padding: 0; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=date], .field select, .field textarea {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--text); background: var(--white); border: 1px solid #a9a9a9; border-radius: 0;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(241, 173, 0, .5); border-color: var(--yellow-dark); }
.field fieldset { border: 0; padding: 0; margin: 0; }
.radio-row { display: flex; gap: 22px; flex-wrap: wrap; }
.radio-row label { font-weight: 400; display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.text-error { color: #b3261e; font-size: .9rem; display: block; margin-top: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 16px 20px; border-left: 6px solid; margin-bottom: 24px; }
.alert--ok { background: #ecf8ee; border-color: #2e7d32; color: #1b4d1f; }
.alert--err { background: #fdecea; border-color: #b3261e; color: #7a1a14; }
.form-card { background: var(--white); padding: clamp(24px, 4vw, 48px); border-top: 10px solid var(--yellow); box-shadow: 0 12px 40px rgba(0, 0, 0, .14); }

.message-page { min-height: 70vh; display: flex; align-items: center; padding-top: var(--nav-h); }
.message-page h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: var(--white); font-size: .95rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }
.site-footer__grid { display: grid; grid-template-columns: auto auto 1fr; gap: 28px clamp(32px, 6vw, 96px); padding-block: clamp(48px, 6vw, 80px); align-items: start; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1em; }
.footer-meta { grid-column: 1 / 3; display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap; }
.footer-meta img { width: 120px; height: 120px; object-fit: cover; background: var(--white); }
.footer-meta p { margin: 0; font-size: .82rem; color: rgba(255, 255, 255, .75); line-height: 1.8; }
.footer-brand { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.footer-brand img { margin-left: auto; width: min(100%, 520px); }
@media (max-width: 860px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .footer-meta { grid-column: 1 / -1; }
  .footer-brand { grid-column: 1 / -1; grid-row: auto; }
  .footer-brand img { margin-left: 0; width: min(100%, 360px); }
}
