/* PassDays site — shared design system
   Mirrors the app: sand/beige light theme, black→graphite dark theme,
   orange→light-yellow accent gradient. */

/* Light is the default theme. Dark is opt-in via [data-theme="dark"] on <html>,
   set by the nav toggle and remembered in localStorage. */
:root {
  color-scheme: light;
  --bg-top: #fdf7ee;
  --bg-bottom: #f3e7d3;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --surface: rgba(255, 255, 255, 0.66);
  --surface-border: rgba(0, 0, 0, 0.10);
  --nav-bg: rgba(253, 247, 238, 0.82);
  --link: #c25e00;
  --accent-start: #ff8a00;
  --accent-end: #ffcb2e;
  --shadow: 0 10px 30px rgba(120, 72, 0, 0.16);
  --disclaimer-border: #c25e00;
  --disclaimer-bg: rgba(194, 94, 0, 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-top: #000000;
  --bg-bottom: #1c1c1e;
  --text: #f2f2f7;
  --text-muted: #9a9aa0;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-border: rgba(255, 255, 255, 0.12);
  --nav-bg: rgba(20, 20, 22, 0.82);
  --link: #ff9f0a;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  --disclaimer-border: #ff9f0a;
  --disclaimer-bg: rgba(255, 159, 10, 0.10);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Solid themed color on the root so the overscroll / rubber-band area
     (top AND bottom) is always filled with the theme color — never a light
     flash. We do NOT use background-attachment: fixed here, because a fixed
     gradient is anchored to the viewport and leaves the overscroll zone
     unpainted (which exposed a light strip in dark mode). The visible
     gradient lives on <body> instead. */
  background-color: var(--bg-bottom);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
  /* Gradient paints the page; fixed keeps it stable while scrolling. The root's
     solid background-color (above) covers any overscroll beyond the body. */
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%) fixed;
  background-color: var(--bg-bottom);
}

a { color: var(--link); }

/* Warm text selection instead of the default blue */
::selection {
  background: rgba(255, 138, 0, 0.22);
  color: var(--text);
}

/* Remove the grey mobile tap flash — we provide our own press feedback */
a, button, .feature, .lang-switch a {
  -webkit-tap-highlight-color: transparent;
}

/* Warm, accessible focus ring for keyboard users */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-start);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Top navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--surface-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05em;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.brand:active img { transform: scale(0.94); }

/* Right-hand nav cluster: links + language switch */
.nav-right {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

/* Language menu (popup) */
.lang-menu { position: relative; display: inline-block; }

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}
.lang-trigger:hover { border-color: rgba(255, 138, 0, 0.5); box-shadow: 0 2px 10px rgba(255, 138, 0, 0.2); }
.lang-trigger:active { transform: scale(0.95); }
.lang-trigger .globe { font-size: 1.05em; line-height: 1; }
.lang-trigger .chev { font-size: 0.7em; opacity: 0.6; transition: transform 0.2s ease; }
.lang-menu[data-open="true"] .lang-trigger .chev { transform: rotate(180deg); }

.lang-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--shadow);
  z-index: 50;
  /* hidden until opened */
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lang-menu[data-open="true"] .lang-pop {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-pop a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.92em;
  transition: background 0.15s ease;
}
.lang-pop a:hover { background: rgba(255, 138, 0, 0.12); }
.lang-pop a.active { font-weight: 600; }
.lang-pop a.active::after { content: "✓"; color: var(--accent-start); font-weight: 700; }
/* small tag for languages that open in English (no translated page yet) */
.lang-pop a .en-tag {
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
  border-radius: 5px;
  padding: 1px 5px;
}

/* Theme toggle (light/dark) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1em;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.2s ease, box-shadow 0.2s ease;
}
.theme-toggle:hover {
  border-color: rgba(255, 138, 0, 0.5);
  box-shadow: 0 2px 10px rgba(255, 138, 0, 0.25);
}
.theme-toggle:active { transform: scale(0.88) rotate(-12deg); }
/* Show sun in dark mode (tap for light), moon in light mode (tap for dark) */
.theme-toggle .t-moon { display: inline; }
.theme-toggle .t-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .t-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .t-sun { display: inline; }

/* Smooth cross-fade when switching themes (skipped on first paint) */
body.theme-ready,
body.theme-ready .site-nav,
body.theme-ready .feature,
body.theme-ready .contact-card,
body.theme-ready .lang-switch,
body.theme-ready .theme-toggle,
body.theme-ready input,
body.theme-ready textarea,
body.theme-ready .foot-links a {
  transition: background-color 0.4s ease, color 0.4s ease,
              border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ---------- Page container ---------- */
.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.content h1 { margin-top: 0; font-size: 2em; }
.content h2 { margin-top: 2em; font-size: 1.3em; }
.content h3 { margin-top: 1.5em; font-size: 1.05em; }
.content .meta { color: var(--text-muted); font-size: 0.9em; margin-top: -0.5em; }
.content ul { padding-left: 1.4em; }
.content li { margin-bottom: 0.3em; }
.content code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}
:root[data-theme="dark"] .content code { background: rgba(255, 255, 255, 0.08); }

