/* ==========================================================================
   KakoBuy Spreadsheet — Question Ladder / Folded Prompt Cards theme
   Soft cream · deep plum-black · bright water blue · warm orange · acid yellow
   ========================================================================== */

:root {
  /* palette */
  --cream:       #F6F1E5;
  --cream-2:     #EDE6D3;
  --paper:       #FDFAF2;
  --plum:        #2B1E30;
  --plum-2:      #463448;
  --plum-3:      #5E4C68;
  --ink:         #2B1E30;
  --ink-soft:    #6D5F74;
  --ink-faint:   #9C8EA3;
  --blue:        #2FB7E4;
  --blue-d:      #1B8BB6;
  --blue-s:      #E1F3FB;
  --orange:      #EC8B3D;
  --orange-d:    #C86E22;
  --orange-s:    #FBE8D5;
  --acid:        #DDF23E;
  --acid-d:      #A9BC14;
  --line:        #E2D9C4;
  --line-soft:   #EDE4D1;
  --on-plum:       rgba(253, 250, 242, 0.84);
  --on-plum-dim:   rgba(253, 250, 242, 0.54);
  --on-plum-line:  rgba(253, 250, 242, 0.16);

  /* typography */
  --serif: Georgia, 'Times New Roman', Times, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* geometry */
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1140px;
  --shadow-sm: 0 1px 2px rgba(43, 30, 48, 0.05), 0 2px 8px rgba(43, 30, 48, 0.06);
  --shadow-md: 0 4px 14px rgba(43, 30, 48, 0.10), 0 12px 32px rgba(43, 30, 48, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- accessibility ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--acid); color: #202700; padding: 10px 16px; z-index: 200; border-radius: 0 0 var(--radius-sm) 0; font-weight: 700; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--acid); outline-offset: 2px; border-radius: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(253, 250, 242, 0.94); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--plum); }
.brand img { width: 34px; height: 34px; display: block; border-radius: 7px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.06rem; letter-spacing: 0.01em; }
.brand-name small { display: block; font-family: var(--sans); font-weight: 600; font-size: 0.66rem; color: var(--ink-faint); letter-spacing: 0.14em; text-transform: uppercase; }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; border-radius: var(--radius-sm); }
.main-nav a:hover { background: var(--cream-2); color: var(--plum); }
.main-nav a.active { color: #202700; background: var(--acid); }

.mobile-nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-sm); cursor: pointer; color: var(--plum); }
.mobile-nav-toggle svg { display: block; margin: 0 auto; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .mobile-nav-toggle { display: block; }
  .main-nav.open { display: block; position: absolute; left: 0; right: 0; top: 66px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); }
  .main-nav.open ul { flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; }
  .main-nav.open a { padding: 12px 14px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 0.98rem; line-height: 1.2; border: 1.5px solid transparent; transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: var(--plum); box-shadow: 0 4px 14px rgba(47, 183, 228, 0.28); }
