/* ============================================================
   J CONNECT — shared stylesheet
   Brand (from logo): navy #0a3161 + orange #ff7f00, warm off-white paper.
   Language toggle: <body data-lang="ja|en">, .ja / .en elements.
   ============================================================ */

:root {
  --brand: #0a3161;          /* navy */
  --brand-deep: #061f40;
  --brand-soft: #dde6f3;
  --accent: #ff7f00;         /* orange */
  --accent-deep: #d96a00;
  --accent-soft: #ffe9d3;
  --accent-text: #b45600;    /* orange dark enough for 4.5:1 on paper */
  --gold: #ffb15c;
  --gold-text: #8a5a05;
  /* legacy aliases (older page-level CSS) */
  --crimson: var(--brand);
  --crimson-deep: var(--brand-deep);
  --crimson-soft: var(--brand-soft);
  --ink: #101828;
  --ink-soft: #364152;
  --muted: #5c606b;
  --paper: #fbf9f5;
  --paper-2: #f1efe9;
  --card: #ffffff;
  --line: #e3e1da;
  --night: #071b3a;
  --night-2: #0d2a55;
  --font-display: "Zen Kaku Gothic New", "Noto Sans JP", system-ui, sans-serif;
  --font-body: "Noto Sans JP", "Zen Kaku Gothic New", system-ui, -apple-system, sans-serif;
  --font-latin: "Sora", "Noto Sans JP", system-ui, sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(10, 49, 97, 0.08);
  --shadow-lg: 0 24px 60px rgba(10, 49, 97, 0.16);
  --max: 1120px;
  --gutter: 20px;
  --nav-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f3f0ea;
    --ink-soft: #cfcbc3;
    --muted: #9fa4b1;
    --paper: #081633;
    --paper-2: #0d1f42;
    --card: #10254d;
    --line: #22386a;
    --brand-soft: #16305e;
    --accent-soft: #3d2410;
    --accent-text: #ffa64d;
    --gold-text: #ffb15c;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --ink: #f3f0ea;
  --ink-soft: #cfcbc3;
  --muted: #9fa4b1;
  --paper: #081633;
  --paper-2: #0d1f42;
  --card: #10254d;
  --line: #22386a;
  --brand-soft: #16305e;
  --accent-soft: #3d2410;
  --accent-text: #ffa64d;
  --gold-text: #ffb15c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 0.5em; letter-spacing: 0.01em; }
p { margin: 0 0 1em; }
.latin { font-family: var(--font-latin); }
:target { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ---- language toggle ---- */
body[data-lang="ja"] .en { display: none !important; }
body[data-lang="en"] .ja { display: none !important; }

/* ---- layout ---- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 80px 0; }
.section--tight { padding: 56px 0; }
.section--alt { background: var(--paper-2); }
.section--night { background: var(--night); color: #f3f0ea; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 12px;
}
.section--night .eyebrow { color: var(--gold); }
.h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
.lead { font-size: 18px; color: var(--ink-soft); max-width: 640px; }
.section--night .lead { color: #cfcbc3; }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* ---- cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  min-height: 48px;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn--primary { background: var(--accent); color: var(--brand-deep); box-shadow: 0 8px 24px rgba(255, 127, 0, 0.35); }
.btn--primary:hover { background: #ff9126; color: var(--brand-deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--light { background: #fff; color: var(--brand); }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--outline-light:hover { border-color: #fff; }

/* ---- logo ---- */
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; font-family: var(--font-latin); font-weight: 800;
  letter-spacing: 0.02em; font-size: 17px;
}
/* the mark sits on a light tile (as in the original logo) so the navy "J" stays visible on navy/dark surfaces */
.logo__img { width: 40px; height: 40px; object-fit: contain; flex: none; background: #f4f4f4; border-radius: 10px; padding: 5px; }
.logo__text { white-space: nowrap; }
.logo__text small { display: block; font-size: 10px; letter-spacing: 0.22em; font-weight: 700; color: var(--muted); line-height: 1; margin-top: 3px; }

/* ---- header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: var(--nav-h); gap: 16px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; padding: 10px 14px; border-radius: 999px;
  font-weight: 600; font-size: 15px; color: var(--ink-soft);
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--brand-soft); color: var(--ink); }
.nav .btn { padding: 10px 18px; min-height: 40px; font-size: 14px; color: var(--brand-deep); }
.nav .btn:hover { background: #ff9126; color: var(--brand-deep); }
.lang-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  font-family: var(--font-latin); font-size: 13px; font-weight: 700;
}
.lang-toggle button {
  border: 0; background: transparent; color: var(--muted); padding: 8px 12px; cursor: pointer; font: inherit;
  min-height: 36px;
}
.lang-toggle button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.lang-toggle button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.nav-toggle {
  display: none; border: 1px solid var(--line); background: var(--card); border-radius: 12px;
  width: 44px; height: 44px; cursor: pointer; align-items: center; justify-content: center; color: var(--ink);
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; padding: 12px var(--gutter) 20px;
    background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px; font-size: 16px; }
  .nav .btn { margin-top: 8px; }
}

/* ---- footer ---- */
.site-footer { background: var(--night); color: #cfcbc3; padding: 56px 0 32px; }
.site-footer .logo { color: #fff; }
.site-footer .logo__text small { color: #9fa4b1; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; font-family: var(--font-latin); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #cfcbc3; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; font-size: 13px; color: #9fa4b1; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.social { display: inline-flex; gap: 10px; }
.social a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); display: inline-grid; place-items: center; }
.social a:hover { background: rgba(255,255,255,.1); }
.social svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- utilities ---- */
.tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-latin); }
.tag--gold { background: rgba(255,177,92,.2); color: var(--gold-text); }
.tag--navy { background: var(--brand-soft); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; text-decoration: none; }
.skip-link:focus { top: 8px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
