/* Home-only styles extracted from css/style.css (perf: reduce unused CSS on other pages) */

/* Landing page background (stars/meteors) */
.page-home {
  position: relative;
}

/* Keep the mobile nav/menu above the hero content */
.page-home header {
  position: relative;
  z-index: 10;
}

.page-home main,
.page-home .site-footer {
  position: relative;
  z-index: 1;
}

.page-home .sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
}

.page-home .sky-stars {
  position: absolute;
  inset: -20% -20% -20% -20%;
  opacity: 0.28;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.9), transparent 40%),
    radial-gradient(1px 1px at 80px 120px, rgba(255, 255, 255, 0.75), transparent 45%),
    radial-gradient(1px 1px at 140px 70px, rgba(255, 255, 255, 0.7), transparent 45%),
    radial-gradient(1px 1px at 40px 160px, rgba(255, 255, 255, 0.55), transparent 45%),
    radial-gradient(1.5px 1.5px at 200px 90px, rgba(255, 255, 255, 0.6), transparent 50%);
  background-size: 220px 220px;
  animation: skyDrift 24s linear infinite, skyTwinkle 6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 2px rgba(var(--accent-rgb), 0.18));
}

@keyframes skyDrift {
  from { transform: translate3d(0, -6%, 0); }
  to { transform: translate3d(0, 6%, 0); }
}

@keyframes skyTwinkle {
  from { opacity: 0.22; }
  to { opacity: 0.34; }
}

.page-home .sky-meteors {
  position: absolute;
  inset: 0;
}

.page-home .meteor {
  position: absolute;
  top: -12vh;
  left: var(--x, 50vw);
  width: var(--len, 220px);
  height: var(--thickness, 2px);
  transform: rotate(135deg);
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(var(--accent-rgb), 0.85), rgba(255,255,255,0));
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.22));
  animation: meteorFall var(--dur, 2.4s) linear var(--delay, 0s) infinite;
  animation-fill-mode: both;
  will-change: transform, opacity;
}

@keyframes meteorFall {
  from { transform: translate3d(0, 0, 0) rotate(135deg); opacity: 0; }
  8% { opacity: 0.9; }
  to { transform: translate3d(calc(-1 * var(--dx, 70vh)), var(--dy, 120vh), 0) rotate(135deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .sky-stars {
    animation: none;
  }
  .page-home .meteor {
    animation: none;
    display: none;
  }
}

/* Home hero (layout + terminal) */
.hero-intro {
  padding: 120px 8% 60px;
  max-width: 900px;
}

/* HOME HERO (desktop: fill right side with visual) */
.hero-layout {
  display: block;
}

.hero-copy {
  min-width: 0;
}

/* Glassy hero panels (landing page only) */
.page-home .hero-copy {
  padding: 18px 18px;
  border-radius: 16px;
  background: rgba(15, 20, 27, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

html[data-theme="light"] .page-home .hero-copy {
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.10);
}

@media (max-width: 768px) {
  .page-home .hero-copy {
    padding: 14px 14px;
    border-radius: 14px;
  }
}

.hero-visual {
  display: none;
}

@media (min-width: 1000px) {
  .hero-intro {
    max-width: none;
  }

  .hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 720px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }

  .hero-visual {
    display: block;
    padding-top: 10px;
  }
}

.terminal-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.08);
  transform: translateY(0);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Glass treatment for terminal on landing page */
.page-home .terminal-card {
  background: rgba(15, 20, 27, 0.58);
  border-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

html[data-theme="light"] .page-home .terminal-card {
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(15, 23, 42, 0.10);
}

.terminal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.14);
}

.terminal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 20% 0%, rgba(var(--accent-rgb), 0.12), transparent 55%),
              radial-gradient(500px 220px at 90% 100%, rgba(var(--accent-rgb), 0.08), transparent 55%);
  pointer-events: none;
}

