/* ==========================================================================
   Pertis Infra — Under Construction
   Edit text in index.html; colours and spacing live here.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roxborough CF";
  src: url("fonts/Roxborough CF.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #0A0A0A;
  --charcoal: #14181F;
  --steel: #2A303A;
  --infra-blue: #0057FF;
  --deep-blue: #0B3D91;
  --sky-blue: #4DA3FF;
  --white: #FFFFFF;
  --light-grey: #F2F4F7;
  --muted: #9AA4B2;

  --font-heading: "Roxborough CF", Georgia, serif;
  --font-brand: "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --radius: 4px;
  --max-width: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--white);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--infra-blue);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  outline: 2px solid var(--sky-blue);
  outline-offset: 2px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--steel);
}

.header-inner {
  display: flex;
  align-items: center;
  min-height: 4.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--white);
}

.logo-text {
  font-family: var(--font-brand);
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  letter-spacing: 0.02em;
}

.logo:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 4px;
  border-radius: var(--radius);
}

/* ==========================================================================
   Shared typography
   ========================================================================== */
.section-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sky-blue);
  margin: 0 0 1rem;
}

.section-label--dark {
  color: var(--deep-blue);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 2.5rem;
  color: var(--white);
}

.section-title--dark {
  color: var(--black);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 10vw, 7rem);
  min-height: calc(100vh - 4.5rem);
  min-height: calc(100svh - 4.5rem);
  display: flex;
  align-items: center;
  background:
    linear-gradient(165deg, var(--black) 0%, var(--black) 50%, #0c1220 78%, var(--deep-blue) 100%);
}

/* Blueprint grid */
.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(var(--steel) 1px, transparent 1px),
    linear-gradient(90deg, var(--steel) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  animation: grid-drift 40s linear infinite;
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-grid {
    animation: none;
  }
}

/* Corner brackets */
.hero-brackets {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px solid var(--infra-blue);
  opacity: 0.4;
  pointer-events: none;
}

.hero-brackets--tl {
  top: 5rem;
  left: max(1rem, calc(50% - 620px));
  border-right: none;
  border-bottom: none;
}

.hero-brackets--br {
  bottom: 2rem;
  right: max(1rem, calc(50% - 620px));
  border-left: none;
  border-top: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 1.05;
  font-weight: 400;
  margin: 0 0 1.25rem;
  color: var(--white);
}

.hero-title .highlight {
  color: var(--infra-blue);
}

.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 36ch;
  margin: 0 auto 2.5rem;
}

/* Progress bar */
.progress-wrap {
  max-width: 420px;
  margin: 0 auto 2.5rem;
  text-align: left;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.progress-label {
  color: var(--white);
}

.progress-percent {
  color: var(--sky-blue);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  background: var(--charcoal);
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  overflow: hidden;
}

.progress-fill {
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, var(--deep-blue), var(--infra-blue), var(--sky-blue));
  background-size: 200% 100%;
  border-radius: inherit;
  animation: shimmer 2.5s ease-in-out infinite;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: shine 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill,
  .progress-fill::after {
    animation: none;
  }
}

/* ==========================================================================
   Capabilities (editorial sector list)
   ========================================================================== */
.capabilities {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem);
  background: var(--charcoal);
  color: var(--white);
  border-top: 1px solid var(--steel);
}

/* Barely-visible blueprint grid */
.capabilities-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(var(--steel) 1px, transparent 1px),
    linear-gradient(90deg, var(--steel) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
}

.capabilities .container {
  position: relative;
}

.capabilities-title {
  max-width: 14ch;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.sectors {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--steel);
}

.sector {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "no arrow"
    "name name"
    "desc desc";
  align-items: center;
  row-gap: 0.5rem;
  padding: 1.75rem 0 2rem;
  border-bottom: 1px solid var(--steel);
  outline: none;
  cursor: default;
}

/* Blue accent that draws across the divider */
.sector::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--infra-blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s var(--ease);
}

.sector-no {
  grid-area: no;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  color: var(--sky-blue);
  transition: color 0.3s var(--ease);
}

.sector-no::after {
  content: "";
  width: 1.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
  transition: width 0.35s var(--ease), opacity 0.3s var(--ease);
}

.sector-name {
  grid-area: name;
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 11vw, 3.5rem);
  font-weight: 400;
  line-height: 1.05;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.3s var(--ease), transform 0.35s var(--ease);
}

