/*
 * RAYN site styles. Values come from css/tokens.css (synced from Figma Variables).
 * Breakpoints: desktop > 1100px, tablet 701–1100px, mobile ≤ 700px.
 * No JavaScript: the menu uses :target, the photo strip and team cards open on hover or focus (tap).
 */

/* ---------- Base ---------- */
:root {
  --gutter: var(--layout-gutter-desktop);
  --header-h: var(--layout-header-desktop);
  --footer-h: 282px;
  --uc-size: 360px;
  --uc-gap: 16px;
  --uc-inset: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ja);
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--text-on-light-primary);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 400; }
/* 英語の部分と英語版のページ全体は欧文フォントにする（body の和文フォントより優先させる） */
[lang="en"], [lang="en"] body { font-family: var(--font-latin); }

.wrap {
  width: min(100% - var(--gutter) * 2, var(--layout-content-max));
  margin-inline: auto;
}

br.sp { display: none; }  /* line break for mobile only */
/* br.pc: line break for desktop and tablet only (hidden on mobile) */

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: var(--radius-card);
  background: var(--bg-dark);
  color: var(--text-primary);
}
.skip:focus { top: 16px; }

:focus-visible { outline: 2px solid var(--accent-default); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: calc(var(--header-h) + var(--layout-safe-area-top));
  padding-top: var(--layout-safe-area-top);
  background: color-mix(in srgb, var(--bg-light) 96%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-on-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand img { width: 147px; height: auto; }

.nav { display: flex; align-items: center; gap: 8px; }

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-card);
  font-size: var(--font-size-ui);
  line-height: 1.2;
  color: var(--text-on-light-secondary);
  transition: background-color .2s ease;
}
.nav-pill:hover { background: var(--border-on-light); }

.icon-button {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--text-on-light-primary);
}
.icon-button svg { width: 20px; height: 20px; fill: none; }

/* Language switch (JP / EN). The current page is underlined. */
.lang {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-left: 16px;
  font-family: var(--font-latin);
  font-size: var(--font-size-ui);
  line-height: 1.2;
}
.lang a { color: var(--text-on-light-secondary); }
.lang a:hover { color: var(--text-on-light-primary); }
.lang a[aria-current="page"] {
  color: var(--text-on-light-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Mobile menu (opened with #menu) */
.menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  flex-direction: column;
  gap: 24px;
  padding: var(--layout-safe-area-top) 0 32px;
  background: color-mix(in srgb, var(--bg-light) 96%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.menu:target { display: flex; }
.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--layout-header-mobile);
  padding: 0 var(--layout-gutter-mobile);
}
.menu-top .brand img { width: 118px; }
.menu-top .icon-button { display: inline-flex; }
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px var(--layout-gutter-mobile);
}
.menu-list .nav-pill { display: flex; width: 100%; }
.menu-lang { padding: 0 calc(var(--layout-gutter-mobile) + 12px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + var(--layout-safe-area-top) + 48px) 0 48px;
  overflow: hidden;
  background: var(--bg-light);
  text-align: center;
}

/* Moving gradient: a looping video rendered from Figma's "Moving gradient" shader
   (same parameters and 100px layer blur as the Figma hero). The still frame shows while it loads. */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg-light) url("../assets/hero-gradient-pc.jpg") center / cover no-repeat;
}
.hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy { position: relative; }

.eyebrow {
  margin-bottom: 28px;
  font-size: var(--font-size-label);
  line-height: 1.6;
  letter-spacing: .06em;
  color: var(--text-on-light-secondary);
}

.hero h1 {
  margin-bottom: 32px;
  font-size: var(--font-size-hero);
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-on-light-primary);
  word-break: keep-all;  /* 1行に入らない幅では「宇宙のAIを」の後（<wbr> の位置）でだけ折り返す */
}

.lead {
  font-size: var(--font-size-lead);
  line-height: 1.67;
  color: var(--text-on-light-secondary);
}

/* ---------- Technology ---------- */
.technology {
  padding: 160px 0;
  background: var(--bg-dark);
  color: var(--text-primary);
}

