/* ══════════════════════════════════════════════════════════════
   dom-core.css — base comune Drops of Memories (tema "diario di carta")
   Autosufficiente: le pagine DoM non caricano css/styles.css né js/app.js.
   Contiene token, reset/base, layout, nav, footer, card, modale e
   stili dei documenti legali. Ogni app aggiunge il proprio foglio
   (travels/travels.css, in futuro moneyplan/moneyplan.css).
   ══════════════════════════════════════════════════════════════ */

/* ─── TOKEN ─── */
:root {
  --bg:      #F2EEE4;
  --surface: #FBF9F3;
  --border:  #E0D8C6;
  --accent:  #1E7A4B;
  --accent2: #C9663C;
  --text:    #2A2620;
  --muted:   #6E685C;
  --heading: #26221C;
  --ink:     #26221C;
  --cream:   #F6F2EA;
  --font-head: 'Newsreader', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --max:     1200px;
  --radius:  12px;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

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

body {
  background: linear-gradient(180deg, #F6F2EA 0%, #ECE6D9 100%) fixed var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* footer ancorato in fondo alla finestra anche sulle pagine corte */
body > footer { margin-top: auto; }

/* ─── TIPOGRAFIA (Newsreader leggero per i titoli) ─── */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--heading);
}
h1 {
  font-weight: 300;
  font-size: clamp(38px, 6vw, 60px);
  letter-spacing: -0.01em;
}
h2 { font-weight: 400; font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-weight: 500; font-size: 1.25rem; }
p { color: var(--muted); }
a { color: inherit; text-decoration: none; }

/* ─── LAYOUT ─── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }
section { padding: 120px 0; }

/* ─── NAV (chiara, "carta") ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(246, 242, 234, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex;
  align-items: center;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0;
}
.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ─── HAMBURGER ─── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 201;
  position: relative;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── NAV MOBILE OVERLAY ─── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 38, 32, 0.35);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-overlay.open { opacity: 1; pointer-events: auto; }

/* nav a goccia: 1-2 link brevi, restano visibili anche su mobile */
@media (max-width: 900px) {
  .nav-links { gap: 1.5rem; }
}

/* ─── CARD FEATURE ─── */
.service-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  transition: border-color 0.3s, transform 0.3s;
  position: relative;
  box-shadow: 0 1px 3px rgba(42, 38, 32, 0.05);
}
.service-item:hover {
  border-color: rgba(30, 122, 75, 0.4);
  transform: translateY(-4px);
}
.service-num {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}
.service-item h3 { margin-bottom: 0.75rem; font-size: 1.1rem; }
.service-item p { font-size: 0.92rem; line-height: 1.65; }

/* ─── CARD APP (hub DoM) ─── */
.dom-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.dom-app-card {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(42, 38, 32, 0.05);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.dom-app-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}
.dom-app-card:hover {
  border-color: rgba(30, 122, 75, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(42, 38, 32, 0.10);
}
.dom-app-card:hover::before { opacity: 1; }
.dom-app-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dom-app-icon {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.3s;
}
.dom-app-card:hover .dom-app-icon { transform: scale(1.05) rotate(-3deg); }
.dom-app-body { min-width: 0; flex: 1; }
.dom-app-kicker {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.dom-app-card h3 { font-size: 1.45rem; margin-bottom: 0.6rem; }
.dom-app-card p { font-size: 0.95rem; line-height: 1.65; }
.dom-app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.dom-app-stores { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dom-app-store {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
}
.dom-app-store svg { width: 12px; height: 12px; flex: none; }
.dom-app-go {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.dom-app-go span { transition: transform 0.25s; }
.dom-app-card:hover .dom-app-go span { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) {
  .dom-app-card, .dom-app-icon, .dom-app-go span { transition: none; }
  .dom-app-card:hover { transform: none; }
  .dom-app-card:hover .dom-app-icon { transform: none; }
  .dom-app-card:hover .dom-app-go span { transform: none; }
}
@media (max-width: 520px) {
  .dom-app-card { flex-direction: column; gap: 1.1rem; padding: 1.75rem; }
}

/* ─── DOCUMENTI LEGALI (privacy, supporto, FAQ) ─── */
.privacy-section { margin-bottom: 2.5rem; }
.privacy-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.privacy-section p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
  margin-bottom: 1rem;
}
.privacy-section ul {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
  color: var(--muted);
  line-height: 1.85;
}
.privacy-section ul li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}
.privacy-section code {
  font-size: 0.9em;
  background: rgba(42, 38, 32, 0.06);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ─── FOOTER: striscia scura "colophon" (eccezione voluta) ─── */
footer {
  background: #211E19;
  padding: 3rem 0 2rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  color: #B8B0A0;
}
.footer-contact-name { font-weight: 600; color: var(--cream); font-size: 0.88rem; }
.footer-contact a { color: #B8B0A0; transition: color 0.2s; }
.footer-contact a:hover { color: var(--cream); }
.footer-links { display: flex; gap: 2rem; }
.footer-links a { font-size: 0.85rem; color: #B8B0A0; transition: color 0.2s; }
.footer-links a:hover { color: var(--cream); }
.footer-copy {
  font-size: 0.8rem;
  color: #8F877A;
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(246, 242, 234, 0.12);
}
.dev-by {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #B8B0A0;
  font-size: 0.88rem;
  transition: color 0.2s;
}
.dev-by:hover { color: var(--cream); }
.dev-by img { display: block; }

/* ─── MODALE "PRESTO DISPONIBILE" ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 38, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 300;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(42, 38, 32, 0.3);
  max-width: 420px;
  width: 100%;
  padding: 2.25rem 2rem 2rem;
  text-align: center;
}
.modal-card h3 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}
.modal-card p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  padding: 0.8rem 2.2rem;
  font: 500 0.95rem var(--font-body);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.modal-close:hover {
  background: #3A352C;
  transform: translateY(-1px);
}

/* ─── REVEAL ON SCROLL (usato da js/dom.js) ─── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
