:root { --green:#00ff00; --bg:#000; --glow: rgba(0,255,0,0.7); }
html, body { height:100%; }
body {
  margin:0;
  background:var(--bg);
  color:var(--green);
  font-family:"Courier New", Courier, monospace;
  font-size:1.05rem;
  padding:22px;        /* subtle “terminal” framing */
}

/* ===== Boot screen ===== */
#boot-screen {
  position:fixed;
  inset:0;
  background:#000;
  color:#7cff7c;
  z-index:5;
  padding:18px;
  box-sizing:border-box;
  display:flex;
}
#boot-view {
  height:100%;
  border:1px solid #0a0;
  padding:12px;
  overflow:hidden; /* we’ll autoscroll inside */
  position:relative;
  flex:1;
}
#boot-log {
  margin:0;
  white-space:pre-wrap;
  line-height:1.35;
  user-select:none;
  font-size:0.98rem;
}

/* subtle scanlines */
#boot-view::after {
  content:"";
  position:absolute;
  inset:0;
  background:repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.07) 3px
  );
  pointer-events:none;
}

/* ===== Home ===== */
#home {
  display:none;          /* revealed after boot */
  position:relative;
  z-index:2;
  margin:0 auto;
  width:min(750px, 92vw);
  padding:40px 20px 80px;
  text-align:center;
  animation:fadeInHome 600ms ease forwards;
}
@keyframes fadeInHome {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}
.home-header h1 {
  margin:0;
  font-size:2.2rem;
  color:var(--green);
  text-shadow:0 0 5px var(--glow);
}
.subtitle {
  margin-top:6px;
  font-size:1rem;
  color:#a5ffa5;
  letter-spacing:0.4px;
}
.intro {
  margin-top:20px;
  margin-bottom:30px;
  color:#e0e0e0;
  line-height:1.6;
}
.home-actions {
  display:flex;
  gap:12px;
  justify-content:center;
  flex-wrap:wrap;
}
.btn {
  padding:10px 20px;
  background:var(--green);
  color:#000;
  font-weight:700;
  font-size:1rem;
  border:none;
  text-decoration:none;
  border-radius:3px;
  transition:transform .15s ease, filter .15s ease;
}
.btn:hover { transform:translateY(-2px); filter:brightness(.9); }
.btn.secondary {
  background:#002900;
  color:#9aff9a;
  border:1px solid #0a0;
}
.btn.secondary:hover { background:#004400; }

/* ===== About Page ===== */
#about {
  display: none;              /* revealed via router */
  position: relative;
  z-index: 2;
  margin: 0 auto;
  width: min(950px, 92vw);
  padding: 40px 20px 80px;
  animation: fadeInHome 500ms ease forwards;
}

.about-header h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--green);
  text-align: center;
  text-shadow: 0 0 5px var(--glow);
}
#about .subtitle {
  margin-top: 6px;
  font-size: 1rem;
  color: #a5ffa5;
  text-align: center;
}

/* Layout */
.about-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 24px;
}
@media (max-width: 720px) {
  .about-body { grid-template-columns: 1fr; }
}

/* About photo container */
.about-photo {
  width: 140px;                /* set size of the circle */
  height: 140px;
  border-radius: 50%;          /* make it circular */
  overflow: hidden;            /* hide overflowing image edges */
  border: 2px solid #0a0;      /* optional green border */
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.3); /* optional glow */
  margin-bottom: 16px;         /* add spacing below the image */
}

/* Force the image to fit the circle properly */
.about-photo img {
  width: 100%;                 /* fill container */
  height: 100%;                /* fill container */
  object-fit: cover;           /* zoom + crop evenly without distortion */
  display: block;              /* remove unwanted gaps */
}


/* Text content */
.about-content .lead {
  color: #e6e6e6;
  line-height: 1.6;
  margin-top: 4px;
  margin-bottom: 18px;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 14px 0 20px;
}
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
}
#about h2 {
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: #8cff8c;
}
#about ul {
  margin: 0;
  padding-left: 18px;
  color: #d6d6d6;
  line-height: 1.6;
}

/* Tag list */
.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  border: 1px solid #0a0;
  color: #a5ffa5;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.92rem;
}

