/* =========================================================
   ALIFE PUBLIC EXPO — Shared Stylesheet
   Palette: ALIFE 2025 "Ciphers of Life" · Kyoto, Japan
   Coral-salmon ↔ Periwinkle lavender gradient · Deep navy surfaces
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@400;500&display=swap');

/* ── Colour tokens ── */
:root {
  /* Core palette — pulled directly from ALIFE 2025 site */
  --coral:        #f07868;   /* warm coral/salmon */
  --coral-dark:   #d95e4a;   /* deeper coral for hover */
  --periwinkle:   #9b8ec4;   /* lavender-purple */
  --periwinkle-lt:#c4b8e8;   /* light lavender */
  --navy:         #1e1b4b;   /* deep navy — buttons, bars */
  --navy-mid:     #2d2960;   /* slightly lighter navy */
  --navy-lt:      #3d3880;   /* nav hover, surface borders */

  /* Backgrounds */
  --color-bg:       #181635;   /* near-navy page background */
  --color-surface:  #221f50;   /* card surface */
  --color-surface2: #2a2760;   /* elevated surface */
  --color-border:   #3d3878;   /* border */

  /* Text */
  --color-heading:  #ffffff;
  --color-text:     #e8e4f5;   /* warm lavender-white */
  --color-muted:    #9b96c0;   /* muted lavender-grey */

  /* Semantic aliases */
  --color-accent:   var(--coral);
  --color-accent2:  var(--periwinkle);
  --color-link:     var(--periwinkle-lt);

  /* Typography */
  --font-display:   'Cormorant Garamond', serif;   /* hero titles — matches conf's elegant serif */
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'DM Mono', monospace;

  /* Shape */
  --radius-sm:  5px;
  --radius-md:  10px;
  --radius-lg:  20px;

  --max-width:  940px;
  --nav-height: 60px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--coral); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-heading);
  line-height: 1.15;
  font-weight: 700;
}

img { max-width: 100%; display: block; }
.cc-icon { display: inline-block; height: 1em; width: auto; max-width: none; margin-left: .2em; vertical-align: -0.125em; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Top bar (mirrors conf's narrow announcement bar in navy) ── */
.top-bar {
  background: var(--navy);
  text-align: center;
  padding: 0.45rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--periwinkle-lt);
}

/* ── Navigation ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(24, 22, 53, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.nav-logo-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--periwinkle);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 0.1rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  font-size: 0.74rem;
  color: var(--color-muted);
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.nav-links a:hover { color: var(--color-heading); background: var(--color-surface2); text-decoration: none; }
.nav-links a.active { color: var(--coral); background: rgba(240,120,104,0.1); text-decoration: none; }

/* ── Language toggle ── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  margin-right: 0.75rem;
  padding: 0.22rem 0.55rem;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-toggle:hover {
  border-color: var(--periwinkle);
  background: rgba(155,142,196,0.12);
}
.lang-toggle .lt-sep {
  color: var(--color-border);
  font-weight: 300;
}
.lang-toggle .lt-active {
  color: var(--coral);
}
@media (max-width: 680px) {
  .lang-toggle { margin-right: 0.5rem; }
}

/* ── Language content blocks — rules live here but are deliberately
   overridden by the higher-specificity block at the bottom of this
   file (after .placard-page rules). Do not add rules here. ── */

/* ── Hero — canvas simulation owns the background ── */
.hero {
  padding: 5.5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;

  /* Fallback colour shown before canvas boots, and for pages without a sim */
  background: linear-gradient(
    145deg,
    #f0806a 0%,
    #d97890 25%,
    #b888b8 50%,
    #9b8ec4 70%,
    #7a80c8 100%
  );
}

/* Live simulation canvas — fills the hero behind all content */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  z-index: 0;
}

/* When a canvas sim is present, hide the CSS gradient (canvas paints its own tint) */
.hero:has(.hero-canvas)::before {
  display: none;
}

/* Original subtle overlay — only applies when no canvas sim is loaded */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(30,27,75,0.35) 0%, transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(30,27,75,0.25) 0%, transparent 55%);
  pointer-events: none;
}

/* All hero content sits above the canvas */
.hero > .container,
.hero > *:not(.hero-canvas) {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 1rem;
  position: relative;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(30,27,75,0.3);
  position: relative;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.82);
  max-width: 580px;
  margin: 0 auto 2.25rem;
  line-height: 1.7;
  font-family: var(--font-body);
  position: relative;
}

