/* ========================================
   Impeccable Design System
   Canvas: #ffffff | Ink: #000000 | Accent: #0052cc
   ======================================== */

:root {
  --canvas: #ffffff;
  --ink: #000000;
  --accent: #0052cc;
  --accent-light: #e8f0fe;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-400: #a3a3a3;
  --gray-600: #525252;
  --red: #dc2626;
  --green: #16a34a;
  --orange: #ea580c;
  --yellow: #ca8a04;
  --radius: 4px;
  --font-sans: 'Pretendard', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
}

/* ---- Typography ---- */
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 48px; }
h2 { font-size: 32px; }
h3 { font-size: 20px; }

@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
}

/* ---- Container ---- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}

.text-center { text-align: center; }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--canvas);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  min-height: 44px;
  line-height: 1.4;
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--canvas);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--canvas);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  min-height: 44px;
}

.btn-secondary:hover {
  background: var(--gray-100);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-image-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) brightness(0.3);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 80px 0;
  max-width: 680px;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--canvas);
  background: var(--accent);
  border-radius: var(--radius);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-title {
  color: var(--canvas);
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  margin-bottom: 32px;
  max-width: 560px;
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.hero-content .btn-primary {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--canvas);
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-content .btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--canvas);
}

.hero-note {
  margin-top: 16px;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Problem Section ---- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.section-title {
  margin-bottom: 32px;
}

.incident-timeline {
  position: relative;
  padding-left: 28px;
}

.incident-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.incident-item {
  position: relative;
  padding-bottom: 28px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.5s, transform 0.5s;
}

.incident-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.incident-dot {
  position: absolute;
  left: -25px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--canvas);
}

.incident-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 4px;
}

.incident-content p {
  font-size: 15px;
  color: var(--gray-600);
}

.problem-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

/* ---- Progress Bar ---- */
.progress-bar-wrap {
  max-width: 680px;
  margin: 0 auto 40px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius);
  transition: width 0.4s ease;
}

/* ---- Diagnostic Form ---- */
.diagnostic-form {
  max-width: 680px;
  margin: 0 auto;
}

.category-slide {
  display: none;
}

.category-slide.active {
  display: block;
  animation: fadeIn 0.35s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.category-header {
  margin-bottom: 32px;
}

.category-header h3 {
  margin-bottom: 8px;
}

.category-header p {
  font-size: 14px;
  color: var(--gray-600);
}

.question-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-200);
}

.question-item:last-child {
  border-bottom: none;
}

.question-text {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.5;
}

.question-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.option-btn {
  padding: 8px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
}

.option-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.option-btn.selected {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}

.option-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  gap: 16px;
}

/* ---- Results ---- */
.results-section {
  background: var(--gray-100);
}

.score-hero {
  text-align: center;
  padding: 48px 0;
}

.score-ring-wrap {
  position: relative;
  display: inline-block;
  width: 200px;
  height: 200px;
  margin-bottom: 24px;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--gray-200);
  stroke-width: 12;
}

.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease-out;
}

.score-number-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 68px;
}

.score-number {
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 700;
  color: var(--ink);
}

.score-unit {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--gray-600);
  margin-left: 4px;
}

.score-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.score-grade {
  display: inline-block;
  padding: 4px 16px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  border-radius: var(--radius);
  color: var(--canvas);
  background: var(--accent);
}

.score-label {
  font-size: 15px;
  color: var(--gray-600);
}

/* Breakdown Grid */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 48px 0;
}

@media (max-width: 768px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.breakdown-card {
  padding: 24px;
  background: var(--canvas);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.breakdown-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.breakdown-card-title {
  font-size: 15px;
  font-weight: 700;
}

.breakdown-card-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.breakdown-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 1s ease-out;
}

/* ---- Recommendations ---- */
.recommendations {
  margin: 48px 0;
}

.subsection-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.rec-card {
  padding: 20px;
  margin-bottom: 12px;
  background: var(--canvas);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.rec-card.priority-high {
  border-left-color: var(--red);
}

.rec-card.priority-medium {
  border-left-color: var(--orange);
}

.rec-card.priority-low {
  border-left-color: var(--green);
}

.rec-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.rec-desc {
  font-size: 14px;
  color: var(--gray-600);
}

.rec-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  border-radius: 2px;
  margin-top: 8px;
}

.rec-tag.high { background: #fef2f2; color: var(--red); }
.rec-tag.medium { background: #fff7ed; color: var(--orange); }
.rec-tag.low { background: #f0fdf4; color: var(--green); }

/* ---- ISMS-P Section ---- */
.isms-section {
  margin: 48px 0;
}

.isms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.isms-table th {
  text-align: left;
  padding: 12px;
  background: var(--ink);
  color: var(--canvas);
  font-weight: 700;
  font-size: 13px;
}

.isms-table td {
  padding: 12px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

.isms-table tr:last-child td {
  border-bottom: none;
}

.isms-code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

/* ---- Scenario Section ---- */
.scenario-section {
  margin: 48px 0;
}

.scenario-timeline {
  position: relative;
  padding: 0;
  list-style: none;
}

.scenario-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-200);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s, transform 0.4s;
}

.scenario-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.scenario-step:last-child {
  border-bottom: none;
}

.scenario-time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  padding-top: 2px;
}

.scenario-action {
  font-size: 15px;
  line-height: 1.5;
}

/* ---- Result CTA ---- */
.result-cta {
  text-align: center;
  padding: 48px;
  margin-top: 48px;
  background: var(--ink);
  color: var(--canvas);
  border-radius: var(--radius);
}

.result-cta p {
  font-size: 18px;
  margin-bottom: 24px;
  font-weight: 700;
}

.result-cta .btn-primary {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--canvas);
}

.result-cta .btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--canvas);
}

/* ---- Footer ---- */
.footer {
  padding: 48px 0 24px;
  border-top: 1px solid var(--gray-200);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.footer-logo {
  font-size: 18px;
  font-weight: 700;
}

.footer-desc {
  font-size: 14px;
  color: var(--gray-600);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  padding: 12px 4px;
  min-height: 44px;
  line-height: 20px;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-400);
}

@media (max-width: 768px) {
  .footer-grid {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* ---- Animations ---- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s, transform 0.6s;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Scroll indicator ---- */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 100;
  transition: width 0.1s;
}
