/* ==========================================================================
   LoopIn — styles.css
   Static, dependency-free stylesheet. Design tokens live in :root.
   ========================================================================== */

:root {
  /* Brand colors */
  --forest: #3E5C3A;
  --forest-dark: #2F4630;
  --moss: #8A9A6B;
  --moss-soft: #E4E8D7;
  --terracotta: #A8613F;
  --terracotta-soft: #F1E0D5;
  --canvas: #EDEFE6;
  --card: #F8F7F0;
  --ink: #232821;
  --white: #FFFFFF;

  /* Derived text tones */
  --ink-soft: rgba(35, 40, 33, 0.66);
  --ink-faint: rgba(35, 40, 33, 0.46);
  --border-soft: rgba(35, 40, 33, 0.10);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --space-8: 6rem;

  /* Radii */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(35, 40, 33, 0.06);
  --shadow-md: 0 14px 34px rgba(35, 40, 33, 0.10);
  --shadow-lg: 0 26px 60px rgba(35, 40, 33, 0.16);

  --container: 1120px;
  --header-h: 76px;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  font-weight: 800;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--space-3);
}

ul {
  margin: 0 0 var(--space-3);
  padding-left: 1.25em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

section {
  padding-block: var(--space-8);
}

/* Visually-hidden utility (kept for skip link / a11y helpers) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -60px;
  background: var(--forest);
  color: var(--white);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--space-3);
}

/* Focus visibility everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  min-height: 48px;
}

.btn-primary {
  background: var(--forest);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--forest-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}

.btn-secondary:hover {
  background: rgba(62, 92, 58, 0.08);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(237, 239, 230, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-weight: 600;
  font-size: 0.96rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.4rem 0.1rem;
}

.site-nav a:hover {
  color: var(--forest);
}

.site-nav .nav-cta {
  background: var(--forest);
  color: var(--white);
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-pill);
}

.site-nav .nav-cta:hover {
  background: var(--forest-dark);
  color: var(--white);
}

@media (max-width: 640px) {
  .site-nav a:not(.nav-cta) {
    display: none;
  }
  .site-nav {
    gap: var(--space-2);
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-top: var(--space-7);
  padding-bottom: var(--space-6);
  background:
    radial-gradient(60% 55% at 82% 10%, rgba(138, 154, 107, 0.20), transparent 60%),
    radial-gradient(50% 45% at 8% 85%, rgba(168, 97, 63, 0.10), transparent 60%),
    var(--canvas);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--space-6);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--moss-soft);
  color: var(--forest-dark);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-3);
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  color: var(--ink);
  max-width: 16ch;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: var(--space-4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding: 0;
  list-style: none;
  margin: 0;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.hero-points svg {
  flex-shrink: 0;
  color: var(--forest);
}

/* Phone mockups (pure CSS device frame) */

.hero-visual {
  position: relative;
  height: 430px;
  justify-self: center;
  width: 100%;
  max-width: 420px;
}

.phone-frame {
  background: var(--ink);
  border-radius: 34px;
  padding: 9px;
  box-shadow: var(--shadow-lg);
}

.phone-frame .screen {
  aspect-ratio: 1320 / 2868;
  border-radius: 25px;
  overflow: hidden;
  background: #000;
}

.phone-frame .screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-visual .phone-frame {
  position: absolute;
  width: 205px;
}

.hero-visual .phone-back {
  top: 0;
  left: 6px;
  z-index: 1;
  transform: rotate(-6deg);
}

.hero-visual .phone-front {
  top: 66px;
  left: 168px;
  z-index: 2;
  transform: rotate(4deg);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-actions,
  .hero-points {
    justify-content: center;
  }

  .hero-sub {
    margin-inline: auto;
  }

  .hero-visual {
    position: static;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-6);
    max-width: none;
  }

  .hero-visual .phone-frame {
    position: static;
    transform: none !important;
    width: min(300px, 72vw);
  }
}

/* --------------------------------------------------------------------------
   Section headings (shared)
   -------------------------------------------------------------------------- */

