/* ==========================================================================
   ALESSANDRO MAINARDI — DEVELOPER PORTFOLIO
   Minimal, Professional Tech Aesthetic
   ========================================================================== */

:root {
  --bg-color: #000000;
  --bg-panel: #0a0a0a;
  --text-color: #ededed;
  --text-muted: #888888;
  --border-color: #222222;
  --border-hover: #444444;
  --accent-color: #ffffff;
  
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grid background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: 
    linear-gradient(var(--border-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.3;
  mask-image: radial-gradient(circle at 50% 0%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, black 20%, transparent 80%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */

.eyebrow {
  margin: 0;
  color: var(--text-muted);
  font: 500 0.75rem/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section {
  padding-left: 5vw;
  padding-right: 5vw;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  height: 64px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wordmark {
  font: 700 1.2rem/1 var(--font-mono);
  color: var(--text-color);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  font: 400 0.85rem/1 var(--font-mono);
  color: var(--text-muted);
  transition: color 0.2s;
}

nav a:hover {
  color: var(--text-color);
}

.availability {
  font: 500 0.75rem/1 var(--font-mono);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-color);
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: background 0.2s;
}

.availability:hover {
  background: var(--bg-panel);
}

.availability span {
  width: 6px;
  height: 6px;
  display: block;
  background: #10b981; /* Precise status green */
  border-radius: 50%;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  min-height: 80vh;
  padding-top: 80px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.hero-copy {
  margin: auto 0;
  max-width: 1000px;
  position: relative;
  z-index: 10;
}

.hero h1 {
  margin: 2rem 0;
  font-family: var(--font-sans);
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 600;
  text-wrap: balance;
  color: var(--text-color);
}

.hero h1 span {
  color: var(--text-muted);
}

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 4rem;
}

.hero-bottom p {
  max-width: 400px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.hero-explore {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-explore span {
  color: var(--text-muted);
  font: 500 0.75rem var(--font-mono);
  letter-spacing: 0.1em;
}

.round-link {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  transition: 0.2s;
}

.round-link svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.round-link:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

/* Developer Console */
.hero-console {
  position: absolute;
  right: 5vw;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font: 400 0.8rem/1.6 var(--font-mono);
  color: var(--text-muted);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.console-bar {
  height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.console-bar span { width: 10px; height: 10px; border-radius: 50%; background: #333; }
.console-bar b { margin-left: auto; font-weight: 500; font-size: 0.7rem; color: var(--text-muted); }

.hero-console p { margin: 0; padding: 0 16px; }
.hero-console p:first-of-type { padding-top: 12px; }
.hero-console p:last-of-type { padding-bottom: 12px; }
.hero-console .indent { padding-left: 2rem; }
.hero-console i { color: #3b82f6; font-style: normal; } /* const */
.hero-console strong { color: #10b981; font-weight: normal; } /* string */
.hero-console em { color: var(--text-color); font-style: normal; animation: blink 1s steps(2) infinite; }

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

/* ==========================================================================
   Ticker
   ========================================================================== */

.ticker {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-panel);
  height: 48px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ticker-track {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3rem;
  font: 400 0.8rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  animation: scroll 30s linear infinite;
}

.ticker-track i {
  color: var(--border-color);
  font-style: normal;
}

@keyframes scroll {
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   Work Section
   ========================================================================== */

.work {
  padding-top: 120px;
  padding-bottom: 120px;
}

.section-intro {
  margin-bottom: 60px;
}

.section-intro p:last-child {
  margin: 1rem 0 0;
  max-width: 500px;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.project-featured {
  grid-column: span 2;
}

.project-visual {
  display: block;
  min-height: 400px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  position: relative;
  transition: border-color 0.2s;
  overflow: hidden;
}

.project-visual:hover {
  border-color: var(--border-hover);
}

.project-featured .project-visual {
  min-height: 500px;
}

.visual-label {
  position: absolute;
  top: 1rem;
  left: 1.2rem;
  font: 500 0.75rem var(--font-mono);
  color: var(--text-muted);
}

.visual-arrow {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: 0.2s;
}

.project-visual:hover .visual-arrow {
  color: var(--text-color);
  transform: translate(2px, -2px);
}

/* Dynamic Visuals (Requested by User) */
.hero-visuals {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 50vw;
  min-width: 500px;
  z-index: -1;
  pointer-events: none;
  overflow: visible;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  mix-blend-mode: screen;
  animation: float 16s ease-in-out infinite alternate;
}

.hero-glow.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4), transparent 70%);
  top: 10%;
  right: 20%;
}

.hero-glow.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3), transparent 65%);
  top: 35%;
  right: -5%;
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.05); }
  100% { transform: translate(40px, -20px) scale(0.95); }
}

.hero-orbit {
  position: absolute;
  width: 340px;
  height: 340px;
  right: 18%;
  top: 22%;
  z-index: 2;
  animation: spin 30s linear infinite;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.hero-orbit svg {
  width: 100%;
  height: 100%;
  fill: var(--text-muted);
  font: 500 13px var(--font-mono);
  letter-spacing: 6px;
  opacity: 0.6;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Rich Project Visuals */
.visual-aurora {
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.15) 0, transparent 60%),
              radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0, transparent 50%),
              var(--bg-panel);
  background-size: 200% 200%;
  animation: slowPan 15s ease-in-out infinite alternate;
}

.visual-grid {
  background: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(135deg, #0a0a0a, #0f172a);
  background-size: 20px 20px, 20px 20px, 100% 100%;
}

.visual-type {
  background: radial-gradient(circle at 0% 100%, rgba(16, 185, 129, 0.1) 0, transparent 70%), var(--bg-panel);
}

@keyframes slowPan {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

.project-meta {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.project-meta h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
}

.project-meta p {
  margin: 0;
  font: 400 0.8rem var(--font-mono);
  color: var(--text-muted);
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about {
  padding-top: 120px;
  padding-bottom: 120px;
  border-top: 1px solid var(--border-color);
}

.about-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.about h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 500;
}

.about-copy {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  background: var(--bg-panel);
}

.about-copy > p {
  margin: 0 0 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.about ul {
  padding: 0;
  margin: 0;
  list-style: none;
  border-top: 1px solid var(--border-color);
}

.about li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  font: 400 0.9rem var(--font-mono);
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.about li span {
  color: var(--text-color);
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact {
  padding-top: 120px;
  padding-bottom: 120px;
  border-top: 1px solid var(--border-color);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact h2 {
  margin: 2rem 0;
  font-size: clamp(3rem, 8vw, 8rem);
  letter-spacing: -0.04em;
  line-height: 1;
  font-weight: 600;
}

.email-link {
  font: 500 clamp(1.2rem, 3vw, 2.5rem) var(--font-mono);
  color: var(--text-muted);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.email-link span {
  transition: 0.2s;
}

.email-link:hover {
  color: var(--text-color);
}

.email-link:hover span {
  transform: translate(4px, -4px);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem 5vw;
  border-top: 1px solid var(--border-color);
  font: 400 0.8rem var(--font-mono);
  color: var(--text-muted);
}

footer p {
  margin: 0;
}

footer div {
  display: flex;
  gap: 2rem;
}

footer a:hover {
  color: var(--text-color);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .hero-console {
    display: none;
  }
}

@media (max-width: 768px) {
  .project-grid, .about-grid {
    grid-template-columns: 1fr;
  }
  .project-featured {
    grid-column: 1;
  }
  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }
  nav {
    display: none;
  }
}
