@layer reset, base, layout, components, utilities;

/* ============================================
   SS Construction — ssc1.co.uk
   UX4G design system — 8px grid, 12-col layout
   ============================================ */

/* ---------- RESET ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; padding: 0; }
  img, picture, video, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; }
  button { cursor: pointer; }
  ul[role="list"], .clean-list { list-style: none; padding: 0; }
}

/* ---------- BASE ---------- */
@layer base {
  :root {
    /* Brand */
    --brand: #1a2d5b;
    --accent: #c49a3c;
    --accent-hover: #b08832;

    /* Neutral palette */
    --white: #ffffff;
    --bg: #ffffff;
    --bg-warm: #fafaf8;
    --text: #1a1a1a;
    --text-muted: #666666;
    --border: #e5e5e5;
    --text-on-dark: #f0f0f0;

    /* Functional */
    --success: #15803d;
    --error: #b91c1c;
    --focus: #c49a3c;
    --overlay: rgba(14, 22, 40, 0.7);

    /* Spacing — strict 8px scale */
    --s8: 8px;    --s16: 16px;   --s24: 24px;
    --s32: 32px;  --s40: 40px;   --s48: 48px;
    --s64: 64px;  --s80: 80px;

    /* Layout */
    --container: 1200px;
    --gutter: 24px;
    --radius: 8px;

    /* Typography */
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --h1: 48px;  --h1-lh: 56px;
    --h2: 32px;  --h2-lh: 40px;
    --h3: 24px;  --h3-lh: 32px;
    --body: 16px; --body-lh: 24px;
    --small: 14px; --small-lh: 20px;
  }

  html { scroll-behavior: smooth; }

  body {
    font-family: var(--font);
    font-size: var(--body);
    line-height: var(--body-lh);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
  }

  h1 { font-size: var(--h1); line-height: var(--h1-lh); font-weight: 700; }
  h2 { font-size: var(--h2); line-height: var(--h2-lh); font-weight: 600; }
  h3 { font-size: var(--h3); line-height: var(--h3-lh); font-weight: 600; }

  @media (max-width: 768px) {
    :root {
      --h1: 32px; --h1-lh: 40px;
      --h2: 24px; --h2-lh: 32px;
      --h3: 20px; --h3-lh: 28px;
    }
  }

  a { color: var(--accent); text-decoration: none; }
  a:hover { color: var(--accent-hover); }

  ::selection { background: var(--accent); color: var(--white); }

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

/* ---------- LAYOUT ---------- */
@layer layout {
  .container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
  }

  .section {
    padding: var(--s64) 0;
  }

  .section--warm { background: var(--bg-warm); }
  .section--dark { background: var(--brand); color: var(--text-on-dark); }

  @media (max-width: 768px) {
    .section { padding: var(--s32) 0; }
  }

  .prose { max-width: 700px; }
  .prose h2 { margin-bottom: var(--s16); }
  .prose p + p { margin-top: var(--s16); }
}

