/* ====== ichigo.js — Landing page styles ======
   いちごミルクの絵本トーン。data-theme でテーマ切替。 */

:root {
  --font-display: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif;
  --font-body: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
  --maxw: 1160px;
}

/* ---- Theme: Strawberry Milk (default) ---- */
html[data-theme='milk'] {
  --bg: #fff8f3;
  --bg-alt: #fff0e9;
  --card: #ffffff;
  --ink: #4d2c31;
  --ink-soft: #927076;
  --primary: #ed5a77;
  --primary-deep: #d83a5d;
  --primary-soft: #ffe3ec;
  --leaf: #57b894;
  --hero-top: #ffe1ec;
  --hero-mid: #fff0ea;
  --hero-bot: #fff8f3;
  --hill-back: #ffe8d9;
  --hill-front: #ffd9c6;
  --badge-bg: rgba(255, 255, 255, 0.7);
  --shadow: rgba(150, 70, 85, 0.13);
  --shadow-soft: rgba(150, 70, 85, 0.08);
  --code-bg: #3a2329;
  --code-panel: #2c191e;
  --code-text: #ffe9ef;
  --code-muted: #c79aa6;
  --tint-1: linear-gradient(160deg, #ffe3ec, #ffcdda);
  --tint-2: linear-gradient(160deg, #ffeede, #ffdcc0);
  --tint-3: linear-gradient(160deg, #e3f6ec, #cbeede);
}

/* ---- Theme: Blueberry Sky ---- */
html[data-theme='sky'] {
  --bg: #f6faff;
  --bg-alt: #ecf3ff;
  --card: #ffffff;
  --ink: #2f3656;
  --ink-soft: #76809e;
  --primary: #6b8bf5;
  --primary-deep: #4f6fe0;
  --primary-soft: #e1e9ff;
  --leaf: #56b8b0;
  --hero-top: #dceaff;
  --hero-mid: #ecf2ff;
  --hero-bot: #f6faff;
  --hill-back: #e0ecff;
  --hill-front: #cfe0ff;
  --badge-bg: rgba(255, 255, 255, 0.7);
  --shadow: rgba(70, 95, 160, 0.14);
  --shadow-soft: rgba(70, 95, 160, 0.08);
  --code-bg: #232a40;
  --code-panel: #1a2034;
  --code-text: #e9efff;
  --code-muted: #9aa6c7;
  --tint-1: linear-gradient(160deg, #e1e9ff, #cdd8ff);
  --tint-2: linear-gradient(160deg, #ddeffb, #c4e4f5);
  --tint-3: linear-gradient(160deg, #e3f6ef, #cbeede);
}

/* ---- Theme: Matcha Cream ---- */
html[data-theme='matcha'] {
  --bg: #fbfaf2;
  --bg-alt: #f4f2e3;
  --card: #ffffff;
  --ink: #3e3f2c;
  --ink-soft: #847e63;
  --primary: #82a94d;
  --primary-deep: #6a9038;
  --primary-soft: #eaf2d6;
  --leaf: #5fae7a;
  --hero-top: #eef3da;
  --hero-mid: #f6f6e6;
  --hero-bot: #fbfaf2;
  --hill-back: #e8eecb;
  --hill-front: #dbe6b6;
  --badge-bg: rgba(255, 255, 255, 0.7);
  --shadow: rgba(110, 120, 60, 0.14);
  --shadow-soft: rgba(110, 120, 60, 0.08);
  --code-bg: #2f3322;
  --code-panel: #24281a;
  --code-text: #eef2df;
  --code-muted: #aab290;
  --tint-1: linear-gradient(160deg, #eaf2d6, #d7e7b3);
  --tint-2: linear-gradient(160deg, #fdeccf, #f8dca9);
  --tint-3: linear-gradient(160deg, #e0f3e6, #c8e9d3);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 48px);
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}
.nav.scrolled {
  background: rgba(255, 250, 246, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px var(--shadow-soft);
  padding-top: 12px;
  padding-bottom: 12px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}
.nav-mark { font-size: 26px; line-height: 1; }
.nav-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.nav-dot, .nav-name .nav-dot { color: var(--primary); }
.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 8px;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  opacity: 0.82;
  transition: opacity 0.2s, color 0.2s;
}
.nav-links a:hover { opacity: 1; color: var(--primary-deep); }

/* ===== Buttons ===== */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  padding: 13px 28px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s, background 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px -8px var(--primary);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 30px -10px var(--primary);
  background: var(--primary-deep);
}
.btn-primary:active { transform: translateY(-1px) scale(0.99); }
.btn-secondary {
  background: var(--card);
  color: var(--primary-deep);
  border: 2px solid var(--primary-soft);
  box-shadow: 0 8px 18px -10px var(--shadow);
}
.btn-secondary:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--primary);
}
.btn-ghost {
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  padding: 9px 18px;
  box-shadow: 0 6px 16px -10px var(--shadow);
  border: 1.5px solid var(--primary-soft);
}
.btn-ghost:hover { transform: translateY(-2px); color: var(--primary-deep); border-color: var(--primary); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 130px 20px 90px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--hero-top) 0%, var(--hero-mid) 48%, var(--hero-bot) 100%);
}

#animation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 180px;
  z-index: 1;
  pointer-events: none;
}
.hero-hills svg { width: 100%; height: 100%; display: block; }
.hill-back { fill: var(--hill-back); opacity: 0.75; }
.hill-front { fill: var(--hill-front); }

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 920px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--primary-deep);
  background: var(--badge-bg);
  border: 1.5px solid #fff;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
  box-shadow: 0 8px 20px -12px var(--shadow);
  backdrop-filter: blur(6px);
}

.logo {
  font-size: 84px;
  line-height: 1;
  display: inline-block;
  animation: float 3.2s ease-in-out infinite;
  filter: drop-shadow(0 12px 16px rgba(216, 58, 93, 0.22));
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 86px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 12px 0 14px;
  color: var(--ink);
}
.logo-dot { color: var(--primary); }

.tagline {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.tagline-sub {
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 44px;
  text-transform: none;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 42px;
  text-align: left;
}
.feature {
  background: rgba(255, 255, 255, 0.66);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  padding: 20px 18px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px -18px var(--shadow);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s;
}
.feature:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 34px -18px var(--shadow);
}
.feature-icon { font-size: 30px; margin-bottom: 10px; }
.feature-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink);
}
.feature-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Sections ===== */
.section { padding: clamp(64px, 9vw, 110px) 20px; }
.section-alt { background: var(--bg-alt); }
.container { max-width: var(--maxw); margin: 0 auto; }

