/* ============================================================
   cpovex.com — Allen Huang personal folio (v2: dark)
   Aesthetic: Silicon photonics nocturne
     - deep warm-blue black, like an RF/optical lab at 2am
     - cyan 1550 nm optical accent  (--photon)
     - amber mmWave / thermal accent (--rf)
   Typography: Fraunces / Geist / Geist Mono
   ============================================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

:root {
  /* ---- Palette: optical bench at 2am ----------------------- */
  --bg:           #060712;
  --bg-elev:      #0b0d1a;
  --bg-card:      #0f1324;
  --bg-glow:      #131831;

  --ink:          #ebeef6;
  --ink-soft:     #b8bfcd;
  --ink-faint:    #7c8498;
  --muted:        #545a6d;
  --muted-soft:   #3a3f4f;

  --rule:         #1a1f33;
  --rule-soft:    #11142a;
  --rule-bright:  #242a44;

  /* Dual signal-domain accents */
  --photon:       #5eead4;            /* 1550 nm optical C-band */
  --photon-dim:   #2dd4bf;
  --photon-glow:  rgba(94, 234, 212, 0.32);

  --rf:           #fb923c;            /* mmWave / thermal amber */
  --rf-dim:       #f97316;
  --rf-glow:      rgba(251, 146, 60, 0.25);

  /* ---- Typography ------------------------------------------ */
  --display:      "Fraunces", "Hoefler Text", Georgia, serif;
  --body:         "Geist", -apple-system, system-ui, sans-serif;
  --mono:         "Geist Mono", "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  /* ---- Rhythm ---------------------------------------------- */
  --unit: 8px;
  --measure: 62ch;
}

/* ------------------------------------------------------------- */
/*  Body & atmosphere                                            */
/* ------------------------------------------------------------- */

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(1400px circle at 10% -10%, rgba(94, 234, 212, 0.07), transparent 50%),
    radial-gradient(1200px circle at 96% 104%, rgba(251, 146, 60, 0.055), transparent 52%),
    radial-gradient(900px  circle at 68% 28%, rgba(94, 234, 212, 0.035), transparent 60%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: 0;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Anechoic-chamber grid — faint square lattice over most of the view */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(94, 234, 212, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 35%, transparent 92%);
          mask-image: radial-gradient(ellipse at 50% 30%, #000 35%, transparent 92%);
  z-index: 1;
}

/* Faint white-noise grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.95  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: screen;
  opacity: 0.8;
  z-index: 50;
}

/* ------------------------------------------------------------- */
/*  Margin ruler — fixed left rail                                */
/* ------------------------------------------------------------- */

.ruler {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 68px;
  padding: 40px 0 40px 20px;
  border-right: 1px solid var(--rule);
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    rgba(19, 24, 49, 0.45) 32%,
    rgba(19, 24, 49, 0.45) 68%,
    var(--bg) 100%
  );
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 40;
  text-transform: uppercase;
}

.ruler-cap,
.ruler-foot {
  display: block;
  color: var(--photon);
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  font-weight: 400;
  font-variation-settings: "opsz" 14;
  padding-left: 2px;
  text-shadow:
    0 0 18px var(--photon-glow),
    0 0 6px var(--photon-glow);
}
.ruler-foot {
  margin-top: auto;
  color: var(--ink-faint);
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  text-shadow: none;
}

.ruler ol {
  list-style: none;
  margin: 26px 0 0;
  padding: 0 0 40px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ruler li {
  position: relative;
  padding-left: 18px;
}

.ruler li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 1px;
  background: var(--rule-bright);
}
.ruler li:nth-child(odd)::before {
  width: 16px;
  background: var(--muted);
}

/* Slow cyan scan line sweeping top-to-bottom, like an s-parameter sweep */
.ruler::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--photon) 0%, transparent 72%);
  box-shadow: 0 0 14px var(--photon-glow);
  animation: scan 14s linear infinite;
  opacity: 0;
}

@keyframes scan {
  0%   { top: 6%;  opacity: 0; }
  8%   { opacity: 0.85; }
  92%  { opacity: 0.85; }
  100% { top: 94%; opacity: 0; }
}

/* ------------------------------------------------------------- */
/*  Page container                                               */
/* ------------------------------------------------------------- */

.page {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 96px 120px 156px;
  z-index: 2;
}

/* Right-edge vertical watermark */
.page::after {
  content: "CPOVEX · VOL. I · MMXXVI · A. HUANG · RF ⊕ PHOTONICS";
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  z-index: 30;
  pointer-events: none;
}

