/* GeneHack — corporate site
   Quiet, institutional: Mincho throughout, vertical setting, square edges, wide margins (余白).
   Shared family traits with the product sites: logo, the blue of the logo, the mail window (with its rabbit).
   System fonts only — no external requests. */

:root {
  --paper: #f5f6f4;
  --white: #fbfbfa;
  --ink: #1c2430;
  --mute: #5f6772;
  --ai: #2f4f73;          /* 藍 — deep blue from the logo */
  --steel: #4f7aa6;
  --line: #d5d9d8;
  --ok: #1d7a46;

  /* names used by the shared mail window */
  --card: var(--white);
  --soft: #eceeec;
  --acc: var(--ai);
  --field: #c6cccb;
  --btn-bg: var(--ink);
  --btn-fg: #ffffff;

  --mincho: "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", "Source Han Serif JP", serif;
  --serif-en: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", "Noto Serif CJK JP", Georgia, serif;
  --face: var(--mincho);
  color-scheme: light;
}
html[lang="en"] { --face: var(--serif-en); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--face);
  font-size: 1.02rem;
  line-height: 2.05;
  letter-spacing: 0.05em;
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { font-size: 1.08rem; line-height: 1.75; letter-spacing: 0.005em; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.3em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--ai); outline-offset: 4px; }
p { margin: 0; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; z-index: 50; background: var(--ink); color: #fff; padding: 0.3rem 0.9rem; text-decoration: none; }
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: clamp(1.4rem, 6vw, 3.5rem); }
.narrow { max-width: 760px; }

