/* ============================================
   PRESS START 2P - Self-hosted pixel font
   ============================================ */
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/PressStart2P-Regular.woff2') format('woff2');
}

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
  /* Dark zone colors */
  --dark-bg: #0d0d0d;
  --green-primary: #00ff41;
  --green-muted: #00cc33;
  --green-bright: #33ff99;
  --dark-dim: #4a4a4a;
  --grey-light: #707070;

  /* Light zone colors */
  --light-bg: #f2f0eb;
  --light-text: #1a1a1a;
  --light-border: #c0c0c0;
  --link-blue: #0000ee;
  --link-visited: #551a8b;
  --win-title: #000080;
  --win-title-text: #ffffff;

  /* Typography */
  --font-pixel: 'Press Start 2P', monospace;
  --body-size: 10px;
  --line-height: 2.0;
  --max-width: 900px;

  /* Spacing */
  --section-padding: 4rem 1.5rem;
  --container-padding: 0 1.5rem;
}

/* ============================================
   RESET / BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-pixel);
  font-size: var(--body-size);
  line-height: var(--line-height);
  color: var(--light-text);
  background-color: var(--light-bg);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  /* Pixel fonts should NOT be anti-aliased */
  text-rendering: optimizeSpeed;
}

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

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

a:visited {
  color: var(--link-visited);
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

/* ============================================
   LAYOUT - Container utility
   ============================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

.section-padding {
  padding: var(--section-padding);
}

/* ============================================
   DARK ZONE - Header, Hero, Contact, Footer
   ============================================ */
.dark-zone {
  background-color: var(--dark-bg);
  color: var(--green-primary);
  position: relative;
}

/* CRT scanline overlay for dark zones */
.dark-zone::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
}

.dark-zone .container {
  position: relative;
  z-index: 2;
}

/* ============================================
   LIGHT ZONE - Content sections
   ============================================ */
.light-zone {
  background-color: var(--light-bg);
  color: var(--light-text);
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--green-primary);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-logo {
  font-size: 12px;
  color: var(--green-primary);
  text-decoration: none;
  letter-spacing: 1px;
}

.site-logo:visited {
  color: var(--green-primary);
}

.site-logo:hover {
  color: var(--green-bright);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--green-muted);
  font-size: 9px;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:visited {
  color: var(--green-muted);
}

.nav-links a::before {
  content: '> ';
  color: var(--dark-dim);
}

.nav-links a:hover {
  color: var(--green-primary);
  text-decoration: none;
}

/* Pixel hamburger menu button - three stacked squares */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 4px;
  background-color: var(--green-primary);
}

/* CRT mode toggle in nav */
.crt-toggle {
  background: none;
  border: 2px solid var(--dark-dim);
  color: var(--dark-dim);
  font-family: var(--font-pixel);
  font-size: 7px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s, border-color 0.15s;
}

.crt-toggle:hover {
  color: var(--green-primary);
  border-color: var(--green-primary);
}

