/* ══════════════════════════════════════════════════════════════
   style.css — shared styles used on both the homepage and detail page
   ══════════════════════════════════════════════════════════════ */

/* JetBrains Mono for all monospace / code / labels
   DM Sans for body text and headings */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;0,9..40,700;1,9..40,300&display=swap');

/* design tokens — change colours/fonts in one place and everything updates */
:root {
  --bg:       #0d0d0d;
  --bg2:      #141414;
  --bg3:      #1c1c1c;
  --border:   #2a2a2a;
  --accent:   #00ff87;
  --accent2:  #00c9ff;
  --text:     #e8e8e8;
  --muted:    #666;
  --mono:     'JetBrains Mono', monospace;
  --sans:     'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-weight: 300; line-height: 1.7; overflow-x: hidden; cursor: none; }
a { color: inherit; text-decoration: none; }

/* ── Film grain / noise overlay ────────────────────────────────────
   Inline SVG noise texture overlaid on everything at low opacity.
   Gives the UI a tactile, slightly analogue feel.
   ─────────────────────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: 0.4;
}

/* ── Page transition overlay ────────────────────────────────────────
   A full-screen accent-colour panel that plays on navigation.
   It starts scaleY(0) at the bottom, wipes to scaleY(1) covering
   the screen, then the new page plays .pt-in which reverses it from
   the top — creating a clean two-stage wipe effect.
   ─────────────────────────────────────────────────────────────────── */
.pt-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: var(--accent);
  transform-origin: bottom;
  transform: scaleY(0);
  pointer-events: none;
}
.pt-overlay.pt-active { pointer-events: all; }
.pt-overlay.pt-in {
  transform-origin: top;
  transform: scaleY(1);
  animation: ptReveal 0.6s 0.05s cubic-bezier(0.76,0,0.24,1) forwards;
}
@keyframes ptReveal { to { transform: scaleY(0); } }

/* ── Scroll progress bar ────────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px; width: 0%;
  background: var(--accent);
  transition: width 0.05s linear;
}

/* ── Custom cursor ─────────────────────────────────────── */
.cursor {
  width: 10px; height: 10px;
  background: var(--accent); border-radius: 50%;
  position: fixed; pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width .15s, height .15s, opacity .2s;
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid var(--accent); border-radius: 50%;
  position: fixed; pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width .25s, height .25s, opacity .2s;
  opacity: 0.4;
}

/* ── Nav ───────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 4rem;
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s, backdrop-filter .3s;
}
nav.scrolled { border-color: var(--border); background: rgba(13,13,13,.88); backdrop-filter: blur(16px); }
.nav-logo { font-family: var(--mono); font-size: .85rem; color: var(--accent); letter-spacing: .05em; }
.nav-logo span { color: var(--muted); }
.nav-back { display: flex; align-items: center; gap: .5rem; transition: color .2s; }
.nav-back:hover { color: var(--accent); }
/* hidden on desktop — the mobile breakpoint switches it on */
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; }
.nav-links { display: flex; gap: 2.5rem; }
.nav-links a {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); transition: color .2s; position: relative;
}
.nav-links a::after { content:''; position: absolute; bottom:-3px; left:0; width:0; height:1px; background: var(--accent); transition: width .25s; }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

/* ── Hero ──────────────────────────────────────────────── */
#hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 8rem 4rem 4rem; position: relative; overflow: hidden; }
.hero-grid-bg { position:absolute; inset:0; background-image: linear-gradient(var(--border) 1px,transparent 1px), linear-gradient(90deg,var(--border) 1px,transparent 1px); background-size: 60px 60px; opacity:.35; mask-image: radial-gradient(ellipse 80% 60% at 50% 50%,black 30%,transparent 100%); }
.hero-glow { position:absolute; top:20%; left:15%; width:500px; height:500px; background: radial-gradient(circle,rgba(0,255,135,.06) 0%,transparent 70%); pointer-events:none; }
.hero-eyebrow { font-family:var(--mono); font-size:.75rem; letter-spacing:.2em; text-transform:uppercase; color:var(--accent); margin-bottom:1.5rem; opacity:0; animation: fadeUp .6s .2s forwards; }
.hero-name { font-size: clamp(3.5rem,9vw,8rem); font-weight:700; line-height:.95; letter-spacing:-.03em; margin-bottom:1.5rem; opacity:0; animation: fadeUp .7s .35s forwards; }
.hero-name .line2 { color: var(--muted); }
.hero-tagline { font-size:1.1rem; font-weight:300; color:var(--muted); max-width:480px; margin-bottom:3rem; opacity:0; animation: fadeUp .7s .5s forwards; }
.hero-cta { display:flex; gap:1rem; flex-wrap:wrap; opacity:0; animation: fadeUp .7s .65s forwards; }

