/*
  SNE Job Compass visual layer
  The page remains a single static document so the existing analysis logic and
  deep links stay intact. This file owns the visual system for /job/ only.
*/
:root {
  --job-ink: #18211d;
  --job-ink-soft: #2f3a34;
  --job-paper: #f4f5f1;
  --job-surface: #ffffff;
  --job-line: #d7ddd5;
  --job-line-strong: #b9c6bc;
  --job-muted: #66736a;
  --job-accent: #d68f2e;
  --job-accent-soft: #f2e3c9;
  --job-s: #3569b8;
  --job-n: #2f8971;
  --job-e: #b4534d;
  --job-radius: 14px;
  --job-shadow: 0 22px 60px rgba(31, 42, 35, 0.08);
  --job-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 8% 4%, rgba(214, 143, 46, 0.08), transparent 28rem),
    var(--job-paper);
  color: var(--job-ink);
  font-family: 'Geist', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.015em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  z-index: -1;
  background-image: linear-gradient(rgba(24, 33, 29, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 29, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

header {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.92fr);
  align-items: end;
  gap: clamp(2rem, 7vw, 8rem);
  min-height: min(720px, 88dvh);
  padding: clamp(5rem, 10vw, 9rem) max(1.25rem, calc((100vw - 1180px) / 2));
  background:
    radial-gradient(circle at 82% 56%, rgba(214, 143, 46, 0.07), transparent 28rem),
    linear-gradient(115deg, #101a15 0%, #19251f 58%, #1c2b24 100%);
  color: #f7f8f3;
  text-align: left;
  isolation: isolate;
}

header::after {
  content: '';
  position: absolute;
  right: -10vw;
  bottom: -22vw;
  width: 58vw;
  height: 58vw;
  border: 1px solid rgba(214, 143, 46, 0.28);
  border-radius: 50%;
  transform: rotate(-18deg);
  pointer-events: none;
  z-index: -1;
}

header h1 {
  max-width: 9ch;
  margin: 0 0 1rem;
  color: #f7f8f3;
  font-family: 'Geist', 'Noto Sans JP', sans-serif;
  font-size: clamp(3.1rem, 7vw, 6.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.07em;
}

.hero-break { display: block; }

header .subtitle {
  max-width: 26rem;
  margin: 0;
  color: #d8ded8;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  letter-spacing: 0.06em;
}

header .declaration {
  align-self: end;
  max-width: 32rem;
  margin: 0 0 0.5rem;
  padding: 1.75rem 1.75rem 1.75rem 2rem;
  border: 1px solid rgba(223, 229, 220, 0.22);
  border-left: 3px solid var(--job-accent);
  border-radius: var(--job-radius);
  background: rgba(15, 23, 19, 0.55);
  color: #edf1eb;
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
}

header .declaration strong {
  color: var(--job-accent);
  font-family: 'Geist', 'Noto Sans JP', sans-serif;
  font-size: 0.75em;
  letter-spacing: 0.14em;
}

nav {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.7rem max(1.25rem, calc((100vw - 1180px) / 2));
  border: 0;
  border-bottom: 1px solid rgba(185, 198, 188, 0.82);
  background: rgba(244, 245, 241, 0.9);
  backdrop-filter: blur(18px) saturate(120%);
}

nav ul {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
}

nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0;
  border: 0;
  color: var(--job-muted);
  font-family: 'Geist', 'Noto Sans JP', sans-serif;
  font-size: clamp(0.95rem, 1.25vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 180ms ease;
}

nav a::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--job-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

nav a:hover,
nav a:focus-visible { color: var(--job-ink); }
nav a:hover::after,
nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

main {
  width: min(1180px, calc(100% - 2.5rem));
  max-width: none;
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 9rem) 0;
}

section {
  margin-bottom: clamp(6rem, 12vw, 12rem);
  scroll-margin-top: 90px;
}

section > h2 {
  position: relative;
  max-width: 62rem;
  margin: 0 0 1.75rem;
  padding: 0 0 1.1rem;
  border: 0;
  color: var(--job-ink);
  font-family: 'Geist', 'Noto Sans JP', sans-serif;
  font-size: clamp(2rem, 4vw, 3.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.06em;
  line-break: strict;
  text-wrap: balance;
}

.heading-nowrap { white-space: nowrap; }

section > h2::after {
  content: '';
  display: block;
  width: 3.5rem;
  height: 3px;
  margin-top: 1rem;
  background: var(--job-accent);
}

section > p,
section > h3,
section > ul,
section > table,
section > .triangle-container {
  max-width: 760px;
}

section > p { color: var(--job-muted); }

h3 {
  margin: 2.75rem 0 0.9rem;
  color: var(--job-ink);
  font-family: 'Geist', 'Noto Sans JP', sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

p { color: var(--job-muted); }
strong { color: var(--job-ink); }

.sne-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(18rem, auto);
  grid-auto-flow: row;
  gap: 1rem;
  margin: 3rem 0 2rem;
  align-items: stretch;
}

.sne-card {
  grid-row: auto !important;
  min-height: 18rem;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--job-line);
  border-top: 4px solid var(--job-ink);
  border-radius: var(--job-radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--job-shadow);
  transition: transform 260ms ease, border-color 260ms ease, background 260ms ease;
}

.sne-card:first-child { background: linear-gradient(145deg, #ffffff 0%, #edf4f6 100%); }
.sne-card.s-card { border-top-color: var(--job-s); }
.sne-card.n-card { border-top-color: var(--job-n); background: linear-gradient(145deg, #ffffff 0%, #edf5f1 100%); }
.sne-card.e-card { border-top-color: var(--job-e); background: linear-gradient(145deg, #ffffff 0%, #f7efee 100%); }
.sne-card:hover { transform: translateY(-4px); border-color: var(--job-line-strong); }

.sne-card h4 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1.1rem;
  color: var(--job-ink);
  font-size: clamp(1.22rem, 1.6vw, 1.5rem);
}

.sne-card .badge {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-family: var(--job-mono);
  font-size: 0.9rem;
  line-height: 1;
}

.sne-card.s-card .badge { background: var(--job-s); }
.sne-card.n-card .badge { background: var(--job-n); }
.sne-card.e-card .badge { background: var(--job-e); }
.sne-card p { margin: 0; font-size: clamp(1.02rem, 1.25vw, 1.18rem); line-height: 1.8; }

.triangle-container {
  display: grid;
  place-items: center;
  min-height: 25rem;
  margin: 3rem 0;
  padding: 1.5rem;
  border: 1px solid var(--job-line);
  border-radius: var(--job-radius);
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(233,238,232,0.65));
}

.triangle-svg {
  width: 620px;
  max-width: 100%;
  filter: drop-shadow(0 16px 24px rgba(32, 52, 40, 0.08));
}

.triangle-svg .vertex-letter { font-size: 22px; }
.triangle-svg .vertex-label { font-size: 16px; font-weight: 600; }
.triangle-svg .tension-label { font-size: 15px; font-weight: 600; }

.prompt-section,
.analysis-form,
.result-card,
.case-study,
.anchor-question {
  border: 1px solid var(--job-line);
  border-radius: var(--job-radius);
  box-shadow: var(--job-shadow);
}

.prompt-section {
  margin: 1.25rem 0 1.75rem;
  padding: 1.35rem;
  background: rgba(255,255,255,0.78);
}

.prompt-section h4 { margin: 0 0 0.75rem; font-size: 0.95rem; }

.prompt-box {
  overflow: auto;
  min-height: 6rem;
  padding: 1.15rem;
  border: 1px solid #35443b;
  border-radius: 10px;
  background: #1a2520;
  color: #e7eee8;
  font-family: var(--job-mono);
  font-size: 0.78rem;
  line-height: 1.7;
}

.copy-btn {
  min-height: 34px;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 7px;
  background: transparent;
  color: #f5f8f4;
  font-family: var(--job-mono);
  font-size: 0.68rem;
  cursor: pointer;
}
.copy-btn:hover, .copy-btn.copied { border-color: var(--job-accent); color: #ffd991; }

.tab-nav {
  display: flex;
  gap: 0.35rem;
  margin: 2.25rem 0 1.25rem;
  border: 0;
}

.tab-btn {
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--job-line);
  border-radius: 9px;
  background: transparent;
  color: var(--job-muted);
  font-family: var(--job-mono);
  font-size: 0.72rem;
  cursor: pointer;
}
.tab-btn:hover { color: var(--job-ink); border-color: var(--job-line-strong); }
.tab-btn.active { border-color: var(--job-ink); background: var(--job-ink); color: #fff; }

.accordion { margin: 1.25rem 0; }
.accordion-item { margin-bottom: 0.65rem; border: 1px solid var(--job-line); border-radius: 11px; overflow: hidden; background: rgba(255,255,255,0.72); }
.accordion-header { padding: 1.05rem 1.15rem; color: var(--job-ink); background: transparent; font-weight: 600; }
.accordion-header:hover { background: rgba(214,143,46,0.07); }
.accordion-content { border-top: 1px solid var(--job-line); background: rgba(249,250,247,0.72); }
.accordion-icon { color: var(--job-accent); font-family: var(--job-mono); font-size: 0.72rem; }

.save-load-bar {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 0.9rem;
  border: 1px solid var(--job-line);
  border-radius: var(--job-radius);
  background: rgba(255,255,255,0.64);
}

.analysis-form { position: relative; padding: clamp(1.25rem, 4vw, 3rem); background: rgba(255,255,255,0.86); }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--job-ink); font-weight: 600; }
.form-group .hint { color: var(--job-muted); font-size: 0.82rem; line-height: 1.65; }
.form-group input, .form-group textarea {
  border: 1px solid var(--job-line-strong);
  border-radius: 9px;
  background: #fbfcfa;
  color: var(--job-ink);
  font-family: 'Geist', 'Noto Sans JP', sans-serif;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--job-accent); box-shadow: 0 0 0 3px rgba(214,143,46,0.15); }
.form-section { margin: 2rem 0; padding: clamp(1rem, 3vw, 1.75rem); border: 1px solid var(--job-line); border-radius: var(--job-radius); }
.form-section.s-section { background: linear-gradient(135deg, rgba(53,105,184,0.08), rgba(255,255,255,0.7)); }
.form-section.n-section { background: linear-gradient(135deg, rgba(47,137,113,0.08), rgba(255,255,255,0.7)); }
.form-section.e-section { background: linear-gradient(135deg, rgba(180,83,77,0.08), rgba(255,255,255,0.7)); }
.form-section h4 { margin: 0 0 1.25rem; }

.btn, .btn-research {
  min-height: 44px;
  border-radius: 9px;
  font-family: 'Geist', 'Noto Sans JP', sans-serif;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.btn { padding: 0.75rem 1.15rem; }
.btn:hover, .btn-research:hover { transform: translateY(-2px); box-shadow: none; }
.btn:active, .btn-research:active { transform: translateY(0) scale(0.98); }
.btn-primary, .btn-ai { background: var(--job-ink); color: #fff; }
.btn-primary:hover, .btn-ai:hover { background: #2c3a32; }
.btn-secondary { border: 1px solid var(--job-line-strong); background: transparent; color: var(--job-ink); }
.btn-secondary:hover { background: #fff; border-color: var(--job-ink); }
.btn-research { margin-top: 0.65rem; padding: 0.55rem 0.8rem; border: 1px solid var(--job-line-strong); background: transparent; color: var(--job-ink); font-size: 0.8rem; cursor: pointer; }
.btn-group { flex-wrap: wrap; gap: 0.75rem; }

.result-card, .case-study { padding: clamp(1.25rem, 4vw, 2.5rem); background: rgba(255,255,255,0.86); }
.score-display { gap: clamp(1rem, 6vw, 4rem); }
.score-circle { box-shadow: 0 8px 18px rgba(31,42,35,0.12); }
.tension-list li { border: 1px solid rgba(214,143,46,0.28); border-left: 4px solid var(--job-accent); border-radius: 9px; background: #fffaf0; }
.anchor-question { padding: clamp(1.25rem, 4vw, 2.75rem); background: linear-gradient(135deg, #fff7e8, #f4eee1); text-align: left; }
.anchor-question h3 { margin-top: 0; }
.anchor-options { justify-content: flex-start; }
.anchor-option { border-radius: 9px; }

.case-study-header { padding-bottom: 1.25rem; border-bottom: 1px solid var(--job-line); }
.case-study-header .company-name { font-family: 'Geist', 'Noto Sans JP', sans-serif; }
.case-study-header .tag { border: 1px solid var(--job-line); border-radius: 999px; background: transparent; }
.data-table { border: 1px solid var(--job-line); border-radius: 10px; overflow: hidden; }
.data-table th { background: #edf1ec; color: var(--job-ink); font-family: var(--job-mono); font-size: 0.72rem; }
.data-table th, .data-table td { border-bottom: 1px solid var(--job-line); }

footer {
  padding: 4rem max(1.25rem, calc((100vw - 1180px) / 2));
  background: var(--job-ink);
  color: #cdd6cf;
  text-align: left;
}
footer a { color: #fff; text-decoration-color: rgba(214,143,46,0.7); text-underline-offset: 4px; }

.modal-overlay { background: rgba(12, 18, 15, 0.76); backdrop-filter: blur(8px); }
.modal-content { border: 1px solid var(--job-line); border-radius: var(--job-radius); box-shadow: 0 26px 80px rgba(0,0,0,0.24); }
.ai-prompt-output { border: 1px solid var(--job-line); border-radius: 10px; background: #f3f5f1; }
.ai-loading .spinner {
  display: inline-block;
  width: 9rem;
  height: 0.55rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--job-line), #e9bf74, var(--job-line));
  background-size: 220% 100%;
  animation: jobShimmer 1.8s ease-in-out infinite;
}
@keyframes jobShimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.progress-active { border-color: var(--job-accent) !important; animation: jobPulse 2.3s ease-in-out infinite; }
@keyframes jobPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214,143,46,0.16); } 50% { box-shadow: 0 0 0 8px rgba(214,143,46,0); } }
.bar-shimmer { background: linear-gradient(90deg, var(--job-accent), #f2c66f, var(--job-accent)) !important; background-size: 200% 100% !important; }

@media (max-width: 767px) {
  body { font-size: 15px; }
  header { display: block; min-height: auto; padding: 5.5rem 1.25rem 4.5rem; }
  header h1 { max-width: none; font-size: clamp(2.65rem, 13vw, 4.4rem); }
  header .declaration { margin-top: 3rem; }
  nav { overflow-x: auto; padding-right: 1rem; padding-left: 1rem; }
  nav ul { width: max-content; justify-content: flex-start; gap: 1.25rem; }
  nav a { min-height: 44px; font-size: 0.95rem; }
  main { width: min(100% - 2rem, 42rem); padding: 4rem 0; }
  section { margin-bottom: 6rem; }
  section > h2 { font-size: clamp(2rem, 10vw, 3rem); }
  .sne-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .sne-card:first-child { grid-row: auto; }
  .triangle-container { min-height: 18rem; }
  .tab-nav { overflow-x: auto; padding-bottom: 0.35rem; }
  .tab-btn { white-space: nowrap; }
  .save-load-bar { align-items: stretch; flex-wrap: wrap; }
  .save-load-bar .btn { flex: 1 1 calc(50% - 0.55rem); }
  .form-section { padding: 1rem; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; }
  .data-table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
