/* =============================================
   FECIT Waitlist — v6 indigo palette
   ============================================= */

:root {
  --accent: #3730A3;
  --accent-hover: #2E2991;
  --accent-text: #3730A3;
  --accent-light: #E0DFFA;
  --accent-dark: #1E1B4B;
  --bg: #F3F1EC;
  --surface: #FFFFFF;
  --border: #DDD9D1;
  --text: #2C2C2C;
  --muted: #7A756D;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --r: 16px;
  --r-sm: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-slow: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1917; --surface: #252420; --border: #3A3832;
    --text: #EDEBE7; --muted: #9B968D;
    --accent-text: #7E7ADB;
    --accent-light: #1E1B4B; --accent-dark: #0F0D2B;
  }
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; line-height: 1.6;
  position: relative;
}

/* Noise texture */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 200px 200px;
}

/* Ambient vignette */
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, transparent 0%, rgba(0,0,0,0.03) 100%);
}

::selection { background: var(--accent); color: #fff; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* =============================================
   HEADER
   ============================================= */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 14px 40px;
  display: flex; justify-content: space-between; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease-slow),
              border-color 0.5s var(--ease-slow),
              box-shadow 0.5s var(--ease-slow);
}

/* On hero: warm paper colors on indigo bg */
.logo {
  font-family: var(--serif); font-size: 1.4rem; font-style: italic;
  text-decoration: none;
  color: var(--bg);
  transition: color 0.5s var(--ease-slow), opacity 0.4s;
}
.logo:hover { opacity: 0.7; }

.lang {
  border-radius: var(--r-sm);
  padding: 4px 10px; font-family: var(--sans); font-size: 0.72rem;
  cursor: pointer;
  color: rgba(243,241,236,0.6);
  background: rgba(243,241,236,0.1);
  border: 1px solid rgba(243,241,236,0.2);
  transition: color 0.5s var(--ease-slow),
              background 0.5s var(--ease-slow),
              border-color 0.5s var(--ease-slow);
}
.lang:hover {
  color: rgba(243,241,236,0.9);
  border-color: rgba(243,241,236,0.4);
}