.crt-toggle.active {
  color: var(--green-primary);
  border-color: var(--green-primary);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: 4rem 1.5rem 3rem;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.hero .container {
  width: 100%;
}

/* ASCII art name block */
.ascii-art {
  color: var(--green-primary);
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1.4;
  margin-bottom: 2rem;
  overflow-x: auto;
  white-space: pre;
}

.hero-title {
  font-size: 12px;
  color: var(--green-primary);
  margin-bottom: 0.5rem;
  line-height: 2.2;
}

.hero-title::before {
  content: '> ';
  color: var(--dark-dim);
}

/* Blinking cursor after hero text */
.blink-cursor::after {
  content: '_';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-subtitle {
  font-size: 9px;
  color: var(--green-muted);
  margin-top: 1.5rem;
  line-height: 2.4;
  max-width: 700px;
}

.hero-description {
  font-size: var(--body-size);
  color: var(--grey-light);
  margin-top: 2rem;
  line-height: 2.2;
  max-width: 650px;
}

.hero-links {
  margin-top: 2.5rem;
}

.hero-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.hero-link-prompt {
  color: var(--dark-dim);
  font-size: var(--body-size);
  white-space: nowrap;
}

.hero-link-url {
  color: var(--link-blue);
  font-size: var(--body-size);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.hero-link-url:hover {
  border-bottom-color: var(--green-primary);
  text-decoration: none;
}

.hero-content {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  margin-top: 2rem;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-image {
  flex-shrink: 0;
}

.hero-text .hero-image {
  display: none;
}

.profile-avatar {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--green-primary);
  box-shadow: 0 4px 12px rgba(0, 255, 65, 0.3);
}

/* Pixel divider between zones */
.zone-divider {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--green-primary) 0px,
    var(--green-primary) 4px,
    transparent 4px,
    transparent 8px
  );
}

/* ============================================
   RETRO WINDOW CHROME COMPONENT
   Reusable container styled like Win95 window
   ============================================ */
.retro-window {
  border: 3px solid var(--light-border);
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #808080,
    2px 2px 0 #808080;
  margin-bottom: 2rem;
  background: var(--light-bg);
}

.retro-window__titlebar {
  background-color: var(--win-title);
  color: var(--win-title-text);
  font-size: 9px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.retro-window__title {
  letter-spacing: 1px;
}

/* Decorative window buttons (purely visual) */
.retro-window__buttons {
  display: flex;
  gap: 4px;
}

.retro-window__btn {
  width: 12px;
  height: 12px;
  border: 1px solid var(--light-border);
  background: var(--light-border);
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  line-height: 1;
}

.retro-window__body {
  padding: 1.5rem;
  font-size: var(--body-size);
  line-height: var(--line-height);
}

.retro-window__body p {
  margin-bottom: 1.2rem;
}

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

.retro-window__body ul {
  margin-bottom: 1.2rem;
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
  font-size: 14px;
  margin-bottom: 2rem;
  letter-spacing: 1px;
}

.light-zone .section-title {
  color: var(--light-text);
}

/* ============================================
   PRINCIPLES LIST
   ============================================ */
.principles-list li {
  margin-bottom: 1rem;
  padding-left: 1.5em;
  position: relative;
}

.principles-list li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--green-muted);
  font-weight: bold;
}

/* ============================================
   ARTICLES / DIRECTORY LISTING
   ============================================ */
.dir-listing {
  font-size: 9px;
  width: 100%;
  border-collapse: collapse;
}

.dir-listing caption {
  text-align: left;
  font-size: 10px;
  margin-bottom: 1rem;
  color: var(--light-text);
}

.dir-listing tr {
  border-bottom: 1px dashed var(--light-border);
}

.dir-listing td {
  padding: 0.8rem 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}

.dir-listing td:first-child {
  color: var(--dark-dim);
  width: 100px;
}

.dir-listing td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dir-listing td:last-child {
  color: var(--dark-dim);
  text-align: right;
  width: 60px;
}

.dir-listing a {
  color: var(--link-blue);
}

.dir-listing a:hover {
  text-decoration: underline;
}

/* ============================================
   EARLY-CAREER / OUTREACH LIST
   ============================================ */
.outreach-list li {
  margin-bottom: 0.8rem;
  padding-left: 1.5em;
  position: relative;
}

.outreach-list li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--green-muted);
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
  padding: 3rem 1.5rem;
}

.email-reveal {
  background: none;
  border: 2px solid var(--green-primary);
  color: var(--green-primary);
  font-family: var(--font-pixel);
  font-size: 9px;
  cursor: pointer;
  padding: 6px 12px;
  margin-top: 1rem;
  display: inline-block;
  transition: background-color 0.15s;
}

.email-reveal:hover {
  background-color: rgba(0, 255, 65, 0.1);
}

.email-obfuscated {
  font-size: 12px;
  letter-spacing: 2px;
  margin: 1rem 0;
}

.contact-note {
  color: var(--grey-light);
  font-size: 9px;
  margin-top: 1.5rem;
  line-height: 2.2;
  font-style: italic;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 2rem 1.5rem;
  border-top: 2px solid var(--dark-dim);
  font-size: 8px;
  color: var(--dark-dim);
}

.site-footer .container {
  text-align: center;
}

.footer-line {
  color: var(--grey-light);
  margin-bottom: 0.5rem;
  line-height: 2.2;
}

.footer-line::before {
  content: '> ';
}

.visitor-counter {
  margin-top: 1.5rem;
  color: var(--green-muted);
  font-size: 8px;
}

/* ============================================
   ARTICLE PAGE STYLES
   ============================================ */
.article-hero {
  padding: 3rem 1.5rem 2rem;
  text-align: left;
}

.article-hero .article-title {
  font-size: 14px;
  color: var(--green-primary);
  line-height: 2.2;
  margin-bottom: 1rem;
}

.article-hero .article-meta {
  font-size: 8px;
  color: var(--dark-dim);
}

.article-body {
  padding: 2rem 1.5rem 4rem;
}

.article-body h2 {
  font-size: 12px;
  margin: 2.5rem 0 1.5rem;
  color: var(--light-text);
}

