/* =========================================================
   Security (Cymru) Limited — main.css
   Editorial brutalism · tactical authority
   Ink · Paper · Crimson
   ========================================================= */

:root {
  --ink: #0a0a0a;
  --ink-2: #1a1a1a;
  --paper: #f2ede3;
  --paper-2: #ebe5d7;
  --accent: #b4251c;
  --muted: #6b6760;
  --muted-dark: #9a958a;
  --rule: rgba(10, 10, 10, 0.12);
  --rule-dark: rgba(242, 237, 227, 0.18);

  --font-display: "IBM Plex Serif", "Times New Roman", serif;
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;

  --wrap: min(1440px, 100% - 3rem);
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --radius: 2px;

  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ol, ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, blockquote, dl, dd { margin: 0; }

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

/* Texture — very subtle grain over the whole page */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: .35;
}

/* =========================================================
   Typography
   ========================================================= */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.028em;
}
.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow span {
  color: var(--accent);
  font-size: 0.55rem;
  transform: translateY(-1px);
}
.eyebrow--light { color: var(--muted-dark); }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  padding: 1.1rem clamp(1.25rem, 3vw, 2.5rem);
  color: var(--paper);
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: var(--paper);
  color: var(--ink);
  border-bottom-color: var(--rule);
  backdrop-filter: blur(8px);
}

/* Logo is a shield — intentionally oversized and allowed to overflow
   the bottom of the header bar for visual weight. */
.mark {
  position: absolute;
  top: 1.1rem;
  left: clamp(1.25rem, 3vw, 2.5rem);
  display: block;
  z-index: 2;
  line-height: 0;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
  transition: transform .45s var(--ease);
}
.mark img {
  display: block;
  height: 44px;
  width: auto;
  transition: transform .45s var(--ease);
}
.mark:hover img { transform: translateY(-2px) scale(1.02); }

.site-header.is-scrolled .mark {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}

@media (min-width: 640px) {
  .mark img { height: 66px; }
}
@media (min-width: 1024px) {
  .mark { top: 0.75rem; }
  .mark img { height: 81px; }
}
@media (min-width: 1280px) {
  .mark img { height: 91px; }
}

.primary-nav ul {
  display: none;
  gap: 2.5rem;
  align-items: center;
}
.primary-nav a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  padding: 0.25rem 0;
}
.primary-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.primary-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Hamburger */
.nav-toggle {
  width: 44px; height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: inherit;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 1.5px;
  background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav {
  position: fixed; inset: 0;
  background: var(--ink);
  color: var(--paper);
  z-index: 45;
  padding: 6rem 1.75rem 2rem;
  transform: translateY(-100%);
  transition: transform .55s var(--ease);
  visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.mobile-nav.is-open {
  transform: translateY(0);
  visibility: visible;
}
.mobile-nav ol {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mobile-nav a {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 10vw, 3.5rem);
  line-height: 1;
  padding: .5rem 0;
  border-bottom: 1px solid var(--rule-dark);
}
.mobile-nav a span {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.mobile-nav__foot {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  padding: 5.5rem var(--gutter) 2rem;
  color: var(--paper);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,10,.55) 0%, rgba(10,10,10,.35) 45%, rgba(10,10,10,.85) 100%),
    url("../images/herobg.png") center 35% / cover no-repeat;
  z-index: -1;
  transform: scale(1.02);
}
.hero__bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 40% at 80% 20%, rgba(180,37,28,.25), transparent 70%),
    linear-gradient(90deg, rgba(10,10,10,.6), transparent 50%);
}

.hero__rail {
  display: none;
  position: absolute;
  left: 1rem;
  bottom: 3rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  color: var(--paper);
  opacity: 0.65;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-self: start;
  justify-self: end;
  max-width: 60%;
  text-align: right;
  opacity: 0;
  animation: fadeIn 1s var(--ease) .8s forwards;
}
.tag {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(242, 237, 227, .35);
  border-radius: 100px;
  backdrop-filter: blur(4px);
}

.hero__content {
  align-self: center;
  max-width: 1100px;
}
.hero__content .eyebrow {
  color: rgba(242, 237, 227, .85);
  opacity: 0;
  animation: riseIn .9s var(--ease) .1s forwards;
}
.hero__content .eyebrow span { color: var(--accent); }

.hero .display {
  font-size: clamp(2.25rem, 7vw, 6rem);
  margin: 1rem 0 1.5rem;
}
.hero .display .line {
  display: block;
  opacity: 0;
  transform: translateY(40%);
  animation: riseIn 1.1s var(--ease) forwards;
}
.hero .display .line:nth-child(1) { animation-delay: .25s; }
.hero .display .line:nth-child(2) { animation-delay: .38s; }
.hero .display .line:nth-child(3) { animation-delay: .51s; }
.hero .display .line:nth-child(4) { animation-delay: .64s; }
.hero .display em {
  color: var(--accent);
}

.hero__lede {
  max-width: 44ch;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: rgba(242, 237, 227, .88);
  opacity: 0;
  animation: riseIn 1s var(--ease) .85s forwards;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
  opacity: 0;
  animation: riseIn 1s var(--ease) 1s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent;
  color: currentColor;
}
.btn--ghost:hover {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}