.btn-primary { display:inline-flex; align-items:center; gap:.5rem; padding:.85rem 2rem; background:var(--accent); color:#000; font-family:var(--mono); font-size:.8rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; border:none; cursor:none; transition: background .2s, transform .15s; }
.btn-primary:hover { background:#fff; transform:translateY(-2px); }
.btn-ghost { display:inline-flex; align-items:center; gap:.5rem; padding:.85rem 2rem; background:transparent; color:var(--text); font-family:var(--mono); font-size:.8rem; letter-spacing:.08em; text-transform:uppercase; border:1px solid var(--border); cursor:none; transition: border-color .2s, color .2s, transform .15s; }
.btn-ghost:hover { border-color:var(--accent); color:var(--accent); transform:translateY(-2px); }

.hero-terminal { position:absolute; right:4rem; top:50%; transform:translateY(-50%); width:380px; background:var(--bg2); border:1px solid var(--border); opacity:0; animation: fadeUp .8s .8s forwards; }
.terminal-bar { display:flex; align-items:center; gap:.5rem; padding:.7rem 1rem; border-bottom:1px solid var(--border); background:var(--bg3); }
.terminal-dot { width:10px; height:10px; border-radius:50%; }
.dot-red { background:#ff5f57; } .dot-yellow { background:#febc2e; } .dot-green { background:#28c840; }
.terminal-title { font-family:var(--mono); font-size:.7rem; color:var(--muted); margin-left:.5rem; }
.terminal-body { padding:1.25rem; font-family:var(--mono); font-size:.75rem; line-height:1.9; }
.t-line { display:flex; gap:.5rem; }
.t-prompt { color:var(--accent); } .t-cmd { color:var(--text); } .t-output { color:var(--muted); padding-left:1rem; }
.t-cursor { display:inline-block; width:8px; height:1em; background:var(--accent); vertical-align:text-bottom; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity:0; } }

.hero-scroll-hint { position:absolute; bottom:2.5rem; left:4rem; font-family:var(--mono); font-size:.7rem; letter-spacing:.15em; text-transform:uppercase; color:var(--muted); display:flex; align-items:center; gap:.75rem; opacity:0; animation: fadeUp .7s 1s forwards; }
.scroll-line { width:40px; height:1px; background:var(--muted); animation: expandLine 1.5s 1.5s ease forwards; transform-origin:left; transform:scaleX(0); }
@keyframes expandLine { to { transform:scaleX(1); } }

/* ── Section shared ─────────────────────────────────────── */
section { padding: 7rem 4rem; position: relative; }
.section-label { font-family:var(--mono); font-size:.7rem; letter-spacing:.25em; text-transform:uppercase; color:var(--accent); margin-bottom:.75rem; }
.section-title { font-size: clamp(2rem,4vw,3.5rem); font-weight:700; letter-spacing:-.02em; line-height:1.1; margin-bottom:1rem; }
.section-sub { color:var(--muted); max-width:500px; margin-bottom:4rem; font-size:.95rem; }
.divider { height:1px; background: linear-gradient(90deg,transparent,var(--border),transparent); margin: 0 4rem; }

/* ── Filter bar ─────────────────────────────────────────── */
.filter-bar { display:flex; gap:.5rem; flex-wrap:wrap; margin-bottom:3rem; }
.filter-btn { padding:.4rem 1rem; font-family:var(--mono); font-size:.7rem; letter-spacing:.1em; text-transform:uppercase; background:transparent; color:var(--muted); border:1px solid var(--border); cursor:none; transition: all .2s; }
.filter-btn:hover, .filter-btn.active { color:var(--accent); border-color:var(--accent); background: rgba(0,255,135,.04); }

/* ── Project cards ──────────────────────────────────────────────────
   Cards are <a> tags so the whole surface is clickable.
   Tilt + glare are applied inline by script.js on mousemove.
   Corner bracket accents appear on hover via CSS transitions.
   ─────────────────────────────────────────────────────────────────── */
.projects-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap:1.25rem; }

/* Card is a div (not an <a>) to allow a real <a> GitHub link inside it.
   position:relative + padding-bottom leave room for the absolute GitHub button. */
.project-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 2rem 2rem 3.5rem 2rem; /* extra bottom padding for the GitHub button */
  cursor: pointer;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.project-card:hover {
  border-color: rgba(0,255,135,.2);
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  transform: translateY(-3px);
}
.project-card:hover::before   { transform: scaleX(1); }
.project-card:hover .card-title { color: var(--accent); }

.card-number { font-family:var(--mono); font-size:.65rem; color:var(--muted); letter-spacing:.1em; margin-bottom:.9rem; }
.card-title  { font-size:1.15rem; font-weight:700; letter-spacing:-.01em; margin-bottom:.6rem; transition: color .2s; }
.card-desc   { color:var(--muted); font-size:.85rem; line-height:1.65; margin-bottom:1rem; }
.card-tags   { display:flex; flex-wrap:wrap; gap:.35rem; }

/* GitHub button — absolute bottom-right corner of the card */
.card-gh-btn {
  position: absolute;
  bottom: 1.1rem; right: 1.25rem;
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: .3rem .75rem;
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}
.card-gh-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0,255,135,.05);
}