/* ------------------------------------------------------------- */
/*  Topbar                                                       */
/* ------------------------------------------------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 120px;
  animation: fadeUp 1s 0.05s both ease-out;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.brand-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  color: var(--photon);
  filter: drop-shadow(0 0 8px var(--photon-glow));
}
.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-text strong {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.22em;
}
.brand-text em {
  color: var(--photon);
  font-style: normal;
}

.topbar-nav {
  display: flex;
  gap: 32px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.topbar-nav a {
  color: var(--ink-faint);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.22s, border-color 0.22s, text-shadow 0.22s;
}
.topbar-nav a:hover {
  color: var(--photon);
  border-bottom-color: var(--photon);
  text-shadow: 0 0 12px var(--photon-glow);
}

/* ------------------------------------------------------------- */
/*  Hero / title page                                            */
/* ------------------------------------------------------------- */

.hero {
  padding-bottom: 160px;
  position: relative;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--photon);
  margin: 0 0 28px;
  text-shadow: 0 0 12px var(--photon-glow);
  animation: fadeUp 1s 0.2s both ease-out;
}
.eyebrow-rule {
  display: inline-block;
  width: 42px;
  height: 1px;
  background: var(--photon);
  box-shadow: 0 0 10px var(--photon-glow);
}

.name {
  font-family: var(--display);
  font-weight: 380;
  font-size: clamp(72px, 14.5vw, 220px);
  line-height: 0.86;
  letter-spacing: -0.025em;
  margin: 0 0 48px;
  font-variation-settings: "opsz" 144;
  color: var(--ink);
  animation: fadeUp 1.3s 0.35s both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.name .first { display: block; }

.name .last {
  display: block;
  padding-left: 0.42em;
  position: relative;
}

.name .last em {
  font-style: italic;
  font-variation-settings: "opsz" 144;
  color: var(--photon);
  letter-spacing: -0.015em;
  text-shadow:
    0 0 38px rgba(94, 234, 212, 0.38),
    0 0 88px rgba(94, 234, 212, 0.18);
}

.name .last .period {
  color: var(--rf);
  font-style: normal;
  font-variation-settings: "opsz" 144;
  padding-left: 0.04em;
  text-shadow: 0 0 32px var(--rf-glow);
}

.lede {
  font-family: var(--display);
  font-weight: 380;
  font-style: italic;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.42;
  letter-spacing: -0.005em;
  color: var(--ink-soft);
  max-width: 28ch;
  margin: 0 0 72px;
  font-variation-settings: "opsz" 48;
  animation: fadeUp 1.3s 0.55s both ease-out;
}

.lede mark {
  background: none;
  color: var(--ink);
  position: relative;
  white-space: nowrap;
}
.lede mark::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0.08em;
  height: 0.26em;
  background: var(--photon);
  opacity: 0.26;
  z-index: -1;
  transform: skewX(-6deg);
  filter: blur(0.5px);
}

/* Metadata strip */
.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  max-width: 760px;
  position: relative;
  animation: fadeUp 1.2s 0.8s both ease-out;
}

/* Glowing cyan corner ticks along the meta strip, like a viewfinder */
.hero-meta::before,
.hero-meta::after {
  content: "";
  position: absolute;
  left: 0;
  width: 64px;
  height: 1px;
  background: var(--photon);
  box-shadow: 0 0 10px var(--photon-glow);
}
.hero-meta::before { top: -1px; }
.hero-meta::after  { bottom: -1px; }

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.meta-value {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
  transition: opacity 0.35s ease;
}

.meta-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

/* The live-cycling carrier gets the photon treatment */
#lambda {
  color: var(--photon);
  text-shadow: 0 0 22px var(--photon-glow);
}

/* ------------------------------------------------------------- */
/*  Section blocks                                               */
/* ------------------------------------------------------------- */

.block {
  padding: 100px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  position: relative;
}

/* Laser-beam tick at the start of each block */
.block::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 84px;
  height: 1px;
  background: linear-gradient(90deg, var(--photon), transparent);
  box-shadow: 0 0 12px var(--photon-glow);
}

.block-head {
  position: sticky;
  top: 40px;
  align-self: start;
}

.section-mark {
  font-family: var(--display);
  font-weight: 380;
  font-style: italic;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--photon);
  margin: 0 0 14px;
  font-variation-settings: "opsz" 48;
  text-shadow: 0 0 22px var(--photon-glow);
}

.section-dek {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  line-height: 1.6;
  margin: 0;
  max-width: 22ch;
  text-transform: uppercase;
}

/* ---- Currently list ---------------------------------------- */

.threads-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.threads-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 22px;
  padding: 30px 0;
  border-bottom: 1px dashed var(--rule-bright);
}
.threads-list li:first-child { padding-top: 6px; }
.threads-list li:last-child  { border-bottom: none; }

.threads-list .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--rf);
  letter-spacing: 0.08em;
  padding-top: 8px;
  text-shadow: 0 0 14px var(--rf-glow);
}

.threads-list h3 {
  font-family: var(--display);
  font-weight: 420;
  font-size: 26px;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
}