.btn-primary:hover { background: #52C6EC; box-shadow: 0 6px 18px rgba(47, 183, 228, 0.36); }
.btn-secondary { background: var(--paper); color: var(--plum); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--blue); background: #fff; }
.btn-ghost-on-plum { background: transparent; color: var(--paper); border-color: var(--on-plum-line); }
.btn-ghost-on-plum:hover { border-color: var(--on-plum); }
.btn-sm { padding: 9px 16px; font-size: 0.88rem; }

/* ---------- hero (light) ---------- */
.hero-section { padding: 52px 0 44px; position: relative; overflow: hidden; background: radial-gradient(circle at 84% 6%, var(--blue-s) 0, transparent 44%), radial-gradient(circle at 6% 94%, var(--orange-s) 0, transparent 40%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; }
.hero-badge { display: inline-block; padding: 5px 13px; border-radius: 999px; background: var(--blue-s); color: var(--blue-d); font-weight: 700; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-title { font-family: var(--serif); font-size: clamp(2.05rem, 4.6vw, 3.1rem); line-height: 1.12; color: var(--plum); margin: 18px 0 16px; font-weight: 700; }
.hero-title em { font-style: italic; color: var(--blue-d); }
.hero-description { font-size: 1.08rem; color: var(--ink-soft); max-width: 34em; margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero question ladder of folded prompt cards */
.hero-visual { position: relative; }
.hero-ladder { display: flex; flex-direction: column; gap: 10px; }
.ladder-card {
  position: relative; display: flex; align-items: center; gap: 13px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px 15px; box-shadow: var(--shadow-sm);
}
.ladder-card::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; border-top: 1px dashed var(--line); }
.ladder-card::after { content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0; border-width: 0 16px 16px 0; border-style: solid; border-color: transparent var(--cream-2) transparent transparent; border-radius: 0 8px 0 0; }
.ladder-card.lc-1 { margin-left: 0; }
.ladder-card.lc-2 { margin-left: 24px; }
.ladder-card.lc-3 { margin-left: 48px; }
.ladder-card.lc-4 { margin-left: 72px; }
.rung-num { flex: none; width: 32px; height: 32px; border-radius: 6px; background: var(--acid); color: var(--plum); font-family: var(--mono); font-weight: 800; font-size: 0.8rem; display: grid; place-items: center; }
.rung-q { font-weight: 600; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.35; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-section { padding-top: 34px; }
  .ladder-card.lc-2 { margin-left: 14px; }
  .ladder-card.lc-3 { margin-left: 28px; }
  .ladder-card.lc-4 { margin-left: 42px; }
}

/* ---------- section scaffolding ---------- */
.section { padding: 46px 0; }
.section-alt { background: var(--cream-2); }
.section-header { max-width: 680px; margin: 0 auto 34px; text-align: center; }
.eyebrow { display: inline-block; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-d); }
.section-title { font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.15rem); color: var(--plum-2); margin: 10px 0 12px; line-height: 1.2; }
.section-lead { color: var(--ink-soft); font-size: 1.02rem; margin: 0; }

/* ---------- category grid (punched question tickets) ---------- */
.categories-section { padding-top: 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 16px 14px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue); }
.cat-card::before { content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0; border-width: 0 22px 22px 0; border-style: solid; border-color: transparent var(--cream-2) transparent transparent; border-radius: 0 var(--radius) 0 0; }
.cat-card::after { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 11px; height: 11px; border-radius: 50%; background: var(--cream); border: 1.5px solid var(--line); }
.cat-num { position: absolute; top: 10px; left: 12px; font-family: var(--mono); font-size: 0.7rem; font-weight: 800; background: var(--acid); color: var(--plum); padding: 2px 7px; border-radius: 5px; }
.cat-icon { width: 30px; height: 30px; color: var(--blue); margin-top: 8px; }
.cat-icon svg { width: 100%; height: 100%; }
.cat-name { font-weight: 700; color: var(--plum-2); font-size: 0.97rem; line-height: 1.32; }
.cat-card .cat-arrow { margin-top: auto; font-size: 0.8rem; font-weight: 700; color: var(--blue-d); }

@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-card { padding: 28px 12px 12px; }
  .cat-name { font-size: 0.9rem; }
}

/* ---------- ladder list (One Click, One Question) ---------- */
.ladder-list { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; counter-reset: rung; }
.ladder-item { display: flex; gap: 16px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 12px 0; box-shadow: var(--shadow-sm); }
.ladder-item .step-num { flex: none; width: 34px; height: 34px; border-radius: 7px; background: var(--acid); color: var(--plum); font-family: var(--mono); font-weight: 800; font-size: 0.8rem; display: grid; place-items: center; }
.ladder-item h3 { margin: 0 0 4px; font-size: 1.02rem; color: var(--plum-2); }
.ladder-item p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }
.ladder-item .answered { color: var(--blue-d); font-weight: 700; }
.ladder-item .left-open { color: var(--orange-d); font-weight: 700; }

/* ---------- duo grid (Ask Before You Assume) ---------- */
.duo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.duo-col { background: var(--paper); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.duo-col h3 { margin: 0 0 12px; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; color: var(--plum-2); }
.duo-col ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.94rem; }
.duo-col ul li { margin: 7px 0; }
.duo-col .mark { flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 0.8rem; color: var(--plum); font-family: var(--mono); }
.duo-col.is-a { border: 1.5px solid var(--blue); border-left: 6px solid var(--blue); }
.duo-col.is-b { border: 1.5px solid var(--orange); border-left: 6px solid var(--orange); }
.duo-col.is-a .mark { background: var(--blue); }
.duo-col.is-b .mark { background: var(--orange); }
@media (max-width: 720px) { .duo-grid { grid-template-columns: 1fr; } }

