@font-face {
  font-family: "Cubic 11";
  src: url("assets/Cubic_11.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #f5f1e6;
  --bg-darker: #e8e4d9;
  --bg-card: #fffef9;
  --text: #2b2b2e;
  --text-muted: #6b6b70;
  --accent: #5490f1;
  --accent-warm: #ff891b;
  --radius: 14px;
  --font-pixel: "Cubic 11", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  --shadow: 0 8px 32px rgba(43, 43, 46, 0.08);
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
  transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
  background: rgba(245, 241, 230, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 1.1rem;
}

.nav-brand img {
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  align-items: center;
}

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

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

.nav-cta {
  background: var(--text) !important;
  color: var(--bg) !important;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 500;
}

.nav-cta:hover {
  opacity: 0.9;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  width: 320px;
  height: 320px;
  background: #a6e49f;
  top: 10%;
  left: -5%;
  animation-delay: 0s;
}

.orb-2 {
  width: 280px;
  height: 280px;
  background: #5490f1;
  top: 40%;
  right: -8%;
  animation-delay: -2s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: #ecd74a;
  bottom: 15%;
  left: 30%;
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 20px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border: 1px solid var(--bg-darker);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.5);
}

.hero-icon {
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(84, 144, 241, 0.25);
  margin-bottom: 1.5rem;
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  line-height: 1.5;
  margin-bottom: 1rem;
  font-weight: normal;
}

.hero-title .line {
  display: block;
}

.hero-title .accent {
  color: var(--accent);
  animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 8px 24px rgba(43, 43, 46, 0.2);
}

.btn-ghost {
  border: 2px solid var(--bg-darker);
  color: var(--text);
  background: transparent;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  animation: bounce 2s ease-in-out infinite;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* Categories marquee */
.categories {
  padding: 2rem 0;
  overflow: hidden;
  border-block: 1px solid var(--bg-darker);
}

.category-pills {
  display: flex;
  gap: 1rem;
  animation: marquee 25s linear infinite;
  width: max-content;
}

.category-pills:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.pill {
  flex-shrink: 0;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  background: var(--c);
  color: var(--text, #fff);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}

/* Sections */
.section {
  padding: 5rem 1.5rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: normal;
  text-align: center;
  margin-bottom: 0.75rem;
}

.section-title em {
  font-style: normal;
  color: var(--accent);
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 3rem;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--bg-darker);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: default;
}

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

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  font-weight: normal;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.feature-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.feature-tags li {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg);
  border-radius: 6px;
  color: var(--text-muted);
}

.feature-card[data-tab="schedule"]:hover { border-color: #5490f1; }
.feature-card[data-tab="target"]:hover { border-color: #a6e49f; }
.feature-card[data-tab="review"]:hover { border-color: #ecd74a; }
.feature-card[data-tab="result"]:hover { border-color: #ff891b; }

/* Phone mock / timeline */
.timeline-demo {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-darker) 50%, var(--bg) 100%);
}

.phone-mock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.phone-frame {
  width: min(320px, 90vw);
  background: #1a1a1c;
  border-radius: 36px;
  padding: 12px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2);
}

.phone-notch {
  width: 100px;
  height: 24px;
  background: #1a1a1c;
  border-radius: 0 0 16px 16px;
  margin: 0 auto 8px;
}

.phone-screen {
  background: var(--bg);
  border-radius: 24px;
  overflow: hidden;
  min-height: 420px;
}

.mock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1rem 0.5rem;
  font-size: 0.85rem;
}

.mock-date {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
}

.mock-mode {
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(84, 144, 241, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.mock-timeline {
  position: relative;
  padding: 0.5rem 1rem 1rem 3rem;
  min-height: 360px;
}

.mock-timeline::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bg-darker);
}

.time-block {
  position: absolute;
  left: 2rem;
  right: 0.5rem;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateX(-12px);
  animation: blockIn 0.5s forwards;
}

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

.time-block.dragging {
  animation: wiggle 0.4s ease-in-out infinite;
  z-index: 2;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}

.timeline-legend {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Achievements carousel */
.achievement-carousel {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.achievement-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: achScroll 30s linear infinite;
}

.achievement-track:hover {
  animation-play-state: paused;
}

@keyframes achScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.achievement-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--bg-darker);
  min-width: 120px;
  transition: transform 0.3s;
}

.achievement-item:hover {
  transform: scale(1.05);
}

.ach-emoji {
  font-size: 2rem;
}

.achievement-item span:last-child {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
}

/* Extras */
.extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.extra-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--bg-darker);
  text-align: center;
}

.extra-card h3 {
  font-family: var(--font-pixel);
  font-size: 1rem;
  font-weight: normal;
  margin: 1rem 0 0.5rem;
}

.extra-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.extra-visual {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-visual {
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.widget-block {
  width: 85%;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8rem;
  text-align: left;
}

.w-current {
  background: #a6e49f;
  animation: widgetPulse 2s ease-in-out infinite;
}

.w-next {
  background: var(--bg-darker);
  color: var(--text-muted);
  font-size: 0.75rem;
}

@keyframes widgetPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.cloud-visual {
  gap: 0.5rem;
}

.cloud-icon {
  font-size: 2.5rem;
  animation: cloudFloat 3s ease-in-out infinite;
}

@keyframes cloudFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.sync-dots {
  display: flex;
  gap: 4px;
}

.sync-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBlink 1.2s ease-in-out infinite;
}

.sync-dots span:nth-child(2) { animation-delay: 0.2s; }
.sync-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBlink {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.watch-face {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #2b2b2e;
  color: #f5f1e6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  gap: 0.25rem;
  box-shadow: inset 0 0 0 4px #47474d;
}

.watch-time {
  font-family: var(--font-pixel);
  font-size: 1rem;
}

.watch-event {
  font-size: 0.55rem;
  color: #a6e49f;
}

/* Quote */
.quote {
  padding: 4rem 1.5rem;
}

.quote blockquote {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent-warm);
  box-shadow: var(--shadow);
}

.quote p {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3vw, 1.2rem);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.quote footer {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Download */
.download {
  text-align: center;
  padding-bottom: 3rem;
}

.download-icon {
  border-radius: 20px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.download h2 {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  font-weight: normal;
  margin-bottom: 0.5rem;
}

.download > .container > p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.download-note {
  font-size: 0.8rem !important;
  margin-top: 1rem !important;
  opacity: 0.7;
}

.footer-links {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--bg-darker);
}

/* Duplicate pills/track for seamless loop */
.category-pills::after {
  content: none;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--bg-darker);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
