/* ============================================
   マルタチ — Design tokens & global styles
   ============================================ */
:root {
  --navy-900: #060d1f;
  --navy-800: #0b1b3b;
  --navy-700: #13316e;
  --navy-600: #1b4391;
  --blue-dusty: #6b86b0;
  --blue-fog: #a9b8d1;
  --paper: #f4f2ec;
  --paper-2: #ebe7dc;
  --ink: #0a0f1e;
  --ink-soft: #2a3553;
  --line: rgba(11, 27, 59, 0.14);
  --line-soft: rgba(11, 27, 59, 0.08);

  --bg: var(--paper);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --accent: var(--navy-800);
  --accent-2: var(--navy-700);
  --accent-3: var(--blue-dusty);

  --font-jp: "Zen Kaku Gothic New", "Noto Sans JP", system-ui, sans-serif;
  --font-jp-body: "Noto Sans JP", system-ui, sans-serif;
  --font-display: "Bodoni Moda", "Times New Roman", serif;
  --font-mono: "Noto Sans JP", system-ui, sans-serif;

  --maxw: 1440px;
  --gutter: clamp(20px, 4vw, 56px);
}

[data-theme="dark"] {
  --bg: #060d1f;
  --bg-2: #0b1b3b;
  --fg: #f4f2ec;
  --fg-soft: #a9b8d1;
  --line: rgba(244, 242, 236, 0.14);
  --line-soft: rgba(244, 242, 236, 0.08);
  --paper: #060d1f;
  --paper-2: #0b1b3b;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-jp-body);
  font-size: 20px;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--navy-800); color: var(--paper); }

/* Display type */
.h-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.92;
}
.h-jp {
  font-family: var(--font-jp);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-soft);
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 22px;
  border-radius: 999px;
  background: var(--navy-800);
  color: var(--paper);
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid var(--navy-800);
  white-space: nowrap;
}
.btn:hover { background: var(--navy-700); transform: translateY(-1px); box-shadow: 0 12px 24px -16px var(--navy-800); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--lg { padding: 20px 28px; font-size: 15px; }

.btn-arrow {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--navy-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.btn--ghost .btn-arrow { background: var(--navy-800); color: var(--paper); }

/* Striped placeholder */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(11, 27, 59, 0.06) 0 8px,
      rgba(11, 27, 59, 0.0) 8px 16px
    ),
    var(--paper-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg-soft);
  text-transform: uppercase;
  overflow: hidden;
}
.placeholder::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--line);
  pointer-events: none;
}
.placeholder-dark {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(244, 242, 236, 0.08) 0 8px,
      rgba(244, 242, 236, 0) 8px 16px
    ),
    var(--navy-800);
  color: var(--blue-fog);
  border-color: rgba(244, 242, 236, 0.12);
}
.placeholder-dark::after { border-color: rgba(244, 242, 236, 0.16); }

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ============================================
   Header
   ============================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
  border-bottom: 1px solid var(--line-soft);
  mix-blend-mode: normal;
  background: rgba(244, 242, 236, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-header.is-scrolled {
  background: rgba(244, 242, 236, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
[data-theme="dark"] .site-header.is-scrolled {
  background: rgba(6, 13, 31, 0.86);
}
.site-header.over-dark { color: var(--paper); }
.site-header.over-dark .logo-mark__bar { background: var(--paper); }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-jp);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 15px;
}
.logo-mark {
  width: 36px; height: 36px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-mark__ring {
  position: absolute; inset: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.logo-mark__bar {
  width: 16px; height: 2px;
  background: currentColor;
  position: relative;
}
.logo-mark__bar::before, .logo-mark__bar::after {
  content: "";
  position: absolute;
  width: 2px; height: 8px;
  background: currentColor;
  top: -3px;
}
.logo-mark__bar::before { left: 0; }
.logo-mark__bar::after { right: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text small {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.22em;
  margin-top: 4px;
  opacity: 0.7;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  position: relative;
  padding: 10px 16px;
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.06em;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.nav a small {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 9px;
  letter-spacing: 0.18em;
  opacity: 0.55;
  font-weight: 400;
}
.nav a.is-active::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  width: 22px; height: 2px;
  transform: translateX(-50%);
  background: currentColor;
}
.nav a:hover { opacity: 0.7; }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-cta {
  padding: 10px 18px;
  background: var(--navy-800);
  color: var(--paper);
  border-radius: 999px;
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.over-dark .header-cta { background: var(--paper); color: var(--navy-800); }

/* Mobile menu */
.menu-toggle { display: none; }

@media (max-width: 880px) {
  .nav, .header-cta { display: none; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }
  .menu-toggle__bars {
    width: 22px; height: 12px;
    position: relative;
  }
  .menu-toggle__bars::before, .menu-toggle__bars::after {
    content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  }
  .menu-toggle__bars::before { top: 0; }
  .menu-toggle__bars::after { bottom: 0; }
}

/* Mobile drawer */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(6,13,31,0.5);
  z-index: 59;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 80%;
  max-width: 340px;
  background: var(--navy-900);
  color: var(--paper);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter);
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.7, 0, 0.2, 1);
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer .drawer-head {
  display: flex; justify-content: space-between; align-items: center;
}
.mobile-drawer nav {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.mobile-drawer nav a {
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(244,242,236,0.12);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.mobile-drawer nav a small {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 10px;
  letter-spacing: 0.22em;
  opacity: 0.55;
}
.close-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  padding: 0;
}
.close-icon {
  position: relative;
  width: 22px; height: 22px;
  display: block;
}
.close-icon::before,
.close-icon::after {
  content: '';
  position: absolute;
  width: 22px; height: 2px;
  background: var(--paper);
  top: 50%; left: 0;
  border-radius: 2px;
}
.close-icon::before { transform: translateY(-50%) rotate(45deg); }
.close-icon::after  { transform: translateY(-50%) rotate(-45deg); }

/* ============================================
   Page transitions
   ============================================ */
.page {
  min-height: 100vh;
}
.page-enter {
  animation: pageIn 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Footer */
.site-footer {
  background: var(--navy-900);
  color: var(--paper);
  padding: 80px var(--gutter) 28px;
}
.site-footer .footer-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(244,242,236,0.14);
}
.site-footer h4 {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-fog);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer ul a { font-size: 14px; opacity: 0.85; }
.site-footer ul a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.site-footer .footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--blue-fog);
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand .h-display {
  font-size: clamp(48px, 7vw, 96px);
  margin: 0;
}
.footer-brand p {
  margin: 16px 0 0;
  max-width: 32ch;
  color: var(--blue-fog);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 880px) {
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Generic section padding */
.section { padding: clamp(80px, 12vw, 140px) 0; }
.section-tight { padding: clamp(56px, 8vw, 96px) 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: 0.02em;
  line-height: 1.18;
}
.section-head h2 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--blue-dusty);
}
.section-head .section-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--fg-soft);
  text-transform: uppercase;
}
.section-head p {
  max-width: 42ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--fg-soft);
  margin: 0;
}

/* ============================================
   Cursor / utilities
   ============================================ */
.flag-en { color: var(--fg-soft); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--navy-700); }

.kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Hide scrollbars on horizontal carousels */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }
