/* ============================================================
   MyNeighbor — landing page styles
   Dark theme with warm grass-green brand accent
   ============================================================ */

:root {
  --bg: #141414;
  --bg-elev: #1c1c1c;
  --surface: #242424;
  --surface-2: #2e2e2e;
  --border: #3a3a3a;
  --text: #f4f4f2;
  --text-muted: #b7b7b2;
  --text-dim: #8a8a86;

  --green: #1f8a3d;
  --green-hover: #1b7a35;
  --green-soft: #2aa34f;

  /* warm brand palette (from concept theme) */
  --cardigan-red: #c0392b;
  --sun-yellow: #ffcf5c;
  --grass-green: #5aa846;
  --cream: #f7efe0;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --container: 1200px;
  --header-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

/* never allow sideways scroll on any phone.
   use overflow-x: clip (not hidden) so position: sticky keeps working */
html, body { max-width: 100%; overflow-x: clip; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right));
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============================ Buttons ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  transition: background .18s ease, transform .05s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-hover); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-muted); }

.btn-dark { background: #000; color: #fff; border: 1px solid #2a2a2a; }
.btn-dark:hover { background: #111; }

.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; padding: 14px; font-size: 1.02rem; }

.btn-social {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid #414141;
  padding: 13px;
  font-weight: 600;
}
.btn-social:hover { background: #383838; }

.btn-guest {
  width: 100%;
  background: transparent;
  color: var(--grass-green);
  border: 1px dashed var(--green-soft);
  padding: 13px;
  font-weight: 600;
}
.btn-guest:hover { background: rgba(42, 163, 79, 0.12); border-style: solid; }

.btn-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  padding: 0;
  flex: 0 0 auto;
}
.btn-icon:hover { background: var(--green-hover); }

/* ============================ Header ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { color: var(--grass-green); display: inline-flex; }
.brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--grass-green);
}

.main-nav { display: flex; align-items: center; gap: 8px; }
.nav-item { position: relative; }
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
}
.nav-trigger:hover { background: var(--surface); }
.chevron { transition: transform .18s ease; }
.nav-item.open .chevron { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
}
.nav-item.open .dropdown { display: flex; }
.dropdown a {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.dropdown a:hover { background: var(--surface); color: var(--text); }

.main-nav .btn { margin-left: 6px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================ Hero ============================ */
.hero {
  padding: 32px 0 56px;
}
.hero-inner {
  position: relative;
  min-height: 620px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  background: var(--cream);
}
.hero-illustration {
  width: 100%;
  height: 100%;
}
.hero-content {
  position: relative;
  z-index: 2;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px 20px;
}

.signup-card {
  width: 100%;
  max-width: 400px;
  background: rgba(24, 24, 24, 0.92);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 22px;
  letter-spacing: -0.01em;
}

.signup-form { display: flex; flex-direction: column; gap: 12px; }

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 4px 0;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider span { padding: 0 14px; }

.field { position: relative; }
.field input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 0.98rem;
  transition: border-color .18s ease;
}
.field input::placeholder { color: var(--text-dim); }
.field input:focus { outline: none; border-color: var(--green-soft); }
.field-password input { padding-right: 48px; }

.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px;
  border-radius: 8px;
}
.pw-toggle:hover { color: var(--text); background: var(--surface); }
.pw-toggle .eye-off { display: none; }
.pw-toggle.showing .eye-open { display: none; }
.pw-toggle.showing .eye-off { display: block; }

.legal {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 6px 0 4px;
}
.legal a { text-decoration: underline; color: var(--text); }

.card-foot {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.card-foot a { color: var(--text); text-decoration: underline; font-weight: 600; }

.invite-btn {
  background: rgba(24, 24, 24, 0.92);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  padding: 16px 40px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  box-shadow: var(--shadow);
}
.invite-btn:hover { background: #1f1f1f; }

/* ============================ Features ============================ */
.features { padding: 56px 0 24px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.feature-art { position: absolute; inset: 0; z-index: -2; }
.feature-art svg { width: 100%; height: 100%; }
.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
}
.feature-text {
  padding: 24px;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.4;
  color: #fff;
}
.feature-text strong { font-weight: 700; }

.connect { text-align: center; margin-top: 48px; }
.connect-title { font-size: 1.9rem; font-weight: 700; margin-bottom: 22px; letter-spacing: -0.01em; }

/* ============================ Business ============================ */
.business {
  margin-top: 56px;
  background: var(--bg-elev);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 56px 0;
}
.business-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.business-copy h2 {
  font-size: 1.5rem;
  font-weight: 700;
  max-width: 460px;
  line-height: 1.35;
}
.business-form { flex: 1; min-width: 300px; max-width: 480px; }
.business-input {
  display: flex;
  align-items: center;
  gap: 14px;
}
.business-input input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
}
.business-input input::placeholder { color: var(--text-dim); }
.business-input input:focus { outline: none; border-color: var(--green-soft); }

/* ============================ Footer ============================ */
.site-footer {
  background: var(--bg-elev);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 56px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}
.footer-col h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.copyright { color: var(--text-muted); font-size: 0.9rem; }
.footer-actions { display: flex; align-items: center; gap: 14px; }
.lang-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
}
.lang-select .chevron { color: var(--text-muted); }

/* ============================ Responsive ============================ */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .business-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav .btn { width: 100%; margin: 4px 0; }
  .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--surface);
    margin-top: 4px;
  }
  .hero-inner { min-height: 560px; }
  .hero-content { min-height: 560px; }
  .signup-card { padding: 24px 18px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .connect-title { font-size: 1.5rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   PWA / mobile hardening
   Device class + display mode are set on <html> by js/pwa.js
   (data-device="mobile|tablet|desktop", data-display="standalone|browser")
   ============================================================ */

/* taller header in the installed app so content clears the status bar */
html[data-display="standalone"] { --header-h: calc(68px + env(safe-area-inset-top)); }
html[data-display="standalone"] .site-header,
html[data-display="standalone"] .app-header { padding-top: env(safe-area-inset-top); }
html[data-display="standalone"] .app-header-inner { padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
html[data-display="standalone"] .site-footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

/* keep wide media inside the viewport on phones */
.hero-media, .hero-inner, .feature-card, .biz-card, .post-media, .like-banner, .feed-list, .post { max-width: 100%; }
svg { overflow: hidden; }

/* proportionate base type per device so nothing overflows */
html[data-device="mobile"] { font-size: 15px; }
html[data-device="tablet"] { font-size: 16px; }
@media (max-width: 380px) { html { font-size: 14px; } }

/* very small phones: tighten the dashboard rails */
@media (max-width: 420px) {
  .app-shell { padding: 16px 14px 56px; gap: 16px; }
  .like-banner { padding: 14px 40px 14px 14px; }
  .post { padding: 14px; }
  .signup-card { padding: 22px 16px; }
}
