/* =========================================================
   Istituto Ottico Bustese - Global Styles
   Theme tokens live in :root. Change values here to re-skin
   the whole site (colors, fonts, sizing).
   ========================================================= */

:root {
  /* Brand colors */
  --color-primary: #0F2A5E;
  --color-primary-dark: #081A3D;
  --color-primary-light: #1E478E;
  --color-accent: #E8832F;
  --color-accent-dark: #C96A1A;

  /* Neutrals */
  --color-bg: #FFFFFF;
  --color-surface: #F6F7FB;
  --color-text: #1A1F2B;
  --color-text-muted: #5A6374;
  --color-border: #E4E7EE;

  /* Typography */
  --font-heading: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Sizing */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --section-py: clamp(4rem, 8vw, 7rem);

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(15, 42, 94, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 42, 94, 0.1);
  --shadow-lg: 0 20px 50px rgba(15, 42, 94, 0.15);
  --transition: 0.3s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.6; min-height: 100vh; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { text-decoration: none; color: inherit; }

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

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header */
#site-header { background: transparent; }
#site-header.scrolled { background: #fff; box-shadow: var(--shadow-sm); }
.nav-brand, .nav-subtitle, .nav-icon { color: #fff; transition: color var(--transition); }
#site-header.scrolled .nav-brand { color: var(--color-text); }
#site-header.scrolled .nav-subtitle { color: var(--color-text-muted); }
#site-header.scrolled .nav-icon { color: var(--color-text); }

.nav-link {
  position: relative;
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  height: 2px;
  width: 0;
  background: var(--color-accent);
  transition: width var(--transition);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
#site-header.scrolled .nav-link { color: var(--color-text); }
#site-header.scrolled .nav-link:hover { color: var(--color-primary); }

.mobile-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.mobile-link:hover { background: var(--color-surface); color: var(--color-primary); }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: 9999px;
  transition: all var(--transition);
  box-shadow: 0 8px 20px rgba(232, 131, 47, 0.3);
}
.btn-primary:hover { background: var(--color-accent-dark); transform: translateY(-2px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
  font-weight: 600;
  border-radius: 9999px;
  transition: all var(--transition);
}
.btn-outline:hover { background: #fff; color: var(--color-primary); }

/* Sections / Typography */
.section { padding-top: var(--section-py); padding-bottom: var(--section-py); }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-text);
}
#mission .section-title, #mission .eyebrow { color: #fff; }

/* Product cards */
.product-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition);
  border: 1px solid var(--color-border);
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }
.product-img {
  width: calc(100% + 3rem);
  height: 14rem;
  margin: -1.5rem -1.5rem 1.25rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .product-img img { transform: scale(1.08); }
.product-title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.product-desc { color: var(--color-text-muted); font-size: 0.925rem; }

/* Service cards */
.service-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.service-img { aspect-ratio: 16/10; overflow: hidden; }
.service-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.service-card:hover .service-img img { transform: scale(1.05); }
.service-title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}
.service-desc { color: var(--color-text-muted); font-size: 0.95rem; }

/* Gallery */
.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1/1;
  position: relative;
}
.gallery-item.row-span-2 { aspect-ratio: 1/2.05; }
.gallery-item.col-span-2 { aspect-ratio: 2/1; }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s ease;
}
.gallery-item:hover img { transform: scale(1.08); }

/* Blog cards */
.blog-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.blog-img { aspect-ratio: 16/10; overflow: hidden; }
.blog-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.blog-card:hover .blog-img img { transform: scale(1.05); }
.blog-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0.5rem 0;
}
.blog-desc { color: var(--color-text-muted); font-size: 0.925rem; margin-bottom: 1rem; }
.blog-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.blog-link:hover { color: var(--color-accent-dark); }
.blog-link::after { content: '→'; transition: transform var(--transition); }
.blog-link:hover::after { transform: translateX(4px); }

/* Forms */
.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: all var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 42, 94, 0.1);
}

.contact-icon {
  flex-shrink: 0;
  width: 2.5rem; height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-primary);
  border-radius: 9999px;
}

/* Animations */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fade-up 0.9s ease-out both; }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