.threads-list p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 56ch;
  font-size: 15.5px;
  line-height: 1.68;
}

.threads-list code {
  font-family: var(--mono);
  font-size: 13px;
  padding: 1px 6px;
  background: var(--bg-card);
  border: 1px solid var(--rule-bright);
  border-radius: 3px;
  color: var(--photon);
}

/* ---- Stub cards -------------------------------------------- */

.stub {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: var(--measure);
}

.stub-card {
  padding: 30px 34px;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-elev));
  border: 1px solid var(--rule-bright);
  border-radius: 3px;
  position: relative;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 20px 42px -28px rgba(0, 0, 0, 0.9);
}
.stub-card:hover {
  transform: translateY(-2px);
  border-color: var(--photon-dim);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 22px 52px -22px rgba(0, 0, 0, 0.95),
    0 0 30px rgba(94, 234, 212, 0.09);
}

.stub-card::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 2px;
  background: var(--photon);
  opacity: 0.6;
  box-shadow: 0 0 12px var(--photon-glow);
}

.stub-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--photon);
  margin-bottom: 14px;
  padding: 4px 10px;
  border: 1px solid var(--photon-dim);
  border-radius: 2px;
  background: rgba(94, 234, 212, 0.06);
}

.stub-card h3 {
  font-family: var(--display);
  font-weight: 420;
  font-size: 24px;
  line-height: 1.24;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
}

.stub-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.66;
  max-width: 56ch;
}

/* ---- Reach list -------------------------------------------- */

.reach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.reach-list li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 30px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.reach-list li:first-child { padding-top: 0; }

.reach-key {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.reach-val {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 48;
  position: relative;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.reach-val em {
  font-style: italic;
  color: var(--ink-faint);
  font-weight: 380;
}
.reach-val::after {
  content: "→";
  display: inline-block;
  margin-left: 14px;
  color: var(--photon);
  font-family: var(--mono);
  transform: translateX(0);
  transition: transform 0.25s ease;
}
.reach-val:hover {
  color: var(--photon);
  text-shadow: 0 0 22px var(--photon-glow);
}
.reach-val:hover::after {
  transform: translateX(6px);
}

/* ------------------------------------------------------------- */
/*  Colophon                                                     */
/* ------------------------------------------------------------- */

.colophon {
  margin-top: 140px;
  padding-top: 56px;
  position: relative;
}

.colo-rule {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--rule) 0%,
    var(--rule) 45%,
    transparent 45%,
    transparent 55%,
    var(--rule) 55%,
    var(--rule) 100%
  );
}
.colo-rule::before {
  content: "◆";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 14px;
  color: var(--photon);
  font-size: 10px;
  text-shadow: 0 0 14px var(--photon-glow);
}

.colo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
}

.colo-grid p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 32ch;
}

.colo-grid em {
  font-family: var(--display);
  font-style: italic;
  color: var(--ink);
  font-variation-settings: "opsz" 14;
}

.colo-grid code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--photon);
}

.colo-label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

/* ------------------------------------------------------------- */
/*  Entrance animation                                           */
/* ------------------------------------------------------------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------- */
/*  Responsive                                                   */
/* ------------------------------------------------------------- */

@media (max-width: 960px) {
  .page {
    padding: 56px 40px 80px 72px;
  }
  .block {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .block-head {
    position: static;
  }
  .topbar {
    margin-bottom: 72px;
  }
  .hero {
    padding-bottom: 96px;
  }
  .name {
    font-size: clamp(64px, 16vw, 120px);
  }
  .lede {
    max-width: 32ch;
  }
  .hero-meta {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .colo-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .page::after {
    display: none;
  }
}

@media (max-width: 640px) {
  :root { --unit: 6px; }
  body { font-size: 15.5px; }
  .ruler {
    width: 48px;
    padding: 20px 0 20px 12px;
  }
  .ruler-cap,
  .ruler-foot { font-size: 14px; }
  .ruler ol { font-size: 8.5px; }
  .page {
    padding: 40px 24px 64px 60px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 60px;
  }
  .topbar-nav { gap: 22px; }
  .name {
    font-size: clamp(56px, 18vw, 96px);
    margin-bottom: 36px;
  }
  .lede {
    font-size: 19px;
    max-width: 100%;
    margin-bottom: 48px;
  }
  .hero-meta {
    grid-template-columns: 1fr;
    padding: 22px 0;
    gap: 22px;
  }
  .block { padding: 72px 0; }
  .threads-list li {
    grid-template-columns: 42px 1fr;
    gap: 14px;
  }
  .threads-list h3 { font-size: 22px; }
  .stub-card { padding: 24px 24px 24px 26px; }
  .reach-list li {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px 0;
  }
  .reach-val { font-size: 20px; }
  .colophon { margin-top: 80px; }
}

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

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