* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #000000;
  --navy: #070a2e;
  --purple: #2b1f7a;
  --white: #ffffff;
  --muted: #c9cbe0;
  --green: #1f883d;
  --green-hover: #238f42;
  --script: "Lucida Calligraphy", "Playball", cursive;
  --sans: "Inter", "Segoe UI", sans-serif;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--sans);
  overflow-x: hidden;
}

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

/* ---------- Splash (image 1 style) ---------- */
.splash {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 1s ease, visibility 1s ease;
}

.splash.hide {
  opacity: 0;
  visibility: hidden;
}

.splash {
  cursor: pointer;
}

/* "WELCOME TO" and WRITY share one spot: the first leaves, then WRITY is written */
.splash-title {
  display: grid;
  place-items: center;
  font-family: var(--script);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 2px;
}

.splash-title > * {
  grid-area: 1 / 1;
}

/* Sweeps in from left to right, holds, then fades away */
.welcome-to {
  font-size: clamp(2.2rem, 8vw, 4.8rem);
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  -webkit-mask-size: 250% 100%;
  mask-size: 250% 100%;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation:
    sweepIn 1.2s ease-out 0.2s forwards,
    fadeAway 0.6s ease-in 1.7s forwards;
}

@keyframes sweepIn {
  to {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

@keyframes fadeAway {
  to {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(-10px);
  }
}

/* WRITY, written by the pen (timing in script.js) */
.writy-wrap {
  position: relative;
  width: min(88vw, 640px);
}

.writy-word {
  display: block;
  width: 100%;
  overflow: visible;
  clip-path: inset(0 100% 0 0);
}

.writy-word text {
  font-family: var(--script);
  font-style: italic;
  font-size: 150px;
  letter-spacing: 4px;
  fill: var(--white);
  fill-opacity: 0;
  stroke: var(--white);
  stroke-width: 1.6;
}

.writy-pen {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(34px, 7vw, 56px);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.pen-body {
  fill: #e8e8ea;
}

.pen-band {
  fill: #8ab4f8;
}

.pen-nib {
  fill: #c9a24a;
}

/* Animations turned off on the device: just show WRITY */
@media (prefers-reduced-motion: reduce) {
  .welcome-to {
    display: none;
  }

  .writy-word {
    clip-path: none;
  }

  .writy-word text {
    fill-opacity: 1;
    stroke: none;
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  z-index: 10;
}

.logo {
  font-family: var(--script);
  font-style: italic;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.2s;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-text {
  font-size: 0.95rem;
}

.btn-outline {
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Hero (image 2 style) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 80px;
  background: linear-gradient(180deg, #000000 0%, var(--navy) 55%, #120f45 100%);
  overflow: hidden;
}

.glow {
  position: absolute;
  bottom: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 450px;
  background: radial-gradient(ellipse at center, rgba(110, 80, 255, 0.55), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff8, transparent),
    radial-gradient(1px 1px at 70% 20%, #fff6, transparent),
    radial-gradient(1px 1px at 40% 80%, #fff5, transparent),
    radial-gradient(1px 1px at 85% 65%, #fff7, transparent),
    radial-gradient(1px 1px at 10% 70%, #fff4, transparent),
    radial-gradient(1px 1px at 55% 50%, #fff5, transparent),
    radial-gradient(1px 1px at 30% 15%, #fff6, transparent),
    radial-gradient(1px 1px at 90% 85%, #fff4, transparent);
  pointer-events: none;
}

.welcome {
  position: relative;
  font-family: var(--script);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.headline {
  position: relative;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 28px;
}

.subtext {
  position: relative;
  max-width: 640px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 40px;
}

.cta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* "Already have an account? Log in" under the sign-up box */
.login-line {
  position: relative;
  margin-top: 22px;
  font-size: 0.98rem;
  color: var(--muted);
}

.login-line a {
  color: var(--white);
  font-weight: 600;
  margin-left: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding-bottom: 1px;
  transition: border-color 0.2s, color 0.2s;
}

.login-line a:hover {
  color: #7ee2a0;
  border-color: #7ee2a0;
}

/* Privacy · Terms, at the bottom of the home page */
.legal-line {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.legal-line a {
  color: var(--muted);
  margin: 0 6px;
}

.legal-line a:hover {
  color: var(--white);
  text-decoration: underline;
}

.email-form {
  display: flex;
  background: linear-gradient(90deg, #f3f3f7, #dcdce6);
  border-radius: 8px;
  padding: 5px;
}

.email-form input {
  border: none;
  outline: none;
  background: transparent;
  padding: 0 20px;
  font-size: 1rem;
  font-family: var(--sans);
  width: 300px;
  color: #222;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 16px 26px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--green-hover);
}

.btn-secondary {
  display: flex;
  align-items: center;
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(10, 12, 50, 0.6);
  font-weight: 600;
  min-height: 62px;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- "Start writing now" pop-up ---------- */
.start-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.start-modal[hidden] {
  display: none;
}

.start-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 36px 28px 28px;
  text-align: center;
  background: linear-gradient(180deg, #0d1040, #070a2e);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 80px rgba(110, 80, 255, 0.15);
  animation: fadeUp 0.25s ease;
}

.start-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.start-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.start-logo {
  font-family: var(--script);
  font-style: italic;
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.start-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.start-sub {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.start-btn {
  display: flex;
  justify-content: center;
  width: 100%;
  text-align: center;
}

.start-btn + .start-btn {
  margin-top: 12px;
}

.btn-secondary.start-btn {
  min-height: 54px;
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .nav {
    padding: 16px 20px;
  }

  .nav-links {
    display: none;
  }

  .email-form {
    flex-direction: column;
    width: 100%;
    gap: 6px;
  }

  .email-form input {
    width: 100%;
    padding: 14px 16px;
  }

  .cta {
    width: 100%;
    max-width: 420px;
  }

  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}