/* After hero: frosted glass */
.header--frosted {
  background: rgba(243,241,236,0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom-color: rgba(221,217,209,0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.header--frosted .logo { color: var(--accent-text); }

.header--frosted .lang {
  color: var(--muted);
  background: rgba(255,255,255,0.5);
  border-color: var(--border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.header--frosted .lang:hover {
  color: var(--accent-text);
  border-color: var(--accent-text);
  background: rgba(255,255,255,0.7);
}

@media (prefers-color-scheme: dark) {
  .header--frosted { background: rgba(26,25,23,0.72); border-bottom-color: rgba(58,56,50,0.6); }
  .header--frosted .logo { color: var(--accent-text); }
  .header--frosted .lang { background: rgba(37,36,32,0.5); color: var(--muted); }
  .header--frosted .lang:hover { background: rgba(37,36,32,0.7); }
}

/* =============================================
   HERO
   ============================================= */
.hero {
  min-height: 100vh;
  background: var(--accent);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 40px;
  position: relative;
}

.hero__headline {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 11vw, 9rem);
  font-weight: 400; line-height: 0.93; letter-spacing: -0.03em;
  color: #fff;
  text-rendering: optimizeLegibility;
}

.hero__headline .word {
  display: inline-block;
  opacity: 0;
  transform: translateX(-24px);
  animation: heroWordIn 0.7s var(--ease-slow) forwards;
}
.hero__headline .word:nth-child(1) { animation-delay: 0.1s; }
.hero__headline .word:nth-child(2) { animation-delay: 0.16s; }
.hero__headline .word:nth-child(3) { animation-delay: 0.22s; }
.hero__headline .word:nth-child(4) { animation-delay: 0.34s; }
.hero__headline .word:nth-child(5) { animation-delay: 0.40s; }
.hero__headline .word:nth-child(6) { animation-delay: 0.46s; }

@keyframes heroWordIn {
  to { opacity: 1; transform: translateX(0); }
}

.hero__bar {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 40px; padding: 28px 0 48px;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 32px;
}

.hero__copy { max-width: 560px; }

.hero__sub {
  font-size: 1.05rem; color: rgba(255,255,255,0.6);
  line-height: 1.6;
}

.hero__persona {
  font-size: 0.85rem; color: rgba(255,255,255,0.35);
  margin-top: 8px;
}

.hero__form-wrap { text-align: right; }

.hero .hero-form { display: flex; gap: 8px; }

.hero .input {
  padding: 13px 16px; border: 1px solid rgba(255,255,255,0.25); border-radius: var(--r-sm);
  font-family: var(--sans); font-size: 0.9rem; color: #fff;
  background: rgba(255,255,255,0.1); outline: none; width: 260px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  transition: border-color 0.3s var(--ease-slow), box-shadow 0.3s var(--ease-slow);
}
.hero .input:focus { border-color: rgba(255,255,255,0.5); box-shadow: 0 0 0 3px rgba(255,255,255,0.1); }
.hero .input::placeholder { color: rgba(255,255,255,0.35); }

.hero .btn {
  padding: 13px 24px; background: #fff; color: var(--accent); border: none;
  border-radius: var(--r-sm); font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.08);
  transition: background 0.3s, transform 0.4s var(--ease-slow), box-shadow 0.3s var(--ease-slow);
}
.hero .btn:hover { background: rgba(255,255,255,0.88); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.1); }
.hero .btn:active { transform: scale(0.98); }

.hero .micro { color: rgba(255,255,255,0.35); text-align: right; margin-top: 10px; }

/* =============================================
   DEFAULT FORM / BTN (outside hero)
   ============================================= */
.hero-form { display: flex; gap: 8px; }

.input {
  padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-family: var(--sans); font-size: 0.9rem; color: var(--text);
  background: var(--surface); outline: none; width: 260px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  transition: border-color 0.3s var(--ease-slow), box-shadow 0.3s var(--ease-slow);
}
.input:focus { border-color: var(--accent-text); box-shadow: inset 0 1px 2px rgba(0,0,0,0.02), 0 0 0 3px rgba(55,48,163,0.1); }
.input::placeholder { color: var(--muted); opacity: 0.5; }

.btn {
  padding: 13px 24px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--r-sm); font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(55,48,163,0.2), 0 4px 12px rgba(55,48,163,0.15);
  transition: background 0.3s, transform 0.4s var(--ease-slow), box-shadow 0.3s var(--ease-slow);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(55,48,163,0.2), 0 8px 20px rgba(55,48,163,0.2); }
.btn:active { transform: scale(0.98); box-shadow: 0 1px 2px rgba(55,48,163,0.15); }

/* Form success state */
.btn .btn-check { display: none; }
.btn.success .btn-text { display: none; }
.btn.success .btn-check { display: inline; }

.micro { font-size: 0.72rem; color: var(--muted); margin-top: 10px; }

/* =============================================
   CATEGORY TABS — scroll-driven
   ============================================= */
.categories { padding: 100px 0 0; height: 300vh; position: relative; }

.categories__sticky {
  position: sticky; top: 60px;
  padding-bottom: 40px;
}
.categories__sticky .win {
  --win-h: calc(100vh - 260px);
  height: var(--win-h);
  width: calc(var(--win-h) * 16 / 10);
  max-width: 90vw;
  margin-inline: auto;
}

.categories__heading {
  font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 400; margin-bottom: 24px; text-rendering: optimizeLegibility;
  text-align: center;
}

.tabs { display: flex; gap: 24px; margin-bottom: 32px; border-bottom: 1px solid var(--border); padding-bottom: 16px; justify-content: center; }

.tab {
  background: none; border: none; font-family: var(--sans);
  font-size: 1rem; font-weight: 500; color: var(--muted);
  cursor: pointer; padding: 0; transition: color 0.3s; position: relative;
}
.tab:hover { color: var(--text); }
.tab--active { color: var(--text); font-weight: 600; }
.tab--active::after { content: ''; position: absolute; bottom: -17px; left: 0; right: 0; height: 2px; background: var(--accent-text); border-radius: 1px; }

/* Screen content switching */
.win__body { position: relative; }
.win__screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.4s var(--ease-slow);
  pointer-events: none;
}
.win__screen--active { opacity: 1; pointer-events: auto; }

/* macOS window */
.win {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04), 0 16px 40px rgba(0,0,0,0.06);
  transition: transform 0.6s var(--ease-slow), box-shadow 0.6s var(--ease-slow);
  position: relative;
  display: flex; flex-direction: column;
}
.win::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent); pointer-events: none; z-index: 1; }
.win:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 8px 20px rgba(0,0,0,0.06), 0 24px 56px rgba(0,0,0,0.08); }

.win__bar { display: flex; gap: 6px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }

