/* ============================================================
   Cornice Landing Page
   Apple-inspired, minimal, responsive
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --card-bg: #f5f5f7;
  --card-border: rgba(0, 0, 0, 0.04);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-border: rgba(0, 0, 0, 0.08);
  --notch-bg: #1d1d1f;
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1080px;
  --section-padding: 120px 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #0a0a0a;
    --text: #f5f5f7;
    --text-secondary: #86868b;
    --card-bg: #1d1d1f;
    --card-border: rgba(255, 255, 255, 0.06);
    --nav-bg: rgba(0, 0, 0, 0.72);
    --nav-border: rgba(255, 255, 255, 0.08);
    --notch-bg: #2d2d2f;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.47059;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

img, svg {
  display: block;
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Stagger children in feature grid */
.feature-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.feature-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.feature-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.feature-grid .reveal:nth-child(5) { transition-delay: 0.24s; }
.feature-grid .reveal:nth-child(6) { transition-delay: 0.12s; }
.feature-grid .reveal:nth-child(7) { transition-delay: 0.06s; }
.feature-grid .reveal:nth-child(8) { transition-delay: 0.12s; }
.feature-grid .reveal:nth-child(9) { transition-delay: 0.18s; }
.feature-grid .reveal:nth-child(10) { transition-delay: 0.24s; }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

.nav-scrolled {
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--nav-border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

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

.nav-icon {
  width: 22px;
  height: 22px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.nav-cta {
  background: var(--accent);
  color: #ffffff !important;
  padding: 6px 16px;
  border-radius: 980px;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s !important;
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: #ffffff !important;
  transform: scale(1.02);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 140px 24px 80px;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-bg);
  padding: 6px 14px;
  border-radius: 980px;
  margin-bottom: 32px;
}

.hero-badge svg {
  display: inline-block;
  flex-shrink: 0;
}

.hero-title {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: scale(1.03);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  padding: 14px 28px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 500;
  border: 1px solid var(--accent);
  transition: background 0.2s, transform 0.15s;
}

.btn-secondary:hover {
  background: rgba(0, 113, 227, 0.06);
  transform: scale(1.03);
}

/* --- Notch Demo Visual --- */
.hero-visual {
  margin-top: 64px;
}

.notch-demo {
  display: flex;
  justify-content: center;
}

.notch-screen {
  width: 520px;
  max-width: 100%;
  background: var(--card-bg);
  border-radius: 18px;
  padding: 0 0 40px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.notch-bar {
  display: flex;
  justify-content: center;
  padding-top: 0;
}

.notch-shape {
  background: var(--notch-bg);
  width: 180px;
  height: 28px;
  border-radius: 0 0 14px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notch-content {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notch-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #424245;
}

.notch-label {
  font-size: 10px;
  font-weight: 600;
  color: #424245;
  letter-spacing: 0.04em;
}

.notch-expanded {
  margin: 12px 24px 0;
}

.notch-expanded-inner {
  background: var(--notch-bg);
  border-radius: 16px;
  padding: 16px 20px;
  animation: notchPulse 4s ease-in-out infinite;
}

@keyframes notchPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); }
  50% { box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12); }
}

.notch-player {
  display: flex;
  align-items: center;
  gap: 14px;
}

.notch-album-art {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  flex-shrink: 0;
  animation: albumRotate 8s linear infinite;
}

@keyframes albumRotate {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

.notch-track-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notch-track-name {
  font-size: 13px;
  font-weight: 600;
  color: #f5f5f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notch-track-artist {
  font-size: 11px;
  color: #86868b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notch-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notch-ctrl {
  width: 18px;
  height: 18px;
  color: #86868b;
  cursor: pointer;
  transition: color 0.2s;
}

.notch-ctrl:hover {
  color: #f5f5f7;
}

.notch-ctrl-play {
  width: 22px;
  height: 22px;
  color: #f5f5f7;
}

/* ============================================================
   Features
   ============================================================ */
.features {
  padding: var(--section-padding);
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-title {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 21px;
  color: var(--text-secondary);
  line-height: 1.38;
}

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

.feature-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 36px 32px;
  border: 1px solid var(--card-border);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  .feature-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  }
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  color: var(--accent);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ============================================================
   How It Works
   ============================================================ */
.how-it-works {
  padding: var(--section-padding);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 700px;
  margin: 0 auto;
}

.step {
  display: grid;
  grid-template-columns: 48px 1fr 160px;
  gap: 24px;
  align-items: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--card-border);
}

