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

/* ===== Theme Variables ===== */
:root, [data-theme="sakura"] {
  --t-bg: #fff5f8;
  --t-card: #fff8fa;
  --t-accent: #e8668f;
  --t-accent2: #ff8fab;
  --t-accent3: #ae94e0;
  --t-accent-hover: #c4365e;
  --t-accent-rgb: 232, 102, 143;
  --t-text-primary: #381e29;
  --t-text-secondary: #947585;
  --t-text-light: #8c7f85;
  --t-pill-bg: #fff0f5;
  --t-nav-bg: rgba(255, 245, 248, .85);
  --t-shadow-lg: 0 4px 24px rgba(232, 102, 143, .15);
  --bg-white: #ffffff;
}

[data-theme="lavender"] {
  --t-bg: #f2edff;
  --t-card: #f8f5ff;
  --t-accent: #9470db;
  --t-accent2: #bf8ce0;
  --t-accent3: #7b68c4;
  --t-accent-hover: #7a52c7;
  --t-accent-rgb: 148, 112, 219;
  --t-text-primary: #281a40;
  --t-text-secondary: #7a6b99;
  --t-text-light: #857a96;
  --t-pill-bg: #ece6ff;
  --t-nav-bg: rgba(242, 237, 255, .85);
  --t-shadow-lg: 0 4px 24px rgba(148, 112, 219, .15);
  --bg-white: #ffffff;
}

[data-theme="mint"] {
  --t-bg: #f0fdf4;
  --t-card: #f5fef8;
  --t-accent: #4dbd9e;
  --t-accent2: #73b8cc;
  --t-accent3: #38a87c;
  --t-accent-hover: #2e9a73;
  --t-accent-rgb: 77, 189, 158;
  --t-text-primary: #1a3228;
  --t-text-secondary: #6b8e7a;
  --t-text-light: #7a9687;
  --t-pill-bg: #e6faf0;
  --t-nav-bg: rgba(240, 253, 244, .85);
  --t-shadow-lg: 0 4px 24px rgba(77, 189, 158, .15);
  --bg-white: #ffffff;
}

[data-theme="peach"] {
  --t-bg: #fff8f0;
  --t-card: #fffaf5;
  --t-accent: #f28c61;
  --t-accent2: #e6a67a;
  --t-accent3: #e07040;
  --t-accent-hover: #d4703a;
  --t-accent-rgb: 242, 140, 97;
  --t-text-primary: #3d2416;
  --t-text-secondary: #8e7262;
  --t-text-light: #967d70;
  --t-pill-bg: #fff0e6;
  --t-nav-bg: rgba(255, 248, 240, .85);
  --t-shadow-lg: 0 4px 24px rgba(242, 140, 97, .15);
  --bg-white: #ffffff;
}

[data-theme="midnight"] {
  --t-bg: #1a1a28;
  --t-card: #222236;
  --t-accent: #a685f2;
  --t-accent2: #7aa6e6;
  --t-accent3: #8b6be0;
  --t-accent-hover: #c4a8ff;
  --t-accent-rgb: 166, 133, 242;
  --t-text-primary: #e0dce8;
  --t-text-secondary: #9e99ad;
  --t-text-light: #807a8f;
  --t-pill-bg: #2e2e48;
  --t-nav-bg: rgba(26, 26, 40, .88);
  --t-shadow-lg: 0 4px 24px rgba(166, 133, 242, .2);
  --bg-white: #26263c;
}

:root {
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --max-w: 960px;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--t-text-primary);
  background: var(--t-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}

a { color: var(--t-accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--t-accent-hover); }

img { max-width: 100%; display: block; }

/* ===== Floating Kawaii Faces ===== */
.kawaii-faces {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.kawaii-face {
  position: absolute;
  opacity: 0.06;
  animation: float-face 20s ease-in-out infinite;
}

[data-theme="midnight"] .kawaii-face { opacity: 0.04; }

.kawaii-face:nth-child(1) { width: 80px; top: 8%; left: 5%; animation-delay: 0s; animation-duration: 22s; }
.kawaii-face:nth-child(2) { width: 60px; top: 25%; right: 8%; animation-delay: -4s; animation-duration: 18s; }
.kawaii-face:nth-child(3) { width: 70px; top: 55%; left: 3%; animation-delay: -8s; animation-duration: 25s; }
.kawaii-face:nth-child(4) { width: 50px; top: 70%; right: 5%; animation-delay: -12s; animation-duration: 20s; }
.kawaii-face:nth-child(5) { width: 65px; top: 40%; right: 15%; animation-delay: -6s; animation-duration: 23s; }
.kawaii-face:nth-child(6) { width: 55px; top: 85%; left: 12%; animation-delay: -10s; animation-duration: 19s; }
.kawaii-face:nth-child(7) { width: 45px; top: 15%; left: 80%; animation-delay: -3s; animation-duration: 21s; }

@keyframes float-face {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(5deg); }
  50% { transform: translateY(10px) rotate(-3deg); }
  75% { transform: translateY(-8px) rotate(4deg); }
}

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--t-nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(var(--t-accent-rgb), .12);
  height: var(--nav-h);
  transition: background .4s ease, border-color .4s ease;
}

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