/* Now / CTA */
.about-now p { color: #e0e0e0; }
.about-cta { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Improve bio text readability */
#about .about-content p {
  color: #e0e0e0;
  line-height: 1.7;
  margin-bottom: 18px;
  font-size: 1.02rem;
  max-width: 65ch;
}

/* Highlight strong and emphasized text */
#about .about-content strong {
  color: #9aff9a;
}
#about .about-content em {
  color: #a0ffa0;
  font-style: italic;
}

/* Better spacing for lead paragraph */
#about .lead {
  font-size: 1.1rem;
  color: #f0fff0;
  margin-top: 0;
}

/* ===== Contact Page ===== */
#contact {
  display: none;
  position: relative;
  z-index: 2;
  margin: 0 auto;
  width: min(950px, 92vw);
  padding: 40px 20px 80px;
  animation: fadeInHome 500ms ease forwards;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 20px;
}
@media (max-width: 820px) {
  .contact-cards { grid-template-columns: 1fr; }
}

.card {
  border: 1px solid #0a0;
  padding: 14px;
  border-radius: 4px;
  background: #000;
}
.card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #8cff8c;
}
.card p a, .card p code { color: #a5ffa5; }

/* ===== Message Board ===== */
.board-wrap { border:1px solid #0a0; border-radius:4px; padding:10px; background:#000; }

/* Visually (and for keyboard) hidden, but present in the DOM for bots */
.hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

/* Floating back-to-home button (shown on Contact only) */
.back-fab {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 1000;
  display: none;                 /* hidden by default; JS will toggle */
  padding: 8px 12px;
  background: #002900;
  color: #9aff9a;
  border: 1px solid #0a0;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 255, 0, 0.12);
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
  opacity: 0.95;
}
.back-fab:hover { transform: translateY(-1px); filter: brightness(1.05); }
.back-fab:active { transform: translateY(0); filter: brightness(0.95); }
.back-fab:focus-visible {
  outline: 2px solid #00ff00;
  outline-offset: 2px;
}

/* Force the floating Home button to be visible on standalone pages */
.back-fab.back-fab--show { 
  display: inline-block !important;
}


/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .back-fab { transition: none; }
}

/* Projects Page */
#projects {
  display: none;
  position: relative;
  z-index: 2;
  margin: 0 auto;
  width: min(950px, 92vw);
  padding: 40px 20px 80px;
  animation: fadeInHome 500ms ease forwards;
}

.projects-grid {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.project-card {
  padding: 18px;
  border: 1px solid #0a0;
  background-color: #000;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 255, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 18px rgba(0, 255, 0, 0.18);
}

.project-card h2 {
  color: #8cff8c;
  margin-bottom: 6px;
}

.project-card p {
  margin-bottom: 10px;
  color: #d6d6d6;
  line-height: 1.6;
}

.project-card ul {
  margin: 0;
  padding-left: 20px;
  color: #a5ffa5;
  line-height: 1.5;
}

.projects-footer {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

/* Allow scrolling on pages like health-checker.html */
.scrollable {
  overflow: auto !important;
  height: auto !important;
}

/* ===== Mobile-only routing guard ===== */
@media (max-width: 720px){
  /* By default, hide all routed sections on phones */
  main[data-route] { display: none; }

  /* Show only the active route (set via JS) */
  main[data-route].route-active { display: block; }

  /* Fallback: if JS hasn’t run yet, honor the hash target */
  main[data-route]:target { display: block; }

  /* Make sure we never show more than one section due to inline styles */
  main[aria-hidden="true"] { display: none !important; }
  main[aria-hidden="false"] { display: block !important; }
}

/* ===== Mobile visual tweaks (layout only) ===== */
@media (max-width: 720px){
  /* Comfortable padding that respects iPhone safe areas */
  main[data-route]{
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(72px, env(safe-area-inset-bottom)); /* room for FAB/footer */
    -webkit-overflow-scrolling: touch;
  }

  /* Stack any two-column grids on phones */
  .about-grid, .projects-grid, .contact-cards{
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Keep the portrait classy, not colossal */
  .about-photo{
    width: clamp(140px, 46vw, 200px);
    height: clamp(140px, 46vw, 200px);
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
  }
  .about-photo img{ width:100%; height:100%; object-fit:cover; display:block; }

  /* Buttons readable/tappable */
  .btn{ padding: 10px 14px; font-size: 0.95rem; min-height: 44px; }

  /* Headings scale nicely */
  h1{ font-size: clamp(1.6rem, 6vw, 2rem); }
  .subtitle{ font-size: 0.95rem; }
}
