/* =========================================================
   Devansh Singh — Portfolio
   Modern minimal dark theme
   ========================================================= */

@font-face {
  font-family: 'Plain';
  src: url('../localfonts/Plain-Regular.woff2') format('woff2'),
       url('../localfonts/Plain-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plain';
  src: url('../localfonts/Plain-Light.woff2') format('woff2'),
       url('../localfonts/Plain-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plain';
  src: url('../localfonts/Plain-Bold.woff2') format('woff2'),
       url('../localfonts/Plain-Bold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:            #0a0a0c;
  --bg-soft:       #111114;
  --surface:       #16161b;
  --surface-2:     #1d1d24;
  --border:        #26262e;
  --border-soft:   #1f1f26;

  --text:          #ededf0;
  --text-muted:    #9a9aa6;
  --text-faint:    #6c6c78;

  --accent:        #ffd500;
  --accent-soft:   rgba(255, 213, 0, 0.12);
  --accent-2:      #5eead4;

  --font-base:  "Plain", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:  ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius:     14px;
  --radius-sm:  10px;
  --maxw:       1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle ambient glow on the page */
body::before {
  content: "";
  position: fixed;
  top: -20%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255,213,0,0.06) 0%, rgba(94,234,212,0.04) 35%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--text); text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--accent); }

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

h1, h2, h3, h4 { font-weight: 300; line-height: 1.15; margin: 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

.section { padding: 7rem 0; position: relative; }
.section-sm { padding: 4.5rem 0; }

/* ---------- Section heading ---------- */
.section-head { margin-bottom: 3rem; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.6rem;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}
.section-title b { font-weight: 600; }

/* ---------- Buttons ---------- */
.btn-x {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all .25s ease;
}
.btn-x:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-x.primary { background: var(--accent); color: #0a0a0c; border-color: var(--accent); font-weight: 600; }
.btn-x.primary:hover { background: transparent; color: var(--accent); }

/* =========================================================
   NAVBAR
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  transition: all .3s ease;
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav.scrolled {
  background: rgba(10,10,12,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  padding: 0.7rem 0;
}
.nav-brand {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-brand .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1.5px; background: var(--accent);
  transition: width .25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--text); }
.nav-cta { margin-left: 0.5rem; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: .3s; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 0 4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}
.hero-title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 0.6rem;
}
.hero-sub {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}
.hero-sub .hl { color: var(--text); }
.hero-desc { max-width: 36rem; color: var(--text-muted); margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.wave { display: inline-block; animation: wave 2.5s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%,60%,100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
.hero-photo { position: relative; justify-self: center; }
.hero-photo img {
  border-radius: 20px;
  border: 1px solid var(--border);
  filter: grayscale(15%);
  transition: filter .4s ease, transform .4s ease;
  width: 320px;
  max-width: 100%;
}
.hero-photo:hover img { filter: grayscale(0%); transform: translateY(-4px); }
.hero-photo::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), transparent 40%);
  opacity: 0.25;
  z-index: -1;
  filter: blur(30px);
}

/* ---------- Hero terminal ---------- */
.terminal {
  width: 420px;
  max-width: 100%;
  background: #0c0c10;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  font-family: var(--font-mono);
  position: relative;
  justify-self: center;
}
.terminal::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), transparent 45%);
  opacity: 0.18;
  z-index: -1;
  filter: blur(34px);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: #15151b;
  border-bottom: 1px solid var(--border);
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.term-dot.r { background: #ff5f57; }
.term-dot.y { background: #febc2e; }
.term-dot.g { background: #28c840; }
.term-title { margin-left: auto; margin-right: auto; font-size: 0.78rem; color: var(--text-faint); }
.term-body {
  padding: 1.2rem 1.3rem;
  min-height: 248px;
  max-height: 330px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.85;
  cursor: text;
}
.term-body::-webkit-scrollbar { width: 6px; }
.term-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.term-input-line { display: flex; align-items: baseline; gap: 0.6ch; }
.term-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  caret-color: var(--accent);
  padding: 0;
}
.term-hint { color: var(--text-faint); font-size: 0.78rem; }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-prompt { color: var(--accent); }
.term-path { color: var(--accent-2); }
.term-cmd { color: var(--text); }
.term-out { color: var(--text-muted); }
.term-out.green { color: #28c840; }
.term-cursor {
  display: inline-block;
  width: 8px; height: 1.05em;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 4rem; }
.about-text p { color: var(--text-muted); margin: 0 0 1.3rem; }
.about-text p strong { color: var(--text); font-weight: 600; }
.about-facts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  align-self: start;
}
.about-facts h4 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.fact-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-soft); font-size: 0.95rem; }
.fact-row:last-child { border-bottom: 0; }
.fact-row .k { color: var(--text-faint); }
.fact-row .v { color: var(--text); text-align: right; }

/* =========================================================
   SKILLS
   ========================================================= */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: border-color .25s ease, transform .25s ease;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill-card h4 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1.1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.pills { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.pill {
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all .2s ease;
}
.pill:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* =========================================================
   EXPERIENCE — timeline
   ========================================================= */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before {
  content: "";
  position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 2.6rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute; left: -2.2rem; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  transform: translateX(0);
  box-shadow: 0 0 0 4px rgba(255,213,0,0.08);
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  transition: border-color .25s ease, transform .25s ease;
}
.tl-card:hover { border-color: var(--accent); transform: translateX(4px); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1rem; margin-bottom: 0.2rem; }
.tl-role { font-size: 1.25rem; font-weight: 600; color: var(--text); }
.tl-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-faint); white-space: nowrap; }
.tl-company { color: var(--accent); font-size: 0.98rem; margin-bottom: 0.9rem; }
.tl-company .loc { color: var(--text-faint); }
.tl-list { margin: 0; padding-left: 1.1rem; color: var(--text-muted); }
.tl-list li { margin-bottom: 0.45rem; }
.tl-list li::marker { color: var(--accent); }

