/* ==============================
   RESET & BASE
   ============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background: #F3F4F6;
  color: #1E293B;
  font-size: 20px;
  line-height: 1.75;
}

/* ==============================
   CSS CUSTOM PROPERTIES
   ============================== */
:root {
  --aws-dark:        #232F3E;
  --aws-orange:      #dc7600;
  --aws-orange-bg:   #FFF7ED;
  --aws-orange-bd:   #FDBA74;
  --text-primary:    #1E293B;
  --text-secondary:  #475569;
  --text-white:      #FFFFFF;
  --bg-page:         #F3F4F6;
  --bg-white:        #FFFFFF;
  --bg-panel:        #F8FAFC;
  --border:          #E2E8F0;
  --border-mid:      #CBD5E1;
  --blue:            #3B82F6;
  --blue-bg:         #EEF2FF;
  --blue-bd:         #818CF8;
  --green:           #10B981;
  --green-bg:        #ECFDF5;
  --green-bd:        #34D399;
  --green-text:      #059669;
  --yellow:          #F59E0B;
  --yellow-bg:       #FEFCE8;
  --yellow-bd:       #FACC15;
  --red:             #EF4444;
  --red-bg:          #FEF2F2;
  --red-bd:          #F87171;
  --purple:          #8B5CF6;
  --purple-bg:       #F5F3FF;
  --purple-bd:       #C4B5FD;
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       18px;
  --radius-xl:       24px;
  --shadow-sm:       0 2px 6px rgba(0,0,0,0.07);
  --shadow-md:       0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:       0 8px 32px rgba(0,0,0,0.13);
}

/* ==============================
   PROGRESS BAR
   ============================== */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--aws-orange), #FF9900);
  z-index: 1001;
  width: 0%;
  transition: width 0.15s;
}

/* ==============================
   SCROLL TO TOP
   ============================== */
