/* Custom lofi theme tokens (CDN daisyUI + plain CSS, no Tailwind) */
[data-theme="lofi"] {
  color-scheme: light;
  --color-base-100: oklch(100% 0 0);
  --color-base-200: oklch(97% 0 0);
  --color-base-300: oklch(94% 0 0);
  --color-base-content: oklch(0% 0 0);
  --color-primary: oklch(15.906% 0 0);
  --color-primary-content: oklch(100% 0 0);
  --color-secondary: oklch(21.455% 0.001 17.278);
  --color-secondary-content: oklch(100% 0 0);
  --color-accent: oklch(26.861% 0 0);
  --color-accent-content: oklch(100% 0 0);
  --color-neutral: oklch(0% 0 0);
  --color-neutral-content: oklch(100% 0 0);
  --color-info: oklch(79.54% 0.103 205.9);
  --color-info-content: oklch(15.908% 0.02 205.9);
  --color-success: oklch(90.13% 0.153 164.14);
  --color-success-content: oklch(18.026% 0.03 164.14);
  --color-warning: oklch(88.37% 0.135 79.94);
  --color-warning-content: oklch(17.674% 0.027 79.94);
  --color-error: oklch(78.66% 0.15 28.47);
  --color-error-content: oklch(15.732% 0.03 28.47);
  --radius-selector: 2rem;
  --radius-field: 0.25rem;
  --radius-box: 0.5rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 0;
  --noise: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 300;
  background: var(--color-base-100);
  color: var(--color-base-content);
}

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

a {
  color: inherit;
}

/* Layout shell */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  border-bottom: 1px solid var(--color-secondary);
  background: var(--color-secondary);
  color: var(--color-secondary-content);
}

