/* GR Energy Scotland — grenergyscotland.co.uk */

:root {
  color-scheme: light;
  --navy: #16161a;
  --navy-800: #232329;
  --navy-600: #4a4a52;
  --flame: #e02b2b;
  --flame-dark: #b91f1f;
  --ink: #1a1a1e;
  --body: #46464e;
  --muted: #71717a;
  --line: #e4e4e7;
  --bg: #ffffff;
  --bg-alt: #f5f5f6;
  --card: #ffffff;
  --ok: #15803d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,20,24,.06), 0 8px 24px rgba(20,20,24,.07);
  --wrap: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .6em;
  font-weight: 700;
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--flame-dark); }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--flame); color: #fff; padding: 12px 18px;
}
.skip:focus { left: 0; }

/* ---------- Top bar ---------- */

.topbar {
  background: var(--navy);
  color: #d6d6dc;
  font-size: .85rem;
  padding: 7px 0;
}
.topbar .wrap { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.topbar a:hover { text-decoration: underline; }
.topbar .gs { color: #d6d6dc; }
@media (max-width: 620px) {
  .topbar { font-size: .78rem; }
  .topbar .wrap { justify-content: center; gap: 10px; }
  .topbar .gs { display: none; }
  .topbar::after { content: none; }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 74px;
}

.brand { display: flex; align-items: center; text-decoration: none; min-width: 0; }
.brand img { height: 40px; width: auto; display: block; }
@media (max-width: 520px) { .brand img { height: 32px; } }

.gs-badge {
  display: block; width: 96px; height: auto; border-radius: 8px;
  background: #fff; padding: 6px;
}
.hero-card .gs-badge { margin-top: 6px; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; cursor: pointer; color: var(--ink);
}

.nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 9px 13px; border-radius: 7px;
  color: var(--body); text-decoration: none; font-weight: 600; font-size: .94rem;
}
.nav a:hover { background: var(--bg-alt); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--flame); }

.btn {
  display: inline-block; padding: 13px 22px; border-radius: 8px;
  font-weight: 700; font-size: .97rem; text-decoration: none; border: 2px solid transparent;
  cursor: pointer; text-align: center; font-family: inherit; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--flame); color: #fff; }
