/* ============================================================
   IRSRASHAD.GITHUB.IO — "CARTOGRAPHY LAB" DESIGN SYSTEM
   Dark field-atlas aesthetic · survey orange + topo mint
   ============================================================ */

:root {
  --ink:        #0b100e;   /* deep moss black */
  --ink-2:      #101613;   /* raised surface */
  --ink-3:      #151d19;   /* higher surface */
  --line:       #24302a;   /* hairline borders */
  --line-soft:  #1a231f;
  --grid:       rgba(155, 191, 136, 0.05);

  --paper:      #e8ede9;   /* primary text */
  --mist:       #93a49b;   /* secondary text */
  --faint:      #5c6b63;   /* tertiary / labels */

  --survey:     #ff6b35;   /* survey-marker orange */
  --survey-dim: rgba(255, 107, 53, 0.14);
  --mint:       #6fe0b2;   /* topo mint */
  --mint-dim:   rgba(111, 224, 178, 0.12);
  --sky:        #6db5e8;   /* hydro blue */

  --font-display: 'Archivo', sans-serif;
  --font-body:    'Archivo', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --pad-x: clamp(1.25rem, 4vw, 3rem);
  --max-w: 1240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--survey); color: var(--ink); }

/* ---------- GRATICULE BACKGROUND ---------- */
.graticule {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
}
.graticule::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(111,224,178,0.045), transparent 60%);
}

/* subtle film grain */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  animation: grain-shift 9s steps(6) infinite;
}
@keyframes grain-shift {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-2%,3%); }
  40% { transform: translate(3%,-2%); } 60% { transform: translate(-3%,-3%); } 80% { transform: translate(2%,2%); }
}

main, .page-shell { position: relative; z-index: 2; }

/* ---------- TYPOGRAPHY UTILITIES ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-stretch: 110%;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* ---------- TOP TICKER BAR ---------- */
.ticker-bar {
  position: relative; z-index: 60;
  border-bottom: 1px solid var(--line-soft);
  background: var(--ink);
  overflow: hidden; white-space: nowrap;
  padding: 0.42rem 0;
}
.ticker-track { display: inline-block; animation: ticker 52s linear infinite; }
.ticker-track span {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint); padding: 0 1.6rem;
}
.ticker-track span b { color: var(--mint); font-weight: 400; }
.ticker-track span i { color: var(--survey); font-style: normal; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- NAV ---------- */
header.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 14, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); position: relative;
}
.brand-mark::before {
  content: ''; position: absolute; width: 6px; height: 6px;
  background: var(--survey); border-radius: 50%;
}
.brand-mark::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  border: 1px solid rgba(255,107,53,0.5); border-radius: 50%;
  animation: ping 2.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.brand-name { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--paper); }
.brand-name em { font-style: normal; color: var(--faint); }

.nav-links { display: flex; align-items: center; gap: 1.9rem; list-style: none; }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.63rem; letter-spacing: 0.15em;
  text-transform: uppercase; text-decoration: none; color: var(--mist);
  padding: 0.35rem 0; position: relative; transition: color 0.2s;
}
.nav-links a::before {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--survey); transition: width 0.28s ease;
}
.nav-links a:hover { color: var(--paper); }
.nav-links a:hover::before { width: 100%; }
.nav-links a.active { color: var(--survey); }
.nav-links a.active::before { width: 100%; background: var(--survey); }

.nav-cta {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--mint);
  padding: 0.5rem 1rem; font-weight: 600;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover { background: var(--survey); }

/* hamburger */
.nav-burger {
  display: none; background: none; border: 1px solid var(--line);
  width: 38px; height: 38px; cursor: pointer; position: relative;
}
.nav-burger span, .nav-burger::before, .nav-burger::after {
  content: ''; position: absolute; left: 9px; right: 9px; height: 1.5px;
  background: var(--paper); transition: all 0.25s;
}
.nav-burger::before { top: 13px; } .nav-burger span { top: 18px; } .nav-burger::after { top: 23px; }
.nav-burger.open::before { top: 18px; transform: rotate(45deg); }
.nav-burger.open::after { top: 18px; transform: rotate(-45deg); }
.nav-burger.open span { opacity: 0; }

.mobile-menu {
  display: none; position: fixed; inset: 64px 0 auto 0; z-index: 49;
  background: var(--ink-2); border-bottom: 1px solid var(--line);
  padding: 1rem var(--pad-x) 1.6rem;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; padding: 0.85rem 0; text-decoration: none;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--mist);
  border-bottom: 1px solid var(--line-soft);
}
.mobile-menu a.active { color: var(--survey); }

