/* Layout: a cell-biology lab notebook in Ando's brand colors: white ground, black type, wordmark red (#D7381E) for accents.
   One bold element: a live "microscope field" in the hero showing red T cells leaving a white iPSC colony. Everything else is quiet and left-aligned. */
:root {
  --paper: #FFFFFF;      /* brand white */
  --wash: #F5F3F2;       /* warm light grey panel, faint red bias */
  --ink: #000000;        /* brand black */
  --ink-soft: #5A5452;   /* warm grey for secondary text */
  --line: #E6E1DF;
  --accent: #D7381E;     /* wordmark red: buttons, bars, marks */
  --accent-ink: #B8301A; /* deeper red for small text and links */
  --on-accent: #FFFFFF;
  --field-surround: #000000;
  color-scheme: light;   /* single light look for every viewer */

  --display: "Hanken Grotesk", "Zen Kaku Gothic New", "Atkinson Hyperlegible", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 3.6vw, 2.75rem);
  --step-4: clamp(2.2rem, 4.9vw, 3.9rem);

  --col-gap: clamp(24px, 3vw, 40px);   /* shared column gap: hero, paragraph columns, pillars */
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: var(--step-0); line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.06; margin: 0; text-wrap: balance; letter-spacing: -0.025em; }
p { margin: 0; max-width: 62ch; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.band { padding-block: clamp(64px, 9vw, 120px); }
.band + .band { border-top: 1px solid var(--line); }
.band.wash { background: var(--wash); border-top: 0; }
.band.tight { padding-block: clamp(43px, 6vw, 80px); }   /* two thirds of the standard band padding */
.band.wash + .band { border-top: 0; }

/* Marks content still waiting on the client */
.ph { display: inline-block; font: 700 0.75rem/1.5 var(--body); letter-spacing: 0; color: var(--ink-soft); border: 1px dashed var(--ink-soft); padding: 1px 8px; border-radius: 2px; vertical-align: 0.15em; margin-right: 6px; }

/* Draft note */
.note { background: var(--ink); color: var(--paper); font-size: var(--step--1); }
.note .wrap { padding-block: 8px; }

/* Header */
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 22px; flex-wrap: wrap; }
.mark { display: block; line-height: 0; }
.mark img { display: block; height: 69px; width: auto; }   /* 1.5x the original 46px */
@media (max-width: 480px) { .mark img { height: 57px; } }   /* 1.5x the original 38px */
.nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: var(--step--1); }
.nav a:hover { color: var(--accent-ink); }
@media (max-width: 860px) { .nav a { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
  font: 700 var(--step--1)/1 var(--body); text-decoration: none; border-radius: 2px;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }

/* Language toggle */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; }
.lang button { font: 700 var(--step--1)/1 var(--body); padding: 11px 12px; background: transparent; color: var(--ink-soft); border: 0; border-radius: 1px; cursor: pointer; }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 5vw, 72px) var(--col-gap); align-items: center; padding-block: clamp(32px, 6vw, 80px) clamp(64px, 8vw, 112px); }
.hero.tight .wrap { padding-block: clamp(21px, 4vw, 53px) clamp(43px, 5.33vw, 75px); }   /* two thirds of the hero padding */
.hero h1 { font-size: var(--step-4); line-height: 1; }
.hero .lede { font-size: var(--step-1); color: var(--ink-soft); margin-top: 28px; max-width: 36ch; line-height: 1.5; }
.hero .lede + .lede { margin-top: 16px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }
.scope { margin: 0; justify-self: end; width: 100%; max-width: 500px; }
.scope-ring { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 50%; background: var(--field-surround); padding: 14px; }
.scope canvas { display: block; width: 100%; height: 100%; border-radius: 50%; background: #0A0605; transition: filter 1.8s ease-out; }
.scope canvas.unfocused { filter: blur(8px); }
.scalebar { position: absolute; right: 22%; bottom: 17%; display: grid; justify-items: center; gap: 4px; color: #fff; font-size: 0.75rem; text-shadow: 0 1px 2px rgba(0,8,16,.6); pointer-events: none; }
.scalebar span:first-child { display: block; width: 62px; height: 3px; background: #fff; box-shadow: 0 1px 2px rgba(0,8,16,.5); }
.scope figcaption { margin: 16px auto 0; font-size: var(--step--1); color: var(--ink-soft); max-width: 42ch; text-align: center; text-wrap: balance; }
.scope figcaption strong { color: var(--ink); font-weight: 700; }
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .scope { justify-self: start; max-width: 420px; }
}

/* Section heads: left column title, right column content */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split > * { min-width: 0; }
.split h2, .band > .wrap > h2 { font-size: var(--step-3); }
.intro { margin-top: 20px; color: var(--ink-soft); }
.intro + .intro { margin-top: 16px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Client copy paragraphs (alt page) */
.prose { display: grid; gap: 1em; }
.prose p { font-size: var(--step-0); }   /* body size; inherits the body line height */
/* Two paragraph columns that line up with the four pillars below (same gap, so each spans two) */
.prose-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); margin-top: 28px; }
.prose-cols p { max-width: none; }
@media (max-width: 760px) { .prose-cols { grid-template-columns: 1fr; } }

/* Platform schematic figures (alt page), cropped from Ando's slide (transparent background) */
.hero .hero-body { margin-top: 18px; color: var(--ink-soft); max-width: 52ch; }
.hero .hero-body + .hero-body { margin-top: 12px; }
.rejt { margin: 0; justify-self: center; width: min(100%, 360px); text-align: center; }   /* box = image width, centred in its column */
.rejt img { display: block; width: 100%; height: auto; }
.rejt figcaption { margin-top: 8px; font-family: var(--display); font-weight: 600; font-size: var(--step-1); letter-spacing: -0.015em; }
.supply { display: block; color: var(--accent); font-family: var(--display); font-weight: 600; }
.rejt .supply { font-size: var(--step-0); margin-top: 2px; }
/* Once the hero stacks, hide its figure: the same cluster ends the process row just below */
@media (max-width: 760px) {
  .rejt { display: none; }
  .hero.tight .wrap .lede, .hero.tight .wrap .hero-body { max-width: none; }   /* full width once alone; specific enough to beat the Japanese measure rule */
}

/* Animated hero figure (reference/animated-hero only). At rest it matches the slide; motion only if the visitor allows it. */
.rejt-anim { width: min(100%, 400px); }
.rejt-anim svg { display: block; width: 100%; height: auto; overflow: visible; }
.rejt-anim .bud { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .rejt-anim .breathe { transform-box: fill-box; transform-origin: center; animation: rejt-breathe 6s ease-in-out infinite; }
  .rejt-anim .bob1 { animation: rejt-bob 5s ease-in-out infinite; }
  .rejt-anim .bob2 { animation: rejt-bob 5s ease-in-out -2.5s infinite; }
  .rejt-anim .bud { transform-box: fill-box; transform-origin: center; animation: rejt-bud 9s cubic-bezier(.3, .6, .4, 1) infinite; }
}
@keyframes rejt-breathe { 50% { transform: scale(1.018); } }
@keyframes rejt-bob { 50% { transform: translate(2px, -4px); } }
@keyframes rejt-bud {
  0%   { opacity: 0; transform: translate(0, 0) scale(.5); }
  20%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

.flow { --icon-h: clamp(110px, 12vw, 150px); list-style: none; margin: 64px 0 0; padding: 0; display: grid; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.2fr); }
.flow .stage { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; text-align: center; min-width: 0; }   /* track = column width, so a long name can't push the image sideways */
.flow .stage img { display: block; height: var(--icon-h); width: auto; max-width: 100%; object-fit: contain; }
.flow .name { font-family: var(--display); font-weight: 600; font-size: var(--step-0); line-height: 1.25; text-wrap: balance; }
.flow .supply { font-size: var(--step--1); margin-top: -6px; }
/* Labels get a fixed two-line slot, bottom-aligned, so every arrow sits at the same height (centred on the icons) */
.flow .link { display: grid; grid-template-rows: 2.6em auto; align-items: end; justify-items: center; gap: 10px; padding-top: max(0px, calc(var(--icon-h) / 2 - 2.6em - 11px)); color: var(--ink-soft); font-size: var(--step--1); line-height: 1.3; text-align: center; text-wrap: balance; min-width: 0; }
.arrow { position: relative; display: block; width: 80%; height: 2px; background: color-mix(in srgb, var(--ink-soft) 70%, var(--paper)); }
.arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border-left: 10px solid color-mix(in srgb, var(--ink-soft) 70%, var(--paper)); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
/* Below desktop width (phones included): the row keeps its desktop layout and scrolls sideways inside a strip.
   The strip bleeds into the right gutter; flow-scroll.js adds .more-left / .more-right so the hidden edge fades. */
.flow-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* Arrow buttons that show which way there is more to see; centred on the icon row (64px row margin + half the icon height) */
.flow-wrap { position: relative; }
.flow-nudge { position: absolute; z-index: 1; top: calc(64px + 55px - 20px); width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 14%, transparent); }
.flow-nudge[hidden] { display: none; }
.flow-nudge.prev { left: -6px; }
.flow-nudge.next { right: calc(-1 * var(--gutter-r) + 8px); }
.flow-nudge:hover { color: var(--accent); }
.flow-nudge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 960px) {
  .flow-scroll { --fade: 36px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    margin-right: calc(-1 * var(--gutter-r)); padding-right: var(--gutter-r); padding-bottom: 14px;
    scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink-soft) 45%, var(--wash)) transparent; }
  .flow-scroll .flow { min-width: 820px; --icon-h: 110px; }   /* scroll only when a real part of the row is hidden */
  .flow-scroll .stage { scroll-snap-align: start; }
  .flow-scroll.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); }
  .flow-scroll.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent); }
  .flow-scroll.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); }
}


