/* Reset & Fonts */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;   /* phones: don't blow text up when turned sideways */
  text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', sans-serif;
  color: #e0e6ed;
  background-color: #030814;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

h1, h2, h3, .logo-text {
  font-family: 'Cinzel', serif;
}

/* Jumping to a part of the page stops just below the banner, not under it */
section[id] {
  scroll-margin-top: 84px;
}

/* Keyboard users see where they are */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #7df9ff;
  outline-offset: 3px;
}

/* Background Atmosphere */
.sky-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;   /* phones: still covers the screen when the address bar slides away */
  background: linear-gradient(180deg, #02050f 0%, #0a1329 50%, #0d2818 100%);
  z-index: -2;
}

/* Star-Shaped Moon Effect */
.star-moon {
  position: absolute;
  top: clamp(78px, 9vw, 96px);
  right: clamp(14px, 8vw, 12%);
  width: clamp(46px, 11vw, 90px);
  height: clamp(46px, 11vw, 90px);
  background: #fff8d6;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 20px #ffd700);
  animation: pulse-moon 4s infinite alternate ease-in-out;
}

@keyframes pulse-moon {
  0% { transform: scale(1); filter: drop-shadow(0 0 15px #ffd700); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 28px #ffeeaa); }
}

/* Dynamic Stars Canvas/Overlay */
.stars-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 40px 70px, #ffd700, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 90px 40px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 160px 120px, #7df9ff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.6;
}

/* Header & Logo */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(14px, 4vw, 40px);
  /* phones with a notch or rounded corners, held sideways */
  padding-left: max(clamp(14px, 4vw, 40px), env(safe-area-inset-left));
  padding-right: max(clamp(14px, 4vw, 40px), env(safe-area-inset-right));
  background: rgba(3, 8, 20, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(125, 249, 255, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

/* Top Left Logo */
.nav-logo {
  flex: none;
  height: 44px;
  width: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.logo-text {
  font-size: clamp(0.95rem, 3.4vw, 1.2rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1.5px;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Right side of the banner: Login, then the three-line menu */
.nav-actions {
  position: relative;   /* the drop-down hangs from this */
  flex: none;
  display: flex;
  align-items: center;
}

/* Tiny stars, drawn here once and used around the Login button.
   (Same five points as the big star in the sky.) */
:root {
  --star-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 112 112'%3E%3Cpolygon points='50,0 61,35 98,35 68,57 79,91 50,70 21,91 32,57 2,35 39,35' fill='%23ffffff'/%3E%3C/svg%3E");
  --star-black: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 112 112'%3E%3Cpolygon points='50,0 61,35 98,35 68,57 79,91 50,70 21,91 32,57 2,35 39,35' fill='%23000000' stroke='%23ffffff' stroke-opacity='.55' stroke-width='7' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Login: a piece of the night sky with a thin rim of starlight */
.btn-login {
  position: relative;
  min-height: 44px;     /* big enough for a thumb */
  padding: 0 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 248, 214, 0.3);
  background: linear-gradient(180deg, rgba(10, 19, 41, 0.85) 0%, rgba(13, 40, 24, 0.7) 100%);
  color: #fff8d6;
  font: 700 0.85rem 'Cinzel', serif;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* the stars around it: white ones, and black ones with a hair of light on their edge */
.btn-login::before,
.btn-login::after {
  content: "";
  position: absolute;
  top: -9px;
  right: -12px;
  bottom: -9px;
  left: -12px;
  pointer-events: none;
  background-repeat: no-repeat;
  transition: opacity 0.3s, transform 0.3s;
}

.btn-login::before {
  background-image: var(--star-white), var(--star-white), var(--star-white), var(--star-white), var(--star-white);
  background-position: 3% 16%, 31% 0%, 98% 34%, 72% 100%, 12% 92%;
  background-size: 9px 9px, 6px 6px, 8px 8px, 7px 7px, 5px 5px;
}

.btn-login::after {
  background-image: var(--star-black), var(--star-black), var(--star-black), var(--star-black);
  background-position: 78% 2%, 0% 58%, 94% 86%, 40% 98%;
  background-size: 9px 9px, 8px 8px, 10px 10px, 7px 7px;
}

.btn-login:hover,
.btn-login:focus-visible {
  border-color: rgba(255, 248, 214, 0.65);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.22);
}

/* a small twinkle when you point at it or tab to it */
.btn-login:hover::before,
.btn-login:focus-visible::before {
  transform: scale(1.06);
}

.btn-login:hover::after,
.btn-login:focus-visible::after {
  opacity: 0.7;
}

/* The three-line menu, to the right of Login */
.menu {
  margin-left: 16px;
}

.menu-toggle {
  display: block;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 248, 214, 0.3);
  background: linear-gradient(180deg, rgba(10, 19, 41, 0.85) 0%, rgba(13, 40, 24, 0.7) 100%);
  cursor: pointer;
  list-style: none;                  /* no little triangle */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: border-color 0.2s;
}

.menu-toggle::-webkit-details-marker {
  display: none;                     /* (the same, for Safari) */
}

.menu-toggle:hover,
.menu[open] .menu-toggle {
  border-color: rgba(255, 248, 214, 0.65);
}

/* the three lines: placed by hand, so they show in every browser */
.menu-bar {
  position: absolute;
  left: 11px;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #fff8d6;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-bar:nth-child(1) { top: 13px; }
.menu-bar:nth-child(2) { top: 20px; }
.menu-bar:nth-child(3) { top: 27px; }

/* open: the three lines turn into an X */
.menu[open] .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu[open] .menu-bar:nth-child(2) { opacity: 0; }
.menu[open] .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  background: #071022;
  border: 1px solid rgba(255, 248, 214, 0.3);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.nav-menu a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  color: #c0d1e3;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: rgba(125, 249, 255, 0.1);
  color: #7df9ff;
}

/* the line for the page you are on */
.nav-menu a[aria-current="page"] {
  color: #fff8d6;
}

/* Hero Section */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: min(75vh, 680px);
  padding: clamp(48px, 9vw, 72px) 20px 40px;
}

.hero-content {
  max-width: 750px;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(22, 101, 52, 0.4);
  border: 1px solid #22c55e;
  color: #4ade80;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.hero h1 {
  font-size: clamp(1.75rem, 7.2vw, 3rem);
  line-height: 1.2;
  color: #ffffff;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(125, 249, 255, 0.3);
  text-wrap: balance;
}

.hero p {
  font-size: clamp(1rem, 3.4vw, 1.15rem);
  color: #a3b8cc;
  line-height: 1.6;
  margin-bottom: 30px;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 30px;
  text-decoration: none;
  font: 700 1rem 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.7);
  transform: translateY(-2px);
}

.btn-secondary {
  border: 1px solid #7df9ff;
  color: #7df9ff;
  background: rgba(125, 249, 255, 0.05);
}

.btn-secondary:hover {
  background: rgba(125, 249, 255, 0.15);
  transform: translateY(-2px);
}

/* Features Grid */
.features-section {
  padding: clamp(36px, 7vw, 60px) clamp(14px, 4vw, 20px);
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.section-title {
  font-size: clamp(1.5rem, 5.6vw, 2.2rem);
  color: #ffffff;
  margin-bottom: clamp(24px, 5vw, 40px);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(14px, 3vw, 25px);
}

.card {
  background: rgba(10, 25, 20, 0.6);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 16px;
  padding: 30px 20px;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: transform 0.3s, border-color 0.3s;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.card h3 {
  color: #ffffff;
  margin-bottom: 10px;
}

.card p {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Get the App */
.download-section {
  padding: clamp(20px, 5vw, 40px) clamp(14px, 4vw, 20px) 0;
}

.download-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 40px) clamp(18px, 5vw, 40px);
  text-align: center;
  background: rgba(7, 16, 34, 0.7);
  border: 1px solid rgba(125, 249, 255, 0.22);
  border-radius: 20px;
}

.download-panel .section-title {
  margin-bottom: 16px;
  text-shadow: 0 0 10px rgba(125, 249, 255, 0.3);
}

.download-panel p {
  color: #a3b8cc;
  line-height: 1.6;
}

.download-panel p + p {
  margin-top: 10px;
  color: #e0e6ed;
  font-weight: 600;
}

/* ---- The Contact page (contact/index.html) ---- */

/* a short page: the footer still sits at the bottom of the screen */
body.page-short {
  display: flex;
  flex-direction: column;
}

body.page-short main {
  flex: 1 0 auto;
}

/* the heading of a page that isn't the home page: no tall empty space around it */
.hero-page {
  min-height: 0;
  padding-bottom: 8px;
}

.hero-page p {
  margin-bottom: 0;
}

.contact-section {
  display: grid;
  gap: clamp(14px, 3vw, 24px);
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 36px) clamp(14px, 4vw, 20px) 0;
}

.contact-panel {
  padding: clamp(24px, 5vw, 40px) clamp(18px, 5vw, 40px);
  text-align: center;
  background: rgba(7, 16, 34, 0.7);
  border: 1px solid rgba(125, 249, 255, 0.22);
  border-radius: 20px;
}

.contact-panel .section-title {
  margin-bottom: 14px;
  text-shadow: 0 0 10px rgba(125, 249, 255, 0.3);
}

.contact-panel p {
  color: #a3b8cc;
  line-height: 1.6;
}

/* the address itself, big enough to read and to tap */
.contact-email {
  display: inline-block;
  margin-bottom: 22px;
  color: #fff8d6;
  font-size: clamp(1.05rem, 5vw, 1.5rem);
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
  overflow-wrap: anywhere;
}

.contact-email:hover {
  color: #7df9ff;
  text-shadow: 0 0 12px rgba(125, 249, 255, 0.4);
}

/* looking for testers: the green of the feature cards */
.tester-panel {
  background: rgba(10, 25, 20, 0.6);
  border-color: rgba(34, 197, 94, 0.3);
}

.tester-panel .badge {
  margin-bottom: 14px;
}

.tester-panel .section-title {
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.tester-panel .tester-ask {
  margin: 10px 0 22px;
  color: #e0e6ed;
  font-weight: 600;
}

/* Smooth Green Grass Horizon & Trail Effect */
.grass-horizon {
  position: relative;
  width: 100%;
  height: clamp(80px, 16vw, 120px);
  background: linear-gradient(180deg, transparent 0%, #0d2818 40%, #05140b 100%);
  margin-top: 40px;
  overflow: hidden;
}

.glowing-trail {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 100%;
  background: linear-gradient(180deg, rgba(125, 249, 255, 0) 0%, rgba(125, 249, 255, 0.3) 100%);
  clip-path: polygon(40% 0%, 60% 0%, 100% 100%, 0% 100%);
  filter: blur(2px);
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  background-color: #05140b;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.5;
  border-top: 1px solid rgba(34, 197, 94, 0.1);
}

/* The box the Login button opens */
.login-dialog {
  margin: auto;   /* (the reset at the top removes the browser's own centering) */
  width: min(92vw, 380px);
  padding: 26px 24px 22px;
  text-align: center;
  color: #e0e6ed;
  background: #071022;
  border: 1px solid rgba(125, 249, 255, 0.3);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.login-dialog::backdrop {
  background: rgba(2, 5, 15, 0.72);
}

.login-dialog h2 {
  font-size: 1.4rem;
  color: #ffffff;
  margin-bottom: 12px;
}

.login-dialog p {
  color: #a3b8cc;
  line-height: 1.6;
  margin-bottom: 20px;
}

.login-dialog .btn {
  min-width: 120px;
}

/* ---- Mouse only: lift a card when the pointer is over it ---- */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-5px);
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
  }
}

/* ---- Phones ---- */
@media (max-width: 600px) {
  /* each feature becomes a compact row: icon on the left, words on the right */
  .card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    padding: 18px 16px;
    text-align: left;
  }

  .card-icon {
    grid-row: span 2;
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 0;
  }

  .card h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
  }

  /* the headline starts near the top, so the features show without a long scroll */
  .hero {
    min-height: 0;
    padding: 64px 20px 20px;
  }

  /* the two big buttons share the row, or stack when there isn't room */
  .cta-group .btn {
    flex: 1 1 auto;
    max-width: 320px;
    padding: 0 20px;
    white-space: nowrap;
  }

  /* the star sits in the gap above the headline instead of behind the words */
  .star-moon {
    top: 74px;
    right: 14px;
    opacity: 0.85;
  }
}

/* ---- Very narrow phones ---- */
@media (max-width: 350px) {
  .navbar { gap: 8px; }
  .logo-container { gap: 8px; }
  .nav-logo { width: 38px; height: 38px; }
  .logo-text { font-size: 0.88rem; letter-spacing: 1px; }
  .btn-login { padding: 0 14px; letter-spacing: 1px; }
  .menu { margin-left: 13px; }
}

/* ---- People who have asked their device for less motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .star-moon { animation: none; }
  .btn, .card, .menu-bar, .btn-login, .btn-login::before, .btn-login::after { transition: none; }
  .btn-login:hover::before, .btn-login:focus-visible::before { transform: none; }
}
