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

/* Improve perceived performance: avoid FOIT for Font Awesome webfonts */
@font-face {
  font-family: "Font Awesome 6 Brands";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-brands-400.woff2") format("woff2");
}

@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-solid-900.woff2") format("woff2");
}

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --bg: #0b0f14;
  --bg-elev: #0f141b;
  --bg-footer: #0a0e13;

  --text: #e5e5e5;
  --text-muted: #b0bec5;
  --text-muted-2: #9aa7b2;
  /* Keep subtle text readable (WCAG contrast) */
  --text-subtle: #9aa7b2;

  --accent: #00ff6a;
  --accent-rgb: 0, 255, 106;
  --border: #1f2933;
  --heading: #b2ffcc;
  --nav-link: #cfd8dc;
  --logo-span: #ffffff;

  --ink: #000;
  --accent-glow: rgba(0, 255, 106, 0.6);
}

html[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-elev: #ffffff;
  --bg-footer: #f0f3f6;

  --text: #0b1220;
  --text-muted: #334155;
  --text-muted-2: #475569;
  /* Keep subtle text readable (WCAG contrast) */
  --text-subtle: #475569;

  --accent: #00b353;
  --accent-rgb: 0, 179, 83;
  --border: #d0d7de;
  --heading: #0f172a;
  --nav-link: #0f172a;
  --logo-span: #0b1220;

  --ink: #0b1220;
  --accent-glow: rgba(0, 179, 83, 0.35);
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  display: flex;
  flex-direction: column;
}

/* Selection styling + prevent accidental selection on UI chrome */
::selection {
  background: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

::-moz-selection {
  background: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

.navbar,
.nav-links,
.menu-toggle,
.logo,
.theme-toggle,
.notes-card,
.contact-card,
.terminal-card,
.back-to-top {
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
.terminal-input {
  -webkit-user-select: text;
  user-select: text;
}

/* Landing page background (stars/meteors) */
/* Home-only styles moved to css/home.css */

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.015em;
}

main {
  flex: 1 0 auto;
}

.site-footer {
  margin-top: auto;
}

/* NAVBAR */
.navbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 8%;
  border-bottom: 1px solid var(--border);
}

.nav-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
}

.logo a {
  text-decoration: none;
  color: var(--accent);
}

.logo span {
  color: var(--logo-span);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: var(--nav-link);
  font-weight: 600;       
  letter-spacing: 0.2px;
  position:relative;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* THEME TOGGLE (in navbar list) */
.nav-links .theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--nav-link);
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.25s ease, text-shadow 0.25s ease, border-color 0.25s ease;
}

/* THEME TOGGLE (next to hamburger, mobile-only) */
.theme-toggle--mobile {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--nav-link);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease, text-shadow 0.25s ease, border-color 0.25s ease;
}

.theme-toggle--mobile:hover {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
  border-color: var(--border);
}

.nav-links .theme-toggle i {
  margin-right: 0;
}

.nav-links .theme-toggle:hover {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
  border-color: var(--border);
}

/* BACK TO TOP */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2000;
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.08);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.back-to-top:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.16);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  font-size: 18px;
  transform: translateY(-1px);
}
/* ACTIVE NAV LINK */
.page-home .nav-links a[href="index.html"],
.page-home .nav-links a[href="/"],
.page-journey .nav-links a[href="journey.html"],
.page-domain .nav-links a[href="journey.html"],
.page-contact .nav-links a[href="contact.html"],
.page-about .nav-links a[href="about.html"] {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 6px var(--accent-glow);
}
/* ACTIVE UNDERLINE */
.page-home .nav-links a[href="index.html"]::after,
.page-home .nav-links a[href="/"]::after,
.page-journey .nav-links a[href="journey.html"]::after,
.page-domain .nav-links a[href="journey.html"]::after,
.page-contact .nav-links a[href="contact.html"]::after,
.page-about .nav-links a[href="about.html"]::after {
  width: 100%;
}

/* BUTTONS */
.hero-buttons {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  padding: 12px 24px;
  background: var(--accent);
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: 0.3s;
}

.btn:hover {
  box-shadow: 0 0 10px var(--accent);
}

.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.outline:hover {
  background: var(--accent);
  color: var(--ink);
}
.page {
  padding: 80px 8%;
  max-width: 900px;
}

/* Prose defaults for content pages (keeps home hero untouched) */
.page p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.page ul,
.page ol {
  margin: 10px 0 20px 22px;
}

.page ul li,
.page ol li {
  margin-bottom: 10px;
  color: var(--text-muted);
  line-height: 1.7;
}

.page h1 {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: clamp(2rem, 3vw, 2.5rem);
  line-height: 1.15;
}

.page h2,
.page h3 {
  margin-top: 30px;
  color: var(--heading);
  font-size: 1.25rem;
  line-height: 1.25;
}

