/* ==========================================================
   NekoKey Homepage -- Warm Premium Style
   Inspired by SayLy's quality bar. No shortcuts.
   ========================================================== */

/* --- Design Tokens --- */

:root {
  --bg: #FBF8F1;
  --bg-alt: #F5EFE0;
  --text: #2C2417;
  --text-secondary: #8A8070;
  --text-dim: rgba(44,36,23,0.10);
  --border: rgba(0,0,0,0.05);
  --border-hairline: rgba(0,0,0,0.06);
  --accent: #C5A54E;
  --accent-soft: rgba(197,165,78,0.12);
  --accent-glow: rgba(197,165,78,0.06);
  --white: #FFFFFF;

  --shadow-card: 0 1px 1px rgba(0,0,0,0.02),
                 0 4px 8px rgba(0,0,0,0.03),
                 0 12px 24px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 1px 2px rgba(0,0,0,0.03),
                       0 8px 16px rgba(0,0,0,0.06),
                       0 24px 48px rgba(0,0,0,0.06);
  --shadow-device: 0 1px 2px rgba(0,0,0,0.04),
                   0 4px 8px rgba(0,0,0,0.04),
                   0 12px 24px rgba(0,0,0,0.06),
                   0 24px 48px rgba(0,0,0,0.08);

  --font: -apple-system, BlinkMacSystemFont, 'Noto Sans JP', 'SF Pro Display', system-ui, sans-serif;

  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px; --s20: 20px; --s24: 24px; --s32: 32px;
  --r12: 12px; --r16: 16px; --r20: 20px;

  --nav-bg: rgba(251,248,241,0.72);
  --nav-blur: saturate(180%) blur(20px);
}

:root[data-lang="zh"] {
  --font: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
}

/* --- Reset --- */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  opacity: 1;
}
body.loading { opacity: 0; }
body.loaded { opacity: 1; transition: opacity 0.6s ease; }

img, picture, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* --- Film Grain Overlay --- */

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

/* --- Reduced Motion --- */

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

/* --- Focus --- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Navigation --- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: var(--nav-blur);
  backdrop-filter: var(--nav-blur);
  border-bottom: 0.5px solid var(--border-hairline);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo img {
  width: 30px; height: 30px;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.nav-logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, #C5A54E, #A08030);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-right { display: flex; gap: 20px; align-items: center; }

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--border);
  border-radius: 6px;
  padding: 2px;
}
.lang-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.lang-btn.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.nav-cta {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  padding: 7px 18px;
  border-radius: 980px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(197,165,78,0.3);
}

/* --- Hero --- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 120px 40px 80px;
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* Breathing glow layers */
@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes breathe2 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.12); }
}

.hero-glow {
  position: absolute;
  top: 20%; left: 50%;
  width: 800px; height: 800px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(197,165,78,0.07) 0%, rgba(232,217,160,0.04) 40%, transparent 70%);
  filter: blur(80px);
  animation: breathe 6s ease-in-out infinite;
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  top: 35%; left: 65%;
  width: 500px; height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(240,224,192,0.06) 0%, rgba(197,165,78,0.03) 40%, transparent 70%);
  filter: blur(80px);
  animation: breathe2 8s ease-in-out infinite;
  pointer-events: none;
}

.hero-glow-3 {
  position: absolute;
  top: 60%; left: 30%;
  width: 400px; height: 400px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(197,165,78,0.04) 0%, transparent 60%);
  filter: blur(60px);
  animation: breathe 10s ease-in-out infinite;
  pointer-events: none;
}

/* Icon + slogan row */
.hero-icon-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.hero-icon {
  width: 96px; height: 96px;
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06),
              0 8px 24px rgba(0,0,0,0.08),
              inset 0 0.5px 0 rgba(255,255,255,0.8);
}
.hero-slogan-text { text-align: left; }
.hero-app-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #2C2417, #C5A54E);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-app-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Title */
.hero-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-align: left;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.hero-sub {
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: left;
  max-width: 460px;
  margin: 0 0 36px;
  position: relative;
  z-index: 1;
}

/* CTA */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  padding: 14px 32px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}
.hero-cta:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.hero-cta:active { transform: scale(0.97); }
.hero-cta svg { width: 16px; height: 16px; fill: currentColor; }

/* Device reflection (under hero) */
.hero-reflection {
  width: 200px; height: 60px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  filter: blur(16px);
  margin: 24px auto 0;
  pointer-events: none;
}

/* ============================================================
   Features
   ============================================================ */

.features {
  padding: 100px 40px;
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  z-index: -1;
}

.features-inner { max-width: 980px; margin: 0 auto; }

.section-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-secondary);
  text-align: center;
  max-width: 440px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--r16);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  border: 0.5px solid var(--border-hairline);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r16);
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(197,165,78,0.2);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 36px; height: 36px;
  color: var(--accent);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.feature-icon svg { width: 100%; height: 100%; }

.feature-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* ============================================================
   Screenshots / iPhone Frames
   ============================================================ */

.screenshots {
  padding: 100px 40px;
  position: relative;
  overflow: hidden;
}

