/* Natty Nice — shared mobile-first foundation (hierarchy, a11y, speed) */
:root {
  --nn-pink: #f8bbd0;
  --nn-pink-deep: #ec407a;
  --nn-blue: #b3e5fc;
  --nn-blue-deep: #29b6f6;
  --nn-white: #ffffff;
  --nn-ink: #1a1a1a;
  --nn-muted: #5c5c5c;
  --nn-space-1: 0.5rem;
  --nn-space-2: 0.75rem;
  --nn-space-3: 1rem;
  --nn-space-4: 1.5rem;
  --nn-space-5: 2rem;
  --nn-space-6: 3rem;
  --nn-radius: 14px;
  --nn-tap: 44px;
  --nn-header-h: 56px;
  --nn-content: 68rem;
  --nn-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nn-fast: 160ms;
  --nn-med: 280ms;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  color: var(--nn-ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Hierarchy: clear type scale */
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--nn-muted);
  margin: 0 0 0.5rem;
}

.hero h1,
h1 {
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 9vw, 3.5rem);
  text-wrap: balance;
}

.lede {
  font-size: clamp(1rem, 3.6vw, 1.2rem);
  line-height: 1.55;
  color: var(--nn-muted);
  max-width: 36ch;
  margin: 0;
  text-wrap: pretty;
}

.sec h2,
main h2 {
  font-size: clamp(1.35rem, 5vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.m-card h3,
.store h3,
.g-name {
  line-height: 1.25;
  text-wrap: balance;
}

.hint, .note, .foot {
  color: var(--nn-muted);
  font-size: 0.92rem;
}

/* Layout rhythm — mobile first */
.hero {
  padding: 2.25rem 1.1rem 2rem;
  max-width: var(--nn-content);
  margin-inline: auto;
}

.sec {
  padding: 2.25rem 1.1rem;
  max-width: var(--nn-content);
  margin-inline: auto;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--nn-header-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  font-weight: 800;
  text-decoration: none;
  color: inherit;
  letter-spacing: -0.02em;
  min-height: var(--nn-tap);
  display: inline-flex;
  align-items: center;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-left: auto;
}

.nav a {
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  min-height: var(--nn-tap);
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.15rem;
}

.burger {
  min-width: var(--nn-tap);
  min-height: var(--nn-tap);
  display: none;
  place-items: center;
  margin-left: auto;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

/* Controls — thumb friendly */
.btn,
button.btn,
a.btn {
  min-height: var(--nn-tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.chip {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  touch-action: manipulation;
}

.search,
input[type="search"],
.form input,
.form textarea,
#contact-form input,
#contact-form textarea {
  font: inherit;
  font-size: 16px; /* avoid iOS zoom */
  min-height: var(--nn-tap);
  width: 100%;
  max-width: 100%;
}

.form textarea,
#contact-form textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.tools {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.15rem;
  margin-inline: -0.15rem;
  padding-inline: 0.15rem;
}
.chips::-webkit-scrollbar { display: none; }
.chips .chip { flex: 0 0 auto; }

/* Content grids — mobile first */
.gelato {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.g-item {
  width: 100%;
  min-height: var(--nn-tap);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.menu-grid {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.m-card {
  min-width: 0;
  height: 100%;
}

.stores {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.foot {
  padding: 2rem 1.1rem 5.5rem; /* room for switcher FAB */
  text-align: center;
}

.phones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}
.phones a {
  min-height: var(--nn-tap);
  display: inline-flex;
  align-items: center;
}

/* Toast above switcher, safe area */
.toast {
  left: 50%;
  bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 5rem));
  max-width: min(92vw, 24rem);
  white-space: normal;
  text-align: center;
}

/* Safe areas */
@supports (padding: max(0px)) {
  .top {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .hero, .sec, .foot {
    padding-left: max(1.1rem, env(safe-area-inset-left));
    padding-right: max(1.1rem, env(safe-area-inset-right));
  }
  #nn-switcher {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Mobile nav drawer */
@media (max-width: 800px) {
  .burger { display: grid; }
  .nav {
    position: fixed;
    inset: var(--nn-header-h) 0 auto 0;
    margin: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: none;
    max-height: min(70vh, 28rem);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav.open { display: flex; }
  .nav a {
    width: 100%;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  body.nav-open { overflow: hidden; }
}

/* Tablet+ */
@media (min-width: 600px) {
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .gelato {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stores {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tools {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .chips {
    flex: 1;
    flex-wrap: wrap;
    overflow: visible;
  }
  .search { flex: 1; min-width: 12rem; width: auto; }
}

@media (min-width: 900px) {
  .hero { padding: 4rem 1.5rem 3rem; }
  .sec { padding: 3rem 1.5rem; }
  .hero h1, h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); }
  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  }
  .gelato {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* Hover only where available — keep mobile clean */
@media (hover: hover) and (pointer: fine) {
  .g-item:hover, .m-card:hover, .store:hover, .card:hover {
    transform: translateY(-2px);
  }
}
@media (hover: none) {
  .g-item:hover, .m-card:hover, .store:hover, .card:hover {
    transform: none;
  }
}

/* Focus visibility */
:focus-visible {
  outline: 3px solid var(--nn-blue-deep);
  outline-offset: 2px;
}

/* Prevent layout shift from sticky header anchors */
[id] { scroll-margin-top: calc(var(--nn-header-h) + 0.75rem); }

/* Hub grid mobile */
.wrap { padding-left: max(1.1rem, env(safe-area-inset-left, 0px)); padding-right: max(1.1rem, env(safe-area-inset-right, 0px)); }
.grid {
  grid-template-columns: 1fr !important;
}
@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important; }
}