/* ── Zone badge ── */
.zone-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(30,27,75,0.55);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  padding: 0.22rem 0.7rem;
  margin-bottom: 1rem;
  position: relative;
  backdrop-filter: blur(4px);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;   /* pill shape — matches conf */
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.18s;
  border: 2px solid transparent;
  text-decoration: none !important;
  font-family: var(--font-mono);
}

.btn-primary {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-mid); border-color: var(--navy-mid); color: #fff; }

.btn-outline {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255,255,255,0.6);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: #fff; color: #fff; }

/* ── Cards ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(155,142,196,0.5); }

/* ── Section spacing ── */
.section { padding: 3rem 0; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin-bottom: 1.25rem;
  color: var(--color-heading);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--color-border) 0%, transparent 100%);
}

/* ── Placard / body text ── */
.placard-text p { margin-bottom: 1.15rem; color: var(--color-text); }
.placard-text p:last-child { margin-bottom: 0; }
.placard-text ul, .placard-text ol { margin: 0.5rem 0 1.15rem 1.6rem; }
.placard-text li { margin-bottom: 0.65rem; color: var(--color-text); }

.placard-text h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 2rem 0 0.8rem;
  color: var(--periwinkle-lt);
  padding-left: 0.85rem;
  border-left: 3px solid var(--coral);
}

.placard-text strong { color: var(--color-heading); }
.placard-text em { color: var(--periwinkle-lt); font-style: italic; }

/* ── Video block ── */
.video-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface2);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper .placeholder-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.placeholder-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--color-surface2);
  color: var(--color-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem;
}
.placeholder-video .icon { font-size: 2.5rem; opacity: 0.3; }

/* ── Interactive block ── */
.interactive-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.interactive-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.interactive-label a { font-size: 0.68rem; color: var(--periwinkle-lt); }
.interactive-label a:hover { color: var(--coral); text-decoration: none; }

.interactive-wrapper { position: relative; height: 540px; }
.interactive-wrapper iframe { width: 100%; height: 100%; border: none; display: block; }

/* Some embedded simulations size their controls to the browser viewport, so in
   a 540px-tall frame they render oversized and get cropped. `zoom-out` gives the
   iframe a larger logical viewport and then scales the whole frame down, which
   fits the full interface inside the box instead of clipping it. */
.interactive-wrapper.zoom-out { overflow: hidden; }
.interactive-wrapper.zoom-out iframe {
  width: 142.86%;   /* 100 / 0.7 */
  height: 142.86%;
  transform: scale(0.7);
  transform-origin: 0 0;
}

.placeholder-interactive {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--color-surface2);
  color: var(--color-muted);
  text-align: center;
  padding: 2rem;
}
.placeholder-interactive .icon { font-size: 2.5rem; opacity: 0.3; }

/* ── Callout box ── */
.callout {
  border-left: 3px solid var(--periwinkle);
  background: rgba(155,142,196,0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}
.callout strong { color: var(--color-heading); }
.callout a { color: var(--periwinkle-lt); }

/* ── Zone prev/next navigation ── */
.zone-nav {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 2.5rem 0 4rem;
  flex-wrap: wrap;
}

.zone-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.86rem;
  transition: all 0.18s;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-surface);
  text-decoration: none !important;
  font-family: var(--font-body);
}
.zone-nav-btn:hover { border-color: var(--periwinkle); color: var(--periwinkle-lt); background: var(--color-surface2); }

.zone-nav-btn.primary {
  background: linear-gradient(135deg, var(--coral) 0%, var(--periwinkle) 100%);
  color: #fff;
  border-color: transparent;
}
.zone-nav-btn.primary:hover { opacity: 0.88; color: #fff; }

/* ── Zone jump grid (welcome page) ── */
.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.zone-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  text-align: center;
  transition: border-color 0.18s, transform 0.15s, background 0.18s;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none !important;
}
.zone-card:hover {
  border-color: var(--periwinkle);
  transform: translateY(-2px);
  background: var(--color-surface2);
}

.zone-card .zone-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--coral);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.zone-card .zone-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.35;
  font-family: var(--font-display);
}