.eyebrow {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.eyebrow-light { color: #ffb3c4; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 44px);
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  color: var(--ink);
  text-wrap: balance;
}
.section-subtitle {
  text-align: center;
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 56px;
  text-wrap: pretty;
}

/* ===== Example cards ===== */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 26px;
}
.example-card {
  background: var(--card);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 40px -24px var(--shadow);
  border: 1.5px solid #fff;
  transition: transform 0.28s cubic-bezier(.34,1.4,.64,1), box-shadow 0.28s;
}
.example-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 54px -26px var(--shadow);
}
.example-preview {
  height: 184px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 76px;
  position: relative;
  overflow: hidden;
}
.example-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.5) 1.4px, transparent 1.6px);
  background-size: 18px 18px;
  opacity: 0.5;
}
.example-preview span {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 10px rgba(120,60,70,0.18));
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
}
.example-card:hover .example-preview span { transform: scale(1.12) rotate(-4deg); }
.tint-berry { background: var(--tint-1); }
.tint-peach { background: var(--tint-2); }
.tint-mint  { background: var(--tint-3); }

.example-info { padding: 26px 26px 28px; }
.example-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}
.example-description { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 18px; }
.example-features { list-style: none; margin-bottom: 22px; }
.example-features li {
  font-size: 14px;
  color: var(--ink);
  padding: 4px 0 4px 26px;
  position: relative;
  opacity: 0.85;
}
.example-features li::before {
  content: '🍓';
  position: absolute;
  left: 0;
  top: 4px;
  font-size: 12px;
}
.example-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  text-decoration: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.example-link:hover {
  background: var(--primary);
  color: #fff;
  transform: translateX(4px);
}

