/* ============================================================
   HGN.ca — styles
   Pure CSS. No frameworks, no build step.
   ============================================================ */

:root {
  --bg: #07090f;
  --bg-raise: #0d111c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8ecf4;
  --text-dim: #9aa3b5;
  --text-faint: #5d6679;
  --accent: #5eead4;          /* teal */
  --accent-2: #818cf8;        /* indigo */
  --accent-3: #f0abfc;        /* orchid */
  --maple: #ff5d5d;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1100px;
  --radius: 18px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

::selection { background: rgba(94, 234, 212, 0.25); }

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 100;
  background: var(--accent);
  color: #04221c;
  padding: 0.5rem 1rem;
  border-radius: 0 0 10px 10px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ---------- animated backdrop ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}
.orb-1 {
  width: 55vw; height: 55vw;
  top: -20vw; left: -12vw;
  background: radial-gradient(circle, #134e4a 0%, transparent 65%);
  animation: drift-1 26s ease-in-out infinite alternate;
}
.orb-2 {
  width: 45vw; height: 45vw;
  top: 10vh; right: -15vw;
  background: radial-gradient(circle, #312e81 0%, transparent 65%);
  animation: drift-2 32s ease-in-out infinite alternate;
}
.orb-3 {
  width: 38vw; height: 38vw;
  bottom: -18vw; left: 28vw;
  background: radial-gradient(circle, #4a1d4e 0%, transparent 65%);
  animation: drift-3 38s ease-in-out infinite alternate;
}

@keyframes drift-1 { to { transform: translate(8vw, 6vh) scale(1.12); } }
@keyframes drift-2 { to { transform: translate(-6vw, 10vh) scale(0.92); } }
@keyframes drift-3 { to { transform: translate(-10vw, -6vh) scale(1.08); } }

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 30%, transparent 75%);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb, .pulse-dot::after, .cursor { animation: none !important; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 9, 15, 0.65);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
}
.brand-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand-tld { color: var(--maple); }

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
}
.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(5rem, 14vh, 9.5rem) clamp(4rem, 10vh, 7rem);
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
}

.pulse-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  0%   { transform: scale(0.6); opacity: 0.9; }
  80%, 100% { transform: scale(2); opacity: 0; }
}

.hero-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.9rem, 8.5vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-top: 2rem;
  text-wrap: balance;
}

.hero-gradient {
  font-weight: 600;
  background: linear-gradient(100deg, var(--accent) 5%, var(--accent-2) 50%, var(--accent-3) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 38rem;
  margin: 1.75rem auto 0;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-dim);
  text-wrap: pretty;
}
.hero-sub em {
  color: var(--text);
  font-style: normal;
  border-bottom: 2px solid var(--accent);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 6vw, 4.5rem);
  margin-top: 3.5rem;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1.1;
  background: linear-gradient(180deg, var(--text) 30%, var(--text-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero-fade {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 6rem;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

/* ---------- shared section bits ---------- */
section { padding-block: clamp(4rem, 10vh, 7.5rem); }

.kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 em { font-style: italic; color: var(--accent); }

/* ---------- story ---------- */
.story {
  background: var(--bg-raise);
  border-block: 1px solid var(--line);
}

.story-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.story-text p {
  margin-top: 1.25rem;
  color: var(--text-dim);
}
.story-text p:first-of-type { margin-top: 1.5rem; }
.story-text strong { color: var(--text); font-weight: 600; }

/* terminal card */
.story-card { perspective: 1200px; }

.terminal {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #0a0e16;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(94, 234, 212, 0.06),
    0 0 80px rgba(94, 234, 212, 0.05);
  overflow: hidden;
  transform: rotateY(-4deg) rotateX(2deg);
  transition: transform 0.45s ease;
}
.story-card:hover .terminal { transform: rotateY(0) rotateX(0); }

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.t-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #3a4153;
}
.t-dot:nth-child(1) { background: #ff5f57; }
.t-dot:nth-child(2) { background: #febc2e; }
.t-dot:nth-child(3) { background: #28c840; }
.terminal-title {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.terminal-body {
  padding: 1.4rem 1.5rem 1.6rem;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.4vw, 0.9rem);
  line-height: 1.8;
  color: #8be9d2;
  overflow-x: auto;
}
.terminal-body code { font-family: inherit; }

.cursor {
  animation: blink 1.1s steps(1) infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- timeline ---------- */
.timeline-list {
  list-style: none;
  margin-top: 3rem;
  position: relative;
  padding-left: 0;
}
.timeline-list::before {
  content: "";
  position: absolute;
  left: 7.4rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(var(--accent), var(--accent-2), transparent);
  opacity: 0.45;
}

.tl-item {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 2.8rem;
  position: relative;
  padding-block: 1.4rem;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 7.4rem;
  top: 2.05rem;
  width: 11px; height: 11px;
  transform: translateX(-5px);
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.5);
}

.tl-year {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-align: right;
  padding-top: 0.35rem;
  white-space: nowrap;
}

.tl-body h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}
.tl-body p {
  color: var(--text-dim);
  max-width: 36rem;
}

/* ---------- why ---------- */
.why {
  background: var(--bg-raise);
  border-block: 1px solid var(--line);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 3rem;
}

.why-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 2rem 1.8rem;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.why-card:hover {
  transform: translateY(-5px);
  border-color: rgba(94, 234, 212, 0.35);
  background: var(--surface-strong);
}

.why-icon {
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  border-radius: 12px;
  margin-bottom: 1.4rem;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.09);
  border: 1px solid rgba(94, 234, 212, 0.22);
}
.why-icon svg { width: 1.5rem; height: 1.5rem; }

.why-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.55rem;
}
.why-card p {
  font-size: 0.97rem;
  color: var(--text-dim);
}
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  white-space: nowrap;
}

/* ---------- outro ---------- */
.outro {
  text-align: center;
  padding-block: clamp(5rem, 14vh, 9rem);
}
.outro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.outro-mark {
  width: 3.2rem;
  height: 3.2rem;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 1.8rem;
}
.outro-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 300;
}
.outro-sub {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text-faint);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.footer-quiet { color: var(--text-faint); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .story-grid { grid-template-columns: 1fr; }
  .terminal { transform: none; }
  .why-grid { grid-template-columns: 1fr; }

  .timeline-list::before { left: 0.45rem; }
  .tl-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding-left: 2.2rem;
  }
  .tl-item::before { left: 0.45rem; top: 0.55rem; }
  .tl-year { text-align: left; padding-top: 0; }
}

@media (max-width: 520px) {
  .site-nav { display: none; }
  .hero-stats { gap: 2rem; }
}