/* ── Contributor cards ── */
.contributor-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.contributor-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-surface2);
  border: 2px solid var(--coral);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.contributor-info .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-heading);
}
.contributor-info .role {
  font-size: 0.8rem;
  color: var(--periwinkle-lt);
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.contributor-info p { font-size: 0.88rem; color: var(--color-muted); }

/* ── Divider ── */
hr.divider { border: none; border-top: 1px solid var(--color-border); margin: 2.5rem 0; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--navy);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.footer-inner { display: flex; flex-direction: column; gap: 0.4rem; align-items: center; }
.footer-conf { font-size: 0.7rem; color: var(--periwinkle-lt); letter-spacing: 0.12em; text-transform: uppercase; }
.site-footer a { color: rgba(255,255,255,0.55); }
.site-footer a:hover { color: var(--coral); text-decoration: none; }

/* ── Placard pager ── */
.placard-pager {
  /* wrapper that holds all pages + nav */
}

.placard-pages {
  position: relative;
}

.placard-page {
  display: none;
  animation: fadeSlide 0.3s ease;
}

.placard-page.active {
  display: block;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.placard-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.placard-page-nav .page-indicator {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  white-space: nowrap;
}

.placard-page-nav .page-dots {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.placard-page-nav .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s, transform 0.18s;
}

.placard-page-nav .dot.active {
  background: var(--coral);
  transform: scale(1.3);
}

.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.82rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface2);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
  font-family: var(--font-body);
}

.pager-btn:hover:not(:disabled) {
  border-color: var(--coral);
  color: var(--coral);
}

.pager-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── Section title — centred variant ── */
.section-title-centred {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-heading);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, transparent, var(--coral), var(--periwinkle), transparent) 1;
}

/* ── Zone figure / image ── */
.zone-figure {
  margin: 0 0 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.zone-figure img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.zone-figure.tall img { height: 340px; }
.zone-figure.short img { height: 180px; }

.zone-figure figcaption {
  background: var(--color-surface2);
  padding: 0.55rem 1rem;
  font-size: 0.76rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--color-border);
}

.zone-figure figcaption a {
  color: var(--periwinkle);
  font-size: 0.72rem;
}

/* placeholder image slot */
.img-placeholder {
  width: 100%;
  height: 260px;
  background: var(--color-surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--color-muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 1rem;
}
.img-placeholder .img-icon { font-size: 2rem; opacity: 0.3; }
.img-placeholder code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--periwinkle);
  word-break: break-all;
  max-width: 90%;
  display: block;
  margin-top: 0.25rem;
}

/* ── Inline SVG illustration wrapper ── */
.svg-illustration {
  margin: 0 0 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.svg-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}

.svg-illustration figcaption {
  background: var(--color-surface2);
  padding: 0.55rem 1rem;
  font-size: 0.76rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

/* ── Zone main 2-column layout: video + placard side by side ── */
.zone-main-section {
  padding: 1.5rem 0 0;
}

.zone-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Video column */
.zone-video-col .video-block {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
}

/* Placard column: scrollable pager */
.zone-placard-col {
  min-width: 0; /* prevent grid blowout */
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .zone-two-col {
    grid-template-columns: 1fr;
  }
  /* On small screens video col comes first (natural order) */
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .contributor-card { flex-direction: column; }
  .zone-nav { flex-direction: column; }
  .zone-nav-btn { justify-content: center; }
  .interactive-wrapper { height: 400px; }
  .hero { padding: 3.5rem 0 2.75rem; }
  .placard-page-nav { flex-direction: column; align-items: flex-start; }
  .zone-figure img, .img-placeholder { height: 200px; }
}

/* ── Language block switching ──────────────────────────────────────────
   These rules MUST come last so they beat the specificity of
   .placard-page.active { display: block } defined above.
   EN shown by default; switching to JP adds class="lang-jp" on <body>.
   ────────────────────────────────────────────────────────────────── */
.placard-page .lang-jp,
.placard-page.active .lang-jp { display: none !important; }

.placard-page .lang-en,
.placard-page.active .lang-en { display: block !important; }

body.lang-jp .placard-page .lang-jp,
body.lang-jp .placard-page.active .lang-jp { display: block !important; }

body.lang-jp .placard-page .lang-en,
body.lang-jp .placard-page.active .lang-en { display: none !important; }