.technology h2,
.intro h2 {
  font-size: var(--font-size-heading-1);
  line-height: 1.4;
  color: var(--text-primary);
}

/* Photo strip */
.uc-viewport {
  margin-top: 48px;
  overflow: hidden;
}

.uc-track {
  display: flex;
  gap: var(--uc-gap);
  width: max-content;
  animation: uc-loop 24s linear infinite;
}

@keyframes uc-loop {
  to { transform: translateX(calc(-50% - var(--uc-gap) / 2)); }
}

.uc {
  position: relative;
  flex: 0 0 var(--uc-size);
  height: var(--uc-size);
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--bg-page);
  cursor: pointer;
}
.uc img { width: 100%; height: 100%; object-fit: cover; }
.uc::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to bottom, rgba(9, 13, 18, 0), rgba(9, 13, 18, .85));
  pointer-events: none;
}

.uc-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bg-hero);
  opacity: 0;
  transition: opacity .3s ease;
}

.uc-body {
  position: absolute;
  top: 80px;
  left: var(--uc-inset);
  right: var(--uc-inset);
  z-index: 2;
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity .3s ease;
}

.uc-title {
  position: absolute;
  left: var(--uc-inset);
  right: calc(var(--uc-inset) + 48px);
  bottom: var(--uc-inset);
  z-index: 2;
  font-size: var(--font-size-heading-4);
  line-height: 1.2;
  color: var(--text-primary);
}

.uc-badge,
.member-badge {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 50%;
  transition: transform .3s ease;
}
.uc-badge::before, .uc-badge::after,
.member-badge::before, .member-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 1px;
}
.uc-badge::after, .member-badge::after { transform: rotate(90deg); }

.uc-badge {
  right: var(--uc-inset);
  bottom: var(--uc-inset);
  width: 36px;
  height: 36px;
  background: var(--text-primary);
}
.uc-badge::before, .uc-badge::after { background: var(--bg-hero); }

.uc:hover .uc-shade, .uc:focus .uc-shade { opacity: .86; }
.uc:hover .uc-body, .uc:focus .uc-body { opacity: 1; }
.uc:hover .uc-badge, .uc:focus .uc-badge { transform: rotate(45deg); }
.uc:focus { outline: none; }
.uc:focus-visible { outline: 2px solid var(--accent-default); outline-offset: -2px; }

.photo-note span { display: inline-block; }
.photo-note {
  margin-top: 24px;
  font-size: var(--font-size-ui);
  line-height: 1.7;
  color: var(--text-secondary);
  opacity: .6;
}

.divider {
  margin-top: 120px;
  margin-bottom: 120px;
  border: 0;
  border-top: 1px solid var(--border-default);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(0, 456px);
  justify-content: space-between;
  gap: 72px;
}
.intro p {
  font-size: var(--font-size-body-lg);
  line-height: 1.9;
  color: var(--text-secondary);
}

/* ---------- About (team) ---------- */
.about {
  padding: 160px 0;
  background: var(--bg-light);
}

/* 見出しの下にメンバーを3人並べる */
.about-layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
}

.about h2 {
  font-size: var(--font-size-heading-1);
  line-height: 1.4;
}

.team { display: flex; gap: 32px; align-items: flex-start; }

.member {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 288px;
  cursor: pointer;
}
.member:focus { outline: none; }
.member:focus-visible .member-photo { outline: 2px solid var(--accent-default); outline-offset: 3px; }

.member-photo {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-media);
}
.member-photo img { width: 100%; height: 100%; object-fit: cover; }

.member-fade {
  position: absolute;
  inset: 0;
  background: var(--bg-light);
  opacity: 0;
  transition: opacity .3s ease;
}

.member-bio {
  position: absolute;
  inset: 20px;
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--text-on-light-primary);
  opacity: 0;
  transition: opacity .3s ease;
}

.member-badge {
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  background: rgba(9, 13, 18, .85);
}
.member-badge::before, .member-badge::after { width: 14px; margin-left: -7px; background: var(--text-primary); }

