/* ==========================================================================
   Heretic Systems — dark cyberpunk theme
   ========================================================================== */

:root {
  --bg:          #04050a;
  --bg-2:        #080b13;
  --panel:       rgba(10, 14, 24, 0.72);

  --cyan:        #00f0ff;
  --magenta:     #ff2bd6;
  --amber:       #ffb347;

  --text:        #c3cddc;
  --text-bright: #eaf2ff;
  --text-dim:    #6f7b8e;

  --line:        rgba(0, 240, 255, 0.18);
  --line-soft:   rgba(120, 140, 170, 0.14);

  --font-head: "Londrina Solid", "Impact", sans-serif;
  --font-body: "Chakra Petch", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --container: 1180px;
  --notch: 14px;
}

/* --------------------------------------------------------------- reset -- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ------------------------------------------------- ambient background -- */
/* Perspective grid receding to the horizon + a slow drift. */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%,   rgba(0, 240, 255, 0.10), transparent 70%),
    radial-gradient(ellipse 70% 50% at 85% 100%, rgba(255, 43, 214, 0.09), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}

.bg-grid::after {
  content: "";
  position: absolute;
  inset: 40% -50% -20% -50%;
  background-image:
    linear-gradient(to right,  var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(340px) rotateX(62deg);
  transform-origin: 50% 0;
  opacity: 0.32;
  mask-image: linear-gradient(to bottom, transparent, #000 35%, transparent 92%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, transparent 92%);
  animation: grid-drift 9s linear infinite;
}

@keyframes grid-drift {
  to { background-position: 0 64px; }
}

/* CRT scanlines, kept very faint so type stays crisp. */
.bg-scan {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0)    0px,
    rgba(0, 0, 0, 0)    2px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0.22) 4px
  );
  opacity: 0.22;
  mix-blend-mode: multiply;
}

/* ------------------------------------------------------------ layout -- */

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

main { flex: 1 0 auto; }

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

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 18px 0;
  background: rgba(4, 5, 10, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
  opacity: 0.6;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 0 7px rgba(0, 240, 255, 0.55));
  transition: filter 0.3s ease;
}

.logo a:hover img {
  filter: drop-shadow(0 0 12px rgba(255, 43, 214, 0.8));
}

.logo-text {
  font-family: var(--font-head);
  font-size: 26px;
  letter-spacing: 0.06em;
  color: var(--text-bright);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
  line-height: 1;
}

/* ---------------------------------------------------------- main nav -- */

.main-menu ul {
  display: flex;
  align-items: center;
  gap: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-menu a {
  position: relative;
  display: block;
  padding: 6px 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.22s ease, text-shadow 0.22s ease;
}

.main-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transition: width 0.28s ease;
}

.main-menu a:hover,
.main-menu li.active a {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.55);
}

.main-menu a:hover::after,
.main-menu li.active a::after { width: 100%; }

/* Bracket markers on the active item. */
.main-menu li.active a::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--magenta);
  box-shadow: 0 0 8px var(--magenta);
}

/* --------------------------------------------------------- hamburger -- */

.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}

.hamburger span {
  position: absolute;
  left: 11px;
  width: 18px;
  height: 1.5px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  transition: transform 0.28s ease, opacity 0.2s ease;
}

.hamburger span:nth-child(1) { top: 14px; }
.hamburger span:nth-child(2) { top: 20px; }
.hamburger span:nth-child(3) { top: 26px; }

body.menu-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .hamburger span:nth-child(2) { opacity: 0; }
body.menu-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ------------------------------------------------------ mobile menu -- */

.main-menu-mobile {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 10, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.menu-open .main-menu-mobile {
  opacity: 1;
  visibility: visible;
}

.main-menu-mobile ul {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.main-menu-mobile li { margin: 26px 0; }

.main-menu-mobile a {
  font-family: var(--font-head);
  font-size: 40px;
  letter-spacing: 0.05em;
  color: var(--text-bright);
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}

.main-menu-mobile a:hover { color: var(--cyan); }

/* -------------------------------------------------------------- intro -- */

.intro {
  padding: 90px 0 110px;
}

.intro .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
}

.intro-copy { min-width: 0; }

.kicker {
  display: inline-block;
  margin-bottom: 26px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--line);
  background: rgba(0, 240, 255, 0.05);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.kicker::before {
  content: "// ";
  color: var(--magenta);
}

/* --------------------------------------------------------- typography -- */

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 400;
  color: var(--text-bright);
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin: 0 0 26px;
}

h1 {
  font-size: clamp(40px, 5.4vw, 68px);
  text-transform: uppercase;
}

h2 { font-size: clamp(32px, 4vw, 48px); }
h3 { font-size: 26px; }

/* Chromatic-aberration glitch on page titles. */
/* Applied directly to headings, so it must stay block-level — `fit-content`
   keeps the box hugging the text so the ghost layers line up. */
