/* ============================================================
   AZFAR YUSRI — TACTICAL TELEMETRY PORTFOLIO
   Substrate: dark CRT. Foreground: white phosphor.
   Accent: hazard red. Terminal green: status dot ONLY.
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-raised: #121212;
  --fg: #eaeaea;
  --fg-dim: #9a9a9a;
  --line: #2c2c2c;
  --red: #ff2a2a;
  --green: #4af626;

  --font-display: "Archivo Black", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --font-body: "Inter", sans-serif;

  --pad: clamp(1rem, 3vw, 2.5rem);

  /* z-scale: sticky < overlay */
  --z-sticky: 20;
  --z-fx: 40;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--red); color: var(--bg); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

samp, .mono { font-family: var(--font-mono); }

.accent { color: var(--red); }

/* ============ TEXTURE OVERLAYS ============ */

.fx-scanlines {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: var(--z-fx);
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(0, 0, 0, 0.14) 2px, rgba(0, 0, 0, 0.14) 4px
  );
}

.fx-noise {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: var(--z-fx);
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ============ TOP TELEMETRY BAR ============ */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-cell {
  padding: 0.85rem 1.1rem;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.topbar .brand { font-weight: 600; }
.brand-logo { height: 18px; width: auto; display: block; }

.topbar .status { color: var(--green); }
.status-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 0; /* square: mechanical, not soft */
  display: inline-block;
  animation: blink 1.6s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

.topbar .nav {
  margin-left: auto;
  border-right: none;
  border-left: 1px solid var(--line);
  gap: 1.4rem;
}
.topbar .nav a { padding: 0.2rem 0; color: var(--fg-dim); transition: color 160ms ease-out; }
.topbar .nav a:hover { color: var(--red); }

/* back-link cell (used only on the rezlsg.agency-embedded copy) */
.back-link {
  color: var(--fg-dim);
  transition: color 160ms ease-out;
  white-space: nowrap;
}
.back-link:hover { color: var(--red); }

/* ============ HERO ============ */

.hero {
  min-height: calc(100svh - 42px);
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  position: relative;
}

/* --- Hero background: halftone-print portrait --- */

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  /* capped to the viewport-height portrait area, not the full (variable-height)
     hero section, so object-fit:cover math stays sane even when the spec
     grid stacks tall on narrow screens */
  height: calc(100svh - 42px);
  overflow: hidden;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  /* degraded print: monochrome, crushed contrast */
  filter: grayscale(1) contrast(1.25) brightness(0.62);
  opacity: 0.5;
  will-change: transform;
}

/* halftone dot screen over the photo */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: radial-gradient(circle, rgba(10, 10, 10, 0.85) 1px, transparent 1.6px);
  background-size: 4px 4px;
}

/* fade into substrate so type stays legible */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to right, var(--bg) 0%, rgba(10, 10, 10, 0.25) 45%, rgba(10, 10, 10, 0) 75%),
    linear-gradient(to bottom, rgba(10, 10, 10, 0.55) 0%, rgba(10, 10, 10, 0) 30%, rgba(10, 10, 10, 0.2) 70%, var(--bg) 100%);
}

/* HUD acquisition frame pinned to the portrait side */
.hero-bg-frame {
  position: absolute;
  z-index: 3;
  top: 12%;
  right: 5%;
  width: clamp(160px, 20vw, 320px);
  height: clamp(170px, 24vh, 300px);
  border: 1px solid rgba(255, 42, 42, 0.55);
  pointer-events: none;
}

/* corner brackets */
.hero-bg-frame::before,
.hero-bg-frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
}
.hero-bg-frame::before {
  top: -1px; left: -1px;
  border-top: 3px solid var(--red);
  border-left: 3px solid var(--red);
}
.hero-bg-frame::after {
  bottom: -1px; right: -1px;
  border-bottom: 3px solid var(--red);
  border-right: 3px solid var(--red);
}

.frame-tag {
  position: absolute;
  top: 0.6rem;
  left: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--red);
  white-space: nowrap;
}

/* lift hero content above the background */
.hero > *:not(.hero-bg) { position: relative; z-index: 1; }
.hero-meta-row { background: rgba(10, 10, 10, 0.6); }
.hero .spec-cell { background: rgba(10, 10, 10, 0.72); }

/* crosshair registration marks at hero corners */
.hero::before, .hero::after {
  content: "+";
  position: absolute;
  font-family: var(--font-mono);
  color: var(--fg-dim);
  font-size: 0.9rem;
}
.hero::before { left: 0.6rem; bottom: 0.4rem; }
.hero::after  { right: 0.6rem; bottom: 0.4rem; }

.hero-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem var(--pad);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--line);
}
.hero-meta-row .accent { color: var(--red); }

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(4rem, 15.5vw, 15rem);
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  padding: 0 var(--pad);
  /* auto margins center the name in the space between meta row and scroll cue */
  margin: auto 0;
  user-select: none;
}

.hero-line { display: block; overflow: hidden; }
.hero-word { display: inline-block; }
.hero-line-2 { text-align: right; }

.hero-social {
  display: flex;
  justify-content: flex-start;
  gap: 1.4rem;
  padding: 0.9rem var(--pad);
}

.social-link {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  transition: color 160ms ease-out, transform 160ms ease-out;
}
.social-link svg { width: 34px; height: 34px; fill: currentColor; }
.social-link:hover {
  color: var(--red);
  transform: scale(1.12);
}

