/* =========================================================================
   AmirInvests — styles.css
   Modern, minimalist, mobile-first financial education landing page.
   Organized: fonts → tokens → base → layout → components → sections → motion → responsive
   ========================================================================= */

/* ------------------------------- Web fonts ------------------------------ */
/* Inter, self-hosted and subsetted to Latin (Fontsource). Three weights only
   to keep the total payload small. `font-display: swap` shows the system
   fallback until Inter is ready, so text is always visible. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/inter-600.woff2") format("woff2");
}

/* ----------------------------- Design tokens ---------------------------- */
:root {
  /* Brand palette — deep navy trust + calm growth green */
  --navy-900: #0B1F33;
  --navy-800: #122C46;
  --navy-700: #1B3A5B;
  --ink:      #14202E;

  --green-500: #12B886;
  --green-400: #2ECC94;
  --green-300: #34D399;

  --paper:    #FFFFFF;
  --mist:     #F5F8FB;
  --mist-200: #EAF1F7;
  --line:     #E2EAF1;

  --text:      #182635;
  --text-soft: #4C5E72;
  --text-mute: #7488A0;
  --text-on-dark:      #EAF2FA;
  --text-on-dark-soft: #9FB3C8;

  /* Typography */
  /* Inter as the primary typeface (self-hosted, subsetted). The system stack
     is the fallback so text is fully readable while Inter is downloading and
     on old browsers that can't fetch woff2. */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: var(--font-sans);

  /* Spacing / shape */
  --container: 1120px;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 39, 64, 0.06), 0 2px 6px rgba(16, 39, 64, 0.05);
  --shadow-md: 0 10px 30px rgba(16, 39, 64, 0.08), 0 4px 12px rgba(16, 39, 64, 0.05);
  --shadow-lg: 0 24px 60px rgba(11, 31, 51, 0.16);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 84px; /* offset sticky header for anchor jumps */
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Inter OpenType features: contextual alternates + tabular figures where
     appropriate. cv11 uses the single-story 'a' that matches SF Pro's shape. */
  font-feature-settings: "cv11", "ss01", "ss03";
}

h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
img, svg, picture { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--green-400);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}

/* Accessibility helpers */
.visually-hidden, .skip-link {
  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:focus {
  position: fixed;
  top: 12px; left: 12px;
  width: auto; height: auto;
  clip: auto; margin: 0;
  padding: 0.7rem 1.1rem;
  background: var(--navy-900);
  color: #fff;
  border-radius: var(--radius-sm);
  z-index: 200;
}

/* ------------------------------- Typography ----------------------------- */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-500);
  margin-bottom: 1rem;
}
.eyebrow--center { text-align: center; }

/* -------------------------------- Buttons ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--green-400), var(--green-500));
  color: #06231a;
  box-shadow: 0 6px 18px rgba(18, 184, 134, 0.35);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(18, 184, 134, 0.42);
}
.btn--primary:active { transform: translateY(0); }
.btn--sm {
  font-size: 0.82rem;
  padding: 0.5rem 0.95rem;
}
/* Keep the header CTA compact on desktop (mobile menu still spans full width) */
@media (min-width: 721px) {
  .nav__cta {
    font-size: 0.82rem;
    padding: 0.45rem 0.9rem;
  }
}

/* ------------------------------- Brand logo ----------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}
.brand__mark { color: var(--green-500); flex: none; }
.brand__accent { color: var(--green-500); }
.brand--footer, .brand--footer .brand__name { color: #fff; }
.brand--footer .brand__accent { color: var(--green-300); }

/* ------------------------------ Navigation ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav__menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav__links a {
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--text-soft);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--green-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav__links a:hover { color: var(--navy-900); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.nav__toggle-bar {
  display: block;
  width: 20px; height: 2px;
  margin-inline: auto;
  background: var(--navy-900);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------- Hero --------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--mist) 0%, var(--paper) 60%);
}
.hero__glow {
  position: absolute;
  top: -30%; left: 50%;
  width: 900px; height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(46, 204, 148, 0.16) 0%, rgba(46, 204, 148, 0) 62%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: 760px;
  text-align: center;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6.2vw, 4rem);
  letter-spacing: -0.03em;
  color: var(--navy-900);
  margin-bottom: 1.25rem;
}
.hero__lead {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto 2.25rem;
}
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
  font-size: 0.9rem;
  color: var(--text-mute);
}
.hero__trust li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero__trust li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-500);
}

/* ------------------------------ Signup form ----------------------------- */
.signup { max-width: 520px; margin-inline: auto; }
/* Hero signup gets a bit more room so the button sits comfortably on one line */
.hero .signup { max-width: 620px; }

/* Beehiiv embed container: center the injected form and reserve space so the
   layout doesn't shift while the script loads. The form itself is styled by
   Beehiiv; we only control its wrapper. */
.beehiiv-embed { display: flex; flex-direction: column; align-items: center; }
.beehiiv-embed > iframe,
.beehiiv-embed > div { width: 100%; margin-inline: auto; }
.beehiiv-embed .signup__note { margin-top: 1.1rem; }
.signup-form {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
}
.signup-form__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  color: var(--text);
}
.signup-form__input::placeholder { color: var(--text-mute); }
.signup-form__input:focus { outline: none; }
.signup-form__button { flex: none; }

.signup-form.is-invalid .signup-form__input { color: #c0392b; }
.signup-form.is-invalid { border-color: #e7a6a0; box-shadow: 0 0 0 3px rgba(224, 74, 58, 0.12); }

.signup__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--text-mute);
}
.signup__note svg { color: var(--green-500); flex: none; }
.signup__note--light { color: var(--text-on-dark-soft); }
.signup__note--light svg { color: var(--green-300); }