/* Remove leftover footer/cta rules that are no longer used */

/* ── Skills ─────────────────────────────────────────────── */
#skills { background: var(--bg2); }
.skills-grid { display:flex; flex-wrap:wrap; gap:.75rem; }
.skill-pill { display:flex; align-items:center; gap:.5rem; padding:.6rem 1.2rem; background:var(--bg3); border:1px solid var(--border); font-family:var(--mono); font-size:.78rem; letter-spacing:.05em; transition: border-color .2s, color .2s; cursor:default; }
.skill-pill:hover { border-color:var(--accent2); color:var(--accent2); }
.skill-dot { width:6px; height:6px; border-radius:50%; background:var(--accent); }

/* ── Contact ─────────────────────────────────────────────── */
.contact-inner { max-width:640px; }
.contact-links { display:flex; flex-direction:column; gap:1rem; margin-top:2rem; }
.contact-row { display:flex; align-items:center; justify-content:space-between; padding:1.25rem 1.5rem; border:1px solid var(--border); background:var(--bg2); transition: border-color .2s, background .2s; cursor:none; }
.contact-row:hover { border-color:var(--accent); background:var(--bg3); }
.contact-label { font-family:var(--mono); font-size:.7rem; letter-spacing:.15em; text-transform:uppercase; color:var(--muted); }
.contact-value { font-size:.9rem; font-weight:500; }
.contact-arrow { color:var(--accent); transition: transform .2s; }
.contact-row:hover .contact-arrow { transform: translateX(4px); }

/* ── Footer ─────────────────────────────────────────────── */
footer { padding:2rem 4rem; border-top:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.footer-copy { font-family:var(--mono); font-size:.7rem; color:var(--muted); letter-spacing:.08em; }
.footer-stack { font-family:var(--mono); font-size:.65rem; color:var(--muted); letter-spacing:.1em; }
.footer-stack span { color:var(--accent); }
.footer-back { font-family:var(--mono); font-size:.7rem; color:var(--muted); letter-spacing:.1em; transition: color .2s; cursor:none; }
.footer-back:hover { color:var(--accent); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
.reveal { opacity:0; transform:translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity:1; transform:translateY(0); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width:900px) {
  nav { padding: 1rem 1.5rem; }
  #hero { padding: 7rem 1.5rem 4rem; }
  .hero-terminal { display:none; }
  section { padding: 5rem 1.5rem; }
  .divider { margin: 0 1.5rem; }
  footer { padding: 1.5rem 1.5rem; flex-direction:column; gap:.5rem; text-align:center; }
}

/* Mobile nav — hide text links, show hamburger menu */
@media (max-width:600px) {
  nav { padding: 1rem 1.25rem; }

  /* hide the link labels — show a stacked icon instead */
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13,13,13,.97);
    backdrop-filter: blur(20px);
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    z-index: 99;
  }
  .nav-links.open a {
    font-size: 1.1rem;
    letter-spacing: .15em;
  }

  /* hamburger button */
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 101;
    padding: .25rem;
  }
  .nav-hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    transition: transform .25s, opacity .25s;
  }
  .nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-hamburger.open span:nth-child(2) { opacity: 0; }
  .nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* projects single column on very small screens */
  .projects-grid { grid-template-columns: 1fr; }

  section { padding: 4rem 1.25rem; }
  .section-title { font-size: 1.8rem; }
  .hero-name { font-size: clamp(2.5rem, 14vw, 4rem); }
  .hero-cta { flex-direction: column; }
  .btn-primary, .btn-ghost { width: 100%; justify-content: center; }
}

/* ── Touch devices — disable custom cursor ──────────────────────────
   (pointer: coarse) matches any touchscreen — phone, tablet, etc.
   We restore the OS cursor and hide the dot + ring entirely.
   Also removes cursor:none from every interactive element so they
   get the normal pointer back on touch devices. ─────────────────── */
@media (pointer: coarse) {
  body,
  .btn-primary, .btn-ghost,
  .filter-btn, .project-card,
  .contact-row, .footer-back,
  .nav-hamburger { cursor: auto; }

  a, button { cursor: pointer; }

  /* hide the custom cursor elements — mousemove never fires on touch anyway,
     but this stops them rendering as stale dots if a stylus is used */
  .cursor, .cursor-ring { display: none !important; }
}