.scroll-top-btn {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 52px; height: 52px;
  background: var(--aws-dark);
  color: var(--text-white);
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==============================
   LAYOUT
   ============================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==============================
   PAGE HEADER
   ============================== */
.page-header {
  background: linear-gradient(135deg, #232F3E 0%, #374151 100%);
  color: var(--text-white);
  padding: 64px 0 52px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,153,0,0.18);
  border: 1px solid rgba(255,153,0,0.4);
  color: #FBBF24;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}
.header-accent { color: #FBBF24; }
.header-desc {
  font-size: 20px;
  color: #CBD5E1;
  max-width: 720px;
  line-height: 1.7;
  margin-bottom: 32px;
}
.header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.header-tag {
  background: rgba(255,255,255,0.1);
  color: #E2E8F0;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 17px;
}

/* ==============================
   MAIN
   ============================== */
main { padding: 52px 0 16px; }

/* ==============================
   SECTION
   ============================== */
.section { margin-bottom: 60px; }
.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--aws-orange);
}
.section-icon {
  width: 46px; height: 46px;
  background: var(--aws-orange);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: var(--text-white);
}

/* ==============================
   CARDS & GRID
   ============================== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

/* ==============================
   KEY TAKEAWAYS
   ============================== */
.takeaway-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid transparent;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.takeaway-card:nth-child(1) { border-left-color: var(--blue); }
.takeaway-card:nth-child(2) { border-left-color: var(--green); }
.takeaway-card:nth-child(3) { border-left-color: var(--aws-orange); }
.takeaway-card:nth-child(4) { border-left-color: var(--purple); }
.takeaway-icon { font-size: 34px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.takeaway-title { font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.takeaway-body { font-size: 19px; color: var(--text-secondary); line-height: 1.65; }

/* ==============================
   ANALOGY INTRO
   ============================== */
.analogy-intro {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.8;
}
.analogy-intro strong { color: var(--text-primary); }

/* ==============================
   ANALOGY TABLE
   ============================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.analogy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
  background: var(--bg-white);
}
.analogy-table thead th {
  background: var(--aws-dark);
  color: var(--text-white);
  padding: 16px 22px;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}
.analogy-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.analogy-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.analogy-table tbody td {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 20px;
}
.analogy-table tbody tr:last-child td { border-bottom: none; }
.analogy-table tbody tr:nth-child(even) td { background: var(--bg-panel); }
.analogy-table tbody tr:hover td { background: var(--blue-bg); }
.tbl-emoji { font-size: 26px; text-align: center; }
.badge-aws {
  display: inline-block;
  background: var(--aws-orange-bg);
  color: var(--aws-orange);
  border: 1px solid var(--aws-orange-bd);
  padding: 3px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 17px;
}
.badge-train {
  display: inline-block;
  background: var(--blue-bg);
  color: #4338CA;
  border: 1px solid var(--blue-bd);
  padding: 3px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 17px;
}

/* ==============================
   SVG DIAGRAM CONTAINER
   ============================== */
.svg-wrap {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px 24px 16px;
  box-shadow: var(--shadow-md);
}
.svg-wrap svg { width: 100%; height: auto; display: block; }
.svg-caption {
  font-size: 18px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
.compare-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.compare-before {
  background: var(--red-bg);
  color: var(--red);
  border: 2px solid var(--red-bd);
}
.compare-after {
  background: var(--green-bg);
  color: var(--green-text);
  border: 2px solid var(--green-bd);
}

/* ==============================
   HOW IT WORKS - STEPS
   ============================== */
.steps-list { display: flex; flex-direction: column; gap: 16px; }
.step-item {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.step-number {
  width: 48px; height: 48px;
  background: var(--blue);
  color: var(--text-white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-body h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.step-body p  { font-size: 20px; color: var(--text-secondary); line-height: 1.7; }
.step-body .inline-code {
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  padding: 2px 9px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 17px;
  color: #7C3AED;
}

/* ==============================
   USE CASE CARDS
   ============================== */
.usecase-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  border-top: 5px solid transparent;
}
.usecase-card:nth-child(1) { border-top-color: var(--blue); }
.usecase-card:nth-child(2) { border-top-color: var(--green); }
.usecase-card:nth-child(3) { border-top-color: var(--purple); }
.usecase-icon { font-size: 38px; margin-bottom: 16px; display: block; }
.usecase-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.usecase-body { font-size: 20px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.7; }
.usecase-tag {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 999px;
}
.tag-blue   { background: var(--blue-bg);   color: #1D4ED8; }
.tag-green  { background: var(--green-bg);  color: var(--green-text); }
.tag-purple { background: var(--purple-bg); color: #6D28D9; }

/* ==============================
   PRICING
   ============================== */
.pricing-note {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.7;
}
.pricing-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}
.pricing-card-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 20px;
  gap: 16px;
}
.pricing-row:last-child { border-bottom: none; }
.pricing-label { color: var(--text-secondary); }
.pricing-amount { font-weight: 700; color: var(--aws-orange); white-space: nowrap; }
.pricing-highlight {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-bd);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 16px;
  font-size: 20px;
  color: #92400E;
  line-height: 1.7;
}

/* ==============================
   BEST PRACTICES
   ============================== */
.do-card {
  background: var(--green-bg);
  border: 2px solid var(--green-bd);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.dont-card {
  background: var(--red-bg);
  border: 2px solid var(--red-bd);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.do-card h3   { font-size: 23px; font-weight: 700; color: var(--green-text); margin-bottom: 18px; }
.dont-card h3 { font-size: 23px; font-weight: 700; color: var(--red);        margin-bottom: 18px; }
.practice-list { list-style: none; }
.practice-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 0;
  font-size: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  line-height: 1.6;
}
.practice-list li:last-child { border-bottom: none; }
.pi { flex-shrink: 0; font-size: 20px; margin-top: 2px; }

/* ==============================
   FAQ ACCORDION
   ============================== */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-btn {
  width: 100%;
  padding: 20px 26px;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  line-height: 1.5;
}
.faq-btn:hover { background: var(--bg-panel); }
.faq-chevron { font-size: 18px; transition: transform 0.3s; flex-shrink: 0; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  font-size: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding: 0 26px;
}
.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 26px 24px;
}
.faq-tag {
  display: inline-block;
  background: var(--blue-bg);
  color: #1D4ED8;
  font-size: 15px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  margin-right: 8px;
}

/* ==============================
   CODE BLOCK
   ============================== */
.code-tabs {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.tab-bar {
  display: flex;
  background: #1E293B;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.tab-btn {
  padding: 13px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #94A3B8;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn.active {
  color: #FBBF24;
  border-bottom-color: #FBBF24;
}
.tab-btn:hover { color: #E2E8F0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.code-block {
  background: #0F172A;
  padding: 26px 28px;
  overflow-x: auto;
}
.code-block pre {
  font-family: 'Courier New', 'Consolas', 'SF Mono', monospace;
  font-size: 17px;
  line-height: 1.7;
  color: #E2E8F0;
  white-space: pre-wrap;
  word-break: break-all;
}
.cc { color: #64748B; }   /* comment */
.ck { color: #7DD3FC; }   /* keyword / key */
.cv { color: #86EFAC; }   /* value */
.cs { color: #FDA4AF; }   /* string */
.cn { color: #FBBF24; }   /* number / flag */

/* ==============================
   CHEAT SHEET
   ============================== */
.cheatsheet {
  background: var(--aws-dark);
  border-radius: var(--radius-xl);
  padding: 44px;
  color: var(--text-white);
}
.cheatsheet-title {
  font-size: 28px;
  font-weight: 700;
  color: #FBBF24;
  margin-bottom: 8px;
}
.cheatsheet-subtitle {
  font-size: 20px;
  color: #94A3B8;
  margin-bottom: 32px;
}
.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cs-item {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 22px;
}
.cs-term  { font-size: 17px; color: #94A3B8; margin-bottom: 6px; font-weight: 600; }
.cs-def   { font-size: 20px; color: var(--text-white); font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.cs-ex    { font-size: 18px; color: #FBBF24; line-height: 1.5; }

/* ==============================
   FOOTER
   ============================== */
footer {
  background: var(--aws-dark);
  color: #64748B;
  text-align: center;
  padding: 36px 24px;
  font-size: 18px;
  margin-top: 40px;
}
footer a { color: #FBBF24; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ==============================
   RESPONSIVE
   ============================== */
.compare-block-before { margin-bottom: 32px; }
.arch-diagram-wrap { margin-top: 32px; }
  .page-header h1 { font-size: 30px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .cheatsheet-grid { grid-template-columns: 1fr 1fr; }
  .cheatsheet { padding: 28px; }
}
@media (max-width: 600px) {
  body { font-size: 18px; }
  .page-header h1 { font-size: 24px; }
  .cheatsheet-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
