/* =========================================================
   THOMAS JOSEPH — PORTFOLIO  |  style.css
   ========================================================= */

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #060d0a;
  --bg2:       #0a1510;
  --surface:   #0f1f16;
  --surface2:  #162b1e;
  --border:    rgba(16,185,129,.18);
  --border2:   rgba(255,255,255,.06);

  --accent:    #059669;
  --accent2:   #10b981;
  --accent3:   #84cc16;
  --green:     #10b981;

  --text:      #e2e8f0;
  --text2:     #94a3b8;
  --text3:     #475569;

  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-disp: 'Syne', sans-serif;

  --radius:    12px;
  --radius-lg: 20px;
  --transition: .35s cubic-bezier(.4,0,.2,1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: none; border: none; background: none; }

/* ─── CUSTOM SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; }

/* ─── CUSTOM CURSOR ─── */
.cursor {
  width: 10px; height: 10px;
  background: var(--accent2);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: transform .1s, background .2s;
  mix-blend-mode: screen;
}
.cursor-follower {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(16,185,129,.5);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: transform .25s cubic-bezier(.23,1,.32,1), border-color .3s;
}
body:has(a:hover) .cursor-follower,
body:has(button:hover) .cursor-follower { border-color: var(--accent2); transform: translate(-50%,-50%) scale(1.5); }

/* ─── UTILITIES ─── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dot { color: var(--accent2); }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── REVEAL ANIMATIONS ─── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: .1s; }
.reveal:nth-child(3) { transition-delay: .2s; }
.reveal:nth-child(4) { transition-delay: .3s; }
.reveal:nth-child(5) { transition-delay: .4s; }

/* ─── NAVBAR ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 2rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(6,9,18,.7);
  border-bottom: 1px solid var(--border2);
  transition: background var(--transition), box-shadow var(--transition);
}
.nav.scrolled { background: rgba(6,9,18,.92); box-shadow: 0 4px 30px rgba(0,0,0,.4); }

.nav-logo {
  font-family: var(--font-disp);
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -.02em;
}

.nav-links {
  display: flex; gap: 2rem;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: .78rem; font-weight: 500;
  color: var(--text2);
  letter-spacing: .05em; text-transform: uppercase;
  position: relative; padding-bottom: 2px;
  transition: color var(--transition);
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent2);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.hamburger { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 9px; transition: var(--transition); }

/* ─── MOBILE MENU ─── */
.mobile-menu {
  position: fixed; inset: 0; z-index: 850;
  background: rgba(6,9,18,.97);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .4s;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu ul { text-align: center; }
.mobile-menu li { margin: 1.5rem 0; }
.mobile-menu a {
  font-family: var(--font-disp);
  font-size: 2.2rem; font-weight: 700;
  color: var(--text2);
  transition: color var(--transition);
}
.mobile-menu a:hover { color: var(--accent2); }

/* ─── HERO ─── */
.hero {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 7rem 6vw 4rem;
  position: relative; overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}

/* grid lines */
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(16,185,129,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,.05) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* animated orbs */
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .35;
  animation: orb-float 12s ease-in-out infinite alternate;
}
.orb-1 { width: 500px; height: 500px; background: var(--accent); top: -10%; left: -5%; animation-delay: 0s; }
.orb-2 { width: 350px; height: 350px; background: var(--accent3); top: 30%; right: 0%; animation-delay: 3s; }
.orb-3 { width: 280px; height: 280px; background: #10b981; bottom: 0; left: 40%; animation-delay: 6s; }

@keyframes orb-float {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px,20px) scale(1.08); }
}

.hero-content { position: relative; z-index: 1; }
.hero-code { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 99px; padding: .35rem 1rem;
  font-family: var(--font-mono); font-size: .78rem; color: var(--green);
  margin-bottom: 1.5rem;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50%      { opacity: .5; box-shadow: 0 0 20px var(--green); }
}

.hero-greeting {
  font-family: var(--font-mono); font-size: 1rem;
  color: var(--text2); margin-bottom: .5rem;
}

.hero-name {
  font-family: var(--font-disp);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800; line-height: 1;
  letter-spacing: -.03em;
  margin-bottom: 1.2rem;
}