.page ul {
  margin-left: 22px;
  margin-bottom: 20px;
}

/* CONTACT PAGE */
.contact-methods {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-card i {
  font-size: 20px;
  color: var(--accent);
  margin-top: 2px;
}

.contact-label {
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 4px;
}

.contact-hint {
  color: var(--text-muted-2);
  font-size: 14px;
  word-break: break-word;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.12);
}

.active {
  color: var(--accent);
}
/* MOBILE NAVBAR */
.menu-toggle {
  display: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--accent);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .theme-toggle--mobile {
    display: inline-flex;
  }

  .nav-links .nav-theme {
    display: none;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    flex-direction: column;
    width: 200px;
    display: none;
    padding: 15px;
    z-index: 1000;
  }

  /* Make each nav item a full-width tap target (mobile) */
  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 12px 12px;
    border-radius: 10px;
  }

  .nav-links a::after {
    bottom: 6px;
  }

  .nav-links a:hover {
    background: rgba(var(--accent-rgb), 0.08);
  }

  .nav-links.show {
    display: flex;
  }
}
/* FADE-IN ANIMATION */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* APPLY ANIMATION */
.page {
  animation: fadeUp 0.8s ease-out;
}

/* ICON COLOR */
i {
  color: var(--accent);
  margin-right: 8px;
}

/* HOVER GLOW (SUBTLE) */
.nav-links a:hover,
.btn:hover {
  text-shadow: 0 0 6px var(--accent-glow);
}

/* LIST HOVER */
.page ul li:hover {
  color: var(--accent);
  transition: 0.2s;
}
/* Home-only styles moved to css/home.css */
/* LEARNING JOURNEY PAGE */
.journey-container {
  padding: 80px 8% 40px;
  max-width: none;
}

.journey-title {
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  color: var(--accent);
  margin-bottom: 15px;
}

.journey-intro {
  color: var(--text-muted);
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 50px;
}

@media (min-width: 1100px) {
  .journey-intro {
    max-width: none;
    white-space: nowrap;
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  }
}

/* STACK LAYOUT */
.journey-stack {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  align-items: start;
}

@media (min-width: 900px) {
  .journey-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* NODE BASE */
.journey-node {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 25px;
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
}

.journey-node h2 {
  color: var(--heading);
  margin-bottom: 8px;
}

.journey-node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.journey-node p {
  color: var(--text-muted-2);
  line-height: 1.5;
}

/* STATUS BADGE */
.journey-node .status {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: bold;
}

@media (max-width: 520px) {
  .journey-node {
    display: flex;
    flex-direction: column;
  }

  .journey-node .status {
    position: static;
    margin-top: 12px;
    align-self: flex-start;
  }
}

/* STATUS COLORS */
.explored .status {
  background: var(--accent);
  color: var(--ink);
}

.exploring .status {
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.interest .status {
  background: var(--border);
  color: var(--text-muted-2);
}

/* INTERACTION */
.journey-node:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.18);
}

/* Reduce the gap between the Journey stack and Related Notes (desktop) */
.page-journey .page-related-notes {
  padding-top: 40px;
}
/* DOMAIN PAGE */
.domain-container {
  padding: 80px 8%;
  max-width: 900px;
  animation: fadeUp 0.8s ease-out;
}

.domain-header h1 {
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  color: var(--accent);
  margin-bottom: 15px;
}

.domain-header p {
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 750px;
}

/* DOMAIN SECTIONS */
.domain-section {
  margin-top: 50px;
}

.domain-section h2 {
  color: var(--heading);
  margin-bottom: 15px;
}

.domain-section p {
  color: var(--text-muted-2);
  line-height: 1.6;
  max-width: 800px;
}

.domain-section ul {
  margin-left: 20px;
  margin-top: 10px;
}

.domain-section ul li {
  margin-bottom: 8px;
  color: var(--text-muted);
}

/* TOOL LIST */
.tool-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.tool-list li {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 4px;
  text-align: center;
  transition: 0.3s;
}

.tool-list li:hover {
  color: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.15);
}

/* DOMAIN NAV */
.domain-nav {
  margin-top: 60px;
}

/* BREADCRUMBS */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--text-muted-2);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: rgba(var(--accent-rgb), 0.35);
}

.breadcrumbs .crumb-sep {
  color: var(--border);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
}
.about-intro {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 720px;
  margin-bottom: 40px;
}

.about-block {
  margin-bottom: 35px;
}

.about-block h2,
.about-block h2 {
  color: var(--heading);
  margin-bottom: 10px;
}

.about-block p {
  color: var(--text-muted-2);
  line-height: 1.6;
  max-width: 800px;
}

/* Blog-only styles moved to css/blog.css */

/* Small layout helpers */
.rss-line {
  margin-top: 10px;
}

.error-actions {
  margin-top: 40px;
}