.terminal-card::after {
  content: "";
  position: absolute;
  left: -20%;
  top: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.08), transparent);
  transform: skewX(-18deg);
  animation: terminalSweep 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes terminalSweep {
  0%, 55% { transform: translateX(-30%) skewX(-18deg); opacity: 0; }
  65% { opacity: 1; }
  100% { transform: translateX(240%) skewX(-18deg); opacity: 0; }
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .terminal-head {
  background: rgba(0, 0, 0, 0.03);
}

.terminal-head .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.9;
}

.terminal-head .dot--red { background: #ff5f57; }
.terminal-head .dot--yellow { background: #febc2e; }
.terminal-head .dot--green { background: #28c840; }

.terminal-title {
  margin-left: 10px;
  font-size: 12px;
  color: var(--text-subtle);
  letter-spacing: 0.3px;
}

.terminal-body {
  position: relative;
  padding: 16px 16px 18px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: text;
}

.terminal-body .t-dim {
  color: var(--text-subtle);
}

.terminal-output {
  white-space: pre-wrap;
  min-height: 200px;
  max-height: 320px;
  overflow: auto;
  padding-right: 6px;
  cursor: text;
}

@media (min-width: 1000px) {
  .terminal-output {
    min-height: 320px;
    height: 320px;
    max-height: 320px;
  }
}

.terminal-line {
  white-space: pre-wrap;
}

.terminal-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  padding: 0;
  caret-color: var(--accent);
}

.terminal-input::placeholder {
  color: var(--text-subtle);
}

.terminal-hint {
  font-size: 12px;
}

.terminal-body .cursor {
  display: inline-block;
  width: 10px;
  margin-left: 2px;
  color: var(--accent);
  animation: blinkCursor 1s steps(1, end) infinite;
}

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

.hero-title {
  font-size: clamp(2.75rem, 6vw, 3.75rem);
  line-height: 1.05;
  font-weight: 800;
  color: var(--accent);
  animation: slideFade 0.8s ease-out forwards;
}

.hero-subtitle {
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 700px;
  animation: slideFade 1.1s ease-out forwards;
}

.hero-icons {
  display: none;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.hero-icons a {
  font-size: 20px;
  color: var(--text-muted-2);
  transition: transform 0.3s ease, color 0.3s ease;
}

.hero-icons a:hover {
  color: var(--accent);
  transform: translateY(-3px);
  text-shadow: 0 0 8px var(--accent-glow);
}

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

/* SOCIAL LINKS STRIP */
.social-strip {
  margin-top: 40px;
  padding: 0 8%;
  display: flex;
  gap: 28px;
  align-items: center;
  animation: fadeUp 1.2s ease-out;
}

.social-strip a {
  font-size: 22px;
  color: var(--text-muted-2);
  transition: transform 0.3s ease, color 0.3s ease;
}

.social-strip a:hover {
  color: var(--accent);
  transform: translateY(-4px);
  text-shadow: 0 0 8px var(--accent-glow);
}

@media (min-width: 1000px) {
  .hero-buttons {
    display: none;
  }

  .hero-icons {
    display: inline-flex;
  }

  .social-strip {
    display: none;
  }
}

/* LATEST NOTES */
.latest-notes {
  margin: 60px auto 0;
  padding: 0 8%;
  max-width: 1280px;
}

.latest-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.latest-notes-header h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  color: var(--heading);
  margin: 0;
}

.latest-notes-link {
  color: var(--text-muted-2);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid transparent;
}

.latest-notes-link:hover {
  color: var(--accent);
  border-bottom-color: rgba(var(--accent-rgb), 0.4);
}

.latest-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

@media (min-width: 1000px) {
  .latest-notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.latest-note-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.latest-note-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.12);
}

.latest-note-meta {
  display: block;
  font-size: 12px;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.latest-note-card h3 {
  font-size: 16px;
  color: var(--heading);
  margin: 0 0 8px;
  line-height: 1.35;
}

.latest-note-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted-2);
}

/* Defer below-the-fold rendering on the home page */
.latest-notes,
.social-strip,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 400px;
}