.pillars { list-style: none; margin: 80px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--col-gap); }
.pillars li { border-top: 3px solid var(--accent); padding-top: 20px; min-width: 0; }
.pillars h3 { font-size: var(--step-1); letter-spacing: -0.015em; }
.pillars p { margin-top: 10px; color: var(--ink-soft); }
@media (max-width: 960px) { .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; } }
@media (max-width: 520px) { .pillars { grid-template-columns: 1fr; } }

/* Technology: the rejT process is a real sequence, so it is numbered */
.steps { list-style: none; margin: 64px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.steps li { padding: 24px 24px 0 0; border-top: 2px solid var(--ink); min-width: 0; }
.steps li.renew { border-top-color: var(--accent); }
.steps .wk { display: block; font-size: var(--step--1); color: var(--accent-ink); font-weight: 700; margin-bottom: 12px; }
.steps h3 { font-size: var(--step-1); letter-spacing: -0.015em; }
.steps p { margin-top: 10px; color: var(--ink-soft); font-size: var(--step--1); }
@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr; }
  .steps li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: 20px; padding: 20px 0; }
  .steps .wk { grid-row: span 2; margin: 0; padding-top: 4px; }
}

/* Aims */
.aims { list-style: none; margin: 0; padding: 0; }
.aims li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 24px; padding-block: 24px; border-bottom: 1px solid var(--line); align-items: baseline; }
.aims li:first-child { border-top: 1px solid var(--line); }
.aims h3 { font-size: var(--step-2); }
.aims p { color: var(--ink-soft); }
@media (max-width: 560px) { .aims li { grid-template-columns: 1fr; gap: 6px; } }

