/*
 * Mori brand wiki (private preview) layout styles.
 * Brand tokens come from core/brand/atomic/agent/visual/colors_and_type.css.
 */

* { box-sizing: border-box; }

body {
  background-color: var(--bg-01);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-scrim);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-1);
}

.site-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}

.site-header .site-nav { margin-left: auto; }

.site-header .wordmark img {
  height: 22px;
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 14px;
  font-weight: 400;
}

.site-nav a {
  color: var(--text-sub);
  padding: 4px 0;
}

.site-nav a:hover { color: var(--brand); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--text-main);
  border-bottom: 2px solid var(--brand);
}

.lang-switch {
  display: flex;
  gap: 10px;
  font-size: 13px;
  flex: none;
}

.lang-switch a { color: var(--text-additional); }
.lang-switch a:hover { color: var(--brand); text-decoration: none; }
.lang-switch a[aria-current="true"] {
  color: var(--text-main);
  font-weight: 500;
}

/* ---------- Layout ---------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.page-wide {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.page-title {
  font-size: 34px;
  margin: 0 0 8px;
}

.page-lead {
  color: var(--text-sub);
  font-size: 16px;
  margin: 0 0 40px;
}

section.block { margin: 64px 0; }
section.block:first-of-type { margin-top: 40px; }

section.block > h2 {
  font-size: 24px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-1);
}

section.block h3 {
  font-size: 18px;
  margin: 32px 0 8px;
}

p { margin: 0 0 16px; }

ul, ol { padding-left: 1.4em; margin: 0 0 16px; }
li { margin-bottom: 8px; }

blockquote {
  margin: 28px 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--border-1);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.9;
}

blockquote p:last-child { margin-bottom: 0; }

hr {
  border: none;
  border-top: 1px solid var(--border-1);
  margin: 48px 0;
}

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  background: var(--secondary-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 15px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-1);
}

tr:last-child td, tr:last-child th { border-bottom: none; }

th {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--secondary-700);
  background: var(--secondary-300);
  white-space: nowrap;
  padding-top: 11px;
  padding-bottom: 11px;
  border-bottom: none;
}

td:first-child {
  white-space: nowrap;
  color: var(--text-sub);
  font-weight: 300;
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

a.card {
  display: block;
  background: var(--bg-04);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 24px;
  color: var(--text-main);
  transition: border-color 0.15s ease;
}

span.card, div.card {
  display: block;
  background: var(--bg-04);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 24px;
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  display: block;
}

.card-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
  .card-grid.cols-3 { grid-template-columns: 1fr; }
}

/* Accessory/product cards filled with the render's own background color */
.card.media-card {
  padding: 0;
  border: none;
  background: #E2E0DF; /* matches the accessory render background (secondary-300) */
  overflow: hidden;
}

.card.media-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1392 / 880; /* matches the accessory renders */
  object-fit: cover;
  display: block;
}

.card.media-card .card-desc {
  text-align: center;
  padding: 12px 12px 16px;
  margin: 0;
  color: var(--secondary-800);
}

.card-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  margin: 0 0 2px;
}

.card-role {
  font-size: 13px;
  color: var(--text-additional);
  margin: 0 0 10px;
}

.card .card-desc {
  font-size: 14px;
  color: var(--text-sub);
  margin: 0;
}

/* Button-style page links (TOP) */
.btn-link {
  display: inline-block;
  background: var(--bg-04);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  color: var(--brand);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s ease;
}

.btn-link:hover { text-decoration: none; border-color: var(--primary-300); }

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 24px;
  margin: 16px 0;
}

.link-grid > div {
  display: flex;
  flex-direction: column;
}

.link-grid p { margin-bottom: 12px; }

.link-grid .btn-link {
  margin-top: auto;
  align-self: flex-start;
}

a.card:hover { text-decoration: none; border-color: var(--primary-300); }

a.card .card-title {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--brand);
}

a.card .card-desc {
  font-size: 14px;
  color: var(--text-sub);
  margin: 0;
}

/* ---------- Images and placeholders ---------- */

