/* ChickenCoopManager — public site
   Palette derivata dal gioco (cozy farm vibes).
   Niente framework: vanilla CSS con variabili custom.
*/

:root {
  /* Base palette — riprende cozyCream / cozyWood / cozyWoodDark del gioco */
  --bg-cream: #FFF6DF;
  --bg-wood: #E8C896;
  --bg-wood-dark: #8B5A2B;
  --text-primary: #3D2817;
  --text-secondary: #6B4423;
  --text-tertiary: #9B7642;

  /* Sky → grass background (come app icon) */
  --sky-top: #80C7F0;
  --sky-mid: #CCE9F4;
  --sky-horizon: #FFEDA6;
  --grass-top: #8CCC6B;
  --grass-bot: #61A64D;

  /* Accent — yellow beak / sun */
  --accent: #FFB84D;
  --accent-dark: #E69500;
  --accent-light: #FFD89E;
  --highlight: #FFEDA6;

  /* Crest red (gallina) */
  --red-crest: #EB382E;
  --red-crest-dark: #B01818;

  /* Surfaces */
  --card-bg: rgba(255, 246, 223, 0.92);
  --card-border: rgba(139, 90, 43, 0.30);
  --card-shadow: 0 6px 24px rgba(61, 40, 23, 0.18);

  --radius: 14px;
  --radius-sm: 8px;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Quicksand",
               system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-cream);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--red-crest); }

/* ============================================================
   NAV (sticky top)
   ============================================================ */
header.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 246, 223, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 2px solid var(--bg-wood);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-primary);
}
.nav-logo img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(61, 40, 23, 0.25);
}
.nav-links {
  display: flex;
  gap: 26px;
  list-style: none;
}
.nav-links a {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}
.nav-links a:hover { color: var(--red-crest); }
.nav-cta {
  background: var(--accent);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: 22px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(255, 184, 77, 0.45);
  transition: transform 0.15s;
}
.nav-cta:hover { transform: translateY(-2px); }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-cream);
    flex-direction: column;
    padding: 20px;
    gap: 18px;
    border-bottom: 2px solid var(--bg-wood);
  }
  .nav-cta { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 620px;
  background: linear-gradient(
    to bottom,
    var(--sky-top) 0%,
    var(--sky-mid) 45%,
    var(--sky-horizon) 70%,
    var(--grass-top) 72%,
    var(--grass-bot) 100%
  );
  padding: 50px 20px 80px;
  overflow: hidden;
}
.hero::before {
  /* Sole soft halo top-right */
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 235, 100, 0.45), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero-text h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.5);
}
.hero-text .tagline {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 540px;
}
.hero-cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 28px;
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--text-primary);
  box-shadow: 0 5px 18px rgba(230, 149, 0, 0.40);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 7px 22px rgba(230, 149, 0, 0.55); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.50);
  color: var(--text-primary);
  border: 2px solid var(--bg-wood-dark);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.85); }

.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-stat {
  display: flex;
  flex-direction: column;
}
.hero-stat .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--red-crest);
}
.hero-stat .lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 600;
}

.hero-image-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-image {
  width: clamp(220px, 36vw, 380px);
  filter: drop-shadow(0 12px 32px rgba(61, 40, 23, 0.35));
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
/* Nuvole decorative */
.cloud {
  position: absolute;
  background: white;
  border-radius: 50px;
  opacity: 0.85;
  animation: drift 60s linear infinite;
}
.cloud-1 { width: 120px; height: 32px; top: 80px; left: 10%; }
.cloud-2 { width: 80px; height: 24px; top: 160px; left: 60%; animation-duration: 90s; }
.cloud-3 { width: 100px; height: 28px; top: 50px; left: 80%; animation-duration: 75s; }
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-100vw); }
}

@media (max-width: 760px) {
  .hero { padding: 40px 20px 60px; min-height: auto; }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; text-align: center; }
  .hero-cta-row { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-image-wrap { order: -1; }
  .hero-image { width: 200px; }
}

/* ============================================================
   SECTIONS
   ============================================================ */
section {
  padding: 80px 20px;
  position: relative;
}
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.section-subtitle {
  font-size: 1.1rem;
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 50px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(61, 40, 23, 0.22);
}
.feature-icon {
  font-size: 44px;
  margin-bottom: 14px;
  display: block;
}
.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

/* Screenshots strip */
.screenshots {
  background: linear-gradient(135deg, #FFE9C4 0%, #F5D7A1 100%);
}
.screens-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.screen {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  border: 1px solid var(--card-border);
}
.screen-mockup {
  background: linear-gradient(180deg, var(--sky-top), var(--grass-top));
  border-radius: 12px;
  aspect-ratio: 9 / 19.5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.6);
}
.screen h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.screen p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--red-crest) 100%);
  text-align: center;
  color: white;
}
.cta-banner h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 14px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.cta-banner p {
  font-size: 1.1rem;
  margin-bottom: 26px;
  opacity: 0.95;
}
.cta-banner .btn-primary {
  background: white;
  color: var(--red-crest-dark);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
}
.cta-banner .btn-primary:hover {
  background: var(--highlight);
  color: var(--red-crest-dark);
}