.glitch {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  text-shadow:
     2px 0 0 rgba(255, 43, 214, 0.55),
    -2px 0 0 rgba(0, 240, 255, 0.55),
     0 0 34px rgba(0, 240, 255, 0.28);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.glitch::before {
  color: var(--magenta);
  clip-path: inset(0 0 62% 0);
  animation: glitch-top 4.5s steps(2, end) infinite;
}

.glitch::after {
  color: var(--cyan);
  clip-path: inset(58% 0 0 0);
  animation: glitch-bottom 4.5s steps(2, end) infinite;
}

@keyframes glitch-top {
  0%, 92%, 100% { transform: translate(0, 0);   opacity: 0; }
  93%           { transform: translate(-4px, -2px); opacity: 0.9; }
  95%           { transform: translate(4px, 1px);   opacity: 0.7; }
  97%           { transform: translate(-2px, 0);    opacity: 0.85; }
}

@keyframes glitch-bottom {
  0%, 92%, 100% { transform: translate(0, 0);  opacity: 0; }
  94%           { transform: translate(4px, 2px);  opacity: 0.9; }
  96%           { transform: translate(-3px, -1px); opacity: 0.7; }
  98%           { transform: translate(2px, 0);     opacity: 0.85; }
}

p { margin: 0 0 22px; }

.lead {
  font-size: 19px;
  color: var(--text);
  max-width: 56ch;
}

/* Neon rule under section headings on interior pages. */
.rule {
  width: 110px;
  height: 2px;
  margin: 0 0 34px;
  border: 0;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
}

/* -------------------------------------------------------- hero image -- */

.intro-figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulsing halo behind the artwork. */
.intro-figure::before {
  content: "";
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.22), rgba(255, 43, 214, 0.12) 45%, transparent 70%);
  filter: blur(28px);
  animation: halo 6s ease-in-out infinite;
}

@keyframes halo {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.09); opacity: 1; }
}

/* Rotating targeting ring. */
.intro-figure::after {
  content: "";
  position: absolute;
  width: 88%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed rgba(0, 240, 255, 0.28);
  animation: spin 44s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.intro-image {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  /* Artwork is alpha-keyed, so the glow traces the silhouette rather than a box. */
  filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.35))
          drop-shadow(0 0 55px rgba(255, 43, 214, 0.22));
}

/* ------------------------------------------------------- page shells -- */

.page-head {
  padding: 82px 0 8px;
}

.content-section {
  padding: 0 0 110px;
}

.content {
  max-width: 68ch;
}

.content p:last-child { margin-bottom: 0; }

/* First paragraph of interior copy reads as a lead: brighter and slightly
   larger, but flush with the rest of the column. */
.content > p:first-of-type {
  color: var(--text-bright);
  font-size: 19px;
}

/* ------------------------------------------------------- contact box -- */

.call {
  max-width: 560px;
  padding: 34px 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(
    0 0,
    calc(100% - var(--notch)) 0,
    100% var(--notch),
    100% 100%,
    var(--notch) 100%,
    0 calc(100% - var(--notch))
  );
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 20px 60px rgba(0, 0, 0, 0.55);
}

.call-row + .call-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.call-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.call-value {
  font-family: var(--font-mono);
  font-size: 19px;
  color: var(--text-bright);
  word-break: break-word;
}

.call-value a {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  transition: color 0.2s ease;
}

.call-value a:hover { color: var(--magenta); text-shadow: 0 0 14px rgba(255, 43, 214, 0.5); }

.call-box-bottom { margin-top: 28px; }

/* ---------------------------------------------------------- buttons -- */

.button {
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding: 13px 30px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid var(--cyan);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(0, 240, 255, 0.35), transparent);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.button:hover {
  color: var(--bg);
  background: var(--cyan);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.45);
}

.button:hover::after { transform: translateX(120%); }

/* ----------------------------------------------------------- footer -- */

.sub-footer {
  flex-shrink: 0;
  padding: 30px 0;
  border-top: 1px solid var(--line-soft);
  background: rgba(4, 5, 10, 0.6);
}

.sub-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.social {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.social a {
  display: block;
  opacity: 0.55;
  transition: opacity 0.22s ease, filter 0.22s ease, transform 0.22s ease;
}

.social img { width: 20px; height: 20px; }

.social a:hover {
  opacity: 1;
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px var(--cyan));
}

.copyright {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* -------------------------------------------------------------- 404 -- */
/* Centred error page: logo artwork over an oversized 404. */

.error-page {
  padding: 56px 0 100px;
  text-align: center;
}

.error-figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 8px;
}

/* Same halo as the home hero, scaled down. */
.error-figure::before {
  content: "";
  position: absolute;
  width: 210px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.2), rgba(255, 43, 214, 0.11) 45%, transparent 70%);
  filter: blur(22px);
  animation: halo 6s ease-in-out infinite;
}

.error-image {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 175px;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.32))
          drop-shadow(0 0 40px rgba(255, 43, 214, 0.2));
}

.error-code {
  font-size: clamp(96px, 19vw, 200px);
  line-height: 0.86;
  letter-spacing: 0.04em;
  margin: 0 auto 22px;
}

/* .glitch is `width: fit-content`, so it needs auto margins to sit centred. */
.error-page .rule {
  margin-left: auto;
  margin-right: auto;
}

.error-page .content {
  max-width: 54ch;
  margin: 0 auto;
}

.error-message { margin-bottom: 34px; }

/* ---------------------------------------------------------- responsive -- */

@media (max-width: 900px) {
  .intro .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .intro-copy { order: 2; }
  .intro-figure { order: 1; }
  .intro-image { max-width: 300px; }
  .intro { padding: 60px 0 80px; }
}

@media (max-width: 768px) {
  .main-menu { display: none; }
  .hamburger { display: block; }

  body { font-size: 16px; }
  .container { padding: 0 20px; }

  .page-head { padding: 56px 0 8px; }
  .content-section { padding: 0 0 80px; }

  .call { padding: 28px 24px; }
  .call-value { font-size: 17px; }

  /* Footer stays on one line at every width — icon left, copyright right.
     The copyright tightens instead of wrapping under the icon. */
  .sub-footer-inner { gap: 14px; }

  .copyright {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 480px) {
  .intro-figure::after { display: none; }
  .intro-image { max-width: 230px; }
}

/* ----------------------------------------------------- accessibility -- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .bg-scan { display: none; }
}

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