.section-head {
  max-width: 640px;
  margin: 0 auto var(--space-6);
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.section-head p {
  color: var(--ink-soft);
  font-size: 1.08rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Feature cards
   -------------------------------------------------------------------------- */

.features {
  background: var(--canvas);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.feature-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--moss-soft);
  color: var(--forest-dark);
  margin-bottom: var(--space-3);
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-1);
}

.feature-card p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   How it works
   -------------------------------------------------------------------------- */

.how {
  background: var(--card);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  counter-reset: step;
}

.step {
  position: relative;
  padding-left: var(--space-6);
}

.step-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-1);
}

.step p {
  color: var(--ink-soft);
  margin-bottom: 0;
}

@media (max-width: 780px) {
  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* --------------------------------------------------------------------------
   App preview
   -------------------------------------------------------------------------- */

.app-preview {
  background: var(--canvas);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  align-items: start;
  max-width: 780px;
  margin-inline: auto;
}

.preview-grid figure {
  margin: 0;
  text-align: center;
}

.preview-grid .phone-frame {
  width: min(260px, 100%);
  margin-inline: auto;
  margin-bottom: var(--space-3);
}

.preview-grid figcaption {
  color: var(--ink-soft);
  font-size: 0.96rem;
  max-width: 30ch;
  margin-inline: auto;
}

@media (max-width: 700px) {
  .preview-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* --------------------------------------------------------------------------
   Download
   -------------------------------------------------------------------------- */

.download {
  background: linear-gradient(180deg, var(--card), var(--moss-soft) 140%);
  text-align: center;
}

.download h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
}

.download p {
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 46ch;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
}

.store-badges a {
  display: inline-block;
  line-height: 0;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease;
}

.store-badges a:hover {
  transform: translateY(-2px);
}

.store-badges img {
  height: 54px;
  width: auto;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: rgba(248, 247, 240, 0.82);
  padding-block: var(--space-6) var(--space-5);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  color: var(--white);
  font-size: 1.05rem;
}

.footer-brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-5);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  text-decoration: none;
  color: rgba(248, 247, 240, 0.82);
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(248, 247, 240, 0.14);
  font-size: 0.85rem;
  color: rgba(248, 247, 240, 0.55);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
}

.footer-bottom a {
  color: rgba(248, 247, 240, 0.72);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Legal / support page layout
   -------------------------------------------------------------------------- */

.legal-hero {
  padding-top: var(--space-6);
  padding-bottom: var(--space-4);
  background: var(--canvas);
}

.legal-hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
}

.legal-updated {
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 0.92rem;
}

.legal-notice {
  background: var(--terracotta-soft);
  border: 1px solid rgba(168, 97, 63, 0.25);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-4);
  font-size: 0.96rem;
}

.legal-body {
  background: var(--card);
  padding-block: var(--space-6) var(--space-8);
}

.legal-content {
  max-width: 760px;
  margin-inline: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.legal-content h2 {
  font-size: 1.25rem;
  margin-top: var(--space-6);
  padding-top: var(--space-1);
  color: var(--forest-dark);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.legal-content a {
  color: var(--forest);
}

.toc {
  background: var(--moss-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.toc h2 {
  margin-top: 0 !important;
  font-size: 1.05rem !important;
  color: var(--ink) !important;
}

.toc ul {
  columns: 2;
  padding-left: 1.1em;
}

.toc a {
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--forest-dark);
}

.toc a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .toc ul {
    columns: 1;
  }
  .legal-content {
    padding: var(--space-4);
  }
}

/* --------------------------------------------------------------------------
   Support page extras
   -------------------------------------------------------------------------- */

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.support-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.support-card h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.support-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
}

.support-contact {
  background: var(--forest);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  margin-bottom: var(--space-6);
}

.support-contact h2 {
  color: var(--white) !important;
  margin-top: 0 !important;
}

.support-contact p {
  color: rgba(255, 255, 255, 0.85) !important;
}

.support-contact .btn-primary {
  background: var(--white);
  color: var(--forest-dark);
}

.support-contact .btn-primary:hover {
  background: var(--card);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@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;
    scroll-behavior: auto !important;
  }
}

/* Prevent horizontal overflow anywhere */
html, body {
  overflow-x: hidden;
}
