/* ============================================================
   I Said This, You Heard That — Study Sessions
   Brand-aligned design system
   ============================================================ */

/* --- Design Tokens ----------------------------------------- */
:root {
  /* Brand temperament palette (from the logo / iOS app) */
  --red:    #E45A53;
  --yellow: #F5B731;
  --green:  #2E9E6A;
  --blue:   #3D88AC;

  /* Softer tints for backgrounds */
  --red-light:    #FDECEA;
  --yellow-light: #FFF7E0;
  --green-light:  #E8F8F0;
  --blue-light:   #E6F1F7;

  /* Neutrals */
  --ink:       #1E1E1E;
  --ink-soft:  #555;
  --surface:   #FFFFFF;
  --bg:        #F5F4F1;
  --border:    #E0DDD8;

  /* Typography */
  --font-body:    'Metrophobic', Arial, sans-serif;
  --font-display: 'Oswald', Arial, sans-serif;

  /* Spacing scale */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-pill: 100px;

  /* Shadows */
  --shadow-card: 0 2px 12px rgba(0,0,0,.06);
  --shadow-lift: 0 8px 32px rgba(0,0,0,.10);
}

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

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

a { color: inherit; text-decoration: none; }

/* --- App Shell --------------------------------------------- */
.app-shell {
  position: relative;
  overflow-x: hidden;
}

/* Animated gradient orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .18;
  pointer-events: none;
  z-index: 0;
  animation: float 18s ease-in-out infinite alternate;
}
.bg-orb-green  { width: 500px; height: 500px; background: var(--green);  top: -120px; left: -80px; }
.bg-orb-blue   { width: 420px; height: 420px; background: var(--blue);   bottom: -100px; right: -60px; animation-delay: -6s; }
.bg-orb-yellow { width: 360px; height: 360px; background: var(--yellow); top: 40%; left: 60%; animation-delay: -12s; }
.bg-orb-red    { width: 400px; height: 400px; background: var(--red);    top: 20%; right: -80px; animation-delay: -9s; }

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.08); }
  100% { transform: translate(-20px, 30px) scale(.95); }
}

/* --- Color Bar --------------------------------------------- */
.color-bar {
  display: flex;
  height: 5px;
  width: 100%;
}
.color-bar span {
  flex: 1;
}
.color-bar .cb-red    { background: var(--red); }
.color-bar .cb-yellow { background: var(--yellow); }
.color-bar .cb-green  { background: var(--green); }
.color-bar .cb-blue   { background: var(--blue); }

/* --- Page Container ---------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-lg) var(--sp-2xl);
}

/* --- Hero (Index Page) ------------------------------------- */
.hero {
  text-align: center;
  padding: var(--sp-3xl) 0 var(--sp-2xl);
}

.brand-logo {
  width: 180px;
  height: auto;
  margin: 0 auto var(--sp-lg);
  border-radius: var(--r-md);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.10));
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--ink-soft);
  margin-top: var(--sp-sm);
}

.hero-copy {
  max-width: 520px;
  margin: var(--sp-md) auto 0;
  color: var(--ink-soft);
  font-size: .95rem;
}

/* --- Session Grid ------------------------------------------ */
.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-lg);
  margin-top: var(--sp-lg);
}

.session-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.session-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

/* Tone-based top accent stripe */
.session-card::before {
  content: '';
  display: block;
  height: 4px;
}
.session-card.tone-0::before { background: var(--yellow); }
.session-card.tone-1::before { background: var(--red); }
.session-card.tone-2::before { background: var(--green); }
.session-card.tone-3::before { background: var(--blue); }

.session-link {
  display: flex;
  flex-direction: column;
  padding: var(--sp-lg);
  height: 100%;
}

.session-pill {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: var(--sp-xs) var(--sp-md);
  border-radius: var(--r-pill);
  width: fit-content;
  margin-bottom: var(--sp-sm);
}
.tone-0 .session-pill { background: var(--yellow-light); color: #9B7000; }
.tone-1 .session-pill { background: var(--red-light);    color: #A13330; }
.tone-2 .session-pill { background: var(--green-light);  color: #1B6E46; }
.tone-3 .session-pill { background: var(--blue-light);   color: #2A6680; }

.session-link h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: var(--sp-xs);
}

.session-link .session-desc {
  font-size: .88rem;
  color: var(--ink-soft);
  flex: 1;
}

.session-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: var(--sp-md);
  color: var(--ink);
  transition: gap .2s ease;
}
.session-card:hover .session-cta { gap: var(--sp-md); }

.session-cta::after {
  content: '\2192';
  font-size: 1.1em;
}

/* --- App Banner (Index Page) ------------------------------- */
.app-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-lg) var(--sp-xl);
  margin-top: var(--sp-2xl);
  overflow: hidden;
  position: relative;
}
.app-banner::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, var(--red), var(--yellow), var(--green), var(--blue));
}

