:root {
  --ink: #1A1A19;
  --ink-2: #4A4A47;
  --ink-3: #7A7A75;
  --ink-4: #9A9A94;
  --rule: #E6E6E2;
  --neon: #EBFF00;
  --paper: #FFFFFF;
  --en: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  /* 和欧混植: Latin and digits in Helvetica, kana and kanji fall back to Yu Gothic */
  --jp: 'Helvetica Neue', Helvetica, Arial, 'YuGothic', 'Yu Gothic', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  --gutter: clamp(20px, 4.5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* no overflow-x here: it makes the page its own scroll container and kills position: sticky on the nav.
   Horizontal overflow is clipped where it happens instead (.hero-copy, .ticker-wrap, .frrm-side). */
body { max-width: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--jp);
  -webkit-font-smoothing: antialiased;
  line-height: 1.8;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 6px; }
.en { font-family: var(--en); }

/* the yellow marker behind a run of text: the same object as the "!" square in the logo */
.marker {
  background: linear-gradient(transparent 55%, var(--neon) 55%, var(--neon) 92%, transparent 92%);
  padding: 0 0.1em;
}
.bang {
  display: inline-block; line-height: 1; padding: 0 0.06em; margin-left: 0.02em;
  background: var(--neon); color: var(--ink);
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-logo img { height: 22px; width: auto; }
.nav-links { display: flex; gap: 36px; font-family: var(--en); font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.nav-toggle {
  display: none; width: 44px; height: 44px; margin: -10px -10px -10px 0;
  background: none; border: 0; padding: 10px; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); }
.mobile-menu {
  position: sticky; top: 61px; z-index: 9;
  display: flex; flex-direction: column; gap: 0;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  font-family: var(--en); font-size: 20px; font-weight: 700;
}
.mobile-menu a { padding: 16px var(--gutter); border-top: 1px solid var(--rule); }
.mobile-menu[hidden] { display: none; }

/* hero */
.hero { padding: 72px var(--gutter) 80px; display: flex; flex-direction: column; gap: 48px; }
.hero-logo { margin: 0; position: relative; }
.hero-logo img { width: 100%; height: auto; }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: end; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; overflow: hidden; }
.jp-head {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 30px); font-weight: 700; line-height: 1.5; letter-spacing: -0.01em;
  /* the house 90% condensed setting: scale from the left, and widen the box so the result fills 100% */
  width: 111.11%; transform: scale(0.9, 1); transform-origin: left center;
  text-align: justify; text-justify: inter-character;
  word-break: keep-all; overflow-wrap: anywhere; /* breaks only at the <wbr> marks, so 研究 and チーム never split; anywhere is the safety net */
}
.hero-en { margin: 0; font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.clocks { display: flex; gap: 48px; justify-content: flex-end; align-items: flex-end; }
.clock { display: flex; flex-direction: column; gap: 6px; }
.clock-label { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.clock-time { font-size: 40px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.clock-sep { width: 1px; height: 56px; background: var(--rule); }

/* the one trick: press the logo and the whole page goes neon. press again to come back */
.hero-logo > img { position: relative; z-index: 1; pointer-events: none; } /* clicks fall through to FRRM below; the ! has its own button */
/* the "!" is the button: an invisible hit area exactly over the neon square (right 9.13% of the wordmark) */
.tadah-trigger { position: absolute; top: 0; bottom: 0; left: 90.87%; width: 9.13%; padding: 0; border: 0; background: none; cursor: pointer; z-index: 2; }
/* FRRM peeks up through the hole of the D now and then. the box is the counter of the D, so the letter itself hides the rest */
.frrm-peek { position: absolute; left: 38.654%; top: 21.808%; width: 10.368%; height: 56.093%; overflow: hidden; z-index: 0; }
.frrm-peek-link { position: absolute; inset: 0; display: block; cursor: pointer; }
.hero-logo .frrm-peek img { position: absolute; bottom: 0; left: -60%; width: 220%; max-width: none; height: auto; transform: translateY(100%); animation: peek 9s ease-in-out 2s infinite; }
.frrm-peek-link:hover img, .frrm-peek-link:focus-visible img { animation: none; transform: translateY(0); transition: transform .25s ease-out; }
@keyframes peek { 0%, 74% { transform: translateY(100%); } 79%, 91% { transform: translateY(0); } 96%, 100% { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .hero-logo .frrm-peek img { animation: none; transform: translateY(30%); } }
/* and once you scroll down to Products, FRRM leans in from the right edge of the screen for a moment */
.frrm-side { position: fixed; right: 0; max-width: 100vw; top: 60vh; width: min(80vw, 260px); aspect-ratio: 895 / 264; z-index: 40; pointer-events: none;
  transform-origin: 100% 100%; transform: rotate(-90deg) translateY(110%); transition: transform .45s cubic-bezier(.2,1.2,.3,1); }
.frrm-side img { display: block; width: 100%; height: auto; }
.frrm-side.on { transform: rotate(-90deg) translateY(4%); transition-duration: .55s; }
@media (prefers-reduced-motion: reduce) { .frrm-side { display: none; } }
.tadah-trigger:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
html.tadah { --paper: #EBFF00; --neon: #FFFFFF; }
html.tadah .member img { mix-blend-mode: darken; }
body, .nav { transition: background-color .35s ease; }

/* sections */
.section { padding: 88px var(--gutter); border-top: 1px solid var(--rule); }
.section-title {
  margin: 0 0 48px; display: flex; align-items: baseline; gap: 20px;
  font-size: 64px; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
}
.section-sub { font-family: var(--jp); font-size: 16px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }

/* about */
.about { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; }
.about-jp { margin: 0; font-size: 20px; line-height: 1.9; max-width: 30em; }
.about-en { margin: 0; font-size: 18px; line-height: 1.7; color: var(--ink-2); max-width: 34em; }

/* work */
.piece { display: flex; flex-direction: column; gap: 28px; }
.piece .video { width: 100%; }
.piece-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 64px; align-items: start; }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.piece-title { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; grid-column: 1 / -1; }
.piece-client { font-size: 14px; color: var(--ink-3); }
.piece-client { grid-column: 1 / -1; }
.piece-desc { margin: 4px 0 0; font-size: 16px; line-height: 1.9; }
.piece-desc.en { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.piece-credit { font-size: 13px; color: var(--ink-3); margin-top: 4px; grid-column: 1 / -1; }
.piece-links { display: flex; gap: 12px 32px; flex-wrap: wrap; grid-column: 1 / -1; }
.piece-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; width: max-content; margin-top: 4px; }

/* team */
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.member { display: flex; flex-direction: column; gap: 6px; }
.member img { margin-bottom: 12px; }
.member-name { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.member-en { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.member-role { font-size: 13px; color: var(--ink-3); line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; min-height: calc(1.5em * 3 + 2px); } /* room for a two-line role, so the bios line up across the four */
.member-bio { margin-top: 18px; font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.member-bio summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--ink); width: max-content; }
.member-bio summary::-webkit-details-marker { display: none; }
.member-bio summary::after { content: ' +'; }
.member-bio[open] summary::after { content: ' −'; }
.member-bio p { margin: 8px 0 0; }
.member-bio .bio-en { margin-top: 12px; font-size: 13px; line-height: 1.7; }
.role-en { display: block; margin-top: 2px; }

/* products */
.product { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: start; }
.product-visual { display: block; }
.product-body { display: flex; flex-direction: column; gap: 14px; max-width: 40em; }
.product-name { margin: 0; font-size: 44px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.product-tagline { margin: 0; font-size: 24px; font-weight: 700; }
.product-desc { margin: 0; font-size: 16px; line-height: 1.9; }
.product-desc-en { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.product-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; width: max-content; margin-top: 6px; }

/* clients */
.clients { padding-left: 0; padding-right: 0; }
.clients .section-title, .client-list { padding: 0 var(--gutter); }
.ticker-wrap { overflow: hidden; width: 100%; }
.ticker {
  display: flex; gap: 72px; width: max-content; white-space: nowrap;
  font-size: 56px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  animation: slide 30s linear infinite;
}
.ticker .dot { color: var(--neon); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
@keyframes slide { to { transform: translateX(-50%); } }
.client-list { list-style: none; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14px; color: var(--ink-3); line-height: 1.8; }
.client-list .en { margin-left: 0.5em; }
.client-list a.marker { color: var(--ink); font-weight: 700; }

/* contact */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: end; }
.contact-cta { display: flex; flex-direction: column; gap: 28px; }
.say-hello { font-size: clamp(72px, 9vw, 132px); font-weight: 700; letter-spacing: -0.045em; line-height: 0.9; }
.contact-link { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; width: max-content; }
.info { margin: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px 24px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.info dt { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); padding-top: 4px; }
.info dd { margin: 0; }

/* say hello: one chat line, not a form (Netlify Forms underneath) */
.chat { display: flex; flex-direction: column; gap: 14px; max-width: 34em; }
.chat .hp { position: absolute; left: -9999px; }
.chat-row { display: flex; align-items: flex-end; gap: 10px; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 6px 6px 20px; background: var(--paper); }
.chat-row:focus-within { box-shadow: 0 0 0 4px var(--neon); }
.chat-input {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 17px; line-height: 1.5; color: var(--ink); padding: 8px 0; max-height: 9em; overflow-y: auto;
}
.chat-input::placeholder { color: var(--ink-4); }
.chat-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--neon); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chat-send:hover { background: var(--ink); color: var(--neon); }
.chat-mail { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--ink-3); }
.chat-mail input { font: inherit; font-size: 15px; color: var(--ink); border: 0; border-bottom: 1px solid var(--ink-3); background: transparent; outline: none; padding: 6px 0; width: 100%; max-width: 20em; }
.chat-mail input:focus { border-bottom-color: var(--ink); }
.chat-note { margin: 0; font-size: 13px; line-height: 1.8; color: var(--ink-3); }
.chat-intro { font-size: 15px; color: var(--ink-2); }
.chat-intro + .chat-row, .chat-note.chat-intro.en + .chat-row { margin-top: 10px; }
.chat-note a { text-decoration: underline; text-underline-offset: 4px; }

/* footer */
.footer { display: flex; justify-content: space-between; padding: 24px var(--gutter) 40px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); }

/* motion */
@media (prefers-reduced-motion: reduce) { .ticker { animation: none; } html { scroll-behavior: auto; } }

/* phone */
@media (max-width: 720px) {
  .nav { padding: 16px 20px; }
  .nav-logo img { height: 20px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .hero { padding: 36px 20px 40px; gap: 28px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-en { font-size: 15px; }
  .clocks { justify-content: flex-start; gap: 28px; }
  .clock-time { font-size: 32px; }
  .clock-sep { height: 40px; }
  .section { padding: 40px 20px; }
  .section-title { font-size: 40px; margin-bottom: 24px; gap: 4px; flex-direction: column; align-items: flex-start; }
  .section-sub { font-size: 13px; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .about-jp { font-size: 16px; }
  .about-en { font-size: 14px; }
  .piece { gap: 16px; }
  .piece-meta { grid-template-columns: 1fr; gap: 8px; }
  .piece-title { font-size: 20px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .member-name { font-size: 17px; }
  .member-en { font-size: 13px; }
  .member-role { font-size: 12px; min-height: 0; }
  .member-bio { font-size: 13px; }
  .product { grid-template-columns: 1fr; gap: 24px; }
  .product-visual { max-width: 200px; }
  .product-name { font-size: 36px; }
  .product-tagline { font-size: 20px; }
  .product-desc { font-size: 15px; }
  .ticker { font-size: 32px; gap: 40px; }
  .client-list { margin-top: 24px; flex-direction: column; gap: 4px; font-size: 13px; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .contact-link { font-size: 16px; }
  .info { grid-template-columns: 1fr; gap: 14px; font-size: 13px; }
  .info dt { padding-top: 0; margin-bottom: -10px; }
  .footer { padding: 20px 20px 32px; font-size: 12px; }
}