.member:hover .member-fade, .member:focus .member-fade { opacity: .88; }
.member:hover .member-bio, .member:focus .member-bio { opacity: 1; }
.member:hover .member-badge, .member:focus .member-badge { transform: rotate(45deg); }

.member-name { display: flex; flex-direction: column; gap: 4px; }
.member-name h3 {
  font-size: var(--font-size-heading-4);
  line-height: 1.2;
  color: var(--text-on-light-primary);
}
.member-role {
  font-size: var(--font-size-ui);
  line-height: 1.2;
  color: var(--text-on-light-secondary);
}

/* ---------- News ---------- */
.news {
  padding-bottom: 160px;
  background: var(--bg-light);
}

.news-rule,
.footer-rule {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border-on-light);
}

.news-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 44px;
  margin-top: 80px;
}

.news h2 {
  font-size: var(--font-size-heading-2);
  line-height: 1.2;
}

.news-list { width: min(816px, 100%); }
.news-list li {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-on-light);
}
.news-list time {
  flex: 0 0 200px;
  font-family: var(--font-latin);
  font-size: var(--font-size-ui);
  line-height: 1.2;
  color: var(--text-on-light-secondary);
}
.news-list p {
  font-size: var(--font-size-body);
  line-height: 1.6;
}

/* ---------- Contact & company ---------- */
.contact {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--footer-h));
  min-height: calc(100svh - var(--footer-h));
  padding: calc(var(--header-h) + 64px) 0 64px;
  background: var(--bg-dark);
  color: var(--text-primary);
}

.contact-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 96px;
}

.contact-copy { width: 560px; }

.contact-copy h2 {
  margin-bottom: 20px;
  font-size: var(--font-size-heading-1);
  line-height: 1.3;
}

.contact-copy p {
  margin-bottom: 36px;
  font-size: var(--font-size-body-lg);
  line-height: 1.7;
  color: var(--text-secondary);
}

.cta-mail {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 6px 6px 6px 28px;
  border: 1px solid var(--border-on-light);
  border-radius: var(--radius-pill);
  background: var(--bg-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.cta-address {
  font-family: var(--font-latin);
  font-size: var(--font-size-ui);
  color: var(--text-on-light-secondary);
}

.cta-button {
  display: inline-grid;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  background: var(--accent-default);
  font-size: var(--font-size-button);
  line-height: 1.2;
  color: var(--text-on-accent);
  transition: background-color .2s ease;
}
.cta-label, .cta-label-hover { grid-area: 1 / 1; text-align: center; transition: opacity .2s ease; }
.cta-label-hover { opacity: 0; }
.cta-mail:hover .cta-button, .cta-mail:focus-visible .cta-button { background: var(--accent-hover); }
.cta-mail:hover .cta-label, .cta-mail:focus-visible .cta-label { opacity: 0; }
.cta-mail:hover .cta-label-hover, .cta-mail:focus-visible .cta-label-hover { opacity: 1; }

.company { width: 592px; }

.company-title {
  margin-bottom: 16px;
  font-size: var(--font-size-ui);
  line-height: 1.2;
  color: var(--text-secondary);
}

.company-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--border-default);
}
.company-row:last-child { border-bottom: 1px solid var(--border-default); }
.company-row dt {
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--text-secondary);
}
.company-row dd {
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--text-primary);
}

/* ---------- Footer ---------- */
.site-footer {
  min-height: var(--footer-h);
  padding: 48px 0 40px;
  background: var(--bg-light);
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 96px;
  margin-bottom: 32px;
}

.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand .brand img { width: 107px; }
.footer-brand p,
.footer-menu a,
.footer-contact a {
  font-size: var(--font-size-ui);
  line-height: 1.2;
  color: var(--text-on-light-secondary);
}

.footer-columns { display: flex; gap: 96px; }
.footer-menu, .footer-contact { display: flex; flex-direction: column; gap: 12px; }
.footer-head {
  font-family: var(--font-latin);
  font-size: var(--font-size-ui);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-on-light-primary);
}
.footer-menu a:hover, .footer-contact a:hover { color: var(--text-on-light-primary); }