.hero-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec-cell {
  background: var(--bg);
  padding: 1.1rem var(--pad);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.spec-key {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

.spec-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.45;
}

.barcode-cell { align-items: flex-start; }
.barcode { width: 100%; max-width: 150px; height: 30px; fill: var(--fg); }

.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 2rem;
  padding: 0 var(--pad) 1.2rem;
}

.hero-scroll {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.scroll-arrow { color: var(--red); }

/* ============ MARQUEE ============ */

.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0;
  background: var(--red);
  color: var(--bg);
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  will-change: transform;
}
.marquee-track span { padding-right: 0; }

/* ============ SECTIONS ============ */

.section {
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(3rem, 7vh, 6rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--pad);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 5vh, 4rem);
}

.section-head h2 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.section-ref {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

.venture-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  transition: color 160ms ease-out, border-color 160ms ease-out;
  white-space: nowrap;
}
.venture-badge svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.venture-badge:hover { color: var(--red); border-color: var(--red); }

/* ============ PROFILE ============ */

.profile-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 0 var(--pad);
}

.profile-statement .lead {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.4;
  font-weight: 500;
  margin-bottom: 1.5rem;
  max-width: 65ch;
}

.profile-statement p:not(.lead) {
  color: var(--fg-dim);
  max-width: 62ch;
  margin-bottom: 1.1rem;
}
.profile-statement p:not(.lead) .accent,
.profile-statement strong { color: var(--fg); }

.profile-data {
  border: 1px solid var(--line);
  align-self: start;
}

.data-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.data-row:last-child { border-bottom: none; }
.data-row span { color: var(--fg-dim); }
.data-row samp { font-weight: 600; text-align: right; }
.data-row a { transition: color 160ms ease-out; }
.data-row a:hover samp { color: var(--red); }

/* ============ CASE FILES ============ */

.case-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.case {
  display: grid;
  grid-template-columns: minmax(90px, 0.5fr) 3fr 1fr;
  gap: clamp(1rem, 3vw, 3rem);
  padding: clamp(1.6rem, 4vh, 2.8rem) var(--pad);
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background-color 200ms ease-out;
}

.case:hover { background: var(--bg-raised); }
.case:hover .case-index { color: var(--red); }

.case-index {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--fg-dim);
  transition: color 200ms ease-out;
  line-height: 1;
}

.case-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.case-body .award {
  font-family: var(--font-mono);
  font-size: 0.6em;
  letter-spacing: 0.1em;
  vertical-align: middle;
  white-space: nowrap;
}

.case-body p {
  color: var(--fg-dim);
  max-width: 60ch;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.case-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.case-tags samp {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  color: var(--fg);
}

.case-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  text-align: right;
}
.case-meta samp:first-child { color: var(--fg); font-weight: 600; }

/* ============ SERVICE RECORD ============ */

.record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 0 var(--pad);
}

.record-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--red);
  margin: 2.2rem 0 1.1rem;
}
.record-label:first-child { margin-top: 0; }

.record-entry {
  border: 1px solid var(--line);
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.75rem;
}

.record-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.record-head strong {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.record-head samp {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  white-space: nowrap;
}

.record-entry p {
  font-size: 0.88rem;
  color: var(--fg-dim);
  max-width: 60ch;
}

.cap-matrix {
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.cap-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.cap-row:last-child { border-bottom: none; }

.cap-row dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

.cap-row dd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  line-height: 1.7;
}

/* ============ CONTACT ============ */

.contact { padding-bottom: 0; }

.contact-primary {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: clamp(2rem, 6vh, 4.5rem) var(--pad);
  border-bottom: 1px solid var(--line);
  transition: background-color 220ms ease-out;
}

.contact-primary:hover { background: var(--red); color: var(--bg); }
.contact-primary:hover .contact-email { color: var(--bg); }

.contact-cta {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.6vw, 1.1rem);
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  transition: color 220ms ease-out;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.contact-cell {
  background: var(--bg);
  padding: 1.5rem var(--pad);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--font-mono);
  transition: background-color 180ms ease-out;
}
.contact-cell:hover { background: var(--bg-raised); }
.contact-cell:hover samp { color: var(--red); }

.contact-cell span {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
}
.contact-cell samp {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: color 180ms ease-out;
}

/* ============ FOOTER ============ */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--pad);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1100px) {
  .hide-lg { display: none; }
}

@media (max-width: 900px) {
  .hide-md { display: none; }
  .hero-spec-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-grid, .record-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .case { grid-template-columns: auto 1fr; }
  .case-meta {
    grid-column: 2;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    text-align: left;
    margin-top: 0.75rem;
  }
}

@media (max-width: 700px) {
  /* matches the <picture> mobile crop breakpoint in index.html */
  .hero-bg img { object-position: 50% 0%; }
}

@media (max-width: 600px) {
  .hide-sm { display: none; }
  .marquee { padding: 0.4rem 0; }
  .marquee-track { font-size: 0.62rem; letter-spacing: 0.08em; }
  .topbar { font-size: 0.62rem; flex-wrap: wrap; }
  .topbar-cell { padding: 0.75rem 0.7rem; }
  .topbar .brand { flex: 1; }
  .topbar .status { border-right: none; }
  .topbar .nav {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
    justify-content: space-between;
    gap: 0.8rem;
    margin-left: 0;
  }
  .hero-spec-grid { grid-template-columns: 1fr; }
  .hero-bottom { flex-direction: column; align-items: flex-start; }
  .hero-scroll { flex-direction: row; }
  .contact-grid { grid-template-columns: 1fr; }
  .case { grid-template-columns: 1fr; }
  .case-meta { grid-column: 1; }
}

/* ============ MOTION SAFETY ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-dot { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
