/* NexFab — shared styles */
:root {
  --navy: #0d1828;
  --accent: #1a3a6b;
  --accent-br: #2a5aaa;
  --white: #fff;
  --bg: #f1f5fb;
  --text: #0d1828;
  --sub: #5a7090;
  --steel: #8aaac8;
  --line: rgba(26, 58, 107, 0.16);
  --font-jp: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  --font-en: 'Rajdhani', 'Noto Sans JP', sans-serif;
  --pad: clamp(18px, 3.2vw, 56px);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-jp);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--accent-br); outline-offset: -3px; }

/* ───────── HOME: one screen, no scroll ───────── */
.stage {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 560px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(rgba(26,58,107,.06) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, rgba(26,58,107,.06) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--bg);
}

/* blueprint crop marks */
.crop { position: absolute; width: 22px; height: 22px; z-index: 6; pointer-events: none; border: 0 solid var(--accent); }
.crop.tl { top: 14px; left: 14px; border-top-width: 2px; border-left-width: 2px; }
.crop.tr { top: 14px; right: 14px; border-top-width: 2px; border-right-width: 2px; }
.crop.bl { bottom: 14px; left: 14px; border-bottom-width: 2px; border-left-width: 2px; }
.crop.br { bottom: 14px; right: 14px; border-bottom-width: 2px; border-right-width: 2px; }

/* top bar */
.top {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 34px var(--pad) 0;
}
.top .logo img { height: clamp(26px, 3vw, 40px); width: auto; }
.tel { display: flex; align-items: center; gap: 12px; transition: opacity .2s; }
.tel:hover { opacity: .8; }
.tel .ico {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--white);
}
.tel .txt { display: flex; flex-direction: column; line-height: 1.2; }
.tel small { font-size: 11px; color: var(--sub); letter-spacing: .04em; }
.tel b {
  font-family: var(--font-en); font-weight: 700; letter-spacing: 1.5px;
  font-size: clamp(22px, 2vw, 28px); color: var(--navy);
}

/* hero */
.hero {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px;
  padding: 0 var(--pad);
  min-height: 0;
}
.giant {
  position: absolute; left: calc(var(--pad) - 1vw); bottom: -7.5vw; z-index: -1;
  font-family: var(--font-en); font-weight: 700;
  font-size: clamp(120px, 24vw, 420px); line-height: .78; letter-spacing: -0.02em;
  color: rgba(42, 90, 170, 0.045);
  -webkit-text-stroke: 1.5px rgba(42, 90, 170, 0.28);
  transform: translate(calc((var(--mx, .5) - .5) * -36px), calc((var(--my, .5) - .5) * -16px));
  transition: transform .5s ease-out;
  user-select: none; white-space: nowrap; pointer-events: none;
}
h1.catch {
  font-size: clamp(30px, min(5.2vw, 8.6vh), 78px);
  font-weight: 700; line-height: 1.22; letter-spacing: 0.02em;
  color: var(--navy);
}
h1.catch .line { display: block; overflow: hidden; padding-bottom: .1em; }
h1.catch .in { display: inline-block; }
h1.catch .hl {
  position: relative; display: inline-block; white-space: nowrap;
  background: linear-gradient(100deg, var(--accent-br) 20%, #4f86d9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1.catch .hl::after {
  content: ''; position: absolute; left: 0; bottom: .02em; width: 100%; height: .07em;
  background: var(--accent-br); transform-origin: left;
}

/* blueprint extras: rulers, crosshair that follows the pointer */
.ruler { position: absolute; z-index: 1; pointer-events: none; opacity: .5; }
.ruler-x {
  top: 0; left: 0; right: 0; height: 14px;
  background:
    repeating-linear-gradient(90deg, var(--accent) 0 1px, transparent 1px 16px) 0 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--accent) 0 1px, transparent 1px 80px) 0 0 / 100% 14px no-repeat;
}
.ruler-y {
  top: 0; bottom: 0; left: 0; width: 14px;
  background:
    repeating-linear-gradient(0deg, var(--accent) 0 1px, transparent 1px 16px) 0 0 / 6px 100% no-repeat,
    repeating-linear-gradient(0deg, var(--accent) 0 1px, transparent 1px 80px) 0 0 / 14px 100% no-repeat;
}
.xh { position: absolute; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .3s; background: rgba(42, 90, 170, .4); }
.xh-x { left: 0; right: 0; height: 1px; top: var(--y, 0); }
.xh-y { top: 0; bottom: 0; width: 1px; left: var(--x, 0); }
.xh-label {
  position: absolute; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .3s;
  left: var(--x, 0); top: var(--y, 0); transform: translate(12px, 12px);
  font-family: var(--font-en); font-weight: 600; font-size: 11px; letter-spacing: 2px; white-space: nowrap;
  color: var(--accent-br); background: rgba(255, 255, 255, .85); padding: 1px 6px;
}
.stage.tracking .xh, .stage.tracking .xh-label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .xh, .xh-label { display: none; } }

