/* ==========================================================================
   South Wales Alloys — shared design system (site.css)
   Single source of truth for tokens + shared components.
   Page-specific CSS should only contain layout unique to that page.

   Brand direction (Phase 2): Inter (UI/body) + Bebas Neue (display).
   Unified red #C42020, gunmetal accent #3A3F44 (replaces the old orange-gold).
   Legacy variable + class names are kept as aliases so pages that have not
   yet had their inline CSS stripped continue to render correctly.
   ========================================================================== */

:root{
  /* Surfaces */
  --dark:#0A0A0A; --dark2:#111; --dark3:#1a1a1a; --dark4:#202020;
  --light:#F0F0F0; --light2:#F3F3F3; --white:#fff; --black:#000;

  /* Text */
  --text:#fff; --text-muted:#aaa; --text-dim:#888; --text-dark:#414141;

  /* Brand */
  --red:#C42020; --red-hover:#A81A1A; --red-bright:#E03333;
  --accent:#3A3F44; --accent-hover:#4A5057; /* gunmetal — replaces orange-gold */
  --green:#00B67A;

  /* Lines + controls */
  --border:#222; --border-light:#ddd; --grey-btn:#D3D3D3;

  /* Spacing scale (0.25rem base) */
  --space-1:.25rem; --space-2:.5rem; --space-3:.75rem; --space-4:1rem;
  --space-5:1.5rem; --space-6:2rem; --space-7:3rem; --space-8:4rem;

  /* Radius — pick 6px for buttons/cards and stick to it */
  --radius-sm:4px; --radius:6px; --radius-lg:10px;

  /* Type */
  --font-ui:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  --font-display:'Bebas Neue',Impact,sans-serif;

  /* Layout */
  --header-h:64px; --container:1200px;

  /* ---- Legacy aliases (keep old inline CSS resolving during migration) ---- */
  --red-bright-legacy:#F80C0C;
  --gold1:#3A3F44; --gold2:#3A3F44;   /* old gold now resolves to gunmetal */
  --orange:#FA984B;
}

/* Font-display safety so swapped webfonts never block LCP */
@font-face{font-family:'Bebas Neue';font-display:swap;src:local('Bebas Neue')}
@font-face{font-family:'Inter';font-display:swap;src:local('Inter')}