/* Pipeline */
.pipe { overflow-x: auto; margin-top: 48px; }
.pipe-grid { min-width: 640px; }
.pipe-row { display: grid; grid-template-columns: minmax(9rem, 1.3fr) minmax(8rem, 1fr) repeat(4, minmax(0, 1fr)); align-items: center; padding-block: 20px; border-bottom: 1px solid var(--line); }
.pipe-row.head { padding-block: 0 12px; border-bottom: 2px solid var(--ink); font-size: var(--step--1); color: var(--ink-soft); }
.pipe-row b { font-family: var(--display); font-size: var(--step-1); font-weight: 600; letter-spacing: -0.015em; }
.pipe-row .area { font-size: var(--step--1); color: var(--ink-soft); }
.track { grid-column: 3 / -1; height: 14px; position: relative;
  background: linear-gradient(90deg, transparent calc(25% - 1px), var(--line) calc(25% - 1px) 25%, transparent 25% calc(50% - 1px), var(--line) calc(50% - 1px) 50%, transparent 50% calc(75% - 1px), var(--line) calc(75% - 1px) 75%, transparent 75%); }
.bar { position: absolute; inset: 0 auto 0 0; border-radius: 1px;
  background: var(--accent); }
.pipe-note { margin-top: 16px; font-size: var(--step--1); color: var(--ink-soft); }

