:root {
  --navy: #10243d;
  --navy-deep: #09182a;
  --wine: #741f36;
  --gold: #b89551;
  --gold-light: #d9c38f;
  --paper: #fbfaf7;
  --ink: #17202b;
  --muted: #647080;
  --line: #d8d4ca;
  --success: #1e704f;
  --danger: #a13d42;
  --shadow: 0 18px 50px rgba(9, 24, 42, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(184, 149, 81, .10), transparent 26rem),
    linear-gradient(180deg, #fff 0, var(--paper) 100%);
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  padding-top: 92px;
}

.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 10; padding: .7rem 1rem; background: #fff; color: var(--navy); }
.skip-link:focus { top: 1rem; }

.site-header { position: fixed; z-index: 1000; top: 0; right: 0; left: 0; height: 92px; color: #444; background: #fff; box-shadow: 0 2px 20px rgba(0, 0, 0, .05); }
.header-container { width: 100%; max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 20px; }
.header-content { display: flex; align-items: center; justify-content: space-between; height: 100%; padding: 20px 0; }
.site-logo { flex: 0 0 160px; }
.site-logo a { color: inherit; text-decoration: none; }
.site-logo p { margin: 0; color: #666; font-size: 14px; font-weight: 400; line-height: 1.4; }
.site-logo .logo-main { display: block; margin-top: 4px; color: #1a2332; font-size: 20px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.nav-list { display: flex; align-items: center; gap: 40px; margin: 0; padding: 0; list-style: none; }
.nav-list a { position: relative; display: block; padding: 5px 0; color: #444; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav-list a::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--wine); content: ""; transform: scaleX(0); transition: transform .25s ease; }
.nav-list a:hover { color: var(--wine); }
.nav-list a:hover::after { transform: scaleX(1); }
.hamburger { display: none; width: 45px; min-width: 0; height: 38px; padding: 10px; border: 0; background: transparent; }
.hamburger span { display: block; width: 25px; height: 2px; background: #1a2332; transition: transform .25s ease, opacity .25s ease; }
.hamburger span + span { margin-top: 6px; }
.hamburger:hover { background: transparent; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.page-shell { width: min(860px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 84px; }
.hero { text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--wine); font-family: Georgia, serif; font-size: .76rem; font-weight: 700; letter-spacing: .22em; }
.hero h1 { margin: 0; color: var(--navy); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; letter-spacing: .14em; }
.hero h1::after { display: block; width: 54px; height: 2px; margin: 18px auto 22px; background: var(--gold); content: ""; }
.lead { max-width: 620px; margin: 0 auto; color: var(--muted); }

.search-panel { margin-top: 42px; padding: 30px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.lookup-form label { display: block; margin-bottom: 8px; color: var(--navy); font-weight: 700; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
input, button, .document-button { font: inherit; }
input { min-width: 0; height: 52px; padding: 0 16px; border: 1px solid #aeb5be; border-radius: 2px; color: var(--ink); background: #fff; text-transform: uppercase; }
input:focus { outline: 3px solid rgba(184, 149, 81, .25); border-color: var(--gold); }
button { min-width: 142px; padding: 0 24px; border: 0; border-radius: 2px; color: #fff; background: var(--wine); font-weight: 700; cursor: pointer; }
button:hover { background: #5d172a; }
button:focus-visible, .document-button:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .65; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }

.message { margin-top: 24px; padding: 17px 20px; border-left: 4px solid var(--danger); background: #fff1f1; color: #74282e; }
.message.loading { border-color: var(--gold); background: #fffaf0; color: #665127; }

.certificate-card { position: relative; margin-top: 32px; padding: 42px; overflow: hidden; background: #fff; border: 1px solid var(--gold); box-shadow: var(--shadow); }
.certificate-card::before, .certificate-card::after { position: absolute; width: 70px; height: 70px; border-color: var(--gold); border-style: solid; content: ""; pointer-events: none; }
.certificate-card::before { top: 10px; left: 10px; border-width: 1px 0 0 1px; }
.certificate-card::after { right: 10px; bottom: 10px; border-width: 0 1px 1px 0; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.verified-label { margin: 0 0 5px; color: var(--success); font-size: .82rem; font-weight: 700; }
h2 { margin: 0; color: var(--navy); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 1.55rem; }
.status-badge { flex: 0 0 auto; padding: 6px 13px; border-radius: 999px; color: var(--success); background: #e7f4ed; font-size: .82rem; font-weight: 700; }
.status-badge.invalid { color: var(--danger); background: #fae8e9; }

.certificate-details { margin: 0; }
.certificate-details > div { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 17px 4px; border-bottom: 1px solid #ece9e2; }
dt { color: var(--muted); font-size: .84rem; font-weight: 700; }
dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.document-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 28px; }
.document-button { display: block; padding: 13px 20px; border: 1px solid var(--navy); text-align: center; text-decoration: none; font-weight: 700; }
.document-button.primary { color: #fff; background: var(--navy); }
.document-button.secondary { color: var(--navy); background: #fff; }
.document-button:hover { filter: brightness(.94); }
.document-button[hidden] { display: none; }
.verification-note { margin: 24px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.site-footer { padding: 24px; color: rgba(255,255,255,.72); background: var(--navy-deep); text-align: center; font-family: Georgia, serif; font-size: .74rem; letter-spacing: .08em; }
.site-footer p { margin: 0; }

[hidden] { display: none !important; }
@media (max-width: 640px) {
  .page-shell { width: min(100% - 28px, 860px); }
  .page-shell { padding: 42px 0 60px; }
  .search-panel { margin-top: 30px; padding: 20px; }
  .search-row { grid-template-columns: 1fr; }
  button { height: 50px; }
  .certificate-card { padding: 28px 20px; }
  .card-heading { display: block; }
  .status-badge { display: inline-block; margin-top: 12px; }
  .certificate-details > div { grid-template-columns: 1fr; gap: 2px; padding: 13px 2px; }
  .document-links { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .header-container { padding: 0 20px; }
  .hamburger { display: block; }
  .global-nav { position: fixed; z-index: 999; top: 92px; right: 0; left: 0; visibility: hidden; background: rgba(255, 255, 255, .98); opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .25s ease, visibility .25s; }
  .global-nav.open { visibility: visible; opacity: 1; transform: translateY(0); }
  .nav-list { display: flex; flex-direction: column; gap: 0; padding: 22px 20px 28px; }
  .nav-list li { width: min(100%, 500px); border-bottom: 1px solid #e8e8e8; }
  .nav-list a { padding: 14px 8px; text-align: center; }
}

@media (prefers-reduced-motion: no-preference) {
  .certificate-card:not([hidden]) { animation: appear .35s ease-out both; }
  @keyframes appear { from { opacity: 0; transform: translateY(8px); } }
}