/* ===== Code section ===== */
.code-section {
  background: var(--code-bg);
  color: var(--code-text);
  padding: clamp(64px, 9vw, 110px) 20px;
  position: relative;
}
.code-container { max-width: 900px; margin: 0 auto; }
.code-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
}
.code-subtitle {
  text-align: center;
  font-size: 17px;
  color: var(--code-muted);
  margin-bottom: 44px;
}
.code-window {
  border-radius: 18px;
  overflow: hidden;
  background: var(--code-panel);
  box-shadow: 0 30px 60px -28px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.06);
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-r { background: #ff8497; }
.dot-y { background: #ffd27d; }
.dot-g { background: #8fd6a6; }
.code-filename {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--code-muted);
}
pre {
  margin: 0;
  padding: 26px 28px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.75;
}
code { font-family: var(--font-mono); }
pre code { color: var(--code-text); }

/* ===== Installation ===== */
.install-wrap { max-width: 620px; margin: 0 auto; }
.install-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1.5px solid var(--primary-soft);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 16px 36px -24px var(--shadow);
}
.install-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.install-box code {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
}

/* ===== Core features ===== */
.core-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}
.core-card {
  background: var(--card);
  border-radius: 24px;
  padding: 32px 30px;
  box-shadow: 0 18px 40px -26px var(--shadow);
  border: 1.5px solid #fff;
  transition: transform 0.25s, box-shadow 0.25s;
}
.core-card:hover { transform: translateY(-6px); box-shadow: 0 28px 50px -28px var(--shadow); }
.core-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 18px;
}
.icon-berry { background: var(--tint-1); }
.icon-peach { background: var(--tint-2); }
.icon-mint  { background: var(--tint-3); }
.core-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--ink);
}
.core-desc { font-size: 15px; color: var(--ink-soft); margin-bottom: 18px; }
.core-list { list-style: none; }
.core-list li {
  font-size: 14.5px;
  color: var(--ink);
  padding: 5px 0 5px 26px;
  position: relative;
  opacity: 0.88;
}
.core-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--leaf);
  font-weight: 800;
}

/* ===== Footer ===== */
.footer {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 54px 20px 40px;
  text-align: center;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
}
.footer-brand .nav-name { color: #fff; }
.footer-links {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--code-text);
  text-decoration: none;
  opacity: 0.8;
  font-weight: 500;
  transition: opacity 0.2s, color 0.2s;
}
.footer-links a:hover { opacity: 1; color: #ffb3c4; }
.footer-credit { font-size: 14px; color: var(--code-muted); }
.footer-credit a { color: #ffb3c4; text-decoration: none; }
.footer-credit .heart { color: var(--primary); }
.footer-credit .muted { opacity: 0.6; margin-top: 8px; font-size: 13px; }

/* ===== Analog clock ===== */
.analog-clock {
  position: absolute;
  top: 92px;
  right: clamp(20px, 4vw, 44px);
  width: 92px;
  height: 92px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px -10px var(--shadow);
  z-index: 6;
}
.clock-face { position: relative; width: 100%; height: 100%; border-radius: 50%; }
.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}
.clock-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  background: var(--ink);
  border-radius: 2px;
}
.hour-hand { width: 3px; height: 24px; margin-left: -1.5px; z-index: 3; }
.minute-hand { width: 2.5px; height: 34px; margin-left: -1.25px; z-index: 2; }
.second-hand { width: 1.5px; height: 38px; margin-left: -0.75px; background: var(--primary); z-index: 1; }
.clock-number {
  position: absolute;
  width: 100%;
  height: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  font-family: var(--font-display);
}
.clock-number span { display: inline-block; position: absolute; text-align: center; }

/* ===== Responsive ===== */
.br-sp { display: none; }

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 768px) {
  .hero { padding-top: 110px; }
  .analog-clock { width: 72px; height: 72px; top: 80px; }
  .hour-hand { height: 18px; }
  .minute-hand { height: 26px; }
  .second-hand { height: 30px; }
  .examples-grid { grid-template-columns: 1fr; }
  .br-sp { display: inline; }
}
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
  html { scroll-behavior: auto; }
}