/* Leadership */
.people { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.photo { aspect-ratio: 4 / 5; max-width: 100%; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-soft); font-size: var(--step--1); }
.people h3 { font-size: var(--step-1); margin-top: 20px; letter-spacing: -0.015em; }
.people .role { color: var(--accent-ink); font-weight: 700; font-size: var(--step--1); margin-top: 4px; }
.people .bio { color: var(--ink-soft); font-size: var(--step--1); margin-top: 12px; }
@media (max-width: 760px) { .people { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 480px) { .people { grid-template-columns: 1fr; } .photo { max-width: 280px; } }

/* Research and publications */
.records { list-style: none; margin: 0; padding: 0; }
.records li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 24px; padding-block: 18px; border-bottom: 1px solid var(--line); align-items: baseline; }
.records li:first-child { border-top: 1px solid var(--line); }
.records .kind { color: var(--ink-soft); font-size: var(--step--1); }
@media (max-width: 560px) { .records li { grid-template-columns: 1fr; gap: 4px; } }

/* Company profile (会社概要) */
.profile { margin: 0; }
.profile div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 24px; padding-block: 16px; border-bottom: 1px solid var(--line); align-items: baseline; }
.profile div:first-child { border-top: 1px solid var(--line); }
.profile dt { color: var(--ink-soft); font-size: var(--step--1); }
.profile dd { margin: 0; }
@media (max-width: 560px) { .profile div { grid-template-columns: 1fr; gap: 2px; } }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 24px; padding-block: 22px; border-bottom: 1px solid var(--line); align-items: baseline; }
.news li:first-child { border-top: 1px solid var(--line); }
.news .date { color: var(--ink-soft); font-size: var(--step--1); }
.news .headline { font-family: var(--display); font-weight: 500; font-size: var(--step-1); line-height: 1.3; }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; gap: 4px; } }

/* Footer / contact */
.site-foot { background: var(--ink); color: var(--paper); }
.site-foot .wrap { padding-block: 72px 40px; display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.site-foot.tight .wrap { padding-top: 48px; }   /* two thirds of the footer top padding */
.site-foot h2 { font-size: var(--step-3); color: var(--paper); }
.site-foot h3 { font-family: var(--body); font-weight: 700; font-size: var(--step--1); margin-bottom: 12px; color: var(--paper); letter-spacing: 0; }
.site-foot p, .site-foot li { font-size: var(--step--1); color: color-mix(in srgb, var(--paper) 78%, var(--ink)); }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-foot a { color: var(--paper); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .ph { color: color-mix(in srgb, var(--paper) 70%, var(--ink)); border-color: currentColor; }
.contact-card { margin-top: 28px; display: grid; gap: 2px; }
.contact-card .name { font-family: var(--display); font-weight: 600; font-size: var(--step-1); color: var(--paper); letter-spacing: -0.015em; }
.contact-card .email { margin-top: 14px; font-size: var(--step-0); color: var(--paper); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--paper) 40%, var(--ink)); }
.legal { grid-column: 1 / -1; border-top: 1px solid color-mix(in srgb, var(--paper) 20%, var(--ink)); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) { .site-foot .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .site-foot .wrap > :first-child { grid-column: 1 / -1; } }

/* Japanese: no negative tracking, taller lines, measure in em (CJK glyphs are ~2ch wide) */
:lang(ja) body { line-height: 1.62; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { letter-spacing: 0.01em; line-height: 1.35; word-break: auto-phrase; }
:lang(ja) .flow .name, :lang(ja) .flow .supply { word-break: auto-phrase; overflow-wrap: anywhere; }   /* phrase breaks, but a phrase wider than its column may still break */   /* break between phrases, not mid-word */
:lang(ja) .hero h1 { font-size: clamp(1.8rem, 3.7vw, 2.9rem); line-height: 1.22; }
:lang(ja) p { max-width: 36em; }
:lang(ja) .hero .lede { max-width: 26em; }
