/* ============================================
   Lorenzo Padoan - Static Website Styles
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================
   CSS Variables (Theme)
   ============================================ */
:root {
  /* Light Mode Colors */
  --background: #f5f0e8;
  --foreground: #3d3630;
  --card: #ede5d8;
  --card-foreground: #3d3630;
  --primary: #8b6b4a;
  --primary-foreground: #fafafa;
  --secondary: #4a3f35;
  --secondary-foreground: #f5f0e8;
  --muted: #ddd5c8;
  --muted-foreground: #6b5f52;
  --accent: #c9a050;
  --accent-foreground: #3d3630;
  --border: #d4c9b8;
  --input: #d4c9b8;
  --ring: #c9a050;

  /* Radius */
  --radius: 0.75rem;
  --radius-sm: 0.375rem;
  --radius-lg: 1.125rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --background: #1a1a2e;
    --foreground: #f0ede8;
    --card: #242442;
    --card-foreground: #f0ede8;
    --primary: #d4a855;
    --primary-foreground: #1a1a2e;
    --secondary: #2a2a4a;
    --secondary-foreground: #f0ede8;
    --muted: #2f2f4f;
    --muted-foreground: #a8a098;
    --accent: #c9a050;
    --accent-foreground: #1a1a2e;
    --border: #3a3a5c;
    --input: #3a3a5c;
    --ring: #c9a050;
  }
}

/* Manual Dark Mode Toggle */
.dark {
  --background: #1a1a2e;
  --foreground: #f0ede8;
  --card: #242442;
  --card-foreground: #f0ede8;
  --primary: #d4a855;
  --primary-foreground: #1a1a2e;
  --secondary: #2a2a4a;
  --secondary-foreground: #f0ede8;
  --muted: #2f2f4f;
  --muted-foreground: #a8a098;
  --accent: #c9a050;
  --accent-foreground: #1a1a2e;
  --border: #3a3a5c;
  --input: #3a3a5c;
  --ring: #c9a050;
}

/* ============================================
   Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--foreground);
}

h1 { font-size: 3rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

@media (min-width: 768px) {
  h1 { font-size: 3.75rem; }
  h2 { font-size: 1.75rem; }
}

.text-muted {
  color: var(--muted-foreground);
}

.text-accent {
  color: var(--accent);
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.section {
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 4rem 0;
  }
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Text alignment */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  background-color: rgba(var(--background), 0.8);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  transition: color 0.2s;
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--accent);
  background-color: var(--muted);
}

.nav-link.active {
  color: var(--accent);
  background-color: rgba(201, 160, 80, 0.1);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius);
  background-color: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-toggle:hover {
  color: var(--accent);
  background-color: var(--muted);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,
    rgba(201, 160, 80, 0.05) 0%,
    rgba(139, 107, 74, 0.05) 50%,
    var(--background) 100%);
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .hero-content {
    padding: 4rem 1.5rem;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background-color: rgba(201, 160, 80, 0.1);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

/* ============================================
   Form Card
   ============================================ */
.form-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .form-card {
    padding: 2rem;
  }
}

.form-card h3 {
  margin-bottom: 0.5rem;
}

.form-card .subtitle {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.input-wrapper {
  position: relative;
}

.input-wrapper svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  width: 20px;
  height: 20px;
}

input[type="email"] {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 160, 80, 0.2);
}

input[type="email"]::placeholder {
  color: var(--muted-foreground);
}

.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-wrapper label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  cursor: pointer;
}

@media (min-width: 768px) {
  .checkbox-wrapper label {
    font-size: 0.875rem;
  }
}

.form-footer {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
  margin-top: 1rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  width: 100%;
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 4px 12px rgba(139, 107, 74, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(201, 160, 80, 0.4);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ============================================
   Profile Section
   ============================================ */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

.profile-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  margin-bottom: 1.5rem;
}

.profile h1 {
  margin-bottom: 0.75rem;
}

.profile-bio {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin-bottom: 1rem;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.profile-meta-item svg {
  color: var(--accent);
  width: 16px;
  height: 16px;
}

.profile-meta a:hover {
  color: var(--accent);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem 1.5rem 0;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-title svg {
  color: var(--accent);
  width: 24px;
  height: 24px;
}

.card-content {
  padding: 1.5rem;
}

/* Achievement Card */
.achievements-card {
  max-width: 700px;
  width: 100%;
}

.achievement {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
}

.achievement:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.achievement-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(201, 160, 80, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.achievement-content h3 {
  margin-bottom: 0.25rem;
}

.achievement-content p {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.achievement-content a {
  color: var(--accent);
  font-weight: 500;
}

.achievement-content a:hover {
  text-decoration: underline;
}

/* Repository Card */
.repo-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.repo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.repo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.repo-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  transition: color 0.2s;
}

.repo-card:hover .repo-title {
  color: var(--accent);
}

.repo-link {
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.repo-link:hover {
  color: var(--accent);
}

.repo-description {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.repo-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: auto;
}

.repo-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.repo-stat svg {
  color: var(--accent);
  width: 16px;
  height: 16px;
}

/* ============================================
   Badges
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.badge-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.badge-secondary {
  background-color: var(--muted);
  color: var(--foreground);
}

/* ============================================
   CV Page Specific
   ============================================ */
.cv-header {
  text-align: center;
  padding: 3rem 1.5rem;
}

.cv-header h1 {
  margin-bottom: 1rem;
}

.cv-header p {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto;
}

.cv-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
}

.contact-item svg {
  color: var(--accent);
  width: 18px;
  height: 18px;
}

.contact-item a:hover {
  color: var(--accent);
}

.experience-item {
  padding: 1rem 0;
}

.experience-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.experience-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.experience-company {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
}

.experience-role {
  color: var(--accent);
  font-weight: 500;
}

.experience-list {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--muted-foreground);
}

.experience-list li {
  margin-bottom: 0.5rem;
}

.skills-category {
  margin-bottom: 1rem;
}

.skills-category:last-child {
  margin-bottom: 0;
}

.skills-category h4 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.education-item {
  padding: 1rem 0;
}

.education-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.education-school {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
}

.education-degree {
  color: var(--accent);
  font-weight: 500;
}

.education-courses {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
}

.language-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.language-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.language-name {
  font-weight: 500;
}

/* ============================================
   Separator
   ============================================ */
.separator {
  height: 1px;
  background-color: var(--border);
  margin: 1rem 0;
}

/* ============================================
   Icons (inline SVG placeholders)
   ============================================ */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