.hero-typewriter {
  font-family: var(--font-mono); font-size: 1.05rem;
  color: var(--text2); margin-bottom: 1.5rem;
  min-height: 2em;
}
.typewriter-static { color: var(--accent2); }
.typewriter-cursor { animation: blink .7s infinite; color: var(--accent2); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-desc {
  font-size: 1.05rem; color: var(--text2);
  max-width: 480px; margin-bottom: 2.5rem;
  line-height: 1.75;
}
.hero-desc strong { color: var(--text); }

.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.8rem;
  border-radius: var(--radius);
  font-family: var(--font-sans); font-size: .95rem; font-weight: 600;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,.07);
  opacity: 0; transition: opacity var(--transition);
}
.btn:hover::before { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  box-shadow: 0 0 30px rgba(16,185,129,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 40px rgba(16,185,129,.5); }

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text2);
  background: rgba(255,255,255,.02);
}
.btn-outline:hover { border-color: var(--accent2); color: var(--text); transform: translateY(-2px); }

.hero-scroll {
  display: flex; align-items: center; gap: .75rem;
  font-family: var(--font-mono); font-size: .75rem; color: var(--text3);
}
.scroll-indicator {
  width: 22px; height: 36px;
  border: 1.5px solid var(--text3); border-radius: 99px;
  display: flex; justify-content: center; padding-top: 6px;
}
.scroll-dot {
  width: 4px; height: 8px;
  background: var(--accent2); border-radius: 99px;
  animation: scroll-anim 1.8s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes scroll-anim {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ─── CODE WINDOW ─── */
.code-window {
  background: rgba(17,24,39,.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(16,185,129,.1);
  backdrop-filter: blur(8px);
}
.code-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .8rem 1.2rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border2);
}
.code-header .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }
.code-filename {
  margin-left: auto;
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--text3);
}
.code-body {
  padding: 1.5rem;
  font-family: var(--font-mono); font-size: .85rem;
  line-height: 1.8; color: #e2e8f0;
  overflow-x: auto;
}
.code-body .kw  { color: #6ee7b7; }
.code-body .fn  { color: #34d399; }
.code-body .str { color: #86efac; }
.code-body .bool{ color: #f97316; }

/* ─── SECTIONS ─── */
.section { padding: 6rem 0; }
.section-alt { background: var(--bg2); }

.section-header { text-align: center; margin-bottom: 4rem; }

.section-tag {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent2); margin-bottom: .75rem; display: block;
}

.section-title {
  font-family: var(--font-disp);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800; letter-spacing: -.02em;
  margin-bottom: .5rem;
}

.section-sub {
  color: var(--text2); font-size: 1.05rem;
  max-width: 500px; margin: 0 auto;
}

/* ─── ABOUT ─── */
.about-grid {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 4rem; align-items: center;
}
.about-card { display: flex; justify-content: center; }
.about-avatar {
  position: relative; width: 180px; height: 180px;
}
.avatar-ring {
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent3)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  animation: spin-ring 8s linear infinite;
}
@keyframes spin-ring { to { transform: rotate(360deg); } }

.avatar-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp); font-size: 2.5rem; font-weight: 800;
  color: var(--accent2);
  border: 2px solid var(--border);
}

.avatar-photo {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--border);
  box-shadow: 0 0 40px rgba(16,185,129,.25);
  display: block;
}

.about-text p {
  color: var(--text2); margin-bottom: 1rem; font-size: 1.05rem;
}
.about-text strong { color: var(--text); }

.about-stats {
  display: flex; gap: 2rem; margin-top: 2rem;
}
.stat { text-align: center; }
.stat-num {
  font-family: var(--font-disp); font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}
.stat-label { font-family: var(--font-mono); font-size: .78rem; color: var(--text3); }

