/*
  Unreal Engine-inspired portfolio
  - Scroll animations
  - Hero section with fluid reveal
  - UE editor dark aesthetic with yellow/gold accent
*/

:root{
  /* Unreal Engine editor color palette - grey/dark theme */
  --bg: #1e1e1e;        /* dark grey background */
  --bg-2: #2d2d2d;      /* slightly lighter grey */
  --text: #e0e0e0;      /* light grey text */
  --muted: #a0a0a0;     /* muted grey */
  --accent: #ffc107;    /* yellow/gold accent (UE selection color) */
  --accent-2: #ffb300;  /* amber accent */
  --accent-glow: rgba(255, 193, 7, 0.4);
  --card: rgba(45, 45, 45, 0.9);
  --border: rgba(128, 128, 128, 0.2);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.6);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth; overflow-x:hidden}


body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background: radial-gradient(ellipse at top, #1a1f3a 0%, #0d0d1a 50%, #000000 100%);
  min-height:100vh;
  overflow-x:hidden;
  position:relative;
}
body::after{
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 193, 7, 0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 179, 0, 0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}


.container{
  width:min(1100px, 92%);
  margin-inline:auto;
  position:relative;
  z-index:1;
}

.site-header{
  position:fixed; top:0; left:0; right:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 4%;
  backdrop-filter:saturate(1.2) blur(20px);
  background:rgba(30, 30, 30, 0.7);
  border-bottom:1px solid var(--border);
  transition: all 0.3s ease;
}
.site-header.scrolled{
  padding:12px 4%;
  background:rgba(30, 30, 30, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.brand{
  color:var(--text);
  text-decoration:none;
  font-weight:700;
  letter-spacing:1px;
  font-size:1.1rem;
  transition: color 0.3s ease;
}
.brand:hover{ color:var(--accent); }
.site-nav{ display:flex; gap:24px }
.site-nav a{
  color:var(--muted);
  text-decoration:none;
  font-weight:500;
  position:relative;
  transition: color 0.3s ease;
}
.site-nav a::after{
  content:'';
  position:absolute;
  bottom:-4px;
  left:0;
  width:0;
  height:2px;
  background:var(--accent);
  transition: width 0.3s ease;
}
.site-nav a:hover{ color:var(--accent); }
.site-nav a:hover::after{ width:100%; }

.section{ padding: clamp(80px, 12vw, 140px) 0; position:relative; z-index:1 }
.section--alt{ background: transparent }

#about.section{ padding-bottom: clamp(18px, 4vw, 48px) }
#contact.section{ padding-top: clamp(18px, 4vw, 48px) }
.about-logo{
  display:flex;
  justify-content:center;
  margin: 0 auto clamp(22px, 5vw, 34px);
}

/* Hero Section */
.hero{
  position:relative;
  min-height:100vh;
  display:grid;
  place-items:center;
  text-align:center;
  overflow:hidden;
  isolation:isolate;
}
.hero__bg{
  position:absolute;
  inset:0;
  z-index:-1;
  background: radial-gradient(ellipse at center, rgba(255, 193, 7, 0.07) 0%, transparent 60%);
}
.hero__content{
  position:relative;
  z-index:1;
}
.ue-mark{
  display:block;
  width: auto;
  height: auto;
  max-width: min(640px, 70vw);
  max-height: min(640px, 70vw);
  border-radius: 0;
  filter: drop-shadow(0 0 18px var(--accent-glow));
}
.hero__tagline{
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.hero .lead{
  color:var(--muted);
  max-width: 60ch;
  margin: 16px auto 32px;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height:1.7;
}
.lead__line{ display:block; }
/* SVG Hero Title */
.hero-title{
  width: 100%;
  max-width: 900px;
  height: auto;
  margin: 0 auto;
  display: block;
  pointer-events: none;
}
.hero-text{
  font-size: 80px;
  font-weight: 800;
  fill: var(--text);
  letter-spacing: -0.02em;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
.hero-text-accent{
  fill: var(--accent);
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

h1{
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height:1.1;
  margin:0;
  font-weight:800;
  letter-spacing:-0.02em;
}
.accent{
  color:var(--accent);
  position:relative;
  display:inline-block;
  text-shadow: 0 0 40px var(--accent-glow);
}

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:20px;
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.3);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  position:relative;
}
.card:hover{
  transform: translateY(-4px);
  border-color: rgba(255, 193, 7, 0.3);
  box-shadow: 0 20px 50px rgba(255, 193, 7, 0.08), 0 8px 16px rgba(0, 0, 0, 0.6);
}

.grid{
  display:grid; gap:16px; grid-template-columns: 1fr;
}
@media (min-width: 700px){
  .grid{ grid-template-columns: 1fr 1fr }
}

.field{ display:flex; flex-direction:column; gap:8px }
/* Honeypot field — parked off-screen rather than display:none, because some
   naive bots skip fields they can see are display:none but still fill
   off-screen ones. Humans never see it; the backends drop filled submissions. */
.field--hp{ position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
.field input,.field textarea{
  background: rgba(2,6,23,.6);
  border:1px solid var(--border);
  color:var(--text);
  border-radius:12px;
  padding:14px 14px;
  outline:none;
}
.field input:focus,.field textarea:focus{ border-color: color-mix(in hsl, var(--accent) 55%, white) }
.field span{ color:var(--muted); font-weight:600; font-size:.95rem }
.error{ color:#f87171; min-height:1em }

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px; padding:14px 28px; border-radius:8px; border:1px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111; font-weight:700; letter-spacing:0.5px; cursor:pointer;
  box-shadow: 0 8px 24px rgba(255, 193, 7, 0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all 0.3s ease;
  position:relative;
  overflow:hidden;
}
.btn::before{
  content:'';
  position:absolute;
  top:0;
  left:-100%;
  width:100%;
  height:100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}
.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 193, 7, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn:hover::before{ left:100%; }
.btn:active{ transform: translateY(0px); }
.actions{ display:flex; align-items:center; gap:16px; margin-top:12px; flex-wrap:wrap }
#form-status{ color:var(--muted) }

.socials{ display:flex; align-items:center; justify-content:center; gap:16px; flex-wrap:wrap }
.socials--inline{ justify-content:flex-start }
.social{
  --size: 48px;
  display:inline-grid; place-items:center; width:var(--size); height:var(--size);
  border-radius:12px; color:var(--muted); text-decoration:none;
  background: rgba(13,17,23,.8); border:1px solid var(--border);
  transition: all .3s ease;
  position:relative;
  overflow:hidden;
}
.social::before{
  content:'';
  position:absolute;
  inset:0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity:0;
  transition: opacity 0.3s ease;
}
.social svg{
  width:22px;
  height:22px;
  position:relative;
  z-index:1;
  transition: transform 0.3s ease;
}
.social:hover{
  transform: translateY(-4px);
  color:white;
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(255, 193, 7, 0.2);
}
.social:hover::before{ opacity:0.15; }
.social:hover svg{ transform: scale(1.1); }

.site-footer{ padding:40px 0; border-top:1px solid var(--border); color:var(--muted); text-align:center }

/* Scroll cue */
.scroll-cue{
  display:inline-grid;
  place-items:center;
  width:48px;
  height:48px;
  margin:24px auto 0;
  color:var(--accent);
  border:2px solid var(--border);
  border-radius:50%;
  transition: all 0.3s ease;
}
.scroll-cue:hover{
  border-color:var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: scale(1.1);
}
.scroll-cue svg{
  width:28px;
  height:28px;
  animation: bounce 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
@keyframes bounce{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(8px); }
}

/* Return to top button */
.back-to-top{
  position:fixed;
  bottom:32px;
  right:32px;
  width:56px;
  height:56px;
  border-radius:50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border:2px solid var(--accent);
  color: #111;
  display:grid;
  place-items:center;
  cursor:pointer;
  z-index:99;
  box-shadow: 0 8px 24px rgba(255, 193, 7, 0.3);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity:0;
  visibility:hidden;
  transform: translateY(100px);
}
.back-to-top.visible{
  opacity:1;
  visibility:visible;
  transform: translateY(0);
}
.back-to-top:hover{
  transform: translateY(-8px) scale(1.1);
  box-shadow: 0 12px 32px rgba(255, 193, 7, 0.5);
}
.back-to-top svg{
  width:28px;
  height:28px;
  transition: transform 0.3s ease;
}
.back-to-top:hover svg{
  transform: translateY(-3px);
}

/* Reveal animations with stagger */
.reveal{
  opacity:0;
  transform: translateY(30px) scale(0.95);
  transition: opacity .8s cubic-bezier(0.16, 1, 0.3, 1), transform .8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.show{
  opacity:1;
  transform:none;
}


/* Accessibility: Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto }
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .back-to-top{ transition: opacity 0.2s ease; }
}

/* Typography tweaks */
section h2{
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0 0 16px 0;
  font-weight:700;
  color:var(--text);
  position:relative;
  display:inline-block;
}
section h2::after{
  content:'';
  position:absolute;
  bottom:-8px;
  left:0;
  width:60px;
  height:3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius:2px;
}
section p{
  line-height:1.8;
  color:var(--muted);
}

/* Noscript message */
.noscript{
  margin: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(13,17,23,.8);
  border:1px solid var(--border);
  backdrop-filter: blur(10px);
}

/* Smooth parallax effect on sections */
.section{
  transform: translateZ(0);
  will-change: transform;
}

/* Mobile responsiveness */
@media (max-width: 768px){
  .site-header{ padding:14px 4%; }
  .brand{ font-size:1rem; }
  .site-nav{ gap:16px; font-size:0.9rem; }
  .back-to-top{
    bottom:20px;
    right:20px;
    width:48px;
    height:48px;
  }
  .back-to-top svg{ width:24px; height:24px; }
  h1{ font-size: clamp(2rem, 10vw, 3rem); }
  .hero .lead{ font-size: 1rem; }
  section h2{ font-size: clamp(1.5rem, 6vw, 2rem); }
}

/* Homelab & Education Additions */
.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.card__badge {
  display: inline-block;
  background: rgba(255, 193, 7, 0.1);
  color: var(--accent);
  border: 1px solid rgba(255, 193, 7, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.education__meta {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

/* Ensure section icons display correctly and glow subtly */
.card__icon svg {
  filter: drop-shadow(0 0 8px var(--accent-glow));
  transition: transform 0.3s ease;
}
.card:hover .card__icon svg {
  transform: scale(1.1) rotate(5deg);
}