/* ---------- PAGE HEAD (interior pages) ---------- */
.page-head {
  max-width: var(--max-w); margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) var(--pad-x) clamp(2rem, 4vw, 3rem);
}
.page-head .kicker {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--survey); margin-bottom: 1.4rem;
}
.page-head .kicker::before { content: ''; width: 26px; height: 1px; background: var(--survey); }
.page-head h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 800;
  margin-bottom: 1.2rem;
}
.page-head h1 .dim { color: var(--faint); font-weight: 700; }
.page-head .lede { max-width: 640px; color: var(--mist); font-size: 1.05rem; }
.page-head .lede strong { color: var(--paper); font-weight: 500; }

/* ---------- SECTIONS ---------- */
.section { max-width: var(--max-w); margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) var(--pad-x); }
.section-head { display: flex; align-items: baseline; gap: 1.2rem; margin-bottom: 2.8rem; flex-wrap: wrap; }
.section-head .idx { font-family: var(--font-mono); font-size: 0.66rem; color: var(--survey); letter-spacing: 0.16em; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 750; }
.section-head .rule { flex: 1; height: 1px; background: var(--line); min-width: 40px; align-self: center; }
.section-head .side-note { font-family: var(--font-mono); font-size: 0.6rem; color: var(--faint); letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- CROSSHAIR CARD ---------- */
.xcard {
  position: relative; background: var(--ink-2);
  border: 1px solid var(--line-soft);
  padding: 1.8rem;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.xcard .xtick { position: absolute; inset: 0; pointer-events: none; }
.xcard::before, .xcard::after,
.xcard .xtick::before, .xcard .xtick::after {
  content: ''; position: absolute; width: 9px; height: 9px;
  border-color: var(--faint); border-style: solid; border-width: 0;
  transition: border-color 0.25s;
}
.xcard::before { top: -1px; left: -1px; border-top-width: 1.5px; border-left-width: 1.5px; }
.xcard::after  { top: -1px; right: -1px; border-top-width: 1.5px; border-right-width: 1.5px; }
.xcard .xtick::before { bottom: -1px; left: -1px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.xcard .xtick::after  { bottom: -1px; right: -1px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.xcard:hover { border-color: var(--line); background: var(--ink-3); transform: translateY(-3px); }
.xcard:hover::before, .xcard:hover::after,
.xcard:hover .xtick::before, .xcard:hover .xtick::after { border-color: var(--survey); }

/* ---------- TAGS ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tag {
  font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 0.3rem 0.6rem;
  border: 1px solid var(--line); color: var(--mist); white-space: nowrap;
}
.tag.hot  { border-color: rgba(255,107,53,0.4);  color: var(--survey); }
.tag.cool { border-color: rgba(111,224,178,0.35); color: var(--mint); }
.tag.hydro{ border-color: rgba(109,181,232,0.35); color: var(--sky); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.13em;
  text-transform: uppercase; text-decoration: none; font-weight: 600;
  padding: 0.9rem 1.7rem; transition: all 0.22s; cursor: pointer;
}
.btn-solid {
  background: var(--survey); color: var(--ink);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.btn-solid:hover { background: var(--mint); }
.btn-ghost { border: 1px solid var(--line); color: var(--mist); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }

.text-link {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--mint); text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.text-link::after { content: '→'; transition: transform 0.2s; }
.text-link:hover::after { transform: translateX(4px); }
.text-link.ext::after { content: '↗'; }
.text-link.ext:hover::after { transform: translate(2px, -2px); }
.text-link.off { color: var(--faint); pointer-events: none; }
.text-link.off::after { content: ''; }

/* ---------- REVEAL ANIMATION ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.on { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; } .reveal.d4 { transition-delay: 0.32s; }

/* ---------- CONTACT BAND ---------- */
.contact-band { border-top: 1px solid var(--line-soft); background: var(--ink-2); }
.contact-band .section { display: grid; grid-template-columns: 1.2fr 1fr; gap: 4rem; align-items: center; }
.contact-band h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; margin-bottom: 1.1rem; }
.contact-band h2 span { color: var(--survey); }
.contact-band p { color: var(--mist); max-width: 480px; margin-bottom: 2rem; }
.contact-list { display: flex; flex-direction: column; gap: 0.7rem; }
.contact-row {
  display: flex; align-items: center; gap: 1rem; text-decoration: none;
  border: 1px solid var(--line-soft); background: var(--ink);
  padding: 0.9rem 1.1rem; transition: border-color 0.22s;
}
.contact-row:hover { border-color: var(--survey); }
.contact-row .ic {
  width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.66rem;
  color: var(--mint);
}
.contact-row .lbl { font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.contact-row .val { font-size: 0.88rem; color: var(--paper); }

/* ---------- FOOTER ---------- */
footer.site-footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--line-soft);
  padding: 1.6rem var(--pad-x);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em;
  color: var(--faint); text-transform: uppercase;
}
footer.site-footer a { color: var(--mint); text-decoration: none; }
footer.site-footer .coords { color: var(--faint); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 920px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: block; }
  .contact-band .section { grid-template-columns: 1fr; gap: 2.5rem; }
}