.nav-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--t-accent);
  display: flex; align-items: center; gap: 8px;
  transition: color .4s ease;
}

.nav-brand-face { width: 28px; height: 28px; }

.nav-links { display: flex; gap: 28px; list-style: none; }

.nav-links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--t-text-secondary);
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--t-accent); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--t-text-primary); margin: 5px 0;
  transition: .3s;
  border-radius: 2px;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--t-bg);
    border-bottom: 1px solid rgba(var(--t-accent-rgb), .12);
    padding: 16px 24px; gap: 16px;
  }
  .nav-links.open { display: flex; }
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.section { padding: 64px 0; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 72px 0 48px;
  position: relative;
}

.hero-face {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  animation: hero-bounce 3s ease-in-out infinite;
}

@keyframes hero-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--t-accent), var(--t-accent2), var(--t-accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--t-text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ===== Theme Switcher ===== */
.theme-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.theme-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.5);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}

.theme-dot:hover { transform: scale(1.25); }

.theme-dot.active {
  transform: scale(1.25);
  box-shadow: 0 0 0 3px rgba(var(--t-accent-rgb), .3), 0 1px 4px rgba(0,0,0,.12);
}

.theme-dot[data-theme="sakura"]   { background: #e8668f; }
.theme-dot[data-theme="lavender"] { background: #9470db; }
.theme-dot[data-theme="mint"]     { background: #4dbd9e; }
.theme-dot[data-theme="peach"]    { background: #f28c61; }
.theme-dot[data-theme="midnight"] { background: #a685f2; }

[data-theme="midnight"] .theme-dot {
  border-color: rgba(255,255,255,.15);
}

/* ===== App Cards ===== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  padding-bottom: 32px;
}

.app-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid rgba(var(--t-accent-rgb), .1);
  padding: 32px;
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease, background .4s ease, border-color .4s ease;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--t-accent), var(--t-accent3));
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--t-shadow-lg);
}

/* Card corner face */
.card-face {
  position: absolute;
  width: 36px;
  height: 36px;
  opacity: 0.12;
  transition: opacity .3s;
}

.card-face.top-right { top: 16px; right: 16px; }
.card-face.bottom-left { bottom: 16px; left: 16px; }

.app-card:hover .card-face { opacity: 0.22; }

.app-icon {
  width: 120px;
  height: 120px;
  border-radius: 26px;
  margin: 0 auto 20px;
  box-shadow: var(--shadow);
}

.app-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--t-text-primary);
}

.app-card p {
  font-size: .92rem;
  color: var(--t-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Feature pills */
.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}

.pill {
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--t-pill-bg);
  color: var(--t-accent);
  transition: background .4s ease, color .4s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 600;
  transition: all .3s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--t-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--t-accent-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--t-accent);
  border: 1.5px solid rgba(var(--t-accent-rgb), .25);
}
.btn-outline:hover {
  background: var(--t-pill-bg);
  color: var(--t-accent-hover);
}

/* ===== Page Content ===== */
.page-header {
  text-align: center;
  padding: 56px 0 24px;
}

.page-header-face {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.7;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--t-accent);
  margin-bottom: 8px;
  transition: color .4s ease;
}

.page-header p {
  color: var(--t-text-secondary);
}

.content-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid rgba(var(--t-accent-rgb), .1);
  padding: 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  transition: background .4s ease, border-color .4s ease;
}

.content-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--t-text-primary);
  margin: 28px 0 12px;
}

.content-card h2:first-child { margin-top: 0; }

.content-card p, .content-card li {
  font-size: .93rem;
  color: var(--t-text-secondary);
  line-height: 1.7;
}

.content-card ul {
  padding-left: 20px;
  margin: 8px 0;
}

.content-card li { margin-bottom: 6px; }

/* ===== Contact Form ===== */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--t-text-primary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(var(--t-accent-rgb), .2);
  border-radius: var(--radius-sm);
  font-size: .93rem;
  font-family: inherit;
  color: var(--t-text-primary);
  background: var(--bg-white);
  transition: border-color .2s, background .4s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--t-accent);
  box-shadow: 0 0 0 3px rgba(var(--t-accent-rgb), .1);
}

.form-group textarea { resize: vertical; min-height: 120px; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid rgba(var(--t-accent-rgb), .1);
  padding: 32px 0;
  text-align: center;
  font-size: .85rem;
  color: var(--t-text-light);
  position: relative;
  z-index: 1;
  transition: border-color .4s ease;
}

.footer-face {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--t-text-light);
  font-size: .85rem;
}
.footer-links a:hover { color: var(--t-accent); }

/* ===== Utilities ===== */
.last-updated {
  font-size: .82rem;
  color: var(--t-text-light);
  text-align: center;
  margin-top: 8px;
}
