/* Shared UI foundation extracted from the existing Ripplow website. */
:root {
  color-scheme: light;

  --bg: #f6f8fc;
  --surface: #fbfcff;
  --surface-soft: #eef3f9;
  --surface-dark: #191919;

  --text: #22292d;
  --text-soft: #667176;
  --text-faint: #8a9498;

  --line: #dbe3ee;
  --line-strong: #c9d5e3;

  --accent: #3674bb;
  --accent-hover: #2e639f;
  --accent-light: #7cacff;
  --accent-soft: #edf4ff;

  --danger: #aa343d;
  --danger-soft: #fff0f1;

  --shadow-soft: 0 12px 32px rgba(31, 44, 49, 0.07);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shell: 1160px;
  --content-width: 820px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: calc(var(--header-height, 112px) + 16px);
}

::selection {
  background: rgba(124, 172, 255, 0.32);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

main:focus {
  outline: none;
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

main .shell {
  width: min(var(--content-width), calc(100% - clamp(32px, 6vw, 48px)));
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 3px solid rgba(124, 172, 255, 0.48);
  outline-offset: 3px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 255, 0.96);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand small {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--text-soft);
  font-size: 12px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
}

/* Language rail */

.language-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 92px;
  width: 92px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
}

.language-switch::before {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--accent);
  transition: transform 160ms ease;
}

.language-switch[data-active-language="en"]::before {
  transform: translateX(100%);
}

.language-switch button {
  position: relative;
  z-index: 1;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.language-switch button[aria-pressed="true"] {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .language-switch::before { transition: none; }
}

/* Buttons */

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: none;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--accent-light);
}

.button-large {
  min-height: 48px;
  padding-inline: 22px;
  font-size: 13px;
}

.button-block {
  width: 100%;
}

.header-action {
  min-height: 40px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px 48px;
  padding-block: 48px 26px;
}

.footer-brand-block {
  display: grid;
  gap: 7px;
}

.footer-brand {
  width: max-content;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.footer-brand-block span {
  color: var(--text-faint);
  font-size: 10px;
}

.footer-links {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.footer-links nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 20px;
  color: var(--text-soft);
  font-size: 10px;
}

.footer-secondary-nav {
  color: var(--text-faint) !important;
}

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

.footer-inner small {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 9px;
}


@media (max-width: 980px) {
  .header-inner {
    min-height: auto;
    padding-block: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px 16px;
  }

  .brand {
    margin-right: auto;
  }

  .header-action {
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    grid-column: 1;
    min-width: 0;
    width: auto;
    gap: 12px;
    font-size: 11px;
    flex-wrap: wrap;
    row-gap: 0;
    padding-top: 4px;
    border-top: 1px solid var(--line);
  }

  .language-switch {
    order: 4;
    grid-column: 2;
    margin-left: auto;
  }

  .site-nav a {
    min-height: 38px;
    white-space: nowrap;
  }

}
@media (max-width: 760px) {
.shell,
  .page-intro {
    width: min(var(--shell), calc(100% - 32px));
  }
.footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 38px;
  }
.footer-links {
    justify-items: start;
  }
.footer-links nav {
    justify-content: flex-start;
  }
.footer-inner small {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
.brand small {
    display: none;
  }
.header-action {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 11px;
  }
.footer-inner nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.site-nav { font-size: 13px; }
.button { font-size: 13px; }
.button-large { font-size: 14px; }
.eyebrow { font-size: 11px; }
.footer-brand-block span { font-size: 11px; }
.footer-links nav { font-size: 12px; }
.footer-inner small { font-size: 11px; }
@media (max-width: 520px) {
  .site-nav { font-size: 11px; gap: 10px; }
}

html[lang="ja"] .ui-en,html[lang="en"] .ui-ja{display:none}
.language-fallback{font-size:12px;color:var(--accent)}
@media(max-width:980px){
  .site-header--compact .language-switch{grid-column:2;grid-row:1;order:0}
  .site-header--compact .site-nav{grid-column:1/-1;grid-row:2}
}

[data-ui-ready] .language-fallback{display:none}

.external-link-icon {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-inline-start: 0.3em;
  vertical-align: -0.13em;
  flex: none;
}
