/* ============================================
   Rizzello Software Systems — Stylesheet
   ============================================ */

:root {
  --bg:          #0a0a0b;
  --bg-raised:   #111113;
  --bg-card:     #161618;
  --border:      #222225;
  --text:        #e4e4e7;
  --text-muted:  #71717a;
  --accent:      #22d3ee;
  --accent-dim:  #0e7490;
  --mono:        'JetBrains Mono', monospace;
  --sans:        'Inter', -apple-system, sans-serif;
  --max-width:   1120px;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Cursor glow ---- */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.06) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: opacity 0.3s;
  opacity: 0;
}
.cursor-glow.active { opacity: 1; }

/* ---- Nav ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 10, 11, 0.8);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.logo-bracket { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.2s;
  letter-spacing: 0.02em;
}
.nav-links a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle.open span:last-child { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(10, 10, 11, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  flex-direction: column;
  padding: 1.5rem 2rem;
  gap: 1.2rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--accent); }

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 2rem 80px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 4rem;
}
.hero-content { flex: 1; max-width: 560px; }
.hero-tag {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.line-number {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-dim);
  letter-spacing: 0.05em;
}
.tag-text {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.hero-line { display: block; }
.hero-line.accent { color: var(--accent); }
.cursor-blink {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}
@keyframes blink {
  50% { opacity: 0; }
}
.hero-sub {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 480px;
  line-height: 1.7;
}
.hero-cta {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover {
  background: #06b6d4;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.25);
}
.btn-primary .arrow {
  transition: transform 0.2s;
}
.btn-primary:hover .arrow {
  transform: translateX(3px);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

/* Code decoration */
.hero-decoration {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
}
.code-block {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-muted);
  width: 100%;
  overflow-x: auto;
  position: relative;
}
.code-block::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 16px 0 0 #eab308, 32px 0 0 #22c55e;
}
.code-block code {
  display: block;
  margin-top: 16px;
}
.code-keyword { color: #c084fc; }
.code-var { color: var(--text); }
.code-key { color: #22d3ee; }
.code-string { color: #34d399; }

/* ---- Sections ---- */
.section {
  padding: 100px 2rem;
  position: relative;
}
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-dark {
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.05em;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
}
.text-accent { color: var(--accent); }

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-text h2 {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}
.about-text p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 0.5rem;
}
.stat {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.stat-number {
  display: block;
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

/* ---- Services ---- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.service-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  transition: border-color 0.3s, transform 0.3s;
}
.service-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}
.service-icon {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.service-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.service-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ---- Projects ---- */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.project-card {
  display: block;
  padding: 2rem 2.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.project-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(34, 211, 238, 0.08);
}
.project-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.project-index {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-dim);
  min-width: 24px;
}
.project-title-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.project-title-row h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.project-type {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.project-arrow {
  font-family: var(--mono);
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}
.project-card:hover .project-arrow {
  transform: translateX(4px);
  color: var(--accent);
}
.project-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  max-width: 720px;
}
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.project-tech span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s;
}
.project-card:hover .project-tech span {
  border-color: rgba(34, 211, 238, 0.12);
  color: var(--text);
}

/* ---- Contact ---- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.contact-content {
  max-width: 560px;
}
.contact-content h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.contact-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.contact-email {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--accent);
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  transition: all 0.2s;
}
.contact-email:hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.contact-meta {
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.separator { opacity: 0.4; }

/* ---- Form ---- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-field label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.form-field input,
.form-field textarea {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #3f3f46;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}
.btn-submit {
  align-self: flex-start;
  margin-top: 0.25rem;
}
.btn-submit.sending {
  opacity: 0.6;
  pointer-events: none;
}
.form-status {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0;
  border-radius: 6px;
  transition: opacity 0.3s;
}
.form-status.success {
  color: #34d399;
}
.form-status.error {
  color: #f87171;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-logo {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
}
.footer-contact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}
.footer-contact a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-contact a:hover {
  color: var(--accent);
}
.footer-sep {
  color: var(--text-muted);
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Scroll animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: left;
    padding-top: 100px;
    gap: 3rem;
    min-height: auto;
  }
  .hero-decoration { max-width: 100%; }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .hero { padding: 100px 1.25rem 60px; }
  .section { padding: 70px 1.25rem; }
  .project-card { padding: 1.25rem 1.25rem; }
  .project-header { gap: 0.75rem; }
  .project-title-row h3 { font-size: 1.1rem; }
  .contact-email { font-size: 0.95rem; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
  .footer-contact { flex-direction: column; gap: 0.25rem; }
}