/* ─── TIMELINE ─── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--accent), transparent);
}
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-dot {
  position: absolute; left: -2.45rem; top: 1.5rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 16px var(--accent2);
}
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 700px; margin: 0 auto;
}
.timeline-card:hover { border-color: var(--accent2); box-shadow: 0 0 40px rgba(16,185,129,.15); }

.timeline-badge {
  display: inline-block;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3);
  color: var(--green); font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .2rem .7rem; border-radius: 99px; margin-bottom: 1rem;
}
.timeline-card h3 {
  font-family: var(--font-disp); font-size: 1.25rem; font-weight: 700;
  margin-bottom: .35rem;
}
.timeline-sub { color: var(--accent2); font-weight: 600; margin-bottom: .25rem; }
.timeline-detail { color: var(--text2); font-size: .95rem; margin-bottom: 1rem; }
.timeline-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.timeline-tags span {
  font-family: var(--font-mono); font-size: .72rem;
  background: rgba(16,185,129,.1); border: 1px solid var(--border);
  color: var(--text2); padding: .2rem .65rem; border-radius: 99px;
}

/* ─── SKILLS ─── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.skill-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(16,185,129,.06), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 10px 40px rgba(16,185,129,.15); }
.skill-card:hover::before { opacity: 1; }

.skill-icon { font-size: 2.4rem; }
.skill-icon i { font-size: 2.4rem; }

.skill-card span {
  font-family: var(--font-mono); font-size: .85rem; color: var(--text2);
}

.skill-bar {
  width: 100%; height: 3px;
  background: rgba(255,255,255,.06); border-radius: 99px;
  overflow: hidden;
}
.skill-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width 1.2s cubic-bezier(.4,0,.2,1) .3s;
}
.skill-card.visible .skill-fill { width: var(--pct); }

/* ─── PROJECTS ─── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-6px); box-shadow: 0 20px 50px rgba(16,185,129,.18); }

.project-card-inner { padding: 2rem; height: 100%; display: flex; flex-direction: column; gap: 1rem; }

.project-header { display: flex; justify-content: space-between; align-items: flex-start; }
.project-icon {
  width: 46px; height: 46px;
  background: rgba(16,185,129,.12); border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2);
}
.project-icon svg { width: 22px; height: 22px; }

.project-links a {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); transition: var(--transition);
}
.project-links a:hover { color: var(--text); border-color: var(--accent); background: rgba(16,185,129,.1); }
.project-links svg { width: 16px; height: 16px; }

.project-title {
  font-family: var(--font-disp); font-size: 1.1rem; font-weight: 700;
}
.project-desc { color: var(--text2); font-size: .93rem; flex-grow: 1; }

.project-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.project-tech { display: flex; gap: .4rem; flex-wrap: wrap; }
.tech-tag {
  font-family: var(--font-mono); font-size: .7rem;
  background: rgba(6,182,212,.08); border: 1px solid rgba(6,182,212,.2);
  color: var(--accent3); padding: .15rem .55rem; border-radius: 99px;
}
.project-stars {
  display: flex; align-items: center; gap: .3rem;
  font-family: var(--font-mono); font-size: .78rem; color: var(--text3);
}
.project-stars svg { width: 13px; height: 13px; color: #f59e0b; }

/* ─── GITHUB ─── */
.github-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem; margin-bottom: 2rem;
}
.github-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.github-card:hover { border-color: var(--accent); }
.github-card img { border-radius: 8px; }
.github-card-wide { grid-column: 1 / -1; }

.github-cta { text-align: center; }

/* ─── CONTACT ─── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem; max-width: 900px; margin: 0 auto;
}
.contact-card {
  display: flex; align-items: center; gap: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: var(--transition); color: var(--text);
}
.contact-card:hover { border-color: var(--accent); transform: translateX(4px); box-shadow: 0 8px 30px rgba(16,185,129,.12); }

.contact-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  background: rgba(16,185,129,.1); border: 1px solid var(--border);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--accent2);
}
.contact-icon svg { width: 22px; height: 22px; }

.contact-label { font-family: var(--font-mono); font-size: .72rem; color: var(--text3); margin-bottom: .15rem; }
.contact-value { font-size: .88rem; font-weight: 500; }

.contact-arrow { width: 18px; height: 18px; margin-left: auto; flex-shrink: 0; color: var(--text3); transition: var(--transition); }
.contact-card:hover .contact-arrow { color: var(--accent2); transform: translate(3px, -3px); }

/* ─── FOOTER ─── */
.footer {
  padding: 2.5rem 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border2);
}
.footer-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.footer-logo {
  font-family: var(--font-disp); font-size: 1.3rem; font-weight: 800;
}
.footer-copy { font-size: .85rem; color: var(--text3); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  font-family: var(--font-mono); font-size: .78rem; color: var(--text3);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent2); }

/* ─── BACK TO TOP ─── */
.back-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 800;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.back-top svg { width: 18px; height: 18px; }
.back-top.show { opacity: 1; pointer-events: all; transform: translateY(0); }
.back-top:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 6rem 5vw 4rem;
  }
  .hero-desc { margin-inline: auto; }
  .hero-btns { justify-content: center; }
  .hero-scroll { justify-content: center; }
  .hero-code { display: none; }

  .about-grid { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
  .about-stats { justify-content: center; }

  .github-grid { grid-template-columns: 1fr; }
  .github-card-wide { grid-column: auto; }
}

@media (max-width: 700px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 520px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .about-stats { gap: 1.2rem; }
}