/* ---------- question card (unfolded paper) ---------- */
.q-card { max-width: 720px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.qc-part { position: relative; padding: 17px 20px 17px 60px; border-bottom: 1px dashed var(--line-soft); }
.qc-part:last-child { border-bottom: none; }
.qc-step { position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 6px; background: var(--acid); color: var(--plum); font-family: var(--mono); font-weight: 800; font-size: 0.78rem; display: grid; place-items: center; }
.qc-label { font-family: var(--mono); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.qc-part p { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.96rem; }
.qc-visible .qc-label { color: var(--blue-d); }
.qc-question .qc-label { color: var(--orange-d); }
.qc-confirm .qc-label { color: var(--plum-2); }
.qc-stop .qc-label { color: var(--ink-faint); }

/* ---------- known / unknown / not knowable ---------- */
.knn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.knn-card { position: relative; background: var(--paper); border-radius: var(--radius); padding: 22px 20px 20px; box-shadow: var(--shadow-sm); }
.knn-card::before, .knn-card::after { content: ""; position: absolute; width: 10px; height: 10px; border: 1.5px solid var(--ink-faint); }
.knn-card::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.knn-card::after { bottom: 8px; right: 8px; border-left: none; border-top: none; }
.knn-known { border: 1.5px solid var(--plum-2); }
.knn-unknown { border: 1.5px dashed var(--orange); }
.knn-notknowable { border: 1.5px dotted var(--blue-d); }
.knn-step { font-family: var(--mono); font-size: 0.72rem; font-weight: 800; background: var(--acid); color: var(--plum); padding: 2px 8px; border-radius: 5px; margin-right: 8px; }
.knn-tag { display: inline-block; font-family: var(--mono); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 5px; margin-bottom: 10px; }
.knn-known .knn-tag { background: var(--plum-2); color: var(--paper); }
.knn-unknown .knn-tag { background: var(--orange-s); color: var(--orange-d); }
.knn-notknowable .knn-tag { background: var(--blue-s); color: var(--blue-d); }
.knn-card h3 { margin: 8px 0 8px; font-size: 1.05rem; color: var(--plum-2); }
.knn-card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 0.93rem; }
.knn-gap { display: block; font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 4px; }
.answer-gap { display: inline-block; min-width: 96px; border-bottom: 1.5px solid var(--ink-faint); margin-left: 4px; }
.pause-tab { position: absolute; top: -13px; right: 18px; background: var(--acid); color: var(--plum); font-family: var(--mono); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 4px; box-shadow: var(--shadow-sm); }
@media (max-width: 900px) { .knn-grid { grid-template-columns: 1fr; } }

/* ---------- stop rules ---------- */
.rules-list { list-style: none; margin: 0; padding: 0; max-width: 760px; margin-inline: auto; }
.rules-list li { display: flex; gap: 14px; align-items: flex-start; padding: 15px 18px; margin: 10px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.rules-list .rule-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--plum); font-weight: 800; font-size: 0.8rem; font-family: var(--mono); background: var(--acid); }
.rules-list p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }
.rules-list strong { color: var(--plum-2); }

/* ---------- guide entry cards ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.guide-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform 0.14s ease, box-shadow 0.14s ease; }
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.guide-card .guide-num { font-family: var(--mono); font-size: 0.78rem; color: var(--blue-d); letter-spacing: 0.1em; }
.guide-card h3 { font-family: var(--serif); font-size: 1.24rem; color: var(--plum-2); margin: 8px 0 10px; }
.guide-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 16px; }
.guide-card .guide-cta { margin-top: auto; font-weight: 700; color: var(--blue-d); font-size: 0.9rem; }
@media (max-width: 900px) { .guide-grid { grid-template-columns: 1fr; } }

/* ---------- example flag ---------- */
.example-flag { display: block; text-align: center; margin-top: 18px; font-size: 0.76rem; color: var(--ink-faint); font-style: italic; border-top: 1px dashed var(--line); padding-top: 10px; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
details.faq-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; box-shadow: var(--shadow-sm); overflow: hidden; }
details.faq-item summary { cursor: pointer; list-style: none; padding: 16px 20px; font-weight: 700; color: var(--plum-2); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: "+"; font-size: 1.5rem; font-weight: 400; color: var(--blue-d); line-height: 1; }
details.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 20px 18px; color: var(--ink-soft); font-size: 0.96rem; }
.faq-item .faq-body p { margin: 0 0 10px; }