.copyright {
  display: block;
  margin-top: 32px;
  font-size: var(--font-size-label);
  line-height: 1.2;
  color: var(--text-on-light-secondary);
}

/* ---------- Tablet (701–1100px) ---------- */
@media (max-width: 1100px) {
  :root {
    --gutter: var(--layout-gutter-tablet);
  }
  .hero h1 { font-size: 64px; }
  .lead { font-size: 20px; }
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .team { flex-wrap: wrap; gap: 32px 24px; }  /* 3人が横に入らない幅では2人＋1人に折り返す */
  .news-row { flex-direction: column; gap: 32px; }
  .news-list { width: 100%; }
  .contact-layout { flex-direction: column; gap: 64px; }
  .contact-copy, .company { width: 100%; }
  .contact { min-height: 0; }
  .site-footer { min-height: 0; }
}

/* ---------- Mobile (≤ 700px) ---------- */
@media (max-width: 700px) {
  :root {
    --gutter: var(--layout-gutter-mobile);
    --header-h: var(--layout-header-mobile);
    --uc-size: 260px;
    --uc-gap: 12px;
    --uc-inset: 20px;
  }

  br.sp { display: inline; }
  br.pc { display: none; }

  .hero-bg { background-image: url("../assets/hero-gradient-sp.jpg"); }

  .brand img { width: 118px; }
  .nav-wide { display: none; }
  .nav .lang { display: none; }
  .icon-button { display: inline-flex; }

  .hero { padding: calc(var(--header-h) + var(--layout-safe-area-top) + 24px) 0 24px; }
  .eyebrow { margin-bottom: 20px; }
  .hero h1 { margin-bottom: 24px; font-size: var(--font-size-hero); }
  .lead { font-size: var(--font-size-lead); }

  .technology { padding: 96px 0; }
  .uc-viewport { margin-top: 28px; }
  .uc-body { top: 72px; }
  .uc-title { right: calc(var(--uc-inset) + 40px); }
  .uc-badge { width: 32px; height: 32px; }

  .photo-note { margin-top: 20px; }
  .photo-note span { display: block; }
  .photo-note .sep { display: none; }

  .divider { margin-top: 72px; margin-bottom: 72px; }
  .intro { gap: 20px; }
  .intro p { line-height: 1.9; }

  .about { padding: 96px 0; }
  .about-layout { gap: 28px; }
  .team { flex-direction: column; gap: 16px; width: 100%; }
  .member { flex-direction: row; align-items: center; gap: 16px; width: 100%; }
  .member-photo { flex: 0 0 140px; width: 140px; }
  .member-bio { inset: 20px; }
  .member-badge { right: 8px; bottom: 8px; width: 28px; height: 28px; }
  .member-badge::before, .member-badge::after { width: 12px; margin-left: -6px; }
  .member:focus { flex-direction: column; align-items: stretch; gap: 12px; }
  .member:focus .member-photo { flex-basis: auto; width: 100%; }

  .news { padding-bottom: 96px; }
  .news-row { margin-top: 40px; gap: 28px; }
  .news-list li { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 0; }
  .news-list time { flex: none; }

  .contact { padding: 96px 0 62px; }
  .contact-layout { gap: 64px; }
  .contact-copy h2 { margin-bottom: 20px; }
  .contact-copy p { font-size: var(--font-size-body-lg); }
  .cta-mail { gap: 14px; padding: 6px 6px 6px 20px; }
  .cta-button { padding: 12px 20px; }
  .company-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }

  .site-footer { padding: 32px 0; }
  .footer-top { flex-direction: column; gap: 24px; margin-bottom: 24px; }
  .footer-menu { display: none; }
  .copyright { margin-top: 24px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-video { display: none; }
  .uc-track { animation: none; }
  .uc-viewport { overflow-x: auto; }
  .uc-copy { display: none; }
}