.btn-primary:hover { background: var(--flame-dark); }
.btn-outline { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--navy-600); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.2); }
.nav .btn { padding: 10px 16px; margin-left: 8px; }
/* `.nav a` sets dark link text, which beat the button's white on red. */
.nav .btn-primary, .nav .btn-primary:hover { color: #fff; }
.nav .btn-primary:hover { background: var(--flame-dark); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 20px 18px;
    box-shadow: var(--shadow);
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav a { padding: 12px 10px; }
  .nav .btn { margin: 8px 0 0; }
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-800) 55%, var(--navy-600) 100%);
  color: #ededf1; padding: 70px 0 76px;
}
.hero h1 { color: #fff; max-width: 17ch; }
.hero .lede { font-size: 1.13rem; max-width: 54ch; color: #cfcfd6; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #ff9d9d; margin-bottom: 14px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.trust {
  list-style: none; margin: 34px 0 0; padding: 22px 0 0; display: grid; gap: 12px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.trust li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: #d6d6dc; }
.trust svg { flex: 0 0 auto; margin-top: 3px; color: #7ed69a; }

.hero-card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px; padding: 26px;
}
.hero-card h2 { color: #fff; font-size: 1.15rem; margin-bottom: 14px; }
.hero-card dl { margin: 0; display: grid; gap: 14px; }
.hero-card dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: #a2a2ab; }
.hero-card dd { margin: 2px 0 0; color: #fff; font-weight: 600; }
.hero-card dd a { color: #fff; text-decoration: none; }
.hero-card dd a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .hero { padding: 48px 0 54px; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
}

/* ---------- Sections ---------- */

section { padding: 72px 0; }
section.alt { background: var(--bg-alt); }
@media (max-width: 700px) { section { padding: 52px 0; } }

.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .45em; }
.card p { color: var(--body); font-size: .97rem; }
.card .more { display: inline-block; margin-top: 14px; font-weight: 700; font-size: .93rem; text-decoration: none; }
.card .more::after { content: " →"; }
/* A whole card that is a link (services overview, Recent work jobs) */
.card-link { display: block; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.card-link:hover, .card-link:focus-visible { transform: translateY(-2px); border-color: var(--flame); }
.card-link .more { color: var(--flame); }
/* Land in-page jumps below the sticky header */
section[id] { scroll-margin-top: 84px; }
.icon {
  width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(224,43,43,.1); color: var(--flame); margin-bottom: 16px;
}
/* Real job photo in place of the icon (home page service cards) */
.card-photo {
  display: block; width: calc(100% + 52px); max-width: none; height: auto; margin: -26px -26px 18px;
  aspect-ratio: 4 / 3; object-fit: cover; object-position: center 35%;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line);
}

/* Before/after: the after image is clipped to --pos; a range input over the
   top drives it, so it works by mouse, touch and keyboard with no library. */
.ba-feature { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 32px; align-items: center; margin-bottom: 40px; }
@media (max-width: 640px) { .ba-feature { grid-template-columns: 1fr; } .ba { margin: 0 auto; } }
.ba { --pos: 42%; position: relative; width: 100%; max-width: 320px; aspect-ratio: 21 / 50; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); user-select: none; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.ba .ba-after { clip-path: inset(0 0 0 var(--pos)); }
.ba .ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.5); pointer-events: none; }
.ba .ba-line::after { content: "\2194"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 999px; background: #fff; color: #16161a; display: grid; place-items: center; font-weight: 700; }
.ba .ba-tag { position: absolute; bottom: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; font-weight: 700; pointer-events: none; }
.ba .ba-tag.b { left: 10px; } .ba .ba-tag.a { right: 10px; }
.ba input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba input[type=range]:focus-visible + .ba-line { background: var(--flame); }

.ba-hint { font-size: .85rem; color: var(--muted); }

/* Recent work: a grid of jobs; each opens its full story in a <dialog> */
.job-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .job-grid { gap: 12px; } }
.job { display: flex; flex-direction: column; text-align: left; padding: 0; font: inherit; color: inherit; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  transition: transform .15s ease, border-color .15s ease; }
.job:hover, .job:focus-visible { transform: translateY(-2px); border-color: var(--flame); }
.job img { display: block; width: 100%; max-width: none; aspect-ratio: 3 / 4; object-fit: cover; }
.job-text { display: block; padding: 14px 16px 16px; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.job-text b { display: block; margin-bottom: 4px; color: var(--ink); font-size: .97rem; }
.job-text .more { display: inline-block; margin-top: 8px; color: var(--flame); font-weight: 700; font-size: .88rem; }
.job-text .more::after { content: " \2192"; }
.job-dialog { width: min(920px, 94vw); max-height: 92vh; padding: 0; border: none; border-radius: var(--radius); background: var(--card); color: var(--body); overflow: auto; }
.job-dialog::backdrop { background: rgba(10,10,12,.72); }
.job-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 720px) { .job-dialog[open] { grid-template-columns: 1fr; } }
.job-dialog img { display: block; width: 100%; max-width: none; height: 100%; max-height: 92vh; object-fit: contain; background: #0f0f12; }
.job-dialog-text { padding: 28px 28px 32px; }
.job-dialog-text h3 { margin: 0 0 .6em; color: var(--ink); }
.job-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 999px; border: none;
  background: rgba(0,0,0,.6); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; z-index: 1; }

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.ticks li { display: flex; gap: 11px; align-items: flex-start; }
.ticks svg { flex: 0 0 auto; margin-top: 4px; color: var(--ok); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 34px; } }
/* Grid items default to min-width:auto, so one long email address could push the
   column past a 360px phone screen. Let them shrink and let addresses wrap. */
.split > *, .grid > * { min-width: 0; }
a[href^="mailto:"], table.spec td { overflow-wrap: anywhere; }

.note {
  border-left: 3px solid var(--flame); background: var(--bg-alt);
  padding: 16px 20px; border-radius: 0 8px 8px 0; font-size: .95rem;
}

.pill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.pill-list li {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 15px; font-size: .9rem; font-weight: 600; color: var(--ink);
}

table.spec { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.spec th, table.spec td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.spec th { color: var(--ink); font-weight: 700; }
table.spec tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

/* ---------- Steps ---------- */

.steps { counter-reset: s; display: grid; gap: 20px; list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 42px 1fr; gap: 16px; align-items: start; }
.steps li::before {
  counter-increment: s; content: counter(s);
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700;
}
.steps h3 { margin-bottom: .25em; font-size: 1.05rem; }
.steps p { font-size: .96rem; margin: 0; }

/* ---------- FAQ ---------- */

details.faq {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); margin-bottom: 12px;
}
details.faq summary {
  cursor: pointer; padding: 18px 22px; font-weight: 700; color: var(--ink); list-style: none;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--flame); font-weight: 400; }
details.faq[open] summary::after { content: "–"; }
details.faq .faq-body { padding: 0 22px 20px; font-size: .97rem; }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--navy); color: #dedee3; text-align: center; padding: 62px 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { max-width: 52ch; margin-inline: auto; color: #bcbcc4; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ---------- Forms ---------- */

.form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 6px; font-size: .93rem; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--navy-600); outline-offset: 1px; border-color: transparent;
}
.field textarea { min-height: 132px; resize: vertical; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-note { font-size: .85rem; color: var(--muted); margin-top: 14px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: #ababb4; padding: 54px 0 26px; font-size: .93rem; }
.site-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.site-footer a { color: #e0e0e6; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.13);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .86rem; color: #8f8f99;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Page header ---------- */

.page-head { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 46px 0 40px; }
.page-head h1 { margin-bottom: .35em; }
.page-head p { max-width: 62ch; color: var(--muted); font-size: 1.07rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { text-decoration: none; }

.prose h2 { margin-top: 1.9em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 1.15em; }
.prose li { margin-bottom: .5em; }