.site-header-inner {
  width: 100%;
  max-width: 1032px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header .navbar {
  padding-inline: 0;
  min-height: 3.5rem;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1032px;
  padding: 1rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.site-footer {
  width: 100%;
  background: var(--color-neutral);
  color: var(--color-neutral-content);
  padding: 3rem 1.5rem 2rem;
}

.site-footer-inner {
  max-width: 1032px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.footer-columns {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.footer-col {
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-socials {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-socials a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.footer-muted {
  color: color-mix(in oklch, var(--color-neutral-content) 70%, transparent);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 300;
}

.footer-meta a {
  text-decoration: none;
}

.footer-meta a:hover,
.footer-tos-btn:hover {
  text-decoration: underline;
}

.footer-tos-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

/* Navbar */
.navbar-brand {
  font-weight: 500;
  font-size: 1.05rem;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.nav-mobile {
  display: flex;
  align-items: center;
}

.nav-icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.25rem;
}

.nav-icon-btn img {
  width: 100%;
  height: 100%;
  /* Monochrome on dark secondary navbar (SVGs are black by default) */
  filter: invert(1);
}

/* Brand-colored icons (simple-icons / bootstrap are black by default) */
.icon-linkedin {
  filter: invert(32%) sepia(78%) saturate(1482%) hue-rotate(187deg) brightness(92%) contrast(95%);
}

.icon-facebook {
  filter: invert(33%) sepia(98%) saturate(1560%) hue-rotate(198deg) brightness(95%) contrast(92%);
}

.icon-whatsapp {
  filter: invert(48%) sepia(79%) saturate(436%) hue-rotate(81deg) brightness(96%) contrast(92%);
}

.icon-mail {
  filter: invert(28%) sepia(89%) saturate(2148%) hue-rotate(209deg) brightness(93%) contrast(94%);
}

/* Secondary button icon helpers (color comes from daisyUI theme) */
.btn.btn-secondary {
  gap: 0.5rem;
}

.btn-icon,
.btn-secondary-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn-secondary-icon {
  filter: invert(1);
}

.btn.btn-secondary svg.btn-secondary-icon {
  filter: none;
  stroke: currentColor;
}

.btn {
  gap: 0.5rem;
}

/* Sections */
.section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0 1rem;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.section-header h2 {
  margin: 0;
  font-weight: 600;
  font-size: 1.5rem;
}

.section-header p {
  margin: 0;
  color: color-mix(in oklch, var(--color-base-content) 55%, transparent);
}

/* Hero */
.hero-layout {
  display: flex;
  flex-direction: column-reverse;
  gap: 1rem;
  padding: 0 1rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-title-desktop {
  display: none;
}

.hero-title-desktop h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
  font-weight: 700;
}

.hero-title-desktop .subtitle {
  margin: 0 0 0.75rem;
  font-weight: 300;
  font-size: 1.15rem;
}

.hero-description {
  margin: 0 0 1rem;
  line-height: 1.5;
  max-width: 25rem;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-card {
  display: block;
  width: 100%;
  max-width: 22.5rem;
  padding: 0;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  text-align: left;
  font: inherit;
  background: var(--color-base-200);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.contact-card:hover {
  background: var(--color-base-300);
}

.contact-card-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
}

.contact-card img {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.contact-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.contact-card-label {
  font-size: 0.8rem;
  color: color-mix(in oklch, var(--color-base-content) 55%, transparent);
}

.contact-card-value {
  font-weight: 500;
  color: var(--color-base-content);
}

/* Dark — “Fissiamo un incontro” */
.contact-card--contact {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-secondary-content);
}

.contact-card--contact:hover {
  background: var(--color-neutral);
  border-color: var(--color-neutral);
}

.contact-card--contact .contact-card-label {
  color: color-mix(in oklch, var(--color-secondary-content) 70%, transparent);
}

.contact-card--contact .contact-card-value {
  color: var(--color-secondary-content);
}

.contact-card--contact img {
  filter: invert(1);
}

/* Blue — mail (brand, theme-independent) */
.contact-card--mail {
  background: #e8f1fc;
  border-color: #aad1fb;
}

.contact-card--mail:hover {
  background: #d2e5fc;
  border-color: #6db2fc;
}

.contact-card--mail .contact-card-label {
  color: #64748b;
}

.contact-card--mail .contact-card-value {
  color: #1e293b;
}

/* Green — WhatsApp (brand, theme-independent) */
.contact-card--whatsapp {
  background: #e8f8e3;
  border-color: #a3e493;
}

.contact-card--whatsapp:hover {
  background: #d5f2cc;
  border-color: #76cf60;
}

.contact-card--whatsapp .contact-card-label {
  color: #4b5563;
}

.contact-card--whatsapp .contact-card-value {
  color: #14532d;
}

/* Gray — social (Facebook / LinkedIn) */
.contact-card--social {
  background: var(--color-base-200);
  border-color: var(--color-base-300);
}

.contact-card--social:hover {
  background: var(--color-base-300);
}

.contact-card--social .contact-card-label {
  color: color-mix(in oklch, var(--color-base-content) 55%, transparent);
}

.contact-card--social .contact-card-value {
  color: var(--color-base-content);
}

/* Sheet cards: text left, icon right, full width */
.contacts-sheet-cards .contact-card {
  max-width: none;
}

.contacts-sheet-cards .contact-card-inner {
  justify-content: space-between;
}

.contacts-sheet-cards .contact-card--mail img {
  filter: invert(28%) sepia(89%) saturate(2148%) hue-rotate(209deg) brightness(93%) contrast(94%);
}

.contacts-sheet-cards .contact-card--whatsapp img {
  filter: invert(48%) sepia(79%) saturate(436%) hue-rotate(81deg) brightness(96%) contrast(92%);
}

.hero-media {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  height: 400px;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1rem 1.25rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
}

.hero-overlay-title h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.hero-overlay-title p {
  margin: 0;
  font-weight: 300;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.service-card {
  background: var(--color-base-200);
}

.service-card .card-body {
  gap: 0.75rem;
}

.modal-heading {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.contact-form .input,
.contact-form .textarea,
.map-select-mobile.select {
  width: 100%;
}

.modal-close {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

.service-icon {
  width: 2.5rem;
  height: 2.5rem;
}

/* Calendar */
.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.calendar-title {
  font-weight: 500;
  min-width: 9rem;
  text-align: center;
}

.calendar-views.join {
  display: inline-flex;
  gap: 0;
  border-radius: var(--radius-field);
  overflow: hidden;
}

.calendar-views.join .join-item {
  border-radius: 0;
  margin: 0;
}

.calendar-views.join .join-item:first-child {
  border-top-left-radius: var(--radius-field);
  border-bottom-left-radius: var(--radius-field);
}

.calendar-views.join .join-item:last-child {
  border-top-right-radius: var(--radius-field);
  border-bottom-right-radius: var(--radius-field);
}

.calendar-panel {
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
  overflow: auto;
  max-height: 28rem;
  background: var(--color-base-100);
}

.cal-week-header,
.cal-week-row {
  display: grid;
  grid-template-columns: 3rem repeat(7, 1fr);
  min-width: 32rem;
}

.cal-week-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-base-100);
  border-bottom: 1px solid var(--color-base-300);
}

.cal-cell {
  border-right: 1px solid var(--color-base-300);
  border-bottom: 1px solid var(--color-base-300);
  min-height: 2.25rem;
  position: relative;
  padding: 0.15rem;
}

.cal-cell:last-child {
  border-right: none;
}

.cal-hour {
  text-align: right;
  font-size: 0.7rem;
  color: color-mix(in oklch, var(--color-base-content) 50%, transparent);
  padding: 0.25rem 0.35rem 0 0;
  border-right: 1px solid var(--color-base-300);
  border-bottom: 1px solid var(--color-base-300);
}

.cal-day-head {
  text-align: center;
  padding: 0.35rem 0.15rem;
  border-right: 1px solid var(--color-base-300);
}

.cal-day-head:last-child {
  border-right: none;
}

.cal-day-label-full {
  display: none;
  font-size: 0.75rem;
  font-weight: 300;
}

.cal-day-label-short {
  display: inline;
  font-size: 0.75rem;
  font-weight: 300;
}

.cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0.15rem auto 0;
  font-size: 0.95rem;
}

.cal-day-num.is-today {
  border-radius: 999px;
  background: var(--color-secondary);
  color: var(--color-secondary-content);
  font-weight: 500;
}

.cal-cell.is-today {
  background: color-mix(in oklch, var(--color-info) 18%, var(--color-base-100));
}

.cal-busy {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  overflow: hidden;
  font-size: 0.65rem;
  padding: 0.2rem;
  color: var(--color-base-content);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 2px,
    var(--color-base-300) 2px,
    var(--color-base-300) 4px
  );
  background-color: color-mix(in oklch, var(--color-base-200) 85%, transparent);
}

.cal-day-view .cal-day-row {
  display: flex;
  min-height: 2.25rem;
  border-bottom: 1px solid var(--color-base-300);
}

.cal-day-view .cal-hour {
  width: 3.5rem;
  flex-shrink: 0;
  border-bottom: none;
}

.cal-day-view .cal-slot {
  flex: 1;
  position: relative;
}

.cal-day-heading {
  text-align: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-base-300);
  position: sticky;
  top: 0;
  background: var(--color-base-100);
  z-index: 2;
}

/* Map */
.map-section {
  position: relative;
}

.map-select-mobile {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
}

.map-list-desktop {
  display: none;
}

#office-map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-box);
  z-index: 1;
}

/* Awards horizontal scroll */
.awards-wrap {
  position: relative;
}

.awards-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.5rem;
  transition: scroll-left 0.3s ease;
}

.awards-scroll::-webkit-scrollbar {
  height: 6px;
}

.awards-item {
  flex: 0 0 auto;
  width: 18rem;
  height: 16rem;
  scroll-snap-align: start;
  border-radius: var(--radius-box);
  overflow: hidden;
  border: 1px solid var(--color-base-300);
}

.awards-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.awards-item:hover img {
  transform: scale(1.03);
}

.awards-arrows {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
}

.awards-arrows .btn {
  pointer-events: auto;
}

/* Experience timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-logo {
  width: 15rem;
  height: 6.25rem;
  object-fit: cover;
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
  flex-shrink: 0;
  background: var(--color-base-200);
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-date {
  color: color-mix(in oklch, var(--color-base-content) 55%, transparent);
}

.timeline-meta h3 {
  margin: 0;
  font-weight: 600;
}

.timeline-company {
  margin: 0;
}

/* Gallery carousel */
.gallery-carousel {
  width: 100%;
  max-width: 100%;
}

.gallery-carousel .carousel-item {
  width: 100%;
}

.gallery-carousel .carousel-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-box);
}

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.form-note {
  font-size: 0.8rem;
  opacity: 0.7;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.tos-content {
  max-height: 60vh;
  overflow-y: auto;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.5;
}

.tos-content h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

.tos-content h4 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.tos-content p {
  margin: 0 0 0.65rem;
}

.tos-updated {
  font-size: 0.75rem;
  opacity: 0.6;
  font-style: italic;
  margin-top: 1.25rem;
}

.contacts-sheet-box {
  position: relative;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  max-height: 85vh;
  padding-top: 0.75rem;
}

.contacts-sheet-handle {
  width: 2.5rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--color-base-300);
  margin: 0 auto 0.75rem;
}

.contacts-sheet-header {
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.contacts-sheet-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: color-mix(in oklch, var(--color-base-content) 55%, transparent);
}

.contacts-sheet-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@media (min-width: 768px) {
  .site-header-inner {
    padding: 0;
  }

  .site-main {
    padding: 3rem 0 4rem;
    gap: 4rem;
  }

  .site-footer {
    padding: 3rem 0 2rem;
  }

  .footer-columns {
    flex-direction: row;
    justify-content: space-between;
  }

  .footer-meta {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    text-align: center;
  }

  .footer-tos-btn {
    text-align: center;
  }

  .nav-desktop {
    display: flex;
  }

  .nav-mobile {
    display: none;
  }

  .section {
    padding: 0;
  }

  .hero-layout {
    flex-direction: row;
    gap: 2rem;
    padding: 0;
    align-items: flex-start;
  }

  .hero-copy {
    flex: 1;
    width: 50%;
  }

  .hero-title-desktop {
    display: block;
  }

  .hero-overlay-title {
    display: none;
  }

  .hero-media {
    flex: 1;
    width: 50%;
    height: 420px;
    border-radius: var(--radius-box);
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .cal-week-header,
  .cal-week-row {
    grid-template-columns: 4rem repeat(7, 1fr);
    min-width: 0;
  }

  .cal-cell {
    min-height: 3.25rem;
  }

  .cal-day-label-short {
    display: none;
  }

  .cal-day-label-full {
    display: inline;
  }

  .cal-day-num {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }

  .cal-day-view .cal-hour {
    width: 5rem;
  }

  .cal-busy {
    font-size: 0.75rem;
    padding: 0.35rem;
  }

  .map-select-mobile {
    display: none;
  }

  .map-list-desktop {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
    left: auto;
    z-index: 400;
    background: var(--color-base-100);
    border-radius: var(--radius-box);
    border: 1px solid var(--color-base-300);
    padding: 0;
    max-width: 16rem;
    width: 15rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  .map-list-body {
    padding: 0.35rem;
    gap: 0;
  }

  .map-list-desktop button {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    border-radius: var(--radius-field);
    transition: background 0.15s ease, color 0.15s ease;
    color: inherit;
    font: inherit;
  }

  .map-list-desktop button:hover {
    background: var(--color-base-200);
  }

  .map-list-desktop button.is-active {
    background: var(--color-secondary);
    color: var(--color-secondary-content);
  }

  .map-list-desktop button.is-active .loc-address {
    opacity: 0.85;
    color: inherit;
  }

  .map-list-desktop .loc-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
  }

  .map-list-desktop .loc-name {
    font-weight: 500;
    display: block;
  }

  .map-list-desktop .loc-address {
    font-size: 0.8rem;
    opacity: 0.65;
  }

  .map-list-desktop .loc-pin {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    opacity: 0;
  }

  .map-list-desktop button.is-active .loc-pin {
    opacity: 1;
  }

  #office-map {
    height: 520px;
  }

  .awards-arrows {
    display: flex;
  }

  .timeline-item {
    flex-direction: row;
    gap: 1rem;
    align-items: stretch;
  }

  .gallery-carousel .carousel-item img {
    height: 420px;
  }
}