/* Ad slot helpers (reserve space to reduce CLS when ads load) */
.ad-slot {
  width: 100%;
  min-height: 250px;
  margin: 24px 0;
  background: rgba(var(--accent-rgb), 0.04);
  border: 1px dashed rgba(var(--accent-rgb), 0.2);
  border-radius: 8px;
  display: none;
}

.ad-slot.is-ready {
  display: block;
}

.ad-slot--horizontal {
  min-height: 90px;
}

.ad-slot--square {
  min-height: 250px;
}

/* Remove underlines from specific UI links */
a.no-underline,
.no-underline a {
  text-decoration: none !important;
}

a.no-underline:hover,
a.no-underline:focus-visible,
.no-underline a:hover,
.no-underline a:focus-visible {
  text-decoration: none;
}

/* Underline inline/content links (but not big UI links like cards/nav). */
.page p a:not(.btn),
.page li a:not(.btn),
.page .about-intro a:not(.btn),
.page .error-lead a:not(.btn),
.page .error-sub a:not(.btn) {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(var(--accent-rgb), 0.45);
}

.page p a:not(.btn):visited,
.page li a:not(.btn):visited,
.page .about-intro a:not(.btn):visited,
.page .error-lead a:not(.btn):visited,
.page .error-sub a:not(.btn):visited {
  color: var(--text);
}

.page p a:not(.btn):hover,
.page li a:not(.btn):hover,
.page .about-intro a:not(.btn):hover,
.page .error-lead a:not(.btn):hover,
.page .error-sub a:not(.btn):hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.page p a:not(.btn):focus-visible,
.page li a:not(.btn):focus-visible,
.page .about-intro a:not(.btn):focus-visible,
.page .error-lead a:not(.btn):focus-visible,
.page .error-sub a:not(.btn):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.page ul li a {
  color: inherit;
}

.page ul li a:hover {
  color: var(--accent);
}
/* MOBILE LAYOUT FIX */
@media (max-width: 768px) {
  .page {
    max-width: 100%;
    padding: 40px 20px;
  }

  .hero-intro {
    padding: 90px 20px 50px;
  }
}
@media (max-width: 768px) {
  .about-intro {
    font-size: 19px;
    line-height: 1.7;
  }

  .about-block p,
  .page p {
    line-height: 1.7;
  }

  .about-block {
    margin-bottom: 45px;
  }
}
@media (max-width: 768px) {
  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }
}
@media (max-width: 768px) {
  .page ul {
    margin-left: 16px;
  }

  .page ul li {
    margin-bottom: 14px;
  }
}
@media (max-width: 768px) {
  .page section + section {
    margin-top: 50px;
  }
}

/* Blog-only post styles moved to css/blog.css */

/* 404 PAGE */
.error-code {
  font-size: 64px;
  color: var(--accent);
}

.error-lead {
  margin-top: 20px;
  font-size: 18px;
  color: var(--text-muted);
}

.error-sub {
  margin-top: 10px;
  color: var(--text-muted-2);
}

/* FOOTER */
.site-footer {
  margin-top: auto;
  padding: 18px 8% 18px;
  border-top: 1px solid var(--border);
  background-color: var(--bg-footer);
}

.footer-content {
  display: none;
}

.footer-section h4 {
  color: var(--accent);
  margin-bottom: 15px;
  font-size: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted-2);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-social {
  display: flex;
  gap: 20px;
  font-size: 20px;
}

.footer-social a {
  color: var(--text-muted-2);
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding-top: 0;
  border-top: 0;
  color: #00ff88;
  font-size: 13px;
}

/* Improve contrast in light theme (green on light footer can be low contrast) */
html[data-theme="light"] .footer-bottom {
  color: var(--text-muted-2);
}

.footer-bottom p {
  margin: 0;
  line-height: 1.4;
}

.footer-bottom .footer-divider {
  display: inline;
  margin: 0 8px;
  color: inherit;
}

.footer-privacy-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.footer-privacy-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.footer-privacy-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.footer-bottom .footer-sep,
.footer-bottom .footer-tagline,
.footer-last-updated {
  display: none;
}

.footer-last-updated {
  color: inherit;
}

.footer-last-updated time {
  color: inherit;
}

@media (max-width: 768px) {
  .footer-content {
    display: none;
  }

  .footer-bottom {
    border-top: 0;
    padding-top: 0;
  }

  .footer-bottom p {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .footer-bottom .footer-divider {
    display: none;
  }

  .footer-bottom .footer-sep,
  .footer-bottom .footer-tagline,
  .footer-last-updated {
    display: none;
  }
}

/* PRINT */
@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .navbar,
  .menu-toggle,
  .site-footer,
  .back-to-top {
    display: none !important;
  }

  .page {
    padding: 0 !important;
    max-width: none !important;
    animation: none !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
  }

  .notes-card,
  .journey-node,
  .tool-list li {
    break-inside: avoid;
    box-shadow: none !important;
  }
}
