/* project MEARI. site styles
   Palette is taken from the cube in the logo:
   top #daf5d9 / front #97e2d6 / right #6dd9c7 */
:root {
  /* "only" opts out of browser-forced dark modes; the site has a light theme only. */
  color-scheme: only light;
  --bg: #eaf2ec;
  --surface: #f6f9f6;
  --cube-top: #daf5d9;
  --cube-right: #6dd9c7;
  --tint: #dfeee2;
  --ink: #1f2d36;
  --text: #1f2d36;
  --text-2: #3f4e58;
  --text-3: #5b6a74;
  --accent-ink: #0d6f60;
  --line: rgba(31, 45, 54, 0.12);
  --line-2: rgba(31, 45, 54, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1160px;
  --nav-h: 72px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "YuGothic", Meiryo, "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0.02em;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; letter-spacing: 0.01em; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* Japanese line breaking.
   Chrome/Edge break headings at phrase boundaries automatically.
   Elements with .phrase only break at <wbr>, spaces and punctuation,
   which also works in Safari. overflow-wrap is the last-resort fallback. */
h1, h2, h3 { word-break: auto-phrase; }
.phrase { word-break: keep-all; overflow-wrap: anywhere; }

.container { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.section { padding: 96px 0; position: relative; }
.section + .section { padding-top: 0; }

/* Small label above a block. Japanese text, no decorative rule. */
.eyebrow { display: block; font-size: 14px; font-weight: 700; color: var(--accent-ink); margin-bottom: 12px; }
.page-title, .h1 { font-size: clamp(30px, 4.2vw, 44px); margin-bottom: 20px; }
.section-title { font-size: clamp(24px, 3vw, 32px); margin-bottom: 28px; }
.lead { color: var(--text-2); font-size: 17px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(234, 242, 236, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.header.is-scrolled { border-bottom-color: var(--line); }
.header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; height: 100%; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; color: var(--text-2);
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ink); background: var(--tint); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 3px;
  border-radius: 2px; background: var(--cube-right);
}
.nav-cta {
  margin-left: 12px; border: 2px solid var(--ink);
  padding: 8px 16px !important; color: var(--ink) !important;
}
.nav-cta:hover, .nav-cta:focus-visible { background: var(--cube-top) !important; }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; padding: 0; position: relative;
}
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .3s, opacity .3s, top .3s;
}
.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 25px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* ---------- Buttons ----------
   A solid bottom edge echoes the side face of the logo cube. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 12px; font-weight: 700; font-size: 15px;
  border: 2px solid var(--ink); cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, background .2s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--cube-right); color: var(--ink); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--cube-top); }
.store-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.store-badge { display: inline-flex; }
.store-badge img { display: block; width: auto; height: 44px; }
.text-link { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.text-link:hover { text-decoration-color: var(--cube-right); }

/* ---------- Home hero ---------- */
.hero { padding: 72px 0 88px; background: var(--tint); border-bottom: 2px solid var(--line); }
.home-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.hero-title { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.25; margin: 0 0 28px; }
.hero-lead { font-size: 17px; color: var(--text-2); max-width: 30em; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px 14px; }
.hero-art { position: relative; margin: 0; justify-self: center; width: min(100%, 480px); }
.hero-art-frame {
  display: block; padding: 10px; background: var(--surface); border-radius: 18px;
  border: 2px solid var(--ink); box-shadow: 0 8px 0 var(--ink);
  transform: rotate(1.5deg); transition: transform .3s;
}
.hero-art-frame:hover { transform: rotate(0deg); }
.hero-art-frame img { width: 100%; height: auto; border-radius: 10px; }
.hero-mascot { position: absolute; left: -36px; bottom: 28px; width: 104px; height: auto; transform: rotate(-8deg); pointer-events: none; }
.hero-art figcaption { margin-top: 22px; font-size: 13px; color: var(--text-3); text-align: right; }

/* ---------- Works on the home page ---------- */
.work-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center;
  padding: 32px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--ink);
}
.work-card-icon { width: 120px; height: 120px; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); }
.work-card h3 { font-size: 24px; margin-bottom: 8px; }
.work-card p { color: var(--text-2); margin-bottom: 20px; }
.work-card-shots { display: flex; gap: 10px; }
.work-card-shots img { width: 96px; height: auto; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card { padding: 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--text-2); font-size: 16px; }