.signup__success {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  padding: 1rem 1.25rem;
  background: rgba(18, 184, 134, 0.08);
  border: 1px solid rgba(18, 184, 134, 0.3);
  border-radius: var(--radius);
  color: var(--text);
  animation: pop 0.4s var(--ease);
}
.signup__success strong { display: block; font-weight: 600; }
.signup__success span { font-size: 0.9rem; color: var(--text-soft); }
.signup__check {
  flex: none;
  color: var(--green-500);
  background: rgba(18, 184, 134, 0.15);
  border-radius: 50%;
  padding: 6px;
  width: 34px; height: 34px;
}
.signup__success--light {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.4);
  color: #fff;
}
.signup__success--light span { color: var(--text-on-dark-soft); }
.signup__success--light .signup__check { color: var(--green-300); }

/* ------------------------------- Sections ------------------------------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--muted { background: var(--mist); }
.section__head {
  max-width: 640px;
  margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  color: var(--navy-900);
  letter-spacing: -0.025em;
}
.section__sub {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--text-soft);
}

/* --------------------------------- Cards -------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  padding: 2rem 1.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(46, 204, 148, 0.16), rgba(18, 184, 134, 0.1));
  color: var(--green-500);
}
.card__icon svg { width: 26px; height: 26px; }
.card__title {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  color: var(--navy-900);
}
.card__text { color: var(--text-soft); font-size: 0.98rem; }

/* -------------------------------- Roadmap ------------------------------- */
.roadmap {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  display: grid;
  gap: 1.25rem;
}
.stage {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.25rem;
  padding: 1.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.stage:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.stage__marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}
.stage__title { font-size: 1.25rem; color: var(--navy-900); margin-bottom: 0.3rem; }
.stage__desc { color: var(--text-soft); margin-bottom: 1rem; font-size: 0.98rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  background: var(--mist-200);
  color: var(--navy-700);
  border-radius: 999px;
}

/* --------------------------------- About -------------------------------- */
.about {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}
.about__media { display: flex; justify-content: center; }
.about__photo {
  width: min(340px, 72vw);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  /* Source portrait is a circle on black — clip to a circle to hide corners. */
  border-radius: 50%;
  background: var(--mist-200);
  box-shadow: var(--shadow-lg);
  border: 8px solid var(--paper);
  outline: 1px solid var(--line);
}
.about__media { position: relative; }
/* Soft brand ring behind the circular photo */
.about__media::before {
  content: "";
  position: absolute;
  width: min(380px, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, rgba(46, 204, 148, 0.18), rgba(46, 204, 148, 0) 70%);
  z-index: -1;
}
.about__title { margin-bottom: 1.25rem; }
.about__text { color: var(--text-soft); font-size: 1.1rem; margin-bottom: 1rem; }
.about__socials { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* ------------------------------ Social links ---------------------------- */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.about__socials .social-link {
  width: 44px; height: 44px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.about__socials .social-link:hover { color: var(--green-500); border-color: var(--green-400); transform: translateY(-2px); }

/* ------------------------------ Newsletter ------------------------------ */
.newsletter { padding-bottom: clamp(4rem, 9vw, 7rem); }
.newsletter__card {
  position: relative;
  overflow: hidden;
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3.5rem);
  background: linear-gradient(160deg, var(--navy-900), var(--navy-800));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.newsletter__glow {
  position: absolute;
  bottom: -50%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(46, 204, 148, 0.22) 0%, rgba(46, 204, 148, 0) 65%);
  pointer-events: none;
}
.newsletter__title {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: #fff;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}
.newsletter__desc {
  position: relative;
  color: var(--text-on-dark-soft);
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto 2rem;
}
.signup--lg { position: relative; }

/* --------------------------------- Footer ------------------------------- */
.footer {
  background: var(--navy-900);
  color: var(--text-on-dark);
  padding: clamp(3rem, 6vw, 4rem) 0 2rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer__tagline { margin-top: 0.85rem; color: var(--text-on-dark-soft); max-width: 320px; font-size: 0.95rem; }
.footer__social { display: flex; flex-wrap: wrap; gap: 1.5rem; align-content: start; }
.footer__social .social-link { color: var(--text-on-dark-soft); font-size: 0.95rem; }
.footer__social .social-link:hover { color: var(--green-300); transform: translateY(-2px); }
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
}
.footer__disclaimer { color: var(--text-on-dark-soft); font-size: 0.85rem; max-width: 620px; }
.footer__copy { color: var(--text-mute); font-size: 0.85rem; }

/* --------------------------------- Motion ------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* -------------------------------- Responsive ---------------------------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }
  .about { grid-template-columns: 1fr; text-align: center; }
  .about__content { display: flex; flex-direction: column; align-items: center; }
  .about__socials { justify-content: center; }
}

@media (max-width: 720px) {
  /* Mobile navigation */
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem clamp(1.15rem, 4vw, 2.5rem) 1.75rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav__menu.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__links li { border-bottom: 1px solid var(--line); }
  .nav__links a { display: block; padding: 0.95rem 0.25rem; font-size: 1.05rem; }
  .nav__links a::after { display: none; }
  .nav__cta { margin-top: 1.1rem; width: 100%; }

  .signup-form { flex-direction: column; border-radius: var(--radius); padding: 0.75rem; }
  .signup-form__input { text-align: center; padding: 0.85rem 1rem; }
  .signup-form__button { width: 100%; padding: 0.95rem; }
  .signup-form { border-radius: 20px; }

  .footer__inner { flex-direction: column; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