/* Press / Media / Support shared style */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.info-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--card-shadow);
}
.info-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.info-card p { color: var(--text-secondary); margin-bottom: 12px; }
.info-card ul { list-style: none; }
.info-card ul li {
  padding: 6px 0;
  color: var(--text-secondary);
}
.info-card ul li::before {
  content: '▸';
  color: var(--accent-dark);
  margin-right: 8px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--text-primary);
  color: var(--bg-cream);
  padding: 50px 20px 30px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 30px; }
}
.footer-col h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--accent);
}
.footer-col ul { list-style: none; }
.footer-col li a {
  color: var(--bg-cream);
  font-size: 0.92rem;
  padding: 5px 0;
  display: block;
  opacity: 0.85;
}
.footer-col li a:hover { opacity: 1; color: var(--accent); }
.footer-brand .name {
  font-weight: 900;
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--accent);
}
.footer-brand p {
  font-size: 0.92rem;
  opacity: 0.75;
  max-width: 320px;
}
.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid rgba(255, 246, 223, 0.20);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.70;
}

/* ============================================================
   DEV/INDIE TOUCHES — build badge, typewriter, fireflies, changelog
   ============================================================ */

/* Build badge nella nav (live status sviluppatore) */
.build-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  background: rgba(139, 90, 43, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(139, 90, 43, 0.18);
}
.build-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@media (max-width: 760px) {
  .build-badge { display: none; }
}

/* Typewriter cursor (alla fine del tagline hero) */
.typed-cursor {
  display: inline-block;
  width: 2px;
  background: var(--accent-dark);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.typed-text {
  white-space: pre-wrap;
}

/* Coming Soon badge (sopra al titolo hero) */
.coming-soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 184, 77, 0.25);
  color: var(--accent-dark);
  padding: 5px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  margin-bottom: 16px;
}
.coming-soon-pill::before {
  content: '⚡';
  animation: spark 1.6s ease-in-out infinite;
}
@keyframes spark {
  0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  50% { transform: scale(1.3) rotate(15deg); opacity: 0.6; }
}

/* Fireflies canvas (background hero) */
.fireflies-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Disabled CTA (Coming Soon) */
.btn-primary.disabled {
  background: linear-gradient(180deg, #b8a994 0%, #8b7d68 100%);
  box-shadow: 0 4px 12px rgba(139, 125, 104, 0.30);
  cursor: not-allowed;
  position: relative;
  overflow: hidden;
}
.btn-primary.disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.30),
    transparent
  );
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  to { left: 100%; }
}

/* Newsletter form inline */
.notify-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  max-width: 420px;
}
.notify-form input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--bg-wood);
  border-radius: 24px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  font-family: inherit;
}
.notify-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 184, 77, 0.25);
}
.notify-form button {
  padding: 12px 22px;
  border: none;
  border-radius: 24px;
  background: var(--accent);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.notify-form .form-success {
  font-size: 13px;
  color: #4ade80;
  font-weight: 600;
}

/* Counter animation (stats) — display only, JS driven */
.hero-stat .num.counting {
  font-variant-numeric: tabular-nums;
}

/* Changelog (dev journal) section */
.changelog-section {
  background: linear-gradient(180deg, var(--bg-cream) 0%, rgba(232, 200, 150, 0.30) 100%);
  border-top: 1px dashed var(--bg-wood-dark);
}
.changelog-list {
  max-width: 720px;
  margin: 0 auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.changelog-item {
  display: grid;
  grid-template-columns: 88px 60px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(139, 90, 43, 0.20);
  font-size: 13px;
  align-items: baseline;
}
.changelog-item:last-child { border-bottom: none; }
.changelog-item .hash {
  color: var(--accent-dark);
  font-weight: 700;
}
.changelog-item .date {
  color: var(--text-tertiary);
  font-size: 11px;
}
.changelog-item .msg {
  color: var(--text-primary);
}
.changelog-item .msg .tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 6px;
}
.tag-feat { background: rgba(74, 222, 128, 0.18); color: #156d2d; }
.tag-fix { background: rgba(239, 68, 68, 0.18); color: #8b1a1a; }
.tag-ui { background: rgba(168, 85, 247, 0.18); color: #5b21b6; }
.tag-balance { background: rgba(59, 130, 246, 0.18); color: #1e40af; }

.terminal-prompt {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}
.terminal-prompt .prompt { color: var(--red-crest); margin-right: 6px; }
.terminal-prompt .cmd { color: var(--text-primary); font-weight: 700; }

/* ============================================================
   FADE-IN scroll animation
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Sub-pages (privacy/support/press)
   ============================================================ */
.subpage-header {
  background: linear-gradient(180deg, var(--sky-mid) 0%, var(--bg-cream) 100%);
  padding: 70px 20px 40px;
  text-align: center;
}
.subpage-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--text-primary);
}
.subpage-header p {
  color: var(--text-secondary);
  margin-top: 8px;
}
.subpage-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.subpage-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.subpage-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 22px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.subpage-content p,
.subpage-content li {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 12px;
}
.subpage-content ul {
  padding-left: 22px;
  margin-bottom: 14px;
}
.subpage-content strong { color: var(--text-primary); }
.subpage-content code {
  background: rgba(139, 90, 43, 0.10);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--accent-dark);
}