*{margin:0;padding:0;box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  font-family:var(--font-ui);
  background:var(--dark);
  color:var(--text);
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img{max-width:100%;height:auto;display:block}
a{text-decoration:none;color:inherit}
h1,h2,h3,h4{line-height:1.2}

.container{max-width:var(--container);margin:0 auto;padding:0 24px}

/* Visible focus ring for keyboard users across all interactive elements */
a:focus-visible,button:focus-visible,input:focus-visible,
select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{
  outline:2px solid var(--red-bright);
  outline-offset:2px;
  border-radius:var(--radius-sm);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:12px 24px;font-family:var(--font-ui);font-size:.82rem;font-weight:600;
  line-height:1;border-radius:var(--radius);border:1.5px solid transparent;
  cursor:pointer;transition:background .2s,border-color .2s,color .2s,transform .05s;
  text-align:center;white-space:nowrap;
}
.btn:active{transform:translateY(1px)}

/* New canonical components */
.btn-primary{background:var(--red);color:var(--white)}
.btn-primary:hover{background:var(--red-hover)}
.btn-secondary{background:var(--accent);color:var(--white)}
.btn-secondary:hover{background:var(--accent-hover)}
.btn-ghost{background:transparent;color:var(--white);border-color:rgba(255,255,255,.4)}
.btn-ghost:hover{border-color:var(--white)}

/* Legacy aliases mapped onto the new system */
.btn-red{background:var(--red);color:var(--white)}
.btn-red:hover{background:var(--red-hover)}
.btn-gold{background:var(--accent);color:var(--white)}      /* was orange-gold gradient */
.btn-gold:hover{background:var(--accent-hover)}
.btn-grey{background:var(--grey-btn);color:var(--black)}
.btn-grey:hover{background:#bbb}
.btn-outline{background:transparent;color:var(--white);border-color:rgba(255,255,255,.4)}
.btn-outline:hover{border-color:var(--white)}

/* ==========================================================================
   SHARED TEXT / SECTION HELPERS
   ========================================================================== */
.label{font-family:var(--font-display);font-size:.85rem;letter-spacing:.25em;
  color:var(--red);margin-bottom:10px;text-transform:uppercase}
.light-section .label,.bottom-about .label{color:var(--red)}
.section-title{font-size:1.8rem;font-weight:700;margin-bottom:16px;line-height:1.25}
.section-title--dark{color:var(--black)}
.text-body{font-size:.92rem;color:#bbb;line-height:1.8;margin-bottom:12px}
.text-body--dark{color:var(--text-dark)}

/* ==========================================================================
   CARD + FORM components
   ========================================================================== */
.card{background:var(--dark2);border:1px solid var(--border);border-radius:var(--radius);
  padding:24px;transition:border-color .2s}
.card:hover{border-color:var(--red)}

.input,input[type=text],input[type=email],input[type=tel],input[type=number],
input[type=search],input[type=password],textarea,select{
  width:100%;font-family:var(--font-ui);
  font-size:16px;                 /* iOS: never below 16px or it zooms */
  color:var(--white);background:var(--dark3);
  border:1px solid var(--border);border-radius:var(--radius-sm);
  padding:12px 14px;line-height:1.4;transition:border-color .2s;
}
.input:focus,input:focus,textarea:focus,select:focus{border-color:var(--red);outline:none}
.input::placeholder,input::placeholder,textarea::placeholder{color:#777}
label{font-size:.82rem;font-weight:600;color:#ddd}

/* ==========================================================================
   HEADER + NAV
   Default = solid sticky (inner pages).
   .header--overlay = transparent fixed scroll-aware (homepage hero).
   ========================================================================== */
.header{position:sticky;top:0;z-index:100;padding:10px 0;
  background:rgba(10,10,10,.95);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);transition:background .3s;contain:layout}
.header .container{display:flex;justify-content:space-between;align-items:center}

.header--overlay{position:fixed;top:0;left:0;right:0;padding:12px 0;
  background:transparent;backdrop-filter:none;border-bottom:1px solid transparent}
.header--overlay.scrolled{background:rgba(10,10,10,.95);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border)}
.header--overlay.scrolled .hdr-cards{display:none}

.logo img{height:auto;width:160px}
/* The logo asset has a baked-in solid #000 background. The site surfaces are
   charcoal (#0A0A0A / #111), so the black box shows as a darker rectangle.
   `screen` blends pure-black pixels invisibly into any dark backdrop while
   keeping the white/chrome lettering crisp — logo sits flush everywhere. */
.logo img,.ft-brand img,.hero-logo{mix-blend-mode:screen}
/* Homepage: the brand mark is the large logo in the hero, so the nav/header
   logo is hidden there (shown on every other page). */
.header--overlay .logo{display:none}

nav{display:flex;align-items:center;gap:24px}
nav a{font-size:.78rem;font-weight:700;color:rgba(255,255,255,.8);transition:color .2s;
  text-transform:uppercase;letter-spacing:.05em}
nav a:hover{color:var(--white)}

.nav-dd{position:relative;display:flex;align-items:center}
.nav-dd .dd{display:none;position:absolute;top:calc(100% + 4px);left:-16px;
  background:var(--dark2);border:1px solid var(--border);border-radius:var(--radius-sm);
  padding:8px 0;min-width:220px;z-index:200;box-shadow:0 8px 24px rgba(0,0,0,.5);
  flex-direction:column}
.nav-dd.open .dd{display:flex;flex-direction:column}
.dd a{display:block;padding:8px 20px;font-size:.78rem;text-transform:none;
  font-weight:400;white-space:nowrap;width:100%}
.dd a:hover{background:var(--dark3);color:var(--red-bright)}

.hdr-right{display:flex;align-items:flex-end;gap:16px}
.hdr-stack{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.hdr-social{display:flex;gap:10px}
.hdr-social a{width:32px;height:32px;border:none;border-radius:50%;display:flex;
  align-items:center;justify-content:center;transition:opacity .2s}
.hdr-social a:hover{opacity:.8}
.hdr-social a svg{width:22px;height:22px}
.hdr-cards{display:flex;align-items:center;gap:6px}
.hdr-cards img{width:36px;height:24px;border-radius:3px;display:block;object-fit:contain}
.hdr-cards .klarna-badge{width:44px;height:26px}

.mob-tog{display:none;background:none;border:none;cursor:pointer;flex-direction:column;
  gap:5px;padding:8px;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.mob-tog span{display:block;width:24px;height:2px;background:var(--white)}

/* ==========================================================================
   MOBILE NAV (full-screen overlay)
   ========================================================================== */
.mob-nav{display:none;position:fixed;inset:0;background:rgba(10,10,10,.98);z-index:1000;
  flex-direction:column;padding:80px 24px 40px;overflow-y:auto}
.mob-nav.open{display:flex}
.mob-nav a{font-size:1.1rem;padding:14px 0;border-bottom:1px solid var(--border);
  color:rgba(255,255,255,.8);font-weight:700}
.mob-nav a:hover{color:var(--red)}
.mob-nav .mob-services{padding-left:16px;display:flex;flex-direction:column}
.mob-nav .mob-services a{font-size:.9rem;font-weight:400;padding:10px 0}
.mob-nav .mob-close{position:absolute;top:16px;right:20px;background:none;border:none;
  color:var(--white);font-size:1.6rem;cursor:pointer;width:40px;height:40px;
  display:flex;align-items:center;justify-content:center}
.mob-nav .mob-cta{margin-top:20px;text-align:center}
.mob-nav .mob-cta a{display:inline-flex;border:none;padding:14px 32px;background:var(--red);
  color:var(--white);border-radius:var(--radius);font-weight:700;font-size:.9rem}

/* ==========================================================================
   PAGE HERO (inner pages)
   ========================================================================== */
.page-hero{padding:100px 0 60px;text-align:center;border-bottom:1px solid var(--border)}
.page-hero h1{font-size:2.2rem;font-weight:700;margin-bottom:12px}
.page-hero p{color:#999;max-width:600px;margin:0 auto;font-size:.95rem}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer{background:var(--dark2);border-top:1px solid var(--border);padding:48px 0 0;
  content-visibility:auto;contain-intrinsic-size:auto 400px}
.ft-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:40px;
  padding-bottom:40px;border-bottom:1px solid var(--border)}
.ft-brand img{height:auto;width:140px;margin-bottom:12px}
.ft-brand p{font-size:.8rem;color:#888;line-height:1.7;max-width:280px}
.footer h3,.footer h4{font-size:.72rem;font-weight:700;text-transform:uppercase;
  letter-spacing:.1em;color:var(--white);margin-bottom:16px}
.footer ul{list-style:none}
.footer li{margin-bottom:8px;font-size:.8rem;color:#888}
.footer li a{color:#888;transition:color .2s}
.footer li a:hover{color:var(--red)}
.ft-bot{padding:20px 0;display:flex;justify-content:space-between;align-items:center;
  font-size:.72rem;color:#999;flex-wrap:wrap;gap:12px}
.ft-bot a{color:#999}.ft-bot a:hover{color:var(--red)}

/* ==========================================================================
   STICKY MOBILE CTA BAR (≤768px) — Quote / Call / WhatsApp
   ========================================================================== */
.mobile-cta{display:none}
@media(max-width:768px){
  .mobile-cta{display:grid;grid-template-columns:1fr 1fr 1fr;position:fixed;
    left:0;right:0;bottom:0;z-index:900;background:rgba(10,10,10,.97);
    backdrop-filter:blur(10px);border-top:1px solid var(--border)}
  .mobile-cta a{display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:3px;padding:9px 4px;font-size:.66rem;font-weight:700;text-transform:uppercase;
    letter-spacing:.04em;color:#ddd;border-right:1px solid var(--border)}
  .mobile-cta a:last-child{border-right:none}
  .mobile-cta a svg{width:20px;height:20px}
  .mobile-cta a.cta-quote{color:#fff;background:var(--red)}
  .mobile-cta a.cta-wa{color:#fff;background:#25D366}
  .mobile-cta a.cta-call{color:#fff}
  /* keep the sticky bar from covering footer content */
  body{padding-bottom:60px}
}

/* ==========================================================================
   RESPONSIVE — shared header/footer behaviour
   ========================================================================== */
@media(max-width:768px){
  nav,.hdr-social{display:none}
  .mob-tog{display:flex}
  .hdr-right .btn{display:none}
  .hdr-cards img{width:28px;height:18px}
  .page-hero{padding:80px 0 40px}
  .page-hero h1{font-size:1.6rem}
  .section-title{font-size:1.4rem}
  .ft-grid{grid-template-columns:1fr 1fr;gap:24px}
}
@media(max-width:480px){
  .ft-grid{grid-template-columns:1fr}
}