.dot { width: 10px; height: 10px; border-radius: 50%; position: relative; }
.dot::after { content: ''; position: absolute; top: 1.5px; left: 2.5px; width: 4px; height: 3px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.dot--r { background: #FF5F57; box-shadow: 0 0 4px rgba(255,95,87,0.3); }
.dot--y { background: #FEBC2E; box-shadow: 0 0 4px rgba(254,188,46,0.3); }
.dot--g { background: #28C840; box-shadow: 0 0 4px rgba(40,200,64,0.3); }

.win__body { display: flex; align-items: center; justify-content: center; flex: 1; }
.win__body--43 { /* height driven by parent .win */ }
.win__body--169 { aspect-ratio: 16/9; }

.ph { font-size: 0.72rem; font-weight: 500; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.08em; }
.ph--dark { color: var(--muted); opacity: 0.4; }

/* =============================================
   FEATURES — grid
   ============================================= */
.grid-features { padding: 80px 0; }

.grid-features__heading { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 400; margin-bottom: 40px; }

.sgrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* 60/40 zigzag */
.sgrid .scard:nth-child(1) { grid-column: 1 / 4; } /* 60 */
.sgrid .scard:nth-child(2) { grid-column: 4 / 6; } /* 40 */
.sgrid .scard:nth-child(3) { grid-column: 1 / 3; } /* 40 */
.sgrid .scard:nth-child(4) { grid-column: 3 / 6; } /* 60 */
.sgrid .scard:nth-child(5) { grid-column: 1 / 4; } /* 60 */
.sgrid .scard:nth-child(6) { grid-column: 4 / 6; } /* 40 */

.scard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 32px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.03);
  transition: transform 0.5s var(--ease-slow), box-shadow 0.5s var(--ease-slow), border-color 0.4s;
}
.scard:hover {
  border-color: rgba(55,48,163,0.3);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.06);
  transform: translateY(-3px);
}

.scard__tag { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-text); margin-bottom: 14px; }
.scard__title { font-family: var(--serif); font-size: 1.3rem; font-weight: 400; line-height: 1.25; margin-bottom: 10px; }
.scard__desc { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }


/* =============================================
   CTA
   ============================================= */
.cta { background: var(--accent); padding: 80px 0; text-align: center; position: relative; }
.cta::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); pointer-events: none; }

.cta__headline { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 400; color: #fff; margin-bottom: 12px; }
.cta__sub { font-size: 0.9rem; color: rgba(255,255,255,0.55); margin-bottom: 32px; }

.cta .hero-form { justify-content: center; }
.cta .input { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
.cta .input::placeholder { color: rgba(255,255,255,0.35); }
.cta .input:focus { border-color: rgba(255,255,255,0.5); box-shadow: 0 0 0 3px rgba(255,255,255,0.1); }
.cta .btn { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.08); }
.cta .btn:hover { background: rgba(255,255,255,0.88); box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.1); }
.cta .micro { color: rgba(255,255,255,0.35); text-align: center; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 28px 32px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; color: var(--muted);
  max-width: 1080px; margin: 0 auto;
}
.footer a { color: var(--muted); text-decoration: none; transition: color 0.3s; }
.footer a:hover { color: var(--accent-text); }
.footer__links { display: flex; gap: 16px; }

/* =============================================
   REVEAL
   ============================================= */
.reveal {
  opacity: 0; filter: blur(5px); transform: translateY(16px);
  transition: opacity 0.9s var(--ease-slow), filter 0.9s var(--ease-slow), transform 0.9s var(--ease-slow);
}
.reveal.visible { opacity: 1; filter: blur(0); transform: translateY(0); }

/* Stagger secondary cards */
.sgrid .scard.reveal:nth-child(1) { transition-delay: 0s; }
.sgrid .scard.reveal:nth-child(2) { transition-delay: 0.08s; }
.sgrid .scard.reveal:nth-child(3) { transition-delay: 0.16s; }
.sgrid .scard.reveal:nth-child(4) { transition-delay: 0.24s; }
.sgrid .scard.reveal:nth-child(5) { transition-delay: 0.32s; }
.sgrid .scard.reveal:nth-child(6) { transition-delay: 0.40s; }


/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .wrap { padding: 0 20px; }
  .header { padding: 14px 20px; }

  .hero { min-height: 85vh; padding: 0 20px; }
  .hero__headline { font-size: clamp(2.4rem, 10vw, 4rem); }
  .hero__bar { flex-direction: column; align-items: flex-start; gap: 24px; }
  .hero__form-wrap { text-align: left; width: 100%; }
  .hero .hero-form { flex-direction: column; }
  .hero .input { width: 100%; }
  .hero .btn { width: 100%; }
  .hero .micro { text-align: left; }

  .categories { height: 200vh; }
  .tabs { gap: 16px; overflow-x: auto; }
  .categories__sticky .win { width: 100%; height: auto; }
  .win__body--43 { aspect-ratio: 16/10; }

  .sgrid { grid-template-columns: 1fr 1fr; }
  .sgrid .scard { grid-column: auto !important; }

  .cta .hero-form { flex-direction: column; align-items: center; }
  .cta .input { width: 100%; }
  .cta .btn { width: 100%; }
  .footer { flex-direction: column; gap: 8px; text-align: center; }
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; filter: none; transform: none; }
  .hero__headline .word { animation: none; opacity: 1; transform: none; }
}