/* five vertical panels = the whole navigation */
.panels {
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: clamp(220px, 42vh, 400px);
  border-top: 2px solid var(--accent);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(6px);
}
.panel {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(16px, 2.6vh, 28px) clamp(16px, 1.8vw, 30px) clamp(18px, 3vh, 32px);
  border-right: 1px solid var(--line);
  transition: color .35s;
}
.panel:last-child { border-right: 0; }
.panel::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--navy);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.panel .no {
  font-family: var(--font-en); font-weight: 600; letter-spacing: 3px;
  font-size: 13px; color: var(--steel);
  display: flex; align-items: center; gap: 10px;
}
.panel .no::after { content: ''; flex: 1; height: 1px; background: var(--line); transition: background .35s; }
.panel .body { display: flex; flex-direction: column; gap: 6px; }
.panel .en {
  font-family: var(--font-en); font-weight: 700; letter-spacing: 2px;
  font-size: clamp(22px, 2.5vw, 38px); line-height: 1; text-transform: uppercase;
  color: var(--accent);
  transition: color .35s;
}
.panel .ja { font-size: clamp(15px, 1.35vw, 19px); font-weight: 700; }
.panel .desc { font-size: 12px; line-height: 1.7; min-height: 3.4em; color: var(--sub); transition: color .35s; }
.panel .go {
  align-self: flex-end;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--accent-br); color: var(--accent-br);
  font-family: var(--font-en); font-size: 20px; line-height: 1;
  transition: transform .35s, background .35s, color .35s, border-color .35s;
}
.panel:hover, .panel:focus-visible { color: var(--white); }
.panel:hover::before, .panel:focus-visible::before { transform: scaleY(1); }
.panel:hover .en, .panel:focus-visible .en { color: var(--white); }
.panel:hover .desc, .panel:focus-visible .desc { color: var(--steel); }
.panel:hover .no::after, .panel:focus-visible .no::after { background: rgba(255, 255, 255, .25); }
.panel:hover .go, .panel:focus-visible .go {
  background: var(--white); color: var(--navy); border-color: var(--white); transform: translateX(6px);
}

/* contact panel: always filled */
.panel.contact { color: var(--white); }
.panel.contact::before { transform: scaleY(1); background: var(--accent); }
.panel.contact .en { color: var(--white); }
.panel.contact .no, .panel.contact .desc { color: #b9cdea; }
.panel.contact .no::after { background: rgba(255, 255, 255, .25); }
.panel.contact .go { border-color: var(--white); color: var(--white); }
.panel.contact:hover::before { background: var(--accent-br); }

/* conveyor line: parts travel along the top of the panels */
.belt {
  position: absolute; left: 0; right: 0; top: -11px; height: 9px; z-index: 4; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.belt::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--accent-br) 0 26px, transparent 26px 190px);
  border-radius: 2px;
}

/* panels: accent line on hover, pulsing ring on the contact button */
.panel::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent-br);
  transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.panel:hover::after, .panel:focus-visible::after { transform: scaleX(1); }
.panel.contact .go { position: relative; }
.panel.contact .go::after {
  content: ''; position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid var(--white); opacity: 0;
}

/* entrance */
@media (prefers-reduced-motion: no-preference) {
  .belt::before { animation: belt 7s linear infinite; }
  @keyframes belt { to { background-position-x: 190px; } }
  .panel.contact .go::after { animation: ring 2.4s ease-out 1.6s infinite; }
  @keyframes ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }
  h1.catch .in { transform: translateY(115%); animation: up .95s cubic-bezier(.2, .8, .2, 1) forwards; }
  h1.catch .line:nth-child(1) .in { animation-delay: .15s; }
  h1.catch .line:nth-child(2) .in { animation-delay: .3s; }
  @keyframes up { to { transform: none; } }
  h1.catch .hl::after { transform: scaleX(0); animation: draw .8s cubic-bezier(.2, .8, .2, 1) 1.1s forwards; }
  @keyframes draw { to { transform: scaleX(1); } }
  .rise { opacity: 0; transform: translateY(16px); animation: rise .7s cubic-bezier(.2, .8, .2, 1) forwards; }
  .d1 { animation-delay: .05s; }
  .panels .panel { opacity: 0; transform: translateY(24px); animation: rise .7s cubic-bezier(.2, .8, .2, 1) forwards; }
  .panels .panel:nth-child(1) { animation-delay: .3s; } .panels .panel:nth-child(2) { animation-delay: .38s; }
  .panels .panel:nth-child(3) { animation-delay: .46s; } .panels .panel:nth-child(4) { animation-delay: .54s; }
  .panels .panel:nth-child(5) { animation-delay: .62s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* tablet & phone: panels become full-width rows, still one screen */
@media (max-width: 900px) {
  .stage { grid-template-rows: auto auto 1fr; }
  .top { padding-top: 28px; }
  .tel { gap: 8px; }
  .tel .ico { width: 36px; height: 36px; }
  .tel .ico svg { width: 17px; height: 17px; }
  .tel small { display: none; }
  .tel b { font-size: 18px; letter-spacing: 1px; }
  .hero { flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; padding-top: clamp(18px, 4vh, 40px); padding-bottom: clamp(18px, 4vh, 40px); }
  .giant, .ruler-y { display: none; }
  h1.catch { font-size: clamp(28px, min(8.6vw, 5.4vh), 54px); }
  .panels {
    grid-template-columns: 1fr; grid-auto-rows: minmax(56px, 1fr);
    height: auto;
  }
  .panel {
    flex-direction: row; align-items: center; gap: 14px;
    padding: 0 var(--pad);
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .panel:last-child { border-bottom: 0; }
  .panel .no { order: 0; font-size: 12px; }
  .panel .no::after { display: none; }
  .panel .body { order: 1; flex: 1; flex-direction: row; align-items: baseline; gap: 12px; }
  .panel .en { font-size: clamp(18px, 5vw, 24px); }
  .panel .ja { font-size: 13px; opacity: .8; }
  .panel .desc { display: none; }
  .panel .go { order: 2; width: 34px; height: 34px; font-size: 16px; align-self: center; }
  .crop { display: none; }
}
@media (max-height: 560px) { .stage { height: auto; } }
