/* ==========================================================================
   bhavyyyya — portfolio stylesheet
   Direction: a quiet terminal window, not a hacker-movie cliché.
   Warm near-black surface, amber phosphor accent, mono headers / sans body.
   Signature: the page reads like a single terminal session —
   "$ " prompts before section titles, a blinking cursor after the name,
   projects listed like a directory, contact like a whoami dump.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  color-scheme: dark; /* stops browser dark-mode extensions from inverting our colors */

  /* --- palette --- */
  --bg:          #0B0C0E;   /* warm near-black, not pure #000 */
  --surface:     #131418;   /* card / nav surface */
  --surface-2:   #1A1C21;   /* hover surface */
  --line:        #24262C;   /* hairline borders */
  --text:        #ECEAE4;   /* warm off-white */
  --text-dim:    #8B8D93;   /* secondary text */
  --text-faint:  #55575E;   /* tertiary / comments */
  --amber:       #E8A33D;   /* phosphor accent */
  --amber-dim:   #7A5A26;   /* amber at low intensity, for borders/glow */

  /* --- type --- */
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* --- rhythm --- */
  --radius: 5px;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--bg) 40%, rgba(11,12,14,0.96) 100%);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: var(--amber-dim);
  color: var(--text);
}

a { color: var(--amber); text-decoration: none; }

/* ==========================================================================
   NAV — a slim terminal titlebar
   ========================================================================== */

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--gutter);
  background: rgba(19, 20, 24, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

nav::before {
  content: "";
  position: absolute;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 12px 0 0 var(--text-faint), 24px 0 0 var(--text-faint);
  opacity: 0.5;
}

.logo {
  margin-left: 76px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.logo::before { content: "~/"; color: var(--text-faint); }

.nav-links { display: flex; gap: 28px; margin-left: auto; }

.nav-links a {
  position: relative;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

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

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::before { width: 100%; }

.github-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 14px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.github-btn::before { content: "↗ "; color: var(--text-faint); }

.github-btn:hover {
  border-color: var(--amber-dim);
  background: var(--surface-2);
  color: var(--amber);
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter) 96px;
}

section { padding: 56px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: lowercase;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin: 0 0 24px;
}

h2::before { content: "$"; color: var(--amber); font-weight: 600; }

/* ==========================================================================
   HERO
   ========================================================================== */

section:first-child { padding-top: 72px; border-bottom: none; text-align: left; }

h1 {
  font-family: var(--font-mono);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--text);
  text-align: left;
}

h1::after {
  content: "_";
  color: var(--amber);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 4px;
}

@keyframes blink { 50% { opacity: 0; } }

.subtitle { font-family: var(--font-mono); font-size: 0.95rem; color: var(--text-dim); margin: 0; text-align: left; }
.subtitle::before { content: "// "; color: var(--text-faint); }

/* ==========================================================================
   ABOUT
   ========================================================================== */

.about { color: var(--text-dim); font-size: 1rem; max-width: 62ch; white-space: pre-line; }
.about strong, .about b { color: var(--text); }

/* ==========================================================================
   PROJECTS — read like a directory listing
   ========================================================================== */

.projects, .project {
  display: block;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  border-radius: var(--radius);
  transition: border-left-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.projects:hover, .project:hover {
  border-left-color: var(--amber);
  background: var(--surface-2);
  transform: translateX(2px);
}

.projects h3, .project h3 {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.projects h3 a, .project h3 a { color: var(--text); }
.projects h3 a::before, .project h3 a::before { content: "› "; color: var(--amber); }
.projects h3 a:hover, .project h3 a:hover { color: var(--amber); }

.projects p, .project p { margin: 0; color: var(--text-dim); font-size: 0.92rem; line-height: 1.55; }

/* ==========================================================================
   CONTACT — reads like `whoami` output
   ========================================================================== */

.contact p {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 12px;
  font-size: 0.98rem;
}

.contact p::before { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-faint); white-space: nowrap; }
.contact p:nth-of-type(1)::before { content: "# github"; }
.contact p:nth-of-type(2)::before { content: "# email "; }

.contact a {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--amber-dim);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact a:hover { border-color: var(--amber); color: var(--amber); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px var(--gutter) 48px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
  nav { flex-wrap: wrap; padding: 14px var(--gutter); }
  nav::before { display: none; }
  .logo { margin-left: 0; }
  .nav-links { gap: 18px; order: 3; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
  section:first-child { padding-top: 48px; }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

a:focus-visible, .github-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  h1::after { animation: none; }
  * { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}