.step:last-child {
  border-bottom: none;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Step animations */
.step-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-anim {
  width: 120px;
  height: 60px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Step 1: Hover animation */
.mini-notch {
  width: 48px;
  height: 12px;
  background: var(--notch-bg);
  border-radius: 0 0 6px 6px;
  position: absolute;
  top: 0;
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cursor-icon {
  position: absolute;
  bottom: 10px;
  right: 20px;
  color: var(--text);
  animation: cursorHover 3s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes cursorHover {
  0%, 100% {
    transform: translate(0, 0);
  }
  30%, 70% {
    transform: translate(-20px, -20px);
  }
}

.step-anim-hover:hover .mini-notch,
.step-anim-hover .mini-notch {
  animation: notchExpand 3s ease-in-out infinite;
}

@keyframes notchExpand {
  0%, 20% { width: 48px; height: 12px; border-radius: 0 0 6px 6px; }
  35%, 65% { width: 100px; height: 36px; border-radius: 0 0 12px 12px; }
  80%, 100% { width: 48px; height: 12px; border-radius: 0 0 6px 6px; }
}

/* Step 2: Click animation */
.tab-row {
  display: flex;
  gap: 6px;
}

.tab {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--notch-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #86868b;
  transition: background 0.2s, color 0.2s;
}

.tab svg {
  width: 14px;
  height: 14px;
}

.tab-active {
  background: var(--accent);
  color: #ffffff;
  animation: tabSwitch 3s ease-in-out infinite;
}

@keyframes tabSwitch {
  0%, 30% { background: var(--accent); }
  33%, 63% { background: var(--notch-bg); }
  66%, 100% { background: var(--accent); }
}

/* Step 3: Drag animation */
.step-anim-drag {
  gap: 12px;
}

.drag-file {
  color: var(--accent);
  animation: fileDrag 3s ease-in-out infinite;
}

@keyframes fileDrag {
  0%, 20% { transform: translateX(0) translateY(0); opacity: 1; }
  50% { transform: translateX(18px) translateY(-8px); opacity: 0.7; }
  70%, 100% { transform: translateX(18px) translateY(-8px); opacity: 0; }
}

.mini-notch-static {
  width: 40px;
  height: 10px;
  background: var(--notch-bg);
  border-radius: 0 0 5px 5px;
  animation: notchReceive 3s ease-in-out infinite;
}

@keyframes notchReceive {
  0%, 40% { transform: scale(1); }
  55% { transform: scale(1.3); }
  70%, 100% { transform: scale(1); }
}

/* ============================================================
   Tech Section
   ============================================================ */
.tech {
  padding: var(--section-padding);
  background: var(--bg-alt);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.tech-card {
  text-align: center;
  padding: 48px 32px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

.tech-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  color: var(--accent);
}

.tech-icon svg {
  width: 100%;
  height: 100%;
}

.tech-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.tech-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tech-cta {
  text-align: center;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: 980px;
  border: 1px solid var(--card-border);
  background: var(--bg);
  transition: background 0.2s, transform 0.15s;
}

.btn-github:hover {
  color: var(--text);
  background: var(--card-bg);
  transform: scale(1.03);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 48px 24px;
  border-top: 1px solid var(--card-border);
}

.footer-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-heart {
  font-size: 15px;
  color: var(--text);
}

.heart {
  color: #ff2d55;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-sep {
  color: var(--text-secondary);
}

.footer-req {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px 20px;
  }

  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .hero {
    padding: 110px 20px 60px;
  }

  .hero-title {
    font-size: 48px;
  }

  .hero-tagline {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .section-title {
    font-size: 36px;
  }

  .section-subtitle {
    font-size: 17px;
  }

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

  .feature-card {
    padding: 28px 24px;
  }

  .step {
    grid-template-columns: 40px 1fr;
    gap: 16px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  .step-visual {
    display: none;
  }

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

  .notch-screen {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 40px;
  }

  .hero-tagline {
    font-size: 21px;
  }

  .section-title {
    font-size: 28px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 24px;
    font-size: 15px;
  }
}