.sector-desc {
  grid-area: desc;
  margin: 0.25rem 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.sector-arrow {
  grid-area: arrow;
  justify-self: end;
  color: var(--muted);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

/* Technical line drawings */
.sector-art {
  position: absolute;
  right: 0;
  bottom: 1.5rem;
  width: clamp(110px, 34vw, 150px);
  height: auto;
  pointer-events: none;
  overflow: visible;
}

.sector-art path,
.sector-art circle {
  fill: none;
  stroke: var(--sky-blue);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0.55;
  opacity: 0.16;
  transition: stroke-dashoffset 0.6s var(--ease), opacity 0.35s var(--ease);
}

/* Active state: hover, keyboard focus, or tap */
.sector:hover::after,
.sector:focus::after {
  transform: scaleX(1);
}

.sector:hover .sector-name,
.sector:focus .sector-name {
  color: var(--white);
  transform: translateX(4px);
}

.sector:hover .sector-no,
.sector:focus .sector-no {
  color: var(--infra-blue);
}

.sector:hover .sector-no::after,
.sector:focus .sector-no::after {
  width: 2.25rem;
  opacity: 1;
}

.sector:hover .sector-arrow,
.sector:focus .sector-arrow {
  color: var(--infra-blue);
  transform: translateX(6px);
}

.sector:hover .sector-art path,
.sector:hover .sector-art circle,
.sector:focus .sector-art path,
.sector:focus .sector-art circle {
  stroke-dashoffset: 0;
  opacity: 0.6;
}

.sector:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Tablet: title row + description row, art on the right */
@media (min-width: 640px) {
  .sector {
    grid-template-columns: 4.5rem 1fr auto;
    grid-template-areas:
      "no name arrow"
      ".  desc arrow";
    column-gap: 1.5rem;
    padding: 2.25rem 0 2.5rem;
  }

  .sector-no {
    align-self: start;
    padding-top: 0.9rem;
  }

  .sector-desc {
    max-width: 40ch;
  }

  .sector-art {
    right: 4rem;
    bottom: 1.75rem;
    width: 150px;
  }
}

/* Desktop: number | title | drawing | description | arrow */
@media (min-width: 960px) {
  .sector {
    grid-template-columns: 5rem minmax(0, 1.1fr) 8rem minmax(0, 0.8fr) 2.5rem;
    grid-template-areas: "no name art desc arrow";
    column-gap: 1.5rem;
    align-items: center;
    padding: 2.75rem 0;
  }

  .sector-no {
    align-self: center;
    padding-top: 0;
  }

  .sector-name {
    font-size: clamp(3rem, 4.8vw, 4.25rem);
  }

  .sector-desc {
    margin: 0;
    max-width: 34ch;
  }

  .sector-art {
    position: static;
    grid-area: art;
    width: 100%;
    justify-self: center;
  }
}


/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
  background: var(--black);
  text-align: center;
}

.contact-title {
  font-family: var(--font-brand);
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.contact-lead {
  color: var(--muted);
  max-width: 42ch;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
}

.contact-blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 960px;
  margin: 0 auto 2rem;
}

@media (min-width: 640px) {
  .contact-blocks {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.contact-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.75rem 1.25rem;
  background: var(--charcoal);
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--white);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.contact-block:hover {
  border-color: var(--infra-blue);
  box-shadow: 0 0 24px rgba(0, 87, 255, 0.35);
  transform: translateY(-4px);
}

.contact-block:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 3px;
}

.contact-icon {
  color: var(--sky-blue);
  margin-bottom: 0.5rem;
}

.contact-block-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-block-value {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
}

.contact-cta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--infra-blue);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.email-noscript {
  margin: 0 auto 2rem;
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--infra-blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--deep-blue);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-secondary:hover {
  border-color: var(--sky-blue);
  color: var(--sky-blue);
  transform: translateY(-2px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--steel);
  background: var(--black);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-github {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
}

.footer-github:hover {
  color: var(--sky-blue);
}

.footer-github:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 3px;
}

.footer-github-icon {
  flex-shrink: 0;
  color: var(--infra-blue);
}

/* ==========================================================================
   Motion: fade-up (initial state; .is-visible added by script.js)
   ========================================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--stagger, 0) * 0.12s);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-content .fade-up:nth-child(2) {
  transition-delay: 0.1s;
}

.hero-content .fade-up:nth-child(3) {
  transition-delay: 0.2s;
}

.hero-content .fade-up:nth-child(4) {
  transition-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.not-found {
  display: grid;
  min-height: calc(100vh - 4.5rem);
  place-items: center;
  padding: 4rem 1rem;
  text-align: center;
}

.not-found__content {
  max-width: 42rem;
}

.not-found__code {
  margin: 0 0 1rem;
  color: var(--sky-blue);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.not-found__title {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 8vw, 5rem);
  font-weight: 400;
  line-height: 1;
}

.not-found__copy {
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Phone optimisations (kept last so they override base rules) */
@media (max-width: 639px) {
  .container { width: min(100% - 2.5rem, var(--max-width)); }
  .hero { padding: 3rem 0; }
  .hero-title { font-size: clamp(3.25rem, 15vw, 4.5rem); }
  .hero-sub { font-size: 1.15rem; max-width: 30ch; }
  .progress-wrap { max-width: 100%; }
  .progress-header { font-size: 1rem; }
  .progress-track { height: 10px; }
  .hero-brackets { width: 48px; height: 48px; }
  .hero-brackets--tl { top: 1.5rem; }
  .section-title { font-size: clamp(2.25rem, 10vw, 3rem); }
  .btn { width: 100%; padding: 1rem 1.75rem; font-size: 1rem; }
  .contact-actions { flex-direction: column; }
  .contact-block:hover { transform: none; }
}