/* ---------- COMPONENTS ---------- */
@layer components {

  /* --- Skip link --- */
  .skip-link {
    position: absolute;
    top: -100%;
    left: var(--s24);
    background: var(--accent);
    color: var(--text);
    padding: var(--s8) var(--s16);
    border-radius: var(--radius);
    font-weight: 600;
    z-index: 1000;
  }
  .skip-link:focus { top: var(--s16); }

  /* --- Header --- */
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--brand);
    transition: background 0.4s ease, box-shadow 0.4s ease;
  }

  .header.is-scrolled {
    box-shadow: 0 1px 8px rgba(0,0,0,0.12);
  }

  .header--transparent { background: transparent; }
  .header--transparent.is-scrolled { background: var(--brand); }

  .header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: var(--s8);
    text-decoration: none;
    flex-shrink: 0;
  }

  .logo__icon { width: 56px; height: auto; }

  .logo__text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--white);
  }

  .nav {
    display: flex;
    align-items: center;
    gap: var(--s24);
  }

  .nav__links {
    display: flex;
    align-items: center;
    gap: var(--s32);
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .nav__link {
    color: rgba(255,255,255,0.8);
    font-size: var(--small);
    font-weight: 500;
    text-decoration: none;
    padding: var(--s8) 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
  }

  .nav__link:hover {
    color: var(--white);
    border-bottom-color: rgba(255,255,255,0.4);
  }

  .nav__link[aria-current="page"] {
    color: var(--white);
    border-bottom-color: var(--accent);
  }

  /* Desktop phone — only the standalone one, never the one inside the menu */
  .nav__phone {
    color: var(--brand);
    font-weight: 700;
    font-size: var(--small);
    text-decoration: none;
    display: none;
    align-items: center;
    gap: var(--s8);
    white-space: nowrap;
    margin-left: var(--s16);
    padding: 8px 18px;
    background: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  }

  .nav__phone:hover {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
  }

  @media (min-width: 769px) {
    .nav__phone:not(.nav__phone--mobile) { display: flex; }
  }

  /* Mobile phone inside menu — hidden on desktop, shown in slide-out */
  .nav__phone--mobile { display: none !important; }

  .nav__phone svg { width: 16px; height: 16px; flex-shrink: 0; }

  .nav__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    padding: var(--s8);
  }

  .nav__toggle svg { width: 24px; height: 24px; }

  @media (max-width: 768px) {
    .nav__links {
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      width: min(80vw, 320px);
      flex-direction: column;
      align-items: flex-start;
      background: var(--brand);
      padding: var(--s80) var(--s32) var(--s32);
      gap: var(--s8);
      transform: translateX(100%);
      transition: transform 0.3s ease;
      box-shadow: -4px 0 24px rgba(0,0,0,0.2);
      z-index: 99;
    }

    .nav__links.is-open { transform: translateX(0); }

    .nav__link {
      font-size: var(--body);
      padding: var(--s8) 0;
      width: 100%;
    }

    .nav__toggle { display: block; }

    .nav__links .nav__phone--mobile {
      display: flex !important;
      align-items: center;
      gap: var(--s8);
      color: var(--accent);
      font-weight: 600;
      margin-top: auto;
      font-size: var(--body);
      text-decoration: none;
      background: none;
      border: none;
      padding: var(--s8) 0;
      border-radius: 0;
    }

    .nav__links .nav__phone--mobile:hover { color: var(--white); }

    .nav__links .nav__phone--mobile svg { width: 20px; height: 20px; }
  }

  .nav__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .nav__overlay.is-visible { opacity: 1; visibility: visible; }

  /* --- Buttons --- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s8);
    padding: 12px 24px;
    font-size: var(--body);
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }

  .btn:active { transform: scale(0.98); }

  .btn--primary {
    background: var(--accent);
    color: var(--brand);
    border-color: var(--accent);
  }

  .btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--brand);
  }

  .btn--outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.4);
  }

  .btn--outline:hover {
    background: var(--white);
    color: var(--brand);
    border-color: var(--white);
  }

  .btn--dark {
    background: var(--brand);
    color: var(--white);
    border-color: var(--brand);
  }

  .btn--dark:hover {
    background: transparent;
    color: var(--brand);
  }

  .btn--full { width: 100%; }

  /* --- Hero --- */
  .hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
  }

  .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      135deg,
      rgba(10, 18, 38, 0.88) 0%,
      rgba(10, 18, 38, 0.55) 60%,
      rgba(10, 18, 38, 0.3) 100%
    );
  }

  .hero__inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    padding: var(--s80) 0 var(--s64);
  }

  .hero__tag {
    display: inline-block;
    font-size: var(--small);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--s16);
  }

  .hero h1 { color: var(--white); margin-bottom: var(--s24); }

  .hero__sub {
    color: rgba(255,255,255,0.85);
    font-size: 18px;
    line-height: 28px;
    margin-bottom: var(--s32);
    max-width: 540px;
  }

  .hero__cta { display: flex; flex-wrap: wrap; gap: var(--s16); margin-bottom: var(--s40); }

  .hero__proof {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s24);
    list-style: none;
    padding: 0;
  }

  .hero__proof li {
    display: flex;
    align-items: center;
    gap: var(--s8);
    color: rgba(255,255,255,0.75);
    font-size: var(--small);
    font-weight: 500;
  }

  .hero__proof svg { color: var(--accent); flex-shrink: 0; }

  /* --- Trust badges --- */
  .trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--s24);
  }

  .trust-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s8);
    padding: 8px 16px;
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    color: var(--white);
    font-size: var(--small);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.3s ease, background 0.3s ease;
  }

  .trust-badge:hover {
    border-color: var(--accent);
    background: rgba(196, 154, 60, 0.1);
    color: var(--white);
  }

  .trust-badge svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

  .trust-badge__rating {
    color: var(--accent);
    font-weight: 700;
  }

  /* Trust badges on light backgrounds */
  .trust-badges--light .trust-badge {
    border-color: var(--border);
    color: var(--text);
  }

  .trust-badges--light .trust-badge:hover {
    border-color: var(--accent);
    background: rgba(196, 154, 60, 0.06);
    color: var(--text);
  }

  /* --- Page hero (inner pages) --- */
  .hero--page {
    min-height: auto;
    padding: 140px 0 var(--s64);
    text-align: center;
  }

  .hero--page .hero__inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 var(--gutter);
  }

  .hero--page .hero__sub { margin: 0 auto; }

  @media (max-width: 768px) {
    .hero { min-height: 70vh; }
    .hero--page { padding: 120px 0 var(--s32); }
  }

  /* --- Section headers --- */
  .section__eyebrow {
    font-size: var(--small);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--s8);
  }

  .section__title { margin-bottom: var(--s16); }

  .section__intro {
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: var(--s48);
  }

  .section--dark .section__intro { color: rgba(255,255,255,0.7); }

  .section__head--center {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--s48);
  }

  .section__head--center .section__intro { margin-inline: auto; }

  /* --- Feature list (replaces card grid for 'Why Us') --- */
  .features {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s32);
  }

  @media (min-width: 769px) {
    .features { grid-template-columns: repeat(3, 1fr); }
  }

  .feature {
    padding: var(--s24);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
  }

  .feature:hover { border-color: var(--accent); }

  .feature__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(196, 154, 60, 0.08);
    border-radius: var(--radius);
    margin-bottom: var(--s16);
    color: var(--accent);
  }

  .feature__icon svg { width: 24px; height: 24px; }
  .feature h3 { margin-bottom: var(--s8); }
  .feature p { color: var(--text-muted); font-size: var(--small); line-height: var(--small-lh); }

  /* --- Services grid (homepage) --- */
  .services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s16);
  }

  @media (min-width: 769px) {
    .services-grid { grid-template-columns: repeat(3, 1fr); }
  }

  .service-tile {
    position: relative;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    text-decoration: none;
    color: var(--white);
  }

  .service-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
  }

  .service-tile:hover img { transform: scale(1.04); }

  .service-tile__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,18,38,0.85) 0%, rgba(10,18,38,0.1) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--s24);
  }

  .service-tile__overlay h3 {
    color: var(--white);
    margin-bottom: var(--s8);
  }

  .service-tile__overlay p {
    color: rgba(255,255,255,0.7);
    font-size: var(--small);
    line-height: var(--small-lh);
  }

  /* --- Service detail (services page) --- */
  .service-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s32);
    align-items: center;
  }

  @media (min-width: 769px) {
    .service-block { grid-template-columns: 1fr 1fr; gap: var(--s48); }
    .service-block--flip .service-block__img { order: -1; }
  }

  .service-block__img {
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  @media (min-width: 769px) {
    .service-block__img {
      aspect-ratio: 4 / 3;
    }
  }

  .service-block__body h2 { margin-bottom: var(--s16); }

  .service-block__body p {
    color: var(--text-muted);
    margin-bottom: var(--s16);
  }

  .service-block__body ul {
    color: var(--text-muted);
    margin-bottom: var(--s24);
    padding-left: var(--s24);
  }

  .service-block__body li { margin-bottom: var(--s8); }
  .service-block__body li:last-child { margin-bottom: 0; }

  /* --- About layout --- */
  .about-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s32);
    align-items: center;
  }

  @media (min-width: 769px) {
    .about-split { grid-template-columns: 1.1fr 0.9fr; gap: var(--s48); }
  }

  .about-split__img {
    border-radius: var(--radius);
    overflow: hidden;
  }

  .about-split__img img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* --- Areas --- */
  .areas-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s32);
  }

  @media (min-width: 769px) {
    .areas-layout { grid-template-columns: 1fr 1fr; gap: var(--s48); }
  }

  .area-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s8);
    margin-top: var(--s24);
  }

  .area-tag {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s8) var(--s16);
    font-size: var(--small);
    color: var(--text);
    font-weight: 500;
  }

  .areas-map {
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 380px;
  }

  .areas-map iframe {
    width: 100%;
    height: 100%;
    min-height: 380px;
    border: 0;
  }

  /* --- CTA section --- */
  .cta {
    text-align: center;
    padding: var(--s80) 0;
    background: var(--brand);
  }

  .cta h2 { color: var(--white); margin-bottom: var(--s16); }

  .cta p {
    color: rgba(255,255,255,0.7);
    max-width: 500px;
    margin: 0 auto var(--s32);
  }

  .cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--s16);
  }

  .cta__phone {
    color: var(--accent);
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
  }

  .cta__phone:hover { color: var(--white); }

  @media (max-width: 768px) {
    .cta { padding: var(--s48) 0; }
  }

  /* --- Contact form --- */
  .contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s48);
  }

  @media (min-width: 769px) {
    .contact-layout { grid-template-columns: 1.2fr 0.8fr; }
  }

  .contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--s24);
  }

  .field { display: flex; flex-direction: column; gap: var(--s8); }

  .field label {
    font-weight: 600;
    font-size: var(--small);
    color: var(--text);
  }

  .field input,
  .field select,
  .field textarea {
    padding: 12px var(--s16);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--body);
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
  }

  .field input:focus,
  .field select:focus,
  .field textarea:focus {
    border-color: var(--accent);
    outline: 2px solid var(--focus);
    outline-offset: 1px;
  }

  .field input[aria-invalid="true"],
  .field select[aria-invalid="true"],
  .field textarea[aria-invalid="true"] {
    border-color: var(--error);
  }

  .field__error {
    font-size: 12px;
    color: var(--error);
    min-height: 16px;
  }

  .form-success {
    background: rgba(21, 128, 61, 0.06);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    padding: var(--s32);
    text-align: center;
  }

  .form-success p { color: var(--success); font-weight: 600; }

  /* --- Contact info --- */
  .contact-info { display: flex; flex-direction: column; gap: var(--s24); }
  .contact-info h2 { margin-bottom: var(--s8); }
  .contact-info address { font-style: normal; display: flex; flex-direction: column; gap: var(--s16); }

  .contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: var(--body);
    transition: color 0.2s;
  }

  a.contact-link:hover { color: var(--accent); }

  .contact-link svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
  }

  .contact-note {
    background: var(--bg-warm);
    padding: var(--s24);
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
  }

  .contact-note p { color: var(--text-muted); font-size: var(--small); }

  .contact-map {
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 220px;
  }

  .contact-map iframe { width: 100%; height: 100%; min-height: 220px; border: 0; }

  /* --- Footer --- */
  .footer {
    background: var(--brand);
    color: rgba(255,255,255,0.7);
    padding: var(--s64) 0 var(--s32);
  }

  .footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s32);
    margin-bottom: var(--s48);
  }

  @media (min-width: 769px) {
    .footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
  }

  .footer .logo__text { color: var(--white); }

  .footer__about {
    font-size: var(--small);
    line-height: var(--small-lh);
    margin-top: var(--s16);
    max-width: 280px;
    color: rgba(255,255,255,0.5);
  }

  .footer__heading {
    font-size: var(--small);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--s16);
  }

  .footer__nav { display: flex; flex-direction: column; gap: 12px; }

  .footer__nav a {
    color: rgba(255,255,255,0.7);
    font-size: var(--small);
    text-decoration: none;
    transition: color 0.2s;
  }

  .footer__nav a:hover { color: var(--white); }

  .footer address {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .footer address a {
    color: rgba(255,255,255,0.7);
    font-size: var(--small);
    text-decoration: none;
  }

  .footer address a:hover { color: var(--accent); }

  .footer address span {
    color: rgba(255,255,255,0.7);
    font-size: var(--small);
  }

  .footer__line {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: var(--s24);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s16);
    font-size: 12px;
    color: rgba(255,255,255,0.35);
  }

  .footer__line a { color: rgba(255,255,255,0.35); text-decoration: none; }
  .footer__line a:hover { color: var(--accent); }

  .footer__reviews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--s16);
  }

  .footer__review-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
  }

  .footer__review-link:hover { color: var(--accent); }

  .footer__review-link svg { width: 14px; height: 14px; color: var(--accent); }

  /* --- Reveal --- */
  @media (prefers-reduced-motion: no-preference) {
    [data-reveal] {
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.5s ease, transform 0.5s ease;
    }
    [data-reveal].is-revealed { opacity: 1; transform: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; }
  }
}

  /* WhatsApp floating button */
  .whatsapp-float {
    position: fixed;
    bottom: var(--s24);
    right: var(--s24);
    z-index: 100;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    text-decoration: none;
  }

  .whatsapp-float:hover { transform: scale(1.08); }

  .whatsapp-float svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
  }
}

/* ---------- UTILITIES ---------- */
@layer utilities {
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
}
