/* Home page: hero + mode launcher, state-based secondary section (recent
   shots / starter / how-it-works), optional feature strip. See home.js for
   the state logic -- this file is pure presentation. */

.home-page { min-height: 100svh; display: flex; flex-direction: column; }

/* ---- hero ---- */
/* max-width+padding live together on .home-hero-inner (not split across
   parent/child) so its left edge lines up exactly with the header logo,
   secondary section, and footer -- all of which use this same single-
   element max-width+margin:auto+padding pattern. Bottom padding is
   intentionally smaller than top: top clears the sticky header, bottom
   should not leave a dead gap before the next section. */
.home-hero { padding: clamp(32px, 5vw, 56px) 0 clamp(36px, 5vw, 64px); }
.home-hero-inner {
  max-width: var(--content-max); margin: 0 auto; padding: 0 20px;
  display: flex; flex-direction: column; gap: 48px;
}
@media (min-width: 860px) {
  .home-hero-inner { flex-direction: row; align-items: center; gap: 64px; }
  .home-hero-copy { flex: 0 1 45%; }
  .home-hero-launcher { flex: 0 1 55%; }
}
@media (min-width: 1180px) {
  .home-hero-inner { gap: 80px; }
}

.home-eyebrow {
  margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.home-hero-copy h1 {
  margin: 0 0 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05;
  font-size: clamp(2.375rem, 1.85rem + 2.2vw, 4.25rem);
}
.home-hero-sub {
  margin: 0 0 30px; color: #ded2c4; max-width: 46ch;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); line-height: 1.55;
}

.home-hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.home-cta-primary, .home-cta-secondary {
  min-height: 48px; padding: 0 26px; font-size: 16px; border-radius: var(--radius-pill);
}
.home-cta-secondary { background: var(--surface-strong); border: 1px solid var(--hair); }

.home-upload-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 20px;
  min-height: 48px; padding: 0 18px;
  border-radius: var(--radius-pill); border: 1px solid var(--hair); background: rgba(251,243,233,0.03);
  font-size: 14px; font-weight: 700; color: var(--muted); text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.home-upload-link .ico { width: 17px; height: 17px; }
.home-upload-link:hover { color: var(--text); border-color: rgba(251,243,233,0.28); background: rgba(251,243,233,0.06); }

.home-permission-note { margin: 0; font-size: 13px; color: var(--muted); }

/* ---- mode launcher ---- */
.home-hero-launcher { position: relative; display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 560px) { .home-hero-launcher { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) and (max-width: 1023px) { .home-hero-launcher { grid-template-columns: 1fr; } }

.home-launcher-glow { display: none; }
.home-spark { position: absolute; z-index: 0; pointer-events: none; color: var(--accent2); opacity: 0.4; }
.home-spark.spark-a { width: 16px; height: 16px; top: -8px; right: 22%; }
.home-spark.spark-b { width: 12px; height: 12px; bottom: 14%; left: -6px; opacity: 0.3; }

.home-mode-card {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start;
  gap: 4px; padding: 28px 26px; border-radius: clamp(22px, 2vw, 28px); text-decoration: none; color: var(--text);
  background: linear-gradient(165deg, rgba(251,243,233,0.05), rgba(251,243,233,0.015));
  border: 1px solid var(--hair);
  transition: transform 0.16s var(--spring), border-color 0.16s ease;
}
.home-mode-card:hover { transform: translateY(-3px); border-color: rgba(251,243,233,0.28); }
.home-mode-card:active { transform: translateY(-1px); }

.home-mode-photo {
  background: linear-gradient(165deg, rgba(240,153,107,0.14), rgba(240,153,107,0.03));
  border-color: rgba(240,153,107,0.28);
}
.home-mode-photo::before, .home-mode-photo::after {
  /* Inset well past the card's own border-radius (up to 28px) so the mark's
     own sharp corner sits inside the rounded curve, not poking past it. */
  content: ''; position: absolute; width: 14px; height: 14px; border-color: rgba(240,153,107,0.45); pointer-events: none;
}
.home-mode-photo::before { top: 22px; left: 22px; border-top: 2px solid; border-left: 2px solid; border-radius: 3px 0 0 0; }
.home-mode-photo::after { bottom: 22px; right: 22px; border-bottom: 2px solid; border-right: 2px solid; border-radius: 0 0 3px 0; }

.home-mode-icon-wrap {
  position: relative; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.home-mode-icon { width: 30px; height: 30px; color: var(--accent); position: relative; z-index: 1; }
.home-mode-live .home-mode-icon-wrap::before,
.home-mode-live .home-mode-icon-wrap::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(240,153,107,0.32);
}
.home-mode-live .home-mode-icon-wrap::after {
  inset: -12px; border-color: rgba(240,153,107,0.16);
  animation: home-pulse-ring 2.6s ease-out infinite;
}
@keyframes home-pulse-ring {
  0% { transform: scale(0.82); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

.home-mode-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.home-mode-card h2 { margin: 4px 0 8px; font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); font-weight: 700; letter-spacing: -0.01em; }
.home-mode-card p { margin: 0 0 18px; font-size: 15.5px; line-height: 1.5; color: #ded2c4; }
.home-mode-action {
  margin-top: auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: 14.5px; font-weight: 700; color: var(--accent);
}
.home-mode-action .ico { width: 16px; height: 16px; }

/* ---- quota warning (only rendered when critically low / exhausted) ---- */
.home-quota-warning-wrap { max-width: var(--content-max); margin: 0 auto; padding: 0 20px; }
.home-quota-warning {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-radius: 16px; border: 1px solid rgba(255,125,125,0.32); background: rgba(255,125,125,0.08);
}
.home-quota-warning .ico { width: 20px; height: 20px; color: var(--danger); flex: 0 0 auto; }
.home-quota-warning p { margin: 0; flex: 1 1 240px; font-size: 14px; color: var(--text); }
.home-quota-warning .btn { min-height: 38px; padding: 0 16px; font-size: 13.5px; }

/* ---- secondary section (shared shell for all three states) ---- */
.home-secondary { max-width: var(--content-max); margin: 0 auto; width: 100%; padding: 8px 20px 12px; }
.home-section-head { margin-bottom: 20px; max-width: 60ch; }
.home-section-head h2 { margin: 0 0 8px; font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.75rem); font-weight: 700; letter-spacing: -0.01em; }
.home-section-head p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
/* Recent Shots' variant: "View all shots" sits at the right of the
   heading row instead of below the grid. */
.home-section-head-row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-section-link {
  display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto;
  font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none;
  transition: color 0.15s ease, gap 0.15s ease;
}
.home-section-link .ico { width: 15px; height: 15px; transition: transform 0.15s var(--spring); }
.home-section-link:hover { color: var(--accent2); gap: 6px; }
.home-section-link:hover .ico { transform: translateX(2px); }

/* recent shots grid */
.home-shots-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 560px) { .home-shots-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .home-shots-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1180px) { .home-shots-grid { grid-template-columns: repeat(5, 1fr); } }

.home-shot-cell {
  position: relative; overflow: hidden; border-radius: 18px; aspect-ratio: 1; background: var(--surface);
  border: 0; padding: 0; display: block; width: 100%; cursor: pointer;
}
.home-shot-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-shot-cell .home-shot-label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.home-shot-label .home-shot-score { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.home-shot-label .home-shot-score .ico { width: 13px; height: 13px; }
.home-shot-label .home-shot-date { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.75); }

/* starter / how-it-works shared bits */
.home-starter, .home-howitworks { display: flex; flex-direction: column; gap: 14px; }
/* .home-section-head's own margin-bottom is for block-flow contexts (e.g.
   Recent Shots); inside these flex columns the container `gap` already
   provides that spacing, so the two would otherwise stack and double it. */
.home-starter .home-section-head, .home-howitworks .home-section-head { margin-bottom: 0; }
.home-starter-illustration { color: var(--accent); opacity: 0.85; width: 64px; height: 64px; }
.home-starter-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.home-starter-actions .btn { min-height: 46px; padding: 0 22px; }

.home-steps { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .home-steps { grid-template-columns: repeat(3, 1fr); } }
.home-step {
  position: relative; padding: 24px 22px; border-radius: 20px;
  background: linear-gradient(165deg, rgba(251,243,233,0.05), rgba(251,243,233,0.015));
  border: 1px solid var(--hair); box-shadow: 0 14px 30px -22px rgba(0,0,0,0.6);
  transition: transform 0.16s var(--spring), border-color 0.16s ease;
}
.home-step:hover { transform: translateY(-2px); border-color: rgba(251,243,233,0.24); }
.home-step-icon-wrap {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 14px;
  border-radius: 14px; background: rgba(240,153,107,0.14);
}
.home-step-icon-wrap .ico { width: 22px; height: 22px; color: var(--accent); }
.home-step-num {
  position: absolute; top: 18px; right: 18px; display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: rgba(251,243,233,0.08);
  color: var(--muted); font-weight: 700; font-size: 12px;
}
.home-step h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 700; }
.home-step p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---- feature strip ---- */
.home-feature-strip {
  max-width: var(--content-max); margin: clamp(40px, 6vw, 64px) auto 0; padding: 28px 20px clamp(40px, 6vw, 64px);
  display: grid; grid-template-columns: 1fr; gap: 28px;
}
@media (min-width: 700px) { .home-feature-strip { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.home-feature { display: flex; gap: 14px; align-items: flex-start; }
.home-feature .ico { width: 24px; height: 24px; color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.home-feature h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.home-feature p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .home-mode-card:hover { transform: none; }
}