.app-banner-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
}

.app-banner-text {
  flex: 1;
}
.app-banner-text h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  margin-bottom: 2px;
}
.app-banner-text p {
  font-size: .85rem;
  color: var(--ink-soft);
}

.app-banner .btn {
  flex-shrink: 0;
}

/* --- Compact Header (Landing Page) ------------------------- */
.compact-header {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) 0;
}

.compact-header .brand-logo-small {
  width: 48px;
  height: auto;
  border-radius: var(--r-sm);
}

.compact-header .brand-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

/* --- Launch Card (Video Landing) --------------------------- */
.launch-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-xl) 0 var(--sp-lg);
}

.launch-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
  padding: var(--sp-xl) var(--sp-lg);
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.launch-card .session-pill {
  margin: 0 auto var(--sp-md);
}

.launch-card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-transform: uppercase;
  margin-bottom: var(--sp-sm);
}

.launch-copy {
  color: var(--ink-soft);
  font-size: .95rem;
  margin-bottom: var(--sp-lg);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* --- CTA Row ----------------------------------------------- */
.cta-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  align-items: center;
}

/* --- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: var(--sp-md) var(--sp-xl);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
  min-width: 240px;
}
.btn-primary:hover {
  background: #26875B;
  border-color: #26875B;
  box-shadow: 0 4px 16px rgba(46,158,106,.3);
}

.btn-xl {
  font-size: 1.05rem;
  padding: var(--sp-lg) var(--sp-2xl);
  min-width: 280px;
}

.btn-secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-secondary:hover {
  background: var(--blue);
  color: white;
  box-shadow: 0 4px 16px rgba(61,136,172,.25);
}

.btn-dark {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.btn-dark:hover {
  background: #333;
  border-color: #333;
}

/* Apple-style icon in button */
.btn .icon-apple {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* --- iOS App Pitch Section --------------------------------- */
.app-pitch {
  margin-top: var(--sp-2xl);
  text-align: center;
}

.app-pitch-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}

.app-pitch-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.app-pitch-header h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  text-transform: uppercase;
}

.app-pitch-header p {
  color: var(--ink-soft);
  font-size: .95rem;
  max-width: 420px;
}

/* --- Feature Grid ------------------------------------------ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-lg);
  margin-top: var(--sp-lg);
}

.feature-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-lg);
  position: relative;
  overflow: hidden;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.feature-card.tone-0::before { background: var(--green); }
.feature-card.tone-1::before { background: var(--blue); }
.feature-card.tone-2::before { background: var(--yellow); }

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-md);
  font-size: 1.2rem;
}
.tone-0 .feature-icon { background: var(--green-light); }
.tone-1 .feature-icon { background: var(--blue-light); }
.tone-2 .feature-icon { background: var(--yellow-light); }

.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.feature-subtitle {
  font-size: .8rem;
  color: var(--ink-soft);
  margin-bottom: var(--sp-sm);
}

.feature-card > p:last-child {
  font-size: .85rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* --- Back Link --------------------------------------------- */
.back-link {
  text-align: center;
  margin-top: var(--sp-2xl);
}
.back-link a {
  font-size: .85rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.back-link a:hover {
  color: var(--ink);
}

/* --- Footer ------------------------------------------------ */
.page-footer {
  text-align: center;
  padding: var(--sp-2xl) 0 var(--sp-lg);
  font-size: .8rem;
  color: var(--ink-soft);
}

/* --- 404 Page ---------------------------------------------- */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.error-code {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 5rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--red), var(--yellow), var(--green), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--sp-md);
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 640px) {
  .page {
    padding: var(--sp-md) var(--sp-md) var(--sp-xl);
  }

  .hero {
    padding: var(--sp-2xl) 0 var(--sp-lg);
  }

  .brand-logo {
    width: 140px;
  }

  .session-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .app-banner {
    flex-direction: column;
    text-align: center;
    padding: var(--sp-lg);
  }
  .app-banner::before {
    left: 0; right: 0; top: 0;
    bottom: auto;
    width: auto; height: 5px;
    background: linear-gradient(to right, var(--red), var(--yellow), var(--green), var(--blue));
  }

  .btn-xl {
    min-width: auto;
    width: 100%;
  }

  .launch-card {
    padding: var(--sp-xl) var(--sp-lg);
  }
}

@media (min-width: 641px) and (max-width: 960px) {
  .session-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