.hero__scroll {
  align-self: end;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(242, 237, 227, .7);
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.3s forwards;
}
.hero__scroll-line {
  display: block;
  width: 48px; height: 1px;
  background: currentColor;
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: sweep 2.8s var(--ease) 1.6s infinite;
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes riseIn { to { opacity: 1; transform: translateY(0); } }
@keyframes sweep {
  0% { transform: translateX(-100%); }
  60% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* =========================================================
   Section head (services, contact)
   ========================================================= */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  max-width: 1200px;
}
.section-head .display {
  font-size: clamp(2.5rem, 7vw, 6rem);
}

/* =========================================================
   Services
   ========================================================= */
.services {
  padding: clamp(5rem, 10vw, 8rem) var(--gutter) clamp(4rem, 8vw, 7rem);
  background: var(--paper);
  position: relative;
}
.services::before {
  content: "";
  position: absolute;
  left: var(--gutter); right: var(--gutter);
  top: 0;
  height: 1px;
  background: var(--rule);
}

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  max-width: 1080px;
  margin: 0 auto;
}

.service {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}
.service__media {
  overflow: hidden;
  aspect-ratio: 2 / 1;
  background: var(--ink-2);
}
.service__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.2) contrast(1.05);
  transition: transform .9s var(--ease), filter .9s var(--ease);
}
.service:hover .service__media img {
  transform: scale(1.04);
  filter: grayscale(0) contrast(1.05);
}
.service__body { display: flex; flex-direction: column; gap: 0.75rem; }
.service__num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.service__num::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--accent);
}
.service h3 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: 1rem;
}
.service h3::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 48px; height: 1px;
  background: var(--ink);
  transform-origin: left;
  transition: width .5s var(--ease), background-color .3s;
}
.service:hover h3::after {
  width: 100%;
  background: var(--accent);
}
.service ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.service ul li {
  padding-left: 1.25rem;
  position: relative;
}
.service ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 8px; height: 1px;
  background: var(--accent);
}

/* =========================================================
   About (dark)
   ========================================================= */
.about {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(6rem, 12vw, 10rem) var(--gutter);
  position: relative;
  overflow: hidden;
}
.about::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--rule-dark);
}
.about .eyebrow {
  color: var(--muted-dark);
}
.about .eyebrow span { color: var(--accent); }

.pullquote {
  max-width: var(--wrap);
  margin: 2rem auto 3.5rem;
  text-align: center;
  position: relative;
}
.pullquote .display {
  font-size: clamp(3rem, 10vw, 8.5rem);
  line-height: 0.9;
}
.pullquote .display em {
  color: var(--accent);
  font-style: italic;
}

.about__body {
  max-width: 62ch;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: rgba(242, 237, 227, .82);
  font-size: 1.05rem;
  line-height: 1.65;
}
.about__intro {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--paper);
  margin-top: 0.5rem;
}
.about__list {
  counter-reset: about;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--rule-dark);
  padding-top: 1.5rem;
}
.about__list li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule-dark);
}
.about__list li span {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-size: 1rem;
  padding-top: 0.15rem;
}
.about__closer {
  margin-top: 1rem;
  font-style: italic;
  color: var(--paper);
}

/* =========================================================
   Contact
   ========================================================= */
.contact {
  padding: clamp(5rem, 10vw, 8rem) var(--gutter);
  background: var(--paper);
}
.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  max-width: var(--wrap);
  margin: 0 auto;
}
.contact__map {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.contact__map iframe {
  width: 100%; height: 100%;
  border: 0;
  filter: grayscale(1) contrast(1.06);
  transition: filter .6s var(--ease);
}
.contact__map:hover iframe { filter: grayscale(0.2) contrast(1.02); }

.details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 2rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  margin-bottom: 2.5rem;
}
.details dt {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.details dd {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.35;
}
.details dd a {
  border-bottom: 1px solid var(--rule);
  transition: border-color .3s, color .3s;
}
.details dd a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Email CTA (replaces the old enquiry form) */
.contact__cta {
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}
.contact__email {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.2rem;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.contact__email:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.contact__cta .btn { margin-top: 0.5rem; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--ink);
  color: var(--muted-dark);
  padding: 3rem var(--gutter);
  border-top: 1px solid var(--rule-dark);
}
.site-footer__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.site-footer__mark {
  height: 64px;
  width: auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}
.site-footer__tag {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* =========================================================
   Reveal on scroll
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Breakpoints
   ========================================================= */
@media (min-width: 640px) {
  .service-grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 3.5rem) clamp(1.75rem, 3vw, 3rem);
  }
  .service--offset { transform: translateY(clamp(1.5rem, 4vw, 3rem)); }
  .hero__rail { display: block; }
  .details { grid-template-columns: 1fr 1fr; }
  .details > dt:nth-of-type(1),
  .details > dd:nth-of-type(1),
  .details > dt:nth-of-type(2),
  .details > dd:nth-of-type(2) { grid-column: span 1; }
}

@media (min-width: 1024px) {
  :root { --gutter: clamp(2rem, 4vw, 4rem); }
  .primary-nav ul { display: flex; }
  .nav-toggle { display: none; }

  .hero {
    padding-top: 7rem;
    padding-bottom: 3rem;
  }
  .hero__meta { max-width: 420px; }

  .contact__grid {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }
  .contact__map {
    position: sticky;
    top: 7rem;
    aspect-ratio: 3 / 4;
  }
}

@media (min-width: 1280px) {
  .service-grid { gap: 3.5rem 3rem; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero .display .line,
  .hero__lede,
  .hero__meta,
  .hero__cta,
  .hero__scroll { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