.screenshots-inner { max-width: 980px; margin: 0 auto; }

.phones-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 32px;
  position: relative;
}

/* Ambient glow behind phones */
.phones-glow {
  position: absolute;
  width: 600px; height: 400px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.phone-frame {
  width: 220px;
  background: linear-gradient(145deg, #2A2A2A, #1A1A1A, #2A2A2A);
  border-radius: 40px;
  padding: 10px 8px 8px;
  box-shadow: var(--shadow-device),
              inset 0 0.5px 0 rgba(255,255,255,0.1);
  position: relative;
}
.phone-frame--center {
  width: 240px;
  transform: translateY(-16px);
  box-shadow: var(--shadow-device),
              0 32px 64px rgba(0,0,0,0.1),
              inset 0 0.5px 0 rgba(255,255,255,0.1);
}

/* Dynamic island */
.phone-frame::before {
  content: '';
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 72px; height: 22px;
  background: #000;
  border-radius: 11px;
  z-index: 3;
}

.phone-screen {
  border-radius: 30px;
  overflow: hidden;
  position: relative;
}
.phone-screen img { width: 100%; display: block; }

/* Glass reflection */
.phone-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    32deg,
    transparent 0%,
    transparent 38%,
    rgba(255,255,255,0.06) 40%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.06) 60%,
    transparent 62%,
    transparent 100%
  );
  pointer-events: none;
  border-radius: 30px;
}

/* Reflection under phone */
.phone-reflection {
  width: 160px; height: 40px;
  background: radial-gradient(ellipse, rgba(197,165,78,0.06) 0%, transparent 70%);
  filter: blur(12px);
  margin: 16px auto 0;
  pointer-events: none;
}

.phone-caption {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 16px;
  letter-spacing: 0.3px;
}

/* ============================================================
   Themes
   ============================================================ */

.themes {
  padding: 80px 40px;
  text-align: center;
}

.themes-inner { max-width: 980px; margin: 0 auto; }

.theme-dots {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.theme-dot-wrap { text-align: center; }

.theme-dot {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2.5px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06),
              0 4px 12px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.theme-dot:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08),
              0 8px 24px rgba(0,0,0,0.06);
}
.theme-dot::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  opacity: 0;
}
.theme-dot.ripple::after {
  animation: dot-ripple 0.6s ease-out;
}
@keyframes dot-ripple {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}

.theme-dot--cream { background: linear-gradient(135deg, #D4C478, #E8D9A0); }
.theme-dot--blue { background: linear-gradient(135deg, #4A90D9, #6BA8E8); }
.theme-dot--pink { background: linear-gradient(135deg, #E8688A, #F0A0B0); }
.theme-dot--green { background: linear-gradient(135deg, #5AAF6A, #80C88A); }
.theme-dot--midnight { background: linear-gradient(135deg, #6B5B8D, #8B7AB8); }
.theme-dot--lavender { background: linear-gradient(135deg, #9A86B8, #B49AC7); }
.theme-dot--wisteria { background: linear-gradient(135deg, #7B6EA8, #9B8EC4); }

.theme-name {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
  display: block;
  letter-spacing: 0.2px;
}

/* ============================================================
   Privacy
   ============================================================ */

.privacy {
  padding: 100px 40px;
  text-align: center;
  position: relative;
}

.privacy-glow {
  position: absolute;
  width: 500px; height: 500px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(60px);
  animation: breathe 8s ease-in-out infinite;
  pointer-events: none;
}

.privacy-headline {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.privacy-underline {
  position: relative;
  display: inline;
}
.privacy-underline::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(197,165,78,0.3));
  border-radius: 2px;
}

.privacy-details {
  margin-top: 24px;
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.privacy-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}
.privacy-chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 16px;
  border-radius: 980px;
  letter-spacing: 0.2px;
}

/* ============================================================
   Footer CTA
   ============================================================ */

.footer-cta {
  padding: 48px 40px;
  text-align: center;
  border-top: 0.5px solid var(--border-hairline);
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--text);
  color: var(--bg);
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}
.footer-cta-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.footer-cta-btn:active { transform: scale(0.97); }
.footer-cta-btn svg { width: 16px; height: 16px; fill: currentColor; }

.footer-info {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.footer-info a {
  color: var(--accent);
  transition: opacity 0.2s;
}
.footer-info a:hover { opacity: 0.7; }

/* Cat silhouette */
.footer-cat {
  display: block;
  margin: 20px auto 0;
  color: var(--text);
  opacity: 0.06;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 767px) {
  .nav { padding: 0 20px; }
  .nav-cta { display: none; }
  .hero { padding: 100px 20px 60px; }
  .features, .screenshots { padding: 60px 20px; }
  .themes, .privacy { padding: 60px 20px; }
  .footer-cta { padding: 40px 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .phones-row {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }
  .phone-frame, .phone-frame--center {
    width: 200px;
    transform: none;
  }
  .hero-icon-row {
    justify-content: center;
  }
  .hero-title, .hero-sub { text-align: left; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
