/* ===========================================================
   Neil Mascarenhas, Portfolio
   Dark navy / cyan cybersecurity theme, evolved from the
   original Google Sites design with a cleaner, more
   professional layout.
   =========================================================== */

:root {
  --bg: #07080a;
  --bg-alt: #0d0f13;
  --card: #111317;
  --card-border: #262930;
  --text: #ffffff;
  --text-muted: #bcc3cb;
  --accent: #3f8fc9;
  --accent-strong: #6fb3e0;
  --gold: #e0b667;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
  --radius: 14px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Scroll-reveal: elements fade + rise into place as they enter the viewport */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent); }

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 9, 11, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav .brand span { color: var(--accent); }

.nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav ul {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--card-border);
  }
  .nav ul.open { display: flex; }
  .nav ul li { border-top: 1px solid var(--card-border); }
  .nav ul li a { display: block; padding: 16px 24px; }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 1.1rem;
    cursor: pointer;
  }
}

/* ---------- Hero / Page-hero / Banner ----------
   All three share one architecture: a ::before layer paints the photo
   (driven by the --hero-img custom property set inline per section), and
   a ::after layer paints a light gradient/scrim so the photo stays
   visible while text stays readable. Tune the overlay once here and it
   applies everywhere. */

.hero, .page-hero, .banner {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--card-border);
}

.hero::before, .page-hero::before, .banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: var(--hero-pos, center);
  background-repeat: no-repeat;
  z-index: 0;
}

.hero::after, .page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,10,13, var(--hero-overlay-top, 0.28)) 0%, rgba(8,10,13, var(--hero-overlay, 0.58)) 68%, var(--bg) 100%);
  z-index: 1;
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8,10,13,0.42);
  z-index: 1;
}

.hero .wrap, .page-hero .wrap, .banner .wrap {
  position: relative;
  z-index: 2;
}

.hero {
  min-height: 66vh;
  display: flex;
  align-items: center;
}

.hero::before { background-attachment: fixed; }

@media (max-width: 900px) {
  /* fixed backgrounds are jittery on mobile Safari/Chrome — fall back to scroll */
  .hero::before { background-attachment: scroll; }
}

.hero .wrap { padding-top: 80px; padding-bottom: 60px; }

.hero h1, .hero .tagline, .hero .eyebrow,
.page-hero h1, .page-hero p, .page-hero .eyebrow,
.banner blockquote, .banner cite {
  text-shadow: 0 2px 18px rgba(0,0,0,0.8);
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 28px;
}

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #06111f;
}
.btn-primary:hover { background: var(--accent-strong); color: #06111f; }

.btn-outline {
  border-color: var(--card-border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.social-row { display: flex; gap: 14px; margin-top: 26px; }
.social-row a {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.social-row a:hover { border-color: var(--accent); color: var(--accent); }
.social-row svg { width: 18px; height: 18px; }

/* ---------- Page hero (secondary pages) ---------- */

.page-hero { padding: 100px 0 64px; }

/* ---------- Quote / image banner ---------- */

.banner {
  padding: 90px 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
}
.banner blockquote {
  max-width: 680px;
  margin: 0 auto;
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.banner cite {
  display: block;
  margin-top: 18px;
  font-style: normal;
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Photo duo (two side-by-side images with captions) ---------- */

.photo-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.photo-duo figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}
.photo-duo img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.photo-duo figure:hover img { transform: scale(1.04); }
.photo-duo figcaption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--card);
}

@media (max-width: 640px) {
  .photo-duo { grid-template-columns: 1fr; }
}

/* ---------- Interest card thumbnails ---------- */

.card.has-thumb { padding: 0; overflow: hidden; }
.card.has-thumb .thumb {
  height: 140px;
  background-size: cover;
  background-position: center;
}
.card.has-thumb .card-body { padding: 22px 26px; }

/* ---------- Sections ---------- */

section { padding: 64px 0; }
section.alt { background: var(--bg-alt); }

.section-heading { margin-bottom: 36px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 10px; }
.section-heading p { color: var(--text-muted); max-width: 620px; margin: 0; }

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

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card .icon { font-size: 1.6rem; margin-bottom: 12px; display: block; }
.card h3 { margin: 0 0 10px; font-size: 1.08rem; }
.card p, .card ul { color: var(--text-muted); margin: 0; font-size: 0.95rem; }
.card ul { padding-left: 18px; }
.card ul li { margin-bottom: 6px; }

/* ---------- Timeline (work history) ---------- */
/* Sidebar intro + two-column entry list, echoing the original layout */

.timeline-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--card-border);
}

.timeline-intro h2 { font-size: 1.6rem; margin: 0 0 16px; color: var(--accent); }
.timeline-intro p { color: var(--text-muted); margin: 0 0 14px; font-size: 0.95rem; }

.timeline-grid {
  column-count: 2;
  column-gap: 40px;
}

.timeline-item {
  break-inside: avoid;
  margin-bottom: 34px;
}
.timeline-item .period {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  display: block;
  margin-bottom: 6px;
}
.timeline-item h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: var(--text); }
.timeline-item .role-meta {
  display: block;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.timeline-item p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.timeline-item ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.timeline-item ul li { margin-bottom: 6px; }
.timeline-item ul li:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .timeline-layout { grid-template-columns: 1fr; gap: 24px; }
  .timeline-grid { column-count: 1; }
}

/* ---------- Projects ---------- */

.project-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.project-card h3 { margin: 0 0 12px; font-size: 1.15rem; }
.project-card ul { color: var(--text-muted); padding-left: 20px; margin: 0 0 14px; }
.project-card ul li { margin-bottom: 8px; }
.project-card p { color: var(--text-muted); margin: 0 0 16px; font-size: 0.96rem; }

.project-card.has-thumb {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project-card.has-thumb .project-thumb {
  height: 220px;
  background-size: cover;
  background-position: center;
}
.project-card.has-thumb .project-body { padding: 26px 28px; }

@media (min-width: 760px) {
  .project-card.has-thumb {
    flex-direction: row;
  }
  .project-card.has-thumb .project-thumb {
    width: 300px;
    height: auto;
    flex-shrink: 0;
  }
  .project-card.has-thumb .project-body {
    padding: 28px 30px;
  }
}
.link-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-strong);
}
.pill-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.contact-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: left;
}
.contact-card .icon { font-size: 1.5rem; margin-bottom: 10px; display: block; }
.contact-card .value { font-size: 1.05rem; font-weight: 600; color: var(--text); display: inline-block; }
.contact-card a.value { color: var(--accent-strong); }

/* ---------- Footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 40px 0 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer .wrap { display: flex; flex-direction: column; gap: 18px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.sources { font-size: 0.78rem; line-height: 1.7; color: #6f8296; }
.sources summary { cursor: pointer; color: var(--text-muted); margin-bottom: 8px; }