figure { margin: 24px 0; }

figure img, .media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  background: var(--bg-04);
}

figure.transparent img {
  background: none;
  width: auto;
  max-width: min(360px, 80%);
  margin: 0 auto;
}

.media-video {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
  margin: 12px 0;
}

/* Team profile cards: square photo flush to the card top, text below */
.card.team-card {
  padding: 0;
  overflow: hidden;
}

.card.team-card .team-photo,
.card.team-card .placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
  display: block;
}

.card.team-card .card-name {
  margin: 16px 20px 2px;
}

.card.team-card .card-role {
  margin: 0 20px 10px;
}

.card.team-card .card-desc {
  margin: 0 20px 20px;
}

img.qr {
  width: 132px;
  height: 132px;
  border-radius: var(--radius-md);
}

figcaption {
  font-size: 13px;
  color: var(--text-additional);
  margin-top: 8px;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: repeating-linear-gradient(
    45deg,
    var(--secondary-100),
    var(--secondary-100) 12px,
    var(--secondary-200) 12px,
    var(--secondary-200) 24px
  );
  border: 1px dashed var(--secondary-400);
  border-radius: var(--radius-lg);
  color: var(--text-additional);
  font-size: 13px;
  padding: 16px;
  min-height: 180px;
}

.placeholder.short { min-height: 100px; }

/* ---------- Feature rows (app page) ---------- */

.feature {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 28px;
  align-items: center;
  margin: 40px 0;
}

.feature:nth-of-type(even) .feature-media { order: 2; }

.feature-media img {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  display: block;
  border-radius: var(--radius-xl);
}

.feature h3 { margin-top: 0; }

@media (max-width: 640px) {
  .feature { grid-template-columns: 1fr; }
  .feature:nth-of-type(even) .feature-media { order: 0; }
}

/* ---------- Flow diagram ---------- */

.flow-diagram {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 24px 0;
}

.flow-node {
  flex: 1;
  background: var(--secondary-100);
  border-radius: var(--radius-md);
  padding: 20px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: center;
}

.flow-node svg {
  width: 36px;
  height: 36px;
  color: var(--primary-600);
}

.flow-node span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.flow-node small {
  font-size: 12px;
  color: var(--text-additional);
}

.flow-arrow {
  align-self: center;
  color: var(--text-additional);
  font-size: 16px;
  flex: none;
}

@media (max-width: 640px) {
  .flow-diagram { flex-direction: column; align-items: stretch; }
  .flow-arrow { transform: rotate(90deg); text-align: center; }
}

/* ---------- Steps ---------- */

ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
}

ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 24px 52px;
  margin: 0;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  background: var(--primary-600);
  color: var(--base-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
}

ol.steps > li > strong { font-weight: 500; }

/* ---------- Chips ---------- */

.todo {
  display: inline-block;
  background: var(--accent-yellow-bg);
  color: var(--accent-yellow-text);
  border-radius: var(--radius-sm);
  padding: 1px 8px;
  font-size: 12.5px;
  font-weight: 400;
}

.pill {
  display: inline-block;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-round);
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 400;
}

/* ---------- Hero (top page) ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 56px 0 24px;
}

.hero h1 {
  font-size: 38px;
  line-height: 1.3;
  margin: 0 0 16px;
}

.hero .hero-sub {
  color: var(--text-sub);
  font-size: 16px;
}

.hero-media img {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: block;
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero h1 { font-size: 30px; }
}

/* Full-bleed hero: cover-cropped KV with overlay gradient and copy at the bottom (per LP) */
.hero-kv {
  position: relative;
  margin: 0;
}

.hero-kv img,
.hero-kv video {
  width: 100%;
  height: clamp(420px, 82vh, 780px);
  object-fit: cover;
  display: block;
  border-radius: 0;
  border: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--image-overlay);
  display: flex;
  align-items: flex-end;
}

.hero-overlay-inner {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px clamp(32px, 6vw, 64px);
}

.hero-overlay h1 {
  color: var(--base-white);
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.35;
  margin: 0 0 14px;
}

