/* Sunny Hill Studio — shared design system for every page.
   Editorial / minimal direction: near-white ground, near-black ink.
   Type: a neutral gothic for display — Inter (Latin) with Noto Sans JP for
   Japanese headings — and system-ui sans for body.
   Monochrome by intent — no color accent; structure comes from type,
   whitespace, hairline rules, and small radii. */

:root {
  --bg: #f7f7f6;
  --surface: #ffffff;
  --surface-alt: #f1f0ed;
  --ink: #080808;            /* strongest — headings, buttons, emphasis */
  --text: #23262c;           /* body */
  --muted: #55555a;
  --line: #e3e2de;           /* hairline borders */
  --accent: #f0663c;         /* sole color accent — reserved for the primary "start free" CTA */

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(39, 44, 72, 0.05);
  --shadow-hover: 0 10px 30px rgba(39, 44, 72, 0.10);

  --maxw: 1000px;
  --maxw-prose: 700px;

  --display: "Inter", "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
  --sans: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

html {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--display);
  color: var(--ink);
  font-feature-settings: "palt" 1; /* tighter Japanese kerning on headings */
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.005em;
}

a {
  color: var(--ink);
}

img {
  max-width: 100%;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

main {
  flex: 1 0 auto;
}

/* ---------- Header (studio) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 247, 246, 0.85);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px 24px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.94rem;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.site-nav .lang-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.site-nav .lang-link:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ---------- Header (app-specific) ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 247, 246, 0.85);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--line);
}

.app-header .header-inner {
  min-height: 62px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

/* monochrome: app classes retained but carry no color */
.app-header.gr,
.app-header.bl,
.app-header.fd { --app-accent: var(--ink); }

/* ---------- Hamburger toggle (mobile nav) ---------- */
/* dropdown is positioned against the sticky header on mobile */
.site-header,
.app-header {
  position: relative;
}

/* visually-hidden checkbox drives the pure-CSS toggle */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* hamburger button — hidden on desktop, shown ≤640px */
.nav-btn {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin: -10px -10px -10px 0; /* keep 44px hit area without enlarging the bar */
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--radius-sm);
}

/* three bars: the span is the middle line, ::before/::after the outer lines */
.nav-btn span,
.nav-btn span::before,
.nav-btn span::after {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-btn span {
  top: 50%;
  transform: translateY(-50%);
}
.nav-btn span::before,
.nav-btn span::after {
  content: "";
  left: 0;
}
.nav-btn span::before { top: -6px; }
.nav-btn span::after { top: 6px; }

/* checked → morph into an X */
.nav-toggle:checked ~ .nav-btn span {
  background: transparent;
}
.nav-toggle:checked ~ .nav-btn span::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-toggle:checked ~ .nav-btn span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* keyboard focus visibility (checkbox is visually hidden) */
.nav-toggle:focus-visible ~ .nav-btn {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border-radius: var(--radius);
  padding: 12px 26px;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s ease,
    background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}

/* ---------- Hero (studio top pages) — type is the hero ---------- */
.hero {
  text-align: center;
  padding: 104px 0 88px;
  border-bottom: 1px solid var(--line);
}

.hero-content > * {
  animation: rise 0.6s ease-out both;
}
.hero-content > *:nth-child(2) { animation-delay: 0.07s; }
.hero-content > *:nth-child(3) { animation-delay: 0.14s; }
.hero-content > *:nth-child(4) { animation-delay: 0.21s; }

.hero h1 {
  font-size: clamp(2rem, 5.4vw, 3.1rem);
  line-height: 1.42;
  margin: 0 0 20px;
}

.hero p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ---------- Eyebrow / section headers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 18px;
}

.section {
  padding: 66px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: clamp(1.55rem, 3.4vw, 1.95rem);
  text-align: center;
  margin: 0 0 28px;
}

/* inside a head group the sub sits close to the title — keep it tight */
.section-head .section-title {
  margin-bottom: 0;
}

.section-sub {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- App list (top pages) ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s var(--ease), box-shadow 0.18s ease, border-color 0.18s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #d3d2cd;
}

.app-card .app-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.app-card h3 {
  margin: 0;
  font-size: 1.28rem;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.app-card .more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  transition: gap 0.15s ease;
}

.app-card:hover .more {
  gap: 12px;
}

/* ---------- App icon tiles ---------- */
.app-icon {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  background: var(--surface-alt);
}

