/* =========================================================
   AIChawla — design tokens
   Palette: Navy / Royal Blue / Signal Orange
   Type: Space Grotesk (display) + Inter (body) + JetBrains Mono (labels)
   ========================================================= */

:root {
  --navy-950: #0a1220;
  --navy-900: #0f172a;
  --navy-800: #16213c;
  --blue-600: #2563eb;
  --blue-400: #60a5fa;
  --orange-500: #f97316;
  --white: #f8fafc;
  --slate-400: #94a3b8;
  --slate-600: #64748b;
  --line: rgba(248, 250, 252, 0.12);

  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

  --container: 1180px;
}

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

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--navy-900);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Faint blueprint grid texture behind everything — the "signature" */
.blueprint-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
}

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

/* =========================================================
   Header — minimal, fixed, logo + single menu trigger
   ========================================================= */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 28px;
  background: linear-gradient(to bottom, rgba(10,18,32,0.85), transparent);
  backdrop-filter: blur(6px);
}

.site-header.is-solid {
  background: rgba(10, 18, 32, 0.92);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .mark {
  width: 10px; height: 10px;
  background: var(--orange-500);
  border-radius: 1px;
  display: inline-block;
}

.menu-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.menu-btn:hover { border-color: var(--orange-500); }
.menu-btn:focus-visible { outline: 2px solid var(--orange-500); outline-offset: 2px; }

.menu-btn .bars { display: inline-flex; flex-direction: column; gap: 3px; }
.menu-btn .bars span { width: 16px; height: 1.5px; background: var(--white); }

/* Full-screen nav overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--navy-950);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;   /* was center */
  padding: 120px 40px 40px;      /* was 40px — extra top space */
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-overlay.is-open { transform: translateY(0); }

.nav-overlay-close {
  position: absolute;
  top: 24px; right: 28px;
  background: none;
  border: none;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  padding: 10px;
}
.nav-overlay-close:focus-visible { outline: 2px solid var(--orange-500); }

.nav-list {
  list-style: none;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}
.nav-list li {
  border-top: 1px solid var(--line);
}
.nav-list li:last-child { border-bottom: 1px solid var(--line); }

.nav-list a {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 18px 4px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 600;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.nav-list a .idx {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--orange-500);
  font-weight: 400;
}
.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--blue-400);
  padding-left: 14px;
}

.nav-meta {
  max-width: var(--container);
  margin: 40px auto 0;
  width: 100%;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate-400);
}
.nav-meta a:hover { color: var(--orange-500); }

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: visible;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10,18,32,0.55) 0%, rgba(10,18,32,0.75) 55%, var(--navy-900) 100%);
}

.hero-inner {
  width: 100%;
  padding: 96px 28px 96px;
  max-width: var(--container);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange-500);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--orange-500);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  max-width: 16ch;
  margin-bottom: 28px;
}
.hero h1 em {
  font-style: normal;
  color: var(--blue-400);
}

.hero p {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--slate-400);
  max-width: 46ch;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-900);
  background: var(--white);
  border: 1px solid var(--white);
  padding: 16px 26px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--orange-500); border-color: var(--orange-500); transform: translateY(-2px); }
.btn.btn-outline {
  background: transparent;
  color: var(--white);
}
.btn.btn-outline:hover { background: var(--orange-500); border-color: var(--orange-500); color: var(--navy-950); }

/* =========================================================
   Bento grid of section cards (the homepage gateway)
   ========================================================= */

.grid-section { padding: 8px 28px 8px; }

.bento {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  background: var(--line);
}

.card {
  position: relative;
  grid-column: span 3;
  min-height: 360px;
  display: block;
  overflow: hidden;
  background: var(--navy-900);
}
.card.span-2 { grid-column: span 2; }
.card.span-3 { grid-column: span 3; }
.card.span-4 { grid-column: span 4; min-height: 420px; }
.card.span-6 { grid-column: span 6; min-height: 300px; }

.card img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0, 0.2, 1);
}
.card:hover img { transform: scale(1.06); }

.card-tint {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,18,32,0.25) 0%, rgba(10,18,32,0.92) 100%);
}

.card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 28px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--orange-500);
  display: block;
  margin-bottom: 10px;
}

.card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 600;
  margin-bottom: 8px;
}

.card p {
  color: var(--slate-400);
  font-size: 0.92rem;
  max-width: 42ch;
}

.card-arrow {
  position: absolute;
  top: 24px; right: 24px;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.card:hover .card-arrow { border-color: var(--orange-500); background: var(--orange-500); }

/* =========================================================
   Standard content page (About, Projects, Book, etc.)
   ========================================================= */

.page-hero {
  padding: 168px 28px 64px;
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { margin-bottom: 18px; }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  max-width: 20ch;
}
.page-hero .lede {
  margin-top: 20px;
  color: var(--slate-400);
  font-size: 1.1rem;
  max-width: 60ch;
}

.content {
  padding: 64px 28px 120px;
}
.content .wrap { max-width: 760px; }

.content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 48px 0 16px;
}
.content h2:first-child { margin-top: 0; }
.content p { margin-bottom: 18px; color: #dbe2ea; }
.content ul, .content ol { margin: 0 0 18px 22px; color: #dbe2ea; }
.content li { margin-bottom: 8px; }
.content a { color: var(--blue-400); text-decoration: underline; text-underline-offset: 3px; }
.content blockquote {
  border-left: 2px solid var(--orange-500);
  padding-left: 20px;
  color: var(--slate-400);
  font-style: italic;
  margin: 24px 0;
}

/* Simple stat / spec strip, used sparingly where it encodes real info */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  margin: 40px 0;
  border: 1px solid var(--line);
}
.spec-strip div {
  background: var(--navy-900);
  padding: 20px;
}
.spec-strip .num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--orange-500);
  display: block;
}
.spec-strip .label {
  font-size: 0.8rem;
  color: var(--slate-400);
  margin-top: 4px;
}

/* =========================================================
   Blog list + post
   ========================================================= */

.post-list { list-style: none; max-width: 760px; }
.post-list li {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: baseline;
  flex-wrap: wrap;
}
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list .post-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.post-list .post-title:hover { color: var(--blue-400); }
.post-list time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate-400);
}
.post-list .excerpt {
  flex-basis: 100%;
  color: var(--slate-400);
  font-size: 0.95rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate-400);
  margin-top: 8px;
}

/* =========================================================
   Contact
   ========================================================= */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--slate-400);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.field input, .field textarea {
  width: 100%;
  background: var(--navy-800);
  border: 1px solid var(--line);
  color: var(--white);
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--orange-500);
}

.contact-list { list-style: none; }
.contact-list li {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-list .k {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--orange-500);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 6px;
}
.contact-list .v a:hover { color: var(--blue-400); }

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 28px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer .logo { font-size: 1rem; }
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.footer-links a:hover { color: var(--orange-500); }
.footer-copy {
  color: var(--slate-600);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card, .card.span-2, .card.span-4, .card.span-6 { grid-column: span 2; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero-inner { padding-bottom: 64px; }
  .page-hero { padding-top: 140px; }
}

@media (max-width: 560px) {
  .nav-overlay { padding: 24px 20px; }
  .nav-list a {
    font-size: clamp(1.3rem, 8vw, 2rem);
    gap: 14px;
  }
  .nav-meta { gap: 16px; margin-top: 28px; }

  .menu-btn { padding: 12px 16px; }
  .nav-overlay-close { padding: 14px; font-size: 0.9rem; }

  .card-body { padding: 20px; }
  .btn { width: 100%; justify-content: center; }
}