.hero-overlay p {
  color: rgba(255, 254, 253, 0.88);
  font-size: clamp(13px, 1.5vw, 16px);
  line-height: 1.8;
  max-width: 36em;
  margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-1);
  margin-top: 64px;
}

.site-footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 24px;
  font-size: 13px;
  color: var(--text-sub);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-sub {
  font-size: 12px;
}

.footer-sub a { color: var(--text-additional); }

.site-footer a { color: var(--text-sub); }
.site-footer a:hover { color: var(--brand); }

.site-footer .copyright {
  color: var(--text-additional);
  font-size: 12px;
  margin: 0 0 0 auto;
  text-align: right;
}

/* ---------- Misc ---------- */

.note {
  font-size: 13px;
  color: var(--text-additional);
}

.contact-box {
  background: var(--bg-04);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 16px 0;
  font-size: 15px;
}

.anchor-toc {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 24px;
}

/* ---------- LED states (setup) ---------- */

.led-grid { gap: 16px; }

.card.led-card {
  text-align: center;
  padding: 20px 16px;
}

.led-stage {
  position: relative;
  width: 132px;
  margin: 4px auto 12px;
}

.led-stage img {
  width: 100%;
  height: auto;
  display: block;
}

/* LED position matches the front render (about 50% / 45.7%) */
.led-dot {
  position: absolute;
  left: 49.97%;
  top: 45.49%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.led-white  { background: #DCCFC2; color: #DCCFC2; }
.led-orange { background: #EDA25C; color: #EDA25C; }
.led-red    { background: #F42B2B; color: #F42B2B; }
.led-blue   { background: #70B0F8; color: #70B0F8; }

.led-on {
  opacity: 0.9;
  box-shadow: 0 0 5px 1px currentColor;
}

@keyframes led-breathing {
  0%, 100% { opacity: 0.08; }
  50% { opacity: 0.9; }
}

.led-breath {
  animation: led-breathing 1.8s ease-in-out infinite;
  box-shadow: 0 0 5px 1px currentColor;
}

@keyframes led-alt-white-orange {
  0%, 49.99% { background: #DCCFC2; color: #DCCFC2; }
  50%, 100%  { background: #EDA25C; color: #EDA25C; }
}

.led-alt {
  opacity: 0.9;
  animation: led-alt-white-orange 1s steps(1) infinite;
  box-shadow: 0 0 5px 1px currentColor;
}

/* ---------- Factory reset demo (setup) ---------- */

.card.demo-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 40px;
  padding: 28px 24px;
  margin: 24px 0;
  text-align: left;
}

.demo-stage {
  width: 200px;
  flex: none;
  margin: 0;
}

.demo-stage .led-dot {
  width: 4px;
  height: 4px;
}

.demo-touch {
  position: absolute;
  left: 50.52%;
  top: 24.41%;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.75);
  opacity: 0;
  transition: opacity 150ms ease, transform 130ms ease, background 130ms ease;
  pointer-events: none;
}

.demo-touch.show { opacity: 1; }

.demo-touch.pressed {
  transform: translate(-50%, -50%) scale(0.7);
  background: rgba(255, 255, 255, 0.55);
}

.demo-info {
  width: 340px;
  max-width: 100%;
}

.demo-phase {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  min-height: 1.6em;
  margin: 0 0 2px;
}

.demo-timer {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-additional);
  min-height: 18px;
  margin: 0 0 8px;
}

.demo-bar {
  height: 6px;
  background: var(--secondary-300);
  border-radius: var(--radius-round);
  overflow: hidden;
}

.demo-bar-fill {
  height: 100%;
  width: 0%;
  background: rgb(165, 57, 237);
}

.demo-steps {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-sub);
  padding-left: 1.5em;
  margin: 14px 0 0;
}

.demo-steps li { margin-bottom: 4px; }

.demo-steps li.active {
  color: var(--text-main);
  font-weight: 500;
}

.demo-steps li.done { opacity: 0.55; }
