/* ============================================================
   Fiorella Licciardiello — Personal Site
   style.css — shared across all pages
   ============================================================ */

/* ----- Google Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;500;600&display=swap');

/* ----- CSS Custom Properties ----- */
:root {
  --bg:        #0d1117;
  --bg-card:   #161b22;
  --bg-hover:  #1c2333;
  --border:    #30363d;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --accent:    #f0b429;
  --accent-dim: rgba(240, 180, 41, 0.15);
  --accent-glow: rgba(240, 180, 41, 0.35);
  --green:     #00d4aa;
  --font-display: 'Courier Prime', 'Courier New', monospace;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  --sidebar-w: 260px;
  --transition: 220ms ease;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   LAYOUT — Sidebar + Content
   ============================================================ */

.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ----- Sidebar ----- */
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.75rem;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  margin-bottom: 2.5rem;
}

.sidebar-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-name span {
  color: var(--accent);
}

.sidebar-tagline {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  line-height: 1.5;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  transition: color var(--transition), background var(--transition);
  position: relative;
}

.sidebar-nav a .nav-prefix {
  color: var(--accent);
  opacity: 0.7;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text);
  background: var(--bg-hover);
}

.sidebar-nav a.active .nav-prefix {
  opacity: 1;
}

/* underline-slide effect */
.sidebar-nav a::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  bottom: 4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.sidebar-nav a:hover::after,
.sidebar-nav a.active::after {
  width: calc(100% - 1.5rem);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.sidebar-footer .status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ----- Main content ----- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  max-width: 900px;
  padding: 4rem 3.5rem;
  animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MOBILE NAV
   ============================================================ */

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.mobile-brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
}

.mobile-brand span { color: var(--accent); }

.hamburger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 199;
  padding: 1rem 1.5rem;
}

.mobile-menu.open { display: block; }

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu a {
  display: block;
  padding: 0.6rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.mobile-menu a:hover,
.mobile-menu a.active { color: var(--accent); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: 1.5rem; color: var(--text); margin-bottom: 1.25rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

.section-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

p { color: var(--muted); margin-bottom: 1rem; }
p strong { color: var(--text); font-weight: 500; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ============================================================
   TERMINAL BLOCK
   ============================================================ */

.terminal {
  background: #0a0e13;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 3rem;
}

.terminal-bar {
  background: #161b22;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red   { background: #ff5f57; }
.terminal-dot.amber { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.5rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 2;
  min-height: 120px;
}

.terminal-line {
  color: var(--muted);
  display: block;
  opacity: 0;
}

.terminal-line.visible { opacity: 1; }

.terminal-line .prompt { color: var(--accent); }
.terminal-line .cmd    { color: var(--text); }
.terminal-line .ok     { color: var(--green); }

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   CHIPS / TAGS
   ============================================================ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}

.chip.accent {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ============================================================
   CV / RESUME SECTION
   ============================================================ */

.cv-section { margin-bottom: 2.5rem; }

.cv-entry {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.cv-entry:last-child { border-bottom: none; }

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.cv-role {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.cv-company {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.cv-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.cv-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition);
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Language bar */
.lang-item {
  margin-bottom: 1rem;
}

.lang-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.lang-level { color: var(--muted); }

.lang-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.lang-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s ease;
}

/* Currently learning widget */
.learning-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
}

.learning-widget .lw-prefix { color: var(--green); }
.learning-widget .lw-item   { color: var(--text); font-weight: 500; min-width: 120px; }

/* ============================================================
   PROJECTS CARDS
   ============================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.35), 0 4px 24px rgba(240, 180, 41, 0.15);
  transform: translateY(-2px);
}

.project-card.placeholder {
  border-style: dashed;
  opacity: 0.6;
}

.project-card.placeholder:hover {
  opacity: 0.9;
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.card-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: auto;
  transition: opacity var(--transition);
}

.card-link:hover { opacity: 0.7; }

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-weight: 500;
}

.badge.soon {
  background: rgba(0, 212, 170, 0.12);
  color: var(--green);
  border: 1px solid var(--green);
}

.badge.locked {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ============================================================
   CONTACT FORM
   ============================================================ */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 560px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b949e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.15);
}

.form-group textarea { resize: vertical; min-height: 130px; }

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  align-self: flex-start;
}

.btn-submit:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.form-note {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
}

/* ============================================================
   CONTACTS PAGE
   ============================================================ */

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
  margin-bottom: 2.5rem;
}

.contact-link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color var(--transition), background var(--transition);
}

.contact-link-item:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.contact-link-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.contact-link-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}

.contact-link-value {
  font-size: 0.8rem;
  color: var(--muted);
}

.ascii-art {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--border);
  line-height: 1.4;
  white-space: pre;
  margin: 2rem 0;
}

.uptime-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 1rem;
}

.uptime-widget .ut-label { color: var(--green); }

/* ============================================================
   OPPORTUNITIES PAGE
   ============================================================ */

.collab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.collab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color var(--transition);
}

.collab-card:hover { border-color: var(--accent); }

.collab-card h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.collab-card p {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .collab-grid   { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }

  .main-content {
    margin-left: 0;
    padding: 5.5rem 1.5rem 3rem;
    max-width: 100%;
  }

  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid   { grid-template-columns: repeat(2, 1fr); }
  .collab-grid   { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .main-content { padding: 5rem 1rem 2.5rem; }
  .chips { gap: 0.35rem; }
  h1 { font-size: 1.65rem; }
}

/* ============================================================
   CONSTELLATION CANVAS
   ============================================================ */

#constellation-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Tooltip shown on dot click */
.constellation-tooltip {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transform: translateX(-50%) translateY(-100%);
  margin-top: -10px;
  white-space: nowrap;
  transition: opacity 0.18s ease;
}

.constellation-tooltip.visible {
  opacity: 1;
}

/* ============================================================
   HERO SECTION (index.html)
   ============================================================ */

.hero-section {
  padding: 1.5rem 0 3rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: 0.85rem;
  letter-spacing: 0.05em;
}

/* ============================================================
   BIO BLOCK
   ============================================================ */

.bio-block {
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.bio-block p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.bio-block p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   CV COLLAPSIBLE
   ============================================================ */

.cv-wrapper {
  position: relative;
  max-height: 185px;
  overflow: hidden;
  transition: max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-wrapper.expanded {
  max-height: 6000px;
}

.cv-expand-mask {
  height: 90px;
  margin-top: -90px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  position: relative;
  z-index: 2;
  transition: opacity 0.25s ease;
}

.cv-expand-mask.hidden {
  opacity: 0;
}

.cv-toggle-btn {
  display: inline-block;
  margin-top: 0.9rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
}

.cv-toggle-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.cv-download-row {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #0d1117;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.7rem 1.5rem;
  text-decoration: none;
  border: none;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-download:hover {
  opacity: 0.85;
  color: #0d1117;
  transform: translateY(-1px);
}

/* ============================================================
   RESPONSIVE — constellation / hero overrides
   ============================================================ */

@media (max-width: 768px) {
  .hero-section {
    padding: 0.5rem 0 2rem;
  }
}

@media (max-width: 390px) {
  .hero-name { font-size: 2rem; }
  .hero-tagline { font-size: 0.9rem; }
}