/* ── Header: centred, still ─────────────────────────────── */
.bar { padding-top: clamp(1.6rem, 4vw, 2.6rem); }
.bar-inner { display: grid; justify-items: center; gap: 1.4rem; position: relative; }
.brand { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.brand-mark { width: 50px; }
.brand-word { width: 168px; }
.nav { display: flex; gap: 2.6rem; font-size: 0.86rem; letter-spacing: 0.18em; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
html[lang="en"] .nav { letter-spacing: 0.04em; font-size: 0.92rem; }
.nav a { text-decoration: none; color: var(--mute); }
.nav a:hover { color: var(--ink); }
.lang { position: absolute; right: clamp(1.4rem, 6vw, 3.5rem); top: 0.5rem; display: flex; align-items: center; gap: 0.7rem; font-size: 0.8rem; letter-spacing: 0.08em; }
.lang a { color: var(--mute); text-decoration: none; }
.lang a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.lang span { width: 1px; height: 0.9em; background: var(--line); }

/* ── Buttons: square, quiet ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem;
  min-width: 12rem; padding: 0.85rem 1.9rem;
  border: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 0.92rem; letter-spacing: 0.14em;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
html[lang="en"] .btn { letter-spacing: 0.03em; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.pri { background: var(--ink); color: #fff; }
.btn.pri:hover { background: var(--ai); border-color: var(--ai); }
.ico { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(5rem, 11vw, 8.5rem); text-align: center; }
.hero-statement { display: flex; justify-content: center; align-items: flex-end; gap: clamp(1.2rem, 3vw, 2rem); }
.hero h1 { margin: 0; font-family: var(--face); font-weight: 500; }
html[lang="ja"] .hero h1 {
  writing-mode: vertical-rl;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.75;
  letter-spacing: 0.24em;
  white-space: nowrap;
  text-align: start;
}
html[lang="ja"] .hero h1 span { display: block; }
html[lang="ja"] .hero h1 span + span { padding-top: 2.4em; }
html[lang="en"] .hero-statement { flex-direction: column; align-items: center; gap: 2.4rem; padding-left: 0; }
html[lang="en"] .hero h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); line-height: 1.15; font-weight: 400; letter-spacing: -0.005em; }
html[lang="en"] .hero h1 span { display: block; }
html[lang="en"] .hero { padding-top: clamp(4.5rem, 10vw, 7.5rem); }
.hero-lead { max-width: 30em; margin: clamp(3rem, 6vw, 4.2rem) auto 0; color: var(--mute); }
html[lang="en"] .hero-lead { max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2.6rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero h1 span { animation: brush 1.6s cubic-bezier(0.6, 0, 0.2, 1) both; }
  .hero h1 span:nth-child(2) { animation-delay: 0.7s; }
  html[lang="ja"] .hero h1 span { --from: inset(0 0 100% 0); }
  html[lang="en"] .hero h1 span { --from: inset(0 100% 0 0); }
}
@keyframes brush { from { clip-path: var(--from); } to { clip-path: inset(0 0 0 0); } }

/* ── Sections ───────────────────────────────────────────── */
.section { padding-block: clamp(5rem, 12vw, 9rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-title {
  margin: 0 0 clamp(3rem, 6vw, 4.5rem); text-align: center;
  font-family: var(--face); font-weight: 500; font-size: 1.05rem; letter-spacing: 0.5em; color: var(--ai);
}
html[lang="ja"] .section-title { padding-left: 0.5em; } /* balance the trailing letter-spacing */
html[lang="en"] .section-title { letter-spacing: 0.12em; font-size: 1.1rem; }
.prose { color: var(--mute); max-width: 34em; }
html[lang="en"] .prose { max-width: 36em; }

/* Mission: Japanese set vertically, reading right to left */
.mission-text { display: flex; justify-content: center; }
.mission-text .belief { font-weight: 500; color: var(--ink); }
html[lang="ja"] .mission-text {
  display: block;
  writing-mode: vertical-rl;
  height: 22em;
}
html[lang="ja"] .mission-text .belief { font-size: clamp(1.45rem, 2.4vw, 1.85rem); line-height: 1.9; letter-spacing: 0.14em; margin-left: 1.6em; }
html[lang="ja"] .mission-text .prose { max-width: none; line-height: 2.3; letter-spacing: 0.1em; }
html[lang="ja"] .mission-wrap { display: flex; justify-content: center; }
html[lang="en"] .mission-text { flex-direction: column; align-items: center; text-align: center; gap: 1.8rem; }
html[lang="en"] .mission-text .belief { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.35; font-weight: 400; max-width: 22em; }

.principles { list-style: none; margin: clamp(4rem, 8vw, 6rem) auto 0; padding: 0; max-width: 880px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.principles li { padding: 0 1.8rem; text-align: center; }
.principles li + li { border-left: 1px solid var(--line); }
.principles h3 { margin: 0; font-family: var(--face); font-weight: 500; font-size: 1.5rem; letter-spacing: 0.3em; padding-left: 0.3em; }
html[lang="en"] .principles h3 { font-size: 1.3rem; letter-spacing: 0.02em; padding-left: 0; }
.principles p { margin-top: 0.9rem; color: var(--mute); font-size: 0.92rem; line-height: 1.95; }

/* Businesses */
.biz + .biz { margin-top: clamp(4.5rem, 9vw, 7rem); }
.biz-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--ink); }
.biz-head h3 { margin: 0; font-family: var(--serif-en); font-weight: 400; font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.1; letter-spacing: 0.01em; }
.biz-head p { color: var(--mute); font-size: 0.88rem; }
.biz-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2rem clamp(2.5rem, 6vw, 5rem); padding-top: 2.4rem; }
.biz-tagline { font-size: clamp(1.25rem, 2.1vw, 1.55rem); line-height: 1.75; font-weight: 500; letter-spacing: 0.08em; }
html[lang="en"] .biz-tagline { line-height: 1.35; font-weight: 400; letter-spacing: 0; }
.biz-main .prose { margin-top: 1.4rem; }
.biz-main .btn { margin-top: 2.4rem; }
.biz-note { margin-top: 1.6rem; font-size: 0.9rem; color: var(--ai); }

.facts { margin: 0; }
.facts div + div { margin-top: 1.8rem; }
.facts dt { font-size: 0.82rem; letter-spacing: 0.2em; color: var(--ai); padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 0.7rem; }
html[lang="en"] .facts dt { letter-spacing: 0.04em; }
.facts dd { margin: 0; font-size: 0.95rem; }
.facts ul { list-style: none; margin: 0; padding: 0; }
.facts li { position: relative; padding-left: 1.3em; line-height: 1.85; }
.facts li + li { margin-top: 0.25rem; }
.facts li::before { content: ""; position: absolute; left: 0.2em; top: 0.88em; width: 0.5em; height: 1px; background: var(--ai); }

/* Why us — one sentence, centred */
.why .belief-line { text-align: center; font-size: clamp(1.45rem, 2.8vw, 2.05rem); line-height: 1.75; font-weight: 500; letter-spacing: 0.1em; }
html[lang="en"] .why .belief-line { line-height: 1.35; font-weight: 400; letter-spacing: 0; }
.why .prose { margin: 2.2rem auto 0; text-align: center; }
html[lang="ja"] .why .prose { text-align: justify; text-align-last: center; }

/* Company — the classic 会社概要 table */
.company { margin: 0 auto; max-width: 760px; border-top: 1px solid var(--ink); }
.company div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1.5rem; padding-block: 1.3rem; border-bottom: 1px solid var(--line); }
.company dt { color: var(--mute); font-size: 0.9rem; letter-spacing: 0.2em; }
html[lang="en"] .company dt { letter-spacing: 0.02em; }
.company dd { margin: 0; }

/* Contact */
.contact { text-align: center; }
.contact .belief-line { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 500; letter-spacing: 0.12em; line-height: 1.7; }
html[lang="en"] .contact .belief-line { font-weight: 400; letter-spacing: 0; }
.contact .prose { margin: 1.6rem auto 0; }
.contact-actions { display: grid; justify-items: center; gap: 1.2rem; margin-top: 2.6rem; }
.contact-addr { color: var(--mute); font-size: 0.92rem; letter-spacing: 0.06em; user-select: all; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: clamp(3.5rem, 7vw, 5rem) 2.5rem; text-align: center; }
.foot-logo { width: 140px; margin-inline: auto; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 2.2rem; margin-top: 2.4rem; font-size: 0.84rem; letter-spacing: 0.08em; }
.foot-links a { color: var(--mute); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-copy { margin-top: 1.8rem; font-size: 0.76rem; color: var(--mute); letter-spacing: 0.1em; }

/* Legal / 404 */
.legal { padding-block: clamp(3.5rem, 8vw, 6rem); }
.legal .wrap { max-width: 780px; }
.legal h1 { margin: 0; font-family: var(--face); font-weight: 500; font-size: clamp(1.6rem, 3.2vw, 2.1rem); letter-spacing: 0.14em; line-height: 1.6; text-align: center; }
html[lang="en"] .legal h1 { letter-spacing: 0.01em; font-weight: 400; }
.legal .updated { text-align: center; color: var(--mute); font-size: 0.86rem; margin-top: 0.8rem; padding-bottom: 2.4rem; border-bottom: 1px solid var(--line); }
.legal h2 { margin: 2.8rem 0 0; font-size: 1.05rem; font-weight: 600; letter-spacing: 0.08em; }
html[lang="en"] .legal h2 { letter-spacing: 0; }
.legal p, .legal li { color: var(--mute); }
.legal p { margin-top: 0.8rem; }
.legal ul { margin: 0.8rem 0 0; padding-left: 1.2rem; }
.legal li + li { margin-top: 0.5rem; }
.legal b { color: var(--ink); font-weight: 600; }
.legal a { color: var(--ai); }
.legal-back { margin-top: 3.2rem !important; text-align: center; }

/* 404 — same voice as the hero, quieter */
.nf { padding-block: clamp(4.5rem, 11vw, 8rem) clamp(5rem, 12vw, 9rem); text-align: center; }
.nf-code { font-family: var(--serif-en); font-size: 0.95rem; letter-spacing: 0.4em; padding-left: 0.4em; color: var(--ai); }
.nf h1 { margin: 1.2rem 0 0; font-family: var(--face); font-weight: 500; font-size: clamp(1.7rem, 3.6vw, 2.4rem); line-height: 1.5; letter-spacing: 0.16em; }
html[lang="ja"] .nf h1 { padding-left: 0.16em; }
html[lang="en"] .nf h1 { font-weight: 400; letter-spacing: 0; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.2; }
.nf .prose { margin: 1.8rem auto 0; max-width: 30em; text-wrap: pretty; }
html[lang="ja"] .nf .prose { word-break: auto-phrase; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2.8rem; }

/* Natural Japanese line breaks in headlines (Chrome/Edge), balanced lines elsewhere */
.belief, .belief-line, .biz-tagline, .principles p { text-wrap: balance; }
html[lang="ja"] .belief, html[lang="ja"] .belief-line, html[lang="ja"] .biz-tagline { word-break: auto-phrase; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .biz-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; gap: 2.4rem; max-width: 28rem; }
  .principles li { padding: 0; }
  .principles li + li { border-left: 0; border-top: 1px solid var(--line); padding-top: 2.4rem; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .bar-inner { justify-items: start; }
  .lang { top: 0.45rem; }
  .hero-lead { text-align: left; }
  .nf .prose { text-align: left; }
  .brand-mark { width: 40px; }
  .brand-word { width: 128px; }
  /* the long mission text reads better horizontally on a phone */
  html[lang="ja"] .mission-text { writing-mode: horizontal-tb; height: auto; }
  html[lang="ja"] .mission-text .belief { margin: 0 0 1.6rem; line-height: 1.8; }
  .mission-text .belief br { display: none; }
  html[lang="ja"] .mission-text .prose { line-height: 2.05; letter-spacing: 0.05em; }
  .company div { grid-template-columns: 1fr; gap: 0.2rem; }
  .btn { min-width: 0; width: 100%; max-width: 22rem; }
}
/* ── Mail window (shared with Sentinel) ─────────────────── */
html.mm-lock { overflow: hidden; }

dialog.mm {
  --mm-line: #5f84ad;
  width: min(25rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: auto;
}
dialog.mm::backdrop { background: rgba(21, 22, 27, 0.45); }
dialog.mm[open]::backdrop { animation: mm-fade 0.2s ease-out; }

.mm-card {
  position: relative;
  padding: 1.4rem 1.4rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--card);
  text-align: center;
}
dialog.mm[open] .mm-card { animation: mm-pop 0.3s ease-out; }

.mm-x {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.6rem;
  background: none;
  color: var(--mute);
  font-size: 1.1rem;
  cursor: pointer;
}
.mm-x:hover { background: var(--soft); color: var(--ink); }

.mm-stage {
  position: relative;
  width: 96px;
  height: 150px;
  margin: 0 auto 0.5rem;
  overflow: hidden;
}
.mm-rise {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 66px;
  height: 150px;
  margin-left: -33px;
}
.mm-hop {
  position: relative;
  width: 66px;
  height: 150px;
}
.mm-rabbit { display: block; width: 66px; height: 150px; }
dialog.mm[open] .mm-rise { animation: mm-rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
dialog.mm[open] .mm-hop { animation: mm-hop 0.5s ease-in-out 0.75s 2; }

.mm-env {
  position: absolute;
  left: 50%;
  top: 98px;
  width: 46px;
  height: 32px;
  margin-left: -23px;
  box-sizing: border-box;
  border: 2px solid var(--mm-line);
  border-radius: 4px;
  background: var(--soft);
}
.mm-env svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 28px;
  fill: none;
  stroke: var(--mm-line);
  stroke-width: 2;
  stroke-linejoin: round;
}
.mm-paw {
  position: absolute;
  top: 96px;
  width: 14px;
  height: 10px;
  box-sizing: border-box;
  border: 2px solid var(--mm-line);
  border-radius: 50%;
  background: #fff;
}
.mm-paw-l { left: 6px; }
.mm-paw-r { left: 46px; }

.mm-h {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.2rem;
  white-space: normal;
}
.mm-p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--mute);
  text-wrap: pretty;
  word-break: auto-phrase;
}
.mm-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  width: 100%;
  box-sizing: border-box;
}
.mm-addr {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding: 0.35rem 0.35rem 0.35rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--soft);
  font-size: 0.92rem;
}
.mm-addr-text {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  user-select: all;
}
/* Latin face, no tracking: the address reads as one unit and fits on one line */
.mm-addr-text { font-family: var(--serif-en); letter-spacing: 0; font-size: 0.9rem; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }

.mm-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--field);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.mm-copy:hover { border-color: var(--ink); }
.mm-copy.is-hint {
  border-color: var(--acc);
  box-shadow: 0 0 0 2px var(--acc);
  animation: mm-nudge 0.9s ease-in-out 2;
}
.mm-web {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin-top: 0.9rem;
  font-size: 0.85rem;
}
.mm-web a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: var(--acc);
  text-decoration: none;
}
.mm-web a:hover { text-decoration: underline; text-underline-offset: 2px; }
.mm-note {
  margin: 0.9rem 0 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--mute);
  text-wrap: pretty;
  word-break: auto-phrase;
}
.mm-status {
  margin: 0.5rem 0 0;
  min-height: 1.3em;
  font-size: 0.85rem;
  color: var(--mute);
  text-wrap: pretty;
  word-break: auto-phrase;
}
.mm-status.ok { color: var(--ok); }

@keyframes mm-fade { from { opacity: 0; } }
@keyframes mm-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes mm-rise { from { transform: translateY(105%); } }
@keyframes mm-hop { 50% { transform: translateY(-10px); } }
@keyframes mm-nudge { 50% { transform: scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  dialog.mm[open]::backdrop,
  dialog.mm[open] .mm-card,
  dialog.mm[open] .mm-rise,
  dialog.mm[open] .mm-hop,
  .mm-copy.is-hint { animation: none; }
}


/* Mail window: square edges to match this site */
.mm-card, .mm-addr, .mm-copy, dialog.mm .btn { border-radius: 0; }
.mm-h { font-family: var(--face); font-weight: 500; }