/* ---------- Page hero (sub pages) ---------- */
.page-hero { padding: 72px 0 32px; }
.page-hero .lead { max-width: 44em; }

/* ---------- Product page ---------- */
.app-hero { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; }
.app-hero-icon { width: 140px; height: 140px; border-radius: 34px; overflow: hidden; border: 1px solid var(--line); }
.app-hero h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; }
.work-description { max-width: 32em; margin-bottom: 24px; }
.gallery { display: flex; gap: 18px; overflow-x: auto; padding: 8px 0 24px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery-image { flex: none; display: block; width: 230px; border-radius: 20px; border: 2px solid var(--ink); overflow: hidden; scroll-snap-align: start; }
.gallery-image img { display: block; width: 100%; height: auto; }

/* ---------- Company ---------- */
.info-card { padding: 8px 32px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { padding: 20px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 16px; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 0; }
.info-table th { width: 180px; color: var(--text-3); font-weight: 600; }
.contact-grid.single-contact { grid-template-columns: 1fr; max-width: 560px; }
.contact-grid .card { scroll-margin-top: 96px; }
.contact-address { display: inline-block; margin-top: 20px; font-size: 18px; font-weight: 700; color: var(--accent-ink); overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 5px; }

/* ---------- Legal / support ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 21px; margin: 44px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text-2); font-size: 16px; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 22px; list-style: disc; margin: 10px 0; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 4px; }
.prose .date { font-size: 14px; color: var(--text-3); margin-bottom: 32px; }

/* ---------- Footer ---------- */
.footer { padding: 56px 0 32px; margin-top: 64px; background: var(--cube-top); border-top: 2px solid var(--ink); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer .brand { height: auto; display: inline-flex; }
.footer .brand img { height: 36px; }
.footer h4 { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.footer ul li + li { margin-top: 8px; }
.footer ul a { font-size: 15px; color: var(--text-2); }
.footer ul a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom { padding-top: 24px; border-top: 2px solid var(--line-2); font-size: 13px; color: var(--text-3); }

/* ---------- Utilities / a11y ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 100; padding: 10px 18px; background: var(--ink); color: #fff; transform: translateY(-160%); border-radius: 8px; }
.skip-link:focus { transform: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 4px; }
main:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .hero-art-frame { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .container { width: calc(100% - 40px); }
  .section { padding: 72px 0; }
  .home-hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero { padding: 48px 0 64px; }
  .hero-art { width: min(100% - 32px, 420px); }
  .work-card { grid-template-columns: auto 1fr; }
  .work-card-shots { display: none; }
  .grid-2 { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav {
    position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 16px 20px 24px; background: var(--bg); border-bottom: 1px solid var(--line-2);
    transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
  .nav a { padding: 14px 16px; font-size: 16px; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a[aria-current="page"] { background: var(--tint); }
  .nav-cta { margin: 10px 0 0; text-align: center; }

  .app-hero { grid-template-columns: 1fr; }
  .app-hero-icon { width: 110px; height: 110px; border-radius: 28px; }
  .page-hero { padding: 48px 0 24px; }
  .page-hero + .section { padding-top: 32px; }
  .info-card { padding: 4px 20px; }
  .info-table th { width: 96px; }
  .info-table th, .info-table td { font-size: 15px; overflow-wrap: anywhere; }
  .contact-address { font-size: 16px; }
  .footer-top { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero-title { font-size: clamp(34px, 10vw, 44px); }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-mascot { width: 80px; left: -20px; bottom: 20px; }
  .work-card { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
  .work-card-icon { width: 88px; height: 88px; border-radius: 22px; }
}
