/* CSS Variables and Themes */
:root {
  --bg: #ffffff;
  --fg: #0b1221;
  --muted: #5b6275;
  --primary: #5b8cff;
  --primary-ink: #ffffff;
  --surface: #f5f7fb;
  --border: #e6e9f2;
  --shadow: 0 10px 20px rgba(0,0,0,0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1221;
    --fg: #f1f3f9;
    --muted: #b1b6c6;
    --primary: #7aa2ff;
    --primary-ink: #0b1221;
    --surface: #10182e;
    --border: #1e2745;
    --shadow: 0 10px 20px rgba(0,0,0,0.4);
  }
}

html[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0b1221;
  --muted: #5b6275;
  --primary: #5b8cff;
  --primary-ink: #ffffff;
  --surface: #f5f7fb;
  --border: #e6e9f2;
}
html[data-theme="dark"] {
  --bg: #0b1221;
  --fg: #f1f3f9;
  --muted: #b1b6c6;
  --primary: #7aa2ff;
  --primary-ink: #0b1221;
  --surface: #10182e;
  --border: #1e2745;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans JP", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}
.narrow { width: min(760px, 92%); }

.skip-link {
  position: absolute; left: 0; top: -40px; padding: 8px 12px; background: var(--primary); color: var(--primary-ink); border-radius: 6px; transition: top .2s;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(180%) blur(6px);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-name { letter-spacing: .4px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; border-radius: 8px; }
.nav-toggle:focus-visible { outline: 2px solid var(--primary); }
.nav-toggle .bar { display:block; width: 22px; height: 2px; background: var(--fg); margin: 4px 0; border-radius: 2px; }

.nav-list { list-style: none; display: flex; gap: 16px; padding: 0; margin: 0; align-items: center; }
.nav-list a { opacity: .9; }
.nav-list a:hover { opacity: 1; }
.theme-toggle { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.theme-toggle:hover { filter: brightness(1.05); }

@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .nav-list { position: absolute; right: 0; top: 100%; background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 12px; padding: 8px; flex-direction: column; align-items: stretch; min-width: 200px; display: none; margin: 8px; }
  .nav-list.open { display: flex; }
  .nav-list li a, .nav-list li button { padding: 10px 12px; border-radius: 8px; }
}

/* Hero */
.hero { position: relative; overflow: clip; }
.hero-inner { padding: clamp(40px, 8vw, 120px) 0; text-align: center; }
.hero h1 { font-size: clamp(28px, 4.5vw, 54px); line-height: 1.15; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: clamp(15px, 1.8vw, 18px); margin: 0 auto 22px; max-width: 60ch; }

.gradient-bg {
  position: absolute; inset: -20% -10% auto -10%; height: 60vh; min-height: 360px; z-index: -1;
  background:
    radial-gradient(60% 60% at 10% 10%, color-mix(in oklab, var(--primary) 38%, transparent) 0%, transparent 60%),
    radial-gradient(50% 50% at 90% 10%, color-mix(in oklab, #ff7ab2 38%, transparent) 0%, transparent 60%),
    radial-gradient(40% 40% at 50% 50%, color-mix(in oklab, #22d3ee 38%, transparent) 0%, transparent 60%);
  filter: blur(40px) saturate(140%);
  opacity: .5;
}

/* Buttons */
.btn { display: inline-block; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); font-weight: 600; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: transparent; }
.btn:hover { filter: brightness(1.05); }
.btn + .btn { margin-left: 10px; }

/* Sections */
.section { padding: 56px 0; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(12px, 2vw, 24px); }
.cards .card { grid-column: span 3; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.cards .card h3 { margin: 0 0 8px; }
.cards .card p { margin: 0; color: var(--muted); }

@media (max-width: 1100px) {
  .cards .card { grid-column: span 6; }
}
@media (max-width: 640px) {
  .cards .card { grid-column: span 12; }
}

/* Contact form */
.contact-form { display: grid; gap: 14px; }
.contact-form label { display: grid; gap: 6px; font-weight: 600; }
.contact-form input, .contact-form textarea { background: var(--bg); border: 1px solid var(--border); color: var(--fg); border-radius: 10px; padding: 10px 12px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid color-mix(in oklab, var(--primary) 40%, transparent); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: color-mix(in oklab, var(--bg) 92%, transparent); }
.footer-inner { display:flex; align-items:center; justify-content:space-between; padding: 18px 0; }
.back-to-top { border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; background: var(--surface); }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .gradient-bg { transition: none; animation: none; }
}