.app-icon.lg {
  width: 88px;
  height: 88px;
  border-radius: 20px;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon.sm {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

/* ---------- Badges ---------- */
.badge-soon {
  display: inline-block;
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

/* ---------- "Why safe" feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s ease;
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.feature .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  font-size: 1.3rem;
  margin-bottom: 16px;
}

/* ---------- Support list on top pages ---------- */
.support-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.support-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.support-list strong {
  display: block;
  margin-bottom: 10px;
  font-family: var(--display);
  color: var(--ink);
}

.support-list a {
  font-size: 0.9rem;
  margin-right: 14px;
  white-space: nowrap;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.support-list a:hover {
  text-decoration-color: var(--ink);
}

/* ---------- App detail page ---------- */
.app-hero {
  text-align: center;
  padding: 76px 0 30px;
}

.app-hero .app-icon {
  margin: 0 auto 20px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 10px 26px rgba(39, 44, 72, 0.12);
  animation: rise 0.55s ease-out both;
}

.app-hero .app-banner {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto 24px;
  animation: rise 0.55s ease-out both;
}

.app-hero h1 {
  font-size: clamp(1.5rem, 3.8vw, 2rem);
  margin: 0 0 12px;
}

.app-hero .tagline {
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* "Start for free" — highlighter marker over the store badges.
   The one place the monochrome palette breaks, by intent. */
.free-start {
  display: inline-block;
  margin: 22px 0 0;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: 0.02em;
  padding: 0 6px;
  background: linear-gradient(transparent 70%, rgba(68, 175, 175, 0.6) 30%);
}

.free-start + .stores {
  margin-top: 14px;
}

.stores {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 26px 0 8px;
}

.stores img {
  height: 48px;
  width: auto;
}

.store-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.feature-lines {
  max-width: var(--maxw-prose);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.feature-lines li {
  padding: 15px 0 15px 30px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.feature-lines li::before { /* editorial dash marker */
  content: "";
  position: absolute;
  left: 0;
  top: 28px;
  width: 16px;
  height: 1px;
  background: var(--ink);
}

.related-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.related-links a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 20px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.related-links a:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-2px);
}

/* ---------- Prose (legal / support / about) ---------- */
.prose {
  max-width: var(--maxw-prose);
  margin: 0 auto;
  padding: 60px 22px 8px;
}

.prose h1 {
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  margin: 0 0 10px;
}

.prose .lead {
  color: var(--muted);
  margin-bottom: 30px;
}

.prose h2 {
  font-size: 1.3rem;
  margin: 40px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.prose p {
  margin: 0 0 14px;
  white-space: pre-line; /* preserve line breaks from source legal text */
}

.prose ul {
  color: var(--text);
  padding-left: 1.2em;
}

.prose a {
  text-underline-offset: 3px;
}

.prose .updated {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 30px;
}

.prose .back {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.9rem;
}

/* ---------- FAQ accordion ---------- */
.faq {
  max-width: var(--maxw-prose);
  margin: 0 auto;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.faq details[open] {
  box-shadow: var(--shadow);
}

.faq summary {
  cursor: pointer;
  padding: 16px 18px;
  font-family: var(--display);
  color: var(--ink);
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "＋";
  color: var(--ink);
  font-weight: 700;
  flex-shrink: 0;
}

.faq details[open] summary::before {
  content: "－";
}

.faq .answer {
  padding: 0 18px 16px 40px;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact-box {
  max-width: var(--maxw-prose);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
}

.contact-box .btn {
  margin: 6px 0 10px;
}

.contact-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ---------- 404 ---------- */
.notfound {
  text-align: center;
  padding: 120px 20px;
}

.notfound h1 {
  font-size: clamp(3rem, 12vw, 5rem);
  margin: 0;
  color: var(--ink);
}

/* ---------- Language chooser (root /) ---------- */
.lang-gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 6px;
}

.lang-gate .logo {
  font-family: var(--display);
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--ink);
  animation: rise 0.6s ease-out both;
}

.lang-gate p {
  color: var(--muted);
  margin: 8px 0 28px;
  animation: rise 0.6s ease-out 0.1s both;
}

.lang-gate .choices {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  animation: rise 0.6s ease-out 0.2s both;
}

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  margin-top: 80px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 40px 0 34px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  font-size: 0.9rem;
  color: var(--text);
}

.footer-brand a {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.footer-brand span {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  max-width: 560px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--ink);
}

/* ---------- Motion ---------- */
@keyframes rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .header-inner {
    padding: 12px 12px;
  }
  .hero {
    padding: 72px 0 60px;
  }
  .hero h1 br {
    display: none;
  }
  .section {
    padding: 50px 0;
  }
  .header-inner {
    flex-wrap: nowrap;
  }
  .nav-btn {
    display: inline-flex;
  }
  /* nav collapses into a full-width dropdown below the header */
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 16px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }
  .site-nav a {
    width: 100%;
    padding: 12px 2px;
    border-bottom: 1px solid var(--line);
  }
  .site-nav a:last-child:not(.lang-link) {
    border-bottom: none;
  }
  .site-nav .lang-link {
    align-self: flex-start;
    width: auto;
    margin-top: 10px;
    padding: 6px 14px;
  }
  .brand {
    font-size: 1.18rem;
  }
  .app-hero {
    padding: 58px 0 22px;
  }
}