/* ---------- final CTA ---------- */
.final-cta { background: var(--plum); color: var(--paper); border-radius: 20px; padding: 46px 40px; text-align: center; position: relative; overflow: hidden; }
.final-cta::before { content: ""; position: absolute; inset: 0; opacity: 0.30; background: radial-gradient(circle at 14% 18%, var(--blue) 0, transparent 42%), radial-gradient(circle at 86% 82%, var(--orange) 0, transparent 42%); }
.final-cta h2 { font-family: var(--serif); font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: 0 0 12px; position: relative; }
.final-cta p { color: var(--on-plum); max-width: 32em; margin: 0 auto 24px; position: relative; }
.final-cta .btn-primary { position: relative; }

/* ---------- footer ---------- */
.site-footer { background: var(--plum); color: var(--on-plum); padding: 44px 0 30px; border-top: 1px solid var(--on-plum-line); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer-brand p { color: var(--on-plum); font-size: 0.92rem; max-width: 34em; }
.footer-brand .brand { color: var(--paper); }
.footer-col h4 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-plum-dim); margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { color: var(--on-plum); text-decoration: none; font-size: 0.94rem; line-height: 2.1; }
.footer-col a:hover { color: var(--paper); }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--on-plum-line); font-size: 0.82rem; color: var(--on-plum-dim); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- article / guide pages ---------- */
.page-hero { background: radial-gradient(circle at 82% 10%, var(--blue-s) 0, transparent 46%), var(--cream); color: var(--plum); padding: 48px 0 40px; position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.page-hero .container { position: relative; }
.page-hero h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 12px 0 12px; line-height: 1.15; color: var(--plum); }
.page-hero p { color: var(--ink-soft); max-width: 40em; font-size: 1.05rem; }

.article-paper { background: var(--cream); padding: 8px 0 20px; }
.article-body { max-width: 760px; margin: 0 auto; padding: 40px 22px 60px; }
.article-body h2 { font-family: var(--serif); font-size: 1.5rem; color: var(--plum-2); margin: 38px 0 12px; }
.article-body h3 { font-size: 1.12rem; color: var(--plum-2); margin: 26px 0 8px; }
.article-body p { color: var(--ink-soft); margin: 0 0 16px; }
.article-body ul, .article-body ol { color: var(--ink-soft); margin: 0 0 18px; padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-body blockquote { margin: 22px 0; padding: 16px 20px; background: var(--paper); border-left: 4px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-soft); font-family: var(--serif); font-size: 1.06rem; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-d); font-weight: 700; text-decoration: none; font-size: 0.9rem; margin-bottom: 6px; }
.back-link:hover { text-decoration: underline; }

/* legal pages */
.legal-body { max-width: 720px; margin: 0 auto; padding: 40px 22px 60px; }
.legal-body h1 { font-family: var(--serif); color: var(--plum-2); font-size: 2rem; margin: 0 0 6px; }
.legal-body .legal-date { color: var(--ink-faint); font-size: 0.85rem; margin-bottom: 24px; }
.legal-body h2 { font-family: var(--serif); font-size: 1.25rem; color: var(--plum-2); margin: 28px 0 8px; }
.legal-body p, .legal-body li { color: var(--ink-soft); }
.legal-body ul { padding-left: 22px; }

/* 404 */
.notfound { text-align: center; padding: 70px 22px 80px; }
.notfound .big { font-family: var(--serif); font-size: clamp(4rem, 14vw, 7rem); color: var(--plum-2); margin: 0; line-height: 1; }
.notfound h1 { font-family: var(--serif); color: var(--plum-2); margin: 8px 0 12px; }
.notfound p { color: var(--ink-soft); max-width: 30em; margin: 0 auto 24px; }
