/* ============================================================
   GLOBAL NAV (gnav) — rich mega-menu header, shared on every page.
   Markup is injected by /js/nav.js so wording lives in ONE place.
   The legacy .nav header stays in each page's HTML (SEO / no-JS
   fallback) but is hidden here once this stylesheet loads.
   ============================================================ */
/* Keyboard focus — a crisp spectral ring for keyboard users only (mouse users
   never see it). Signals accessibility craft across every page that loads this. */
:where(a,button,input,textarea,select,summary,[tabindex]):focus-visible{
  outline:2px solid var(--gnav-accent); outline-offset:3px; border-radius:5px;
  box-shadow:0 0 0 4px rgba(28,79,214,.16);
}
:root{
  --gnav-h:64px;
  --gnav-accent:#1c4fd6;
  --gnav-spectrum:linear-gradient(90deg,#ff4d4d,#ff9a3b,#ffe23b,#46d17a,#3b8cff,#9a5bff);
}

/* Hide the legacy static nav + mobile menu (kept in markup as fallback). */
header.nav{ display:none !important; }
.mobile-menu{ display:none !important; }

/* ---- bar ---- */
.gnav{ position:fixed; top:0; left:0; right:0; z-index:200; height:var(--gnav-h);
  display:flex; align-items:center; gap:26px; padding:0 clamp(16px,4vw,40px);
  background:rgba(255,255,255,.9);
  transition:background .25s ease, border-color .25s ease;
  -webkit-backdrop-filter:saturate(180%) blur(12px); backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid #ececec; font-family:'Noto Sans JP',sans-serif; }
.gnav::before{ content:""; position:absolute; top:0; left:0; right:0; height:2px; background:var(--gnav-spectrum); opacity:.85; }
.gnav-logo{ flex-shrink:0; display:flex; align-items:center; }
.gnav-logo img{ height:40px; width:auto; display:block; transition:opacity .2s; }
.gnav-logo:not(.gnav-lockup):hover img{ opacity:.72; }
/* ---- Magnet lockup: "Magnet  by  PRISM" — the Magnet symbol is the lead
   brand (→ /magnet), with a small "by" + small PRISM symbol (→ /). ---- */
.gnav-lockup{ gap:9px; align-items:flex-end; }
/* The Magnet art has a little internal bottom padding, so nudge the
   "by PRISM" group up a hair to sit on the Magnet wordmark's baseline. */
.gnav-lockup .gnav-lk-by,
.gnav-lockup .gnav-lk-sub{ margin-bottom:11px; }
.gnav-lockup .gnav-lk-main,
.gnav-lockup .gnav-lk-sub{ display:inline-flex; align-items:center; }
/* The Magnet wordmark art carries more internal padding, so it reads smaller
   at the same box height — bump it on Magnet (service) pages. */
.gnav-lockup .gnav-lk-main img{ height:54px; }
.gnav-lockup .gnav-lk-by{ font-family:'Space Mono','Noto Sans JP',monospace; font-size:11px; font-weight:400;
  letter-spacing:.04em; color:#8a8f98; text-transform:lowercase; }
.gnav-lockup .gnav-lk-sub img{ height:20px; opacity:.78; }
.gnav-lockup .gnav-lk-main:hover img,
.gnav-lockup .gnav-lk-sub:hover img{ opacity:1; }
/* Over the dark hero the small "by" needs a lighter tone — but ONLY on overlay
   pages (e.g. /magnet). On normal light pages (e.g. /case) the bar is light
   from the top even before it solidifies, so the gray base color must stay or
   the "by" turns white-on-white and vanishes. */
body.nav-overlay .gnav--magnet:not(.gnav--solid) .gnav-lockup .gnav-lk-by{ color:rgba(255,255,255,.72); }

/* ---- primary menu ---- */
.gnav-menu{ display:flex; align-items:center; gap:2px; list-style:none; margin:0; padding:0; height:100%; }
.gnav-item{ position:relative; height:100%; display:flex; align-items:center; }
.gnav-link{ position:relative; display:inline-flex; align-items:center; gap:6px; height:100%; padding:0 14px;
  font-size:14px; font-weight:700; color:#1a1a1a; background:none; border:none; cursor:pointer; font-family:inherit; text-decoration:none; }
.gnav-link .caret{ width:9px; height:9px; opacity:.5; transition:transform .22s; }
.gnav-item:hover .gnav-link,.gnav-item:focus-within .gnav-link{ color:var(--gnav-accent); }
.gnav-item:hover .caret,.gnav-item:focus-within .caret{ transform:rotate(180deg); }
.gnav-link::after{ content:""; position:absolute; left:14px; right:14px; bottom:13px; height:2px;
  background:var(--gnav-accent); transform:scaleX(0); transform-origin:left; transition:transform .22s; border-radius:2px; }
.gnav-item:hover .gnav-link::after,.gnav-item:focus-within .gnav-link::after,.gnav-link.is-active::after{ transform:scaleX(1); }

/* ---- mega panel ---- */
.gnav-panel{ position:absolute; top:calc(var(--gnav-h) - 7px); left:0; min-width:300px;
  background:#fff; border:1px solid #ececec; border-radius:14px; box-shadow:0 24px 60px -20px rgba(16,24,40,.28);
  padding:12px; opacity:0; visibility:hidden; transform:translateY(8px);
  transition:opacity .18s ease, transform .18s ease, visibility .18s; }
.gnav-item:hover .gnav-panel,.gnav-item:focus-within .gnav-panel{ opacity:1; visibility:visible; transform:translateY(0); }
.gnav-panel.has-cta{ min-width:560px; display:grid; grid-template-columns:1.35fr 1fr; gap:10px; }
.gnav-panel-links{ display:grid; gap:2px; align-content:start; }
.gnav-sub{ display:flex; gap:12px; align-items:flex-start; padding:11px 13px; border-radius:10px; text-decoration:none; transition:background .15s; }
.gnav-sub:hover{ background:#f5f7fb; }
.gnav-sub-ico{ flex-shrink:0; width:34px; height:34px; border-radius:9px; background:#eef2fc; color:var(--gnav-accent);
  display:flex; align-items:center; justify-content:center; }
.gnav-sub-ico svg{ width:18px; height:18px; }
.gnav-sub-t{ display:block; font-size:13.5px; font-weight:700; color:#1a1a1a; line-height:1.4; }
.gnav-sub-d{ display:block; font-size:11.5px; color:#6b7280; line-height:1.5; margin-top:3px; }

/* featured CTA card inside a panel — light, restrained, activation-led */
.gnav-cta-card{ position:relative; overflow:hidden; border-radius:12px; padding:20px 20px 18px;
  display:flex; flex-direction:column; background:#f6f8fc; border:1px solid #e6ebf5; }
.gnav-cta-card-k{ font-size:10.5px; letter-spacing:.12em; color:var(--gnav-accent); font-weight:700; }
.gnav-cta-card-t{ font-size:15.5px; font-weight:700; line-height:1.5; margin:9px 0 6px; color:#0d1117; }
.gnav-cta-card-d{ font-size:11.5px; color:#6b7280; line-height:1.75; }
.gnav-cta-card-foot{ margin-top:auto; padding-top:16px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.gnav-cta-card-btn{ display:inline-flex; align-items:center; gap:7px; background:#0d1117; color:#fff;
  font-size:12.5px; font-weight:700; padding:10px 16px; border-radius:7px; text-decoration:none; transition:transform .15s, background .2s; }
.gnav-cta-card-btn:hover{ transform:translateX(2px); background:#000; }
.gnav-cta-card-tag{ font-size:10.5px; font-weight:700; color:#5b6472; background:#fff; border:1px solid #e2e6ee; border-radius:999px; padding:4px 10px; }

/* ---- right actions ---- */
.gnav-spacer{ flex:1; }
.gnav-actions{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.gnav-btn-outline{ border:1.5px solid #111; background:#fff; color:#111; padding:9px 16px; border-radius:6px; font-size:13px; font-weight:700; text-decoration:none; transition:background .2s,color .2s; }
.gnav-btn-outline:hover{ background:#111; color:#fff; }
.gnav-btn-filled{ border:1.5px solid #111; background:#111; color:#fff; padding:9px 18px; border-radius:6px; font-size:13px; font-weight:700; text-decoration:none; transition:background .2s,border-color .2s; }
.gnav-btn-filled:hover{ background:#333; border-color:#333; }
/* ログイン等の控えめリンク。枠なしテキストでボタン群を1行に収める。 */
.gnav-btn-text{ color:#111; padding:9px 4px; font-size:13px; font-weight:700; text-decoration:none; white-space:nowrap; transition:opacity .2s; }
.gnav-btn-text:hover{ opacity:.55; }

/* ---- hamburger ---- */
.gnav-burger{ display:none; flex-direction:column; gap:5px; width:42px; height:42px; align-items:center; justify-content:center; background:none; border:none; cursor:pointer; }
.gnav-burger span{ display:block; width:22px; height:2px; background:#111; border-radius:2px; transition:transform .25s, opacity .2s; }
.gnav-burger.open span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
.gnav-burger.open span:nth-child(2){ opacity:0; }
.gnav-burger.open span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }

/* ---- responsive: collapse to drawer ---- */
@media(max-width:980px){
  .gnav-menu,.gnav-actions,.gnav-spacer{ display:none; }
  .gnav-burger{ display:flex; margin-left:auto; }
  /* perf: a per-frame backdrop blur on the fixed bar is the main cause of
     mobile scroll jank — the bar is near-opaque, so go solid on small widths */
  .gnav{ background:#fff; -webkit-backdrop-filter:none; backdrop-filter:none; }
}

/* ---- mobile drawer ---- */
.gnav-drawer{ position:fixed; inset:var(--gnav-h) 0 0 0; z-index:190; background:#fff;
  transform:translateX(100%); transition:transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y:auto; -webkit-overflow-scrolling:touch; padding:10px clamp(16px,5vw,24px) 36px;
  display:flex; flex-direction:column; }
.gnav-drawer.open{ transform:translateX(0); }
.gnav-acc{ border-bottom:1px solid #eee; }
.gnav-acc-head{ width:100%; display:flex; align-items:center; justify-content:space-between; padding:18px 4px;
  background:none; border:none; font-family:inherit; font-size:16px; font-weight:700; color:#1a1a1a; cursor:pointer; }
.gnav-acc-head .caret{ width:13px; height:13px; opacity:.5; transition:transform .25s; }
.gnav-acc.open .gnav-acc-head .caret{ transform:rotate(180deg); }
.gnav-acc-body{ display:grid; grid-template-rows:0fr; transition:grid-template-rows .3s ease; }
.gnav-acc.open .gnav-acc-body{ grid-template-rows:1fr; }
.gnav-acc-inner{ overflow:hidden; }
.gnav-acc-link{ display:block; padding:11px 4px 11px 14px; font-size:14px; font-weight:700; color:#333; text-decoration:none; }
.gnav-acc-link .d{ display:block; font-size:11.5px; font-weight:400; color:#9aa3b2; margin-top:2px; }
.gnav-acc-link:active{ color:var(--gnav-accent); }
.gnav-drawer-cta{ margin-top:26px; display:flex; flex-direction:column; gap:10px; }
.gnav-drawer-cta a{ display:block; text-align:center; padding:15px; border-radius:8px; font-size:15px; font-weight:700; text-decoration:none; }
.gnav-drawer-cta .out{ border:1.5px solid #111; color:#111; }
.gnav-drawer-cta .fill{ background:#111; color:#fff; }
body.gnav-locked{ overflow:hidden; }

@media (prefers-reduced-motion: reduce){
  .gnav-panel,.gnav-drawer,.gnav-burger span,.caret{ transition:none !important; }
}

/* ============================================================
   OVERLAY NAV — on pages with a dark hero (body.nav-overlay), the bar
   is transparent with white content while at the top, then solidifies
   to the white bar on scroll (JS toggles .gnav--solid).
   ============================================================ */
/* Let the dark hero reach the very top, under the transparent bar.
   (Overlay pages' first section provides its own top padding to clear the bar.) */
body.nav-overlay{ padding-top:0 !important; }
body.nav-overlay .gnav:not(.gnav--solid){
  background:transparent; border-bottom-color:transparent;
  -webkit-backdrop-filter:none; backdrop-filter:none; }
/* Logo white-art is swapped in by nav.js on overlay pages (no filter needed). */
body.nav-overlay .gnav:not(.gnav--solid) .gnav-link{ color:#fff; }
body.nav-overlay .gnav:not(.gnav--solid) .gnav-link::after{ background:#fff; }
/* Over the dark hero, suppress the persistent active underline (it reads like a
   stuck bar); it still appears on hover and once the bar solidifies on scroll. */
body.nav-overlay .gnav:not(.gnav--solid) .gnav-link.is-active::after{ transform:scaleX(0); }
body.nav-overlay .gnav:not(.gnav--solid) .gnav-item:hover .gnav-link.is-active::after{ transform:scaleX(1); }
body.nav-overlay .gnav:not(.gnav--solid) .gnav-btn-outline{ background:transparent; color:#fff; border-color:rgba(255,255,255,.55); }
body.nav-overlay .gnav:not(.gnav--solid) .gnav-btn-outline:hover{ background:#fff; color:#111; border-color:#fff; }
body.nav-overlay .gnav:not(.gnav--solid) .gnav-btn-filled{ background:#fff; color:#111; border-color:#fff; }
body.nav-overlay .gnav:not(.gnav--solid) .gnav-btn-filled:hover{ background:rgba(255,255,255,.88); border-color:rgba(255,255,255,.88); }
body.nav-overlay .gnav:not(.gnav--solid) .gnav-btn-text{ color:#fff; }
body.nav-overlay .gnav:not(.gnav--solid) .gnav-burger span{ background:#fff; }

/* ============================================================
   COOL TOP (body.ct-page) — the whole page is dark, so the bar must NOT flip
   to the white style on scroll. It stays a dark glass bar with white content,
   and on desktop we drop the mega-menu for a minimal logo + hamburger header.
   ============================================================ */
body.ct-page .gnav--solid{ background:rgba(8,9,13,.72); border-bottom-color:rgba(255,255,255,.08);
  -webkit-backdrop-filter:saturate(160%) blur(14px); backdrop-filter:saturate(160%) blur(14px); }
body.ct-page .gnav--solid .gnav-link{ color:#fff; }
body.ct-page .gnav--solid .gnav-link::after{ background:#fff; }
body.ct-page .gnav--solid .gnav-burger span{ background:#fff; }
body.ct-page .gnav::before{ opacity:.6; }
@media(min-width:981px){
  body.ct-page .gnav-menu{ display:none; }
  body.ct-page .gnav-burger{ display:flex; margin-left:auto; }
}

/* ============================================================
   Apply CTA — recruitment "book a casual interview" buttons across the
   recruit / careers pages. Brand gradient. The calendar glyph is injected
   by /js/nav.js; the buttons link to /apply (opened in-page by modal.js).
   ============================================================ */
.apply-cta{ display:inline-flex; align-items:center; justify-content:center; gap:9px;
  background:linear-gradient(140deg,#1c4fd6,#16b3c4); color:#fff; font-weight:700; font-family:inherit; border:none; border-radius:10px;
  padding:15px 28px; font-size:15px; line-height:1.2; text-decoration:none; cursor:pointer;
  box-shadow:0 14px 30px -14px rgba(28,79,214,.7); transition:transform .15s, box-shadow .2s; }
.apply-cta:hover{ transform:translateY(-1px); box-shadow:0 18px 38px -14px rgba(28,79,214,.8); }
.apply-cta:active{ transform:translateY(0); }
.apply-cta svg{ width:18px; height:18px; flex-shrink:0; }
.apply-cta--lg{ padding:17px 34px; font-size:16px; }
.apply-cta--sm{ padding:11px 18px; font-size:13.5px; box-shadow:none; }
.apply-cta--block{ display:flex; width:100%; }
.apply-note{ font-size:12px; color:var(--sub); margin-top:10px; }
/* persistent floating apply button (desktop) */
.apply-fab{ position:fixed; left:22px; bottom:22px; z-index:140; display:inline-flex; align-items:center; gap:8px;
  background:linear-gradient(140deg,#1c4fd6,#16b3c4); color:#fff; font-weight:700; font-size:14px; padding:13px 20px; border-radius:999px; text-decoration:none;
  box-shadow:0 14px 34px -12px rgba(28,79,214,.8); transition:transform .15s; }
.apply-fab:hover{ transform:translateY(-2px); }
.apply-fab svg{ width:18px; height:18px; }
@media(max-width:768px){ .apply-fab{ display:none; } }

/* JD (careers) sticky mobile apply bar — always reachable on phones. */
.jd-sticky{ position:fixed; left:0; right:0; bottom:0; z-index:150; display:none; gap:10px;
  padding:12px clamp(12px,4vw,16px); background:rgba(255,255,255,.96);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); border-top:1px solid var(--border,#e6e9f0); }
.jd-sticky a{ flex:1; text-align:center; padding:13px; border-radius:9px; font-size:14px; font-weight:700; text-decoration:none; }
.jd-sticky .s{ background:#fff; color:#111; border:1.5px solid #111; }
.jd-sticky .apply-cta{ box-shadow:none; gap:7px; padding:13px; }
@media(max-width:768px){ .jd-sticky{ display:flex; } body:has(.jd-sticky){ padding-bottom:78px; } }