/* =========================================================
   EDUCATION
   ========================================================= */
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.edu-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1rem; }
.edu-school { font-size: 1.4rem; font-weight: 600; }
.edu-date { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-faint); }
.edu-degree { color: var(--accent); margin: 0.4rem 0 1.3rem; }
.edu-label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); margin-bottom: 0.8rem; }

/* =========================================================
   PROJECTS — grid
   ========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.proj-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
}
.proj-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.proj-card:hover .proj-thumb img { transform: scale(1.05); }
.proj-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.proj-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.proj-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.proj-links { display: flex; gap: 1.1rem; margin-top: 1.1rem; }
.proj-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.proj-links a:hover { color: var(--accent); }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 4rem; }
.contact-form .fgroup { margin-bottom: 1.4rem; }
.contact-form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.85rem 1rem;
  font-family: var(--font-base);
  font-size: 1rem;
  transition: border-color .25s ease;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-aside h4 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.8rem; }
.contact-aside p { color: var(--text-muted); margin: 0 0 1.4rem; }
.contact-email {
  font-family: var(--font-mono);
  color: var(--accent);
  cursor: pointer;
  border: 1px dashed var(--border);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.contact-email:hover { background: var(--accent-soft); color: var(--accent); }
.socials { display: flex; gap: 1rem; margin-top: 1.8rem; list-style: none; padding: 0; }
.socials a {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 1.2rem;
  background: var(--surface);
  transition: all .25s ease;
}
.socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

.copied-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #0a0a0c;
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
  padding: 0.7rem 1.2rem; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 200;
}
.copied-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 2.2rem 0;
  text-align: center;
}
.footer p { color: var(--text-faint); font-size: 0.85rem; font-family: var(--font-mono); margin: 0; }
.footer a { color: var(--text-muted); }

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

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

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .hero-photo { order: -1; }
  .terminal { text-align: left; }
  .hero-actions { justify-content: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  body { font-size: 16px; }
  .section { padding: 5rem 0; }
  .nav-links {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 75%; max-width: 320px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.6rem;
    padding: 2rem 2.2rem;
    background: var(--bg-soft);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform .35s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; }
  .nav-toggle { display: block; z-index: 101; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}