.disclaimer {
  margin: 1.5em 0 0;
  padding: 1em 1.2em;
  border: 1px solid var(--disclaimer-border);
  border-radius: 8px;
  background: var(--disclaimer-bg);
}
.disclaimer p { margin: 0; }

/* ---------- Landing hero ---------- */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 20px 24px;
  text-align: center;
}

.hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 25px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0;
  font-size: 2.6em;
  letter-spacing: -0.02em;
}

.hero .kicker {
  display: inline-block;
  margin: 10px 0 0;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent-start) 0%, var(--accent-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  max-width: 560px;
  margin: 18px auto 28px;
  font-size: 1.15em;
  color: var(--text-muted);
}

/* App Store button */
.appstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: 14px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.appstore-btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow); }
.appstore-btn:active { transform: translateY(0) scale(0.96); box-shadow: 0 4px 12px rgba(120, 72, 0, 0.18); }
.appstore-btn svg { width: 26px; height: 26px; fill: #fff; }
.appstore-btn .as-text { text-align: left; line-height: 1.15; }
.appstore-btn .as-small { display: block; font-size: 0.66em; opacity: 0.85; }
.appstore-btn .as-big { display: block; font-size: 1.2em; font-weight: 600; }
:root[data-theme="dark"] .appstore-btn { background: #fff; color: #000; border-color: rgba(0, 0, 0, 0.1); }
:root[data-theme="dark"] .appstore-btn svg { fill: #000; }

/* Section heading (between landing blocks) */
.section-head {
  max-width: 860px;
  margin: 64px auto 0;
  padding: 0 20px;
  text-align: center;
}
.section-head h2 {
  margin: 0;
  font-size: 1.7em;
  letter-spacing: -0.01em;
}
.section-head p {
  margin: 10px auto 0;
  max-width: 540px;
  color: var(--text-muted);
}

/* Feature grid */
.features {
  max-width: 860px;
  margin: 28px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* Compact grid for the "smart by default" points */
.features.compact {
  margin-top: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.features.compact .feature { padding: 18px 20px; }
.features.compact .feature h3 { margin: 0 0 4px; }
.features.compact .feature .row { display: flex; align-items: baseline; gap: 8px; }
.features.compact .feature .row .ic { font-size: 1.15em; }

.feature {
  padding: 22px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  text-align: left;
  /* Not a link / not tappable — purely informational. No pointer cursor,
     no press feedback; it grows on hover for a tactile feel. Slow, relaxed
     easing for a premium feel. */
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.6s ease,
              border-color 0.6s ease;
}
.feature:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
  border-color: rgba(255, 138, 0, 0.35);
}
.feature .ic {
  font-size: 1.7em;
  line-height: 1;
  display: inline-block;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.feature:hover .ic { transform: scale(1.15) rotate(-6deg); }
.feature h3 { margin: 12px 0 6px; font-size: 1.05em; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.95em; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 48px;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--surface-border);
  text-align: center;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.foot-links a {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92em;
  font-weight: 500;
  transition: border-color 0.25s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.foot-links a:hover {
  border-color: var(--disclaimer-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(120, 72, 0, 0.14);
}
.foot-links a:active { transform: translateY(0) scale(0.96); }

.foot-meta {
  color: var(--text-muted);
  font-size: 0.85em;
  line-height: 1.5;
}
.foot-meta a { color: var(--text-muted); }

/* ---------- Support page: contact card ---------- */
.support-intro {
  margin: 0 0 8px;
  color: var(--text-muted);
}

/* Quick email card above the form */
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease, border-color 0.3s ease;
}
.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 138, 0, 0.35);
}
.contact-card .ic { font-size: 1.6em; line-height: 1; }
.contact-card .ct { line-height: 1.3; }
.contact-card .ct strong { display: block; }
.contact-card .ct a { font-weight: 500; }


/* ---------- Entrance animations ---------- */

/* Hero settles in on page load, gently staggered */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-icon,
.hero .kicker,
.hero h1,
.hero .lede,
.hero .appstore-btn {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero .kicker      { animation-delay: 0.06s; }
.hero h1           { animation-delay: 0.12s; }
.hero .lede        { animation-delay: 0.20s; }
.hero .appstore-btn { animation-delay: 0.28s; }

/* Soft floating loop for the hero icon, after it has settled */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.hero-icon {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both,
             float 5s ease-in-out 0.9s infinite;
}

/* Scroll-reveal: JS adds .reveal then toggles .is-visible when in view */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger children of a revealed grid for a cascade effect */
.reveal.is-visible .feature {
  animation: rise-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.reveal.is-visible .feature:nth-child(2) { animation-delay: 0.06s; }
.reveal.is-visible .feature:nth-child(3) { animation-delay: 0.12s; }
.reveal.is-visible .feature:nth-child(4) { animation-delay: 0.18s; }
.reveal.is-visible .feature:nth-child(5) { animation-delay: 0.24s; }
.reveal.is-visible .feature:nth-child(6) { animation-delay: 0.30s; }

/* ---------- Respect reduced-motion: turn everything calm ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* Never leave reveal content hidden if JS/observer is skipped */
  .reveal { opacity: 1 !important; transform: none !important; }
}