.article-body h3 {
  font-size: 10px;
  margin: 2rem 0 1rem;
  color: var(--light-text);
}

.article-body p {
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 2em;
}

.article-body li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5em;
}

.article-body li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--green-muted);
}

.article-body blockquote {
  border-left: 4px solid var(--green-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--dark-dim);
  background: rgba(0, 255, 65, 0.03);
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 9px;
  color: var(--green-primary);
}

.back-link:visited {
  color: var(--green-primary);
}

.back-link::before {
  content: '> ';
  color: var(--dark-dim);
}

/* ============================================
   CRT MODE - Full dark override
   Toggled via .crt-mode class on <body>
   ============================================ */
body.crt-mode {
  background-color: var(--dark-bg);
  color: var(--green-primary);
}

body.crt-mode .light-zone {
  background-color: var(--dark-bg);
  color: var(--green-primary);
}

/* Scanlines on entire page in CRT mode */
body.crt-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
}

body.crt-mode .light-zone .section-title {
  color: var(--green-primary);
}

body.crt-mode .retro-window {
  border-color: var(--green-muted);
  background: var(--dark-bg);
  box-shadow:
    inset 1px 1px 0 var(--green-muted),
    inset -1px -1px 0 #003300,
    2px 2px 0 #003300;
}

body.crt-mode .retro-window__titlebar {
  background-color: #003300;
  color: var(--green-primary);
}

body.crt-mode .retro-window__btn {
  border-color: var(--green-muted);
  background: #003300;
  color: var(--green-primary);
}

body.crt-mode .retro-window__body {
  color: var(--green-primary);
}

body.crt-mode .article-body h2,
body.crt-mode .article-body h3 {
  color: var(--green-bright);
}

body.crt-mode .article-body blockquote {
  color: var(--green-muted);
  background: rgba(0, 255, 65, 0.05);
  border-left-color: var(--green-muted);
}

body.crt-mode a {
  color: var(--green-bright);
}

body.crt-mode a:visited {
  color: var(--green-muted);
}

body.crt-mode .hero-link-url {
  color: var(--green-primary);
}

body.crt-mode .hero-link-url:hover {
  border-bottom-color: var(--green-primary);
}

body.crt-mode .dir-listing td:first-child,
body.crt-mode .dir-listing td:last-child {
  color: var(--green-muted);
}

body.crt-mode .dir-listing a {
  color: var(--green-bright);
}

body.crt-mode .dir-listing tr {
  border-color: #003300;
}

body.crt-mode .contact-note {
  color: var(--grey-light);
}

body.crt-mode .site-footer {
  border-top-color: #003300;
  color: var(--green-muted);
}

body.crt-mode .footer-line {
  color: var(--grey-light);
}

body.crt-mode .zone-divider {
  background: repeating-linear-gradient(
    90deg,
    var(--green-muted) 0px,
    var(--green-muted) 4px,
    transparent 4px,
    transparent 8px
  );
}

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

/* Tablet and below */
@media (max-width: 768px) {
  :root {
    --section-padding: 3rem 1rem;
    --container-padding: 0 1rem;
  }

  .ascii-art {
    font-size: 5px;
  }

  .hero {
    min-height: auto;
    padding: 3rem 1rem 2rem;
  }

  .hero-content {
    display: block;
  }

  .hero-image {
    display: none;
  }

  .hero-text .hero-image {
    display: block;
    text-align: center;
    margin: 2rem auto 1rem;
  }

  .profile-avatar {
    width: 140px;
    height: 140px;
  }

  .hero-title {
    font-size: 10px;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--dark-bg);
    padding: 1rem;
    border-bottom: 2px solid var(--green-primary);
    gap: 1rem;
    z-index: 99;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .dir-listing {
    font-size: 7px;
  }

  .dir-listing td:first-child {
    display: none;
  }

  .email-obfuscated {
    font-size: 9px;
  }

  .retro-window__body {
    padding: 1rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  :root {
    --body-size: 8px;
  }

  .ascii-art {
    font-size: 3.5px;
  }

  .hero-title {
    font-size: 9px;
  }

  .hero-subtitle {
    font-size: 8px;
  }

  .hero-text .hero-image {
    display: block;
    text-align: center;
    margin: 1.5rem 0 1rem;
  }

  .profile-avatar {
    width: 120px;
    height: 120px;
  }

  .section-title {
    font-size: 11px;
  }

  .site-logo {
    font-size: 9px;
  }

  .retro-window__titlebar {
    font-size: 7px;
  }
}
