/* ============================================
   La Cassetta degli AI-trezzi — Sito Principale
   Brand: Dark-first, Teal accent
   ============================================ */

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

:root {
  --brand: #2DD4A8;
  --brand-light: #5EEAD2;
  --brand-dark: #0D9488;
  --brand-glow: rgba(45, 212, 168, 0.15);
  --brand-badge: rgba(13, 148, 136, 0.2);

  --bg: #292524;
  --surface: #2D2D2D;
  --hover: #3A3A3A;
  --border: #454545;
  --elevated: #4A4A4A;

  --text: #FFFFFF;
  --text-secondary: #A9A8A7;
  --text-muted: #9CA3AF;
  --text-dark: #363231;

  --success: #4ADE80;
  --info: #60A5FA;
  --warning: #FDE047;
  --error: #F87171;
  --violet: #C084FC;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-serif: 'Spectral', Georgia, 'Times New Roman', serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--brand-light);
}

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

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(41, 37, 36, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand .icon {
  color: var(--brand);
  font-size: 1.3rem;
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--brand);
}

.nav-cta {
  background: var(--brand);
  color: var(--text-dark);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.15s;
}

.nav-cta:hover {
  background: var(--brand-light);
  color: var(--text-dark);
  transform: translateY(-1px);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Hero Section --- */
.hero {
  padding: 160px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  position: relative;
}

.hero h1 .highlight {
  color: var(--brand);
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--brand);
  color: var(--text-dark);
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.05rem;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(45, 212, 168, 0.25);
}

.hero-cta:hover {
  background: var(--brand-light);
  color: var(--text-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(45, 212, 168, 0.35);
}

.hero-meta {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--brand);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* --- La Cassetta (Story) Section --- */
.story {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.story-content {
  max-width: 720px;
  margin: 0 auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.story-content p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.story-content strong {
  color: var(--text);
}

/* --- Featured App --- */
.featured-app {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 40px;
}

.featured-app-badge {
  display: inline-block;
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.featured-app-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.featured-app-info p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.featured-app-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.featured-app-preview iframe {
  border: none;
  border-radius: var(--radius-sm);
  pointer-events: none;
  transform: scale(0.75);
  transform-origin: top left;
  width: 133.33%;
  height: 560px;
}

.featured-app-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(41, 37, 36, 0.95));
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
}

.featured-app-overlay:hover {
  color: var(--brand-light);
}

/* Mobile: hide iframe, show link button */
.featured-app-preview-mobile {
  display: none;
}

@media (max-width: 768px) {
  .featured-app {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .featured-app-preview-desktop {
    display: none;
  }

  .featured-app-preview-mobile {
    display: block;
  }

  .featured-app-mobile-link {
    display: block;
    text-align: center;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 24px;
    color: var(--brand);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s;
  }

  .featured-app-mobile-link:hover {
    background: var(--brand-badge);
    border-color: var(--brand-dark);
  }
}

/* --- App Grid --- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-dark);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.app-card-image {
  width: 100%;
  height: 180px;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
  position: relative;
}

.app-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--brand-badge);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-card-badge.coming-soon {
  background: rgba(253, 224, 71, 0.15);
  color: var(--warning);
}

.app-card-badge.free {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.app-card-body {
  padding: 24px;
}

.app-card-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand);
  margin-bottom: 8px;
}

.app-card-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.app-card-tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.app-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  transition: gap 0.2s;
}

.app-card-link:hover {
  gap: 10px;
}

.app-card-link .arrow {
  transition: transform 0.2s;
}

.app-card-link:hover .arrow {
  transform: translateX(2px);
}

/* Empty state */
.apps-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* Filter pills */
.apps-filters {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--brand-badge);
  border-color: var(--brand-dark);
  color: var(--brand);
}

/* --- About Section --- */
.about {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}

.about-photo {
  width: 280px;
  height: 280px;
  border-radius: var(--radius);
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--text-muted);
  border: 2px solid var(--border);
}

.about-content h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-role {
  color: var(--brand);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 20px;
}

.about-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.about-tag {
  background: var(--brand-badge);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
}

/* --- Pricing Section --- */
.pricing {
  background: var(--bg);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 780px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.pricing-card-featured {
  border-color: var(--brand-dark);
  background: linear-gradient(135deg, var(--bg) 0%, rgba(13, 148, 136, 0.05) 100%);
}

.pricing-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--text-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-card-header {
  text-align: center;
  margin-bottom: 32px;
}

.pricing-card-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.pricing-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
}

.pricing-period {
  font-size: 1rem;
  color: var(--text-secondary);
}

.pricing-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(69, 69, 69, 0.3);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-features .check {
  color: var(--brand);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-features .check.highlight {
  color: var(--brand-light);
}

.pricing-features strong {
  color: var(--text);
}

.pricing-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.pricing-btn-primary {
  background: var(--brand);
  color: var(--text-dark);
  box-shadow: 0 4px 20px rgba(45, 212, 168, 0.25);
}

.pricing-btn-primary:hover {
  background: var(--brand-light);
  color: var(--text-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(45, 212, 168, 0.35);
}

.pricing-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.pricing-btn-secondary:hover {
  border-color: var(--brand-dark);
  color: var(--brand);
}

/* --- CTA Buttons Row --- */
.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta-outline {
  background: transparent;
  border: 2px solid var(--brand);
  color: var(--brand);
  box-shadow: none;
}

.hero-cta-outline:hover {
  background: var(--brand);
  color: var(--text-dark);
  box-shadow: 0 6px 30px rgba(45, 212, 168, 0.35);
}

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  padding: 100px 0;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
}

.cta-section p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto 36px;
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--brand);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }

  .container {
    padding: 0 16px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .nav-cta {
    display: none;
  }

  .hero {
    padding: 120px 0 80px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .story-content p {
    font-size: 1rem;
    line-height: 1.75;
  }

  .featured-app {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 24px;
  }

  .featured-app-info h3 {
    font-size: 1.3rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .about-photo {
    margin: 0 auto;
    width: 180px;
    height: 180px;
  }

  .about-content h3 {
    font-size: 1.3rem;
  }

  .about-tags {
    justify-content: center;
  }

  .about-tag {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .pricing-card {
    padding: 28px 20px;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .hero-cta {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}
