/* 바이브 코딩 활동 기록기 설치 안내 — Fluent 2 tokens (web, light), restrained */

:root {
  --colorBrandBackground: #0F6CBD;
  --colorBrandBackgroundHover: #115EA3;
  --colorBrandBackgroundPressed: #0C3B5E;
  --colorBrandBackground2: #EBF3FC;
  --colorBrandForeground1: #0F6CBD;
  --colorBrandForeground2: #115EA3;

  --colorNeutralForeground1: #242424;
  --colorNeutralForeground2: #424242;
  --colorNeutralForeground3: #616161;
  --colorNeutralBackground1: #FFFFFF;
  --colorNeutralBackground1Hover: #F5F5F5;
  --colorNeutralBackground2: #FAFAFA;
  --colorNeutralBackground3: #F5F5F5;
  --colorNeutralBackground4: #F0F0F0;
  --colorNeutralBackgroundDisabled: #F0F0F0;
  --colorNeutralStroke1: #D1D1D1;
  --colorNeutralStroke2: #E0E0E0;
  --colorNeutralStrokeAccessible: #616161;
  --colorStrokeFocus2: #000000;

  --colorStatusWarningBackground1: #FFF9F5;
  --colorStatusWarningBorder1: #FDCFB4;
  --colorStatusWarningForeground3: #BC4B09;
  --colorStatusSuccessForeground3: #107C10;

  --shadow4: 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.14);
  --shadow16: 0 0 2px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.14);
  --shadow64: 0 0 8px rgba(0,0,0,.12), 0 32px 64px rgba(0,0,0,.14);

  --radiusMedium: 4px;
  --radiusXLarge: 8px;
  --radiusXXLarge: 12px;

  --durationFaster: 100ms;
  --durationNormal: 200ms;
  --durationGentle: 250ms;
  --curveDecelerateMid: cubic-bezier(0.1, 0.9, 0.2, 1);
  --curveEasyEase: cubic-bezier(0.33, 0, 0.67, 1);

  --font: "Pretendard Variable", Pretendard, "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "Cascadia Mono", Consolas, "D2Coding", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.7 var(--font);
  color: var(--colorNeutralForeground1);
  background: var(--colorNeutralBackground1);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #CFE4FA; color: #082338; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.35; letter-spacing: -0.02em; text-wrap: balance; }
p, ul, ol { margin: 0; }
a { color: var(--colorBrandForeground1); text-underline-offset: 3px; }
a:hover { color: var(--colorBrandForeground2); }
b, strong { font-weight: 650; }
code, kbd { font-family: var(--mono); font-size: .875em; }
:not(pre) > code { padding: 1px 5px; border-radius: var(--radiusMedium); background: var(--colorNeutralBackground4); white-space: nowrap; }
kbd {
  display: inline-block; min-width: 1.8em; padding: 0 6px;
  font-family: var(--font); font-size: .8125em; font-weight: 600; line-height: 1.7; text-align: center;
  background: var(--colorNeutralBackground1); border: 1px solid var(--colorNeutralStroke1); border-bottom-width: 2px; border-radius: var(--radiusMedium);
  white-space: nowrap;
}
.muted { color: var(--colorNeutralForeground3); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: currentColor; }
:focus-visible { outline: 2px solid var(--colorStrokeFocus2); outline-offset: 2px; border-radius: var(--radiusMedium); }

/* layout */
.page { max-width: 880px; margin: 0 auto; padding: 56px 24px 120px; }
.intro h1 { font-size: clamp(26px, 4vw, 32px); font-weight: 700; }
.intro p { margin-top: 8px; }
.intro__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.block { margin-top: 64px; }
.block > h2 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.block > p + * { margin-top: 16px; }
.note { margin-top: 16px; color: var(--colorNeutralForeground2); font-size: 15px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 5px 12px;
  font: 600 14px/20px var(--font); white-space: nowrap;
  color: var(--colorNeutralForeground1); background: var(--colorNeutralBackground1);
  border: 1px solid var(--colorNeutralStroke1); border-radius: var(--radiusMedium);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--durationFaster) var(--curveEasyEase);
}
.btn:hover { background: var(--colorNeutralBackground1Hover); color: var(--colorNeutralForeground1); }
.btn--primary { color: #fff; background: var(--colorBrandBackground); border-color: transparent; }
.btn--primary:hover { color: #fff; background: var(--colorBrandBackgroundHover); }
.btn--primary:active { background: var(--colorBrandBackgroundPressed); }
.btn--subtle { background: transparent; border-color: transparent; color: var(--colorNeutralForeground2); }
.btn--subtle:hover { background: var(--colorNeutralBackground3); }
.btn--large { min-height: 44px; padding: 10px 18px; font-size: 16px; border-radius: var(--radiusXLarge); gap: 8px; }
.btn--xl { min-height: 52px; padding: 13px 28px; font-size: 17px; border-radius: var(--radiusXLarge); gap: 10px; margin-top: 20px; }
.btn--icon { width: 36px; min-height: 36px; padding: 0; }
.btn.is-disabled, .btn[aria-disabled="true"] { background: var(--colorNeutralBackgroundDisabled); color: #707070; border-color: var(--colorNeutralStroke2); cursor: not-allowed; }
.btn.is-success, .btn.is-success:hover { background: var(--colorStatusSuccessForeground3); color: #fff; }

/* summary (instructor's original text) */
.summary { padding-left: 1.4em; display: grid; gap: 6px; }
.summary li::marker { color: var(--colorBrandForeground1); font-weight: 700; }
.messagebar {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 20px; padding: 14px 16px;
  background: var(--colorStatusWarningBackground1);
  border: 1px solid var(--colorStatusWarningBorder1);
  border-radius: var(--radiusXLarge);
}
.messagebar__icon { color: var(--colorStatusWarningForeground3); margin-top: 3px; }
.summary__end { margin-top: 16px; font-weight: 650; }

/* tabs (Fluent TabList) */
.tabs { display: flex; gap: 4px; margin-top: 20px; border-bottom: 1px solid var(--colorNeutralStroke2); }
.tab {
  position: relative; padding: 10px 14px; margin-bottom: -1px;
  font: 600 15px/22px var(--font); color: var(--colorNeutralForeground3);
  background: none; border: 0; cursor: pointer; border-radius: var(--radiusMedium) var(--radiusMedium) 0 0;
}
.tab:hover { color: var(--colorNeutralForeground1); background: var(--colorNeutralBackground3); }
.tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 2px; background: var(--colorBrandBackground); transform: scaleX(0); transition: transform var(--durationNormal) var(--curveDecelerateMid); }
.tab[aria-selected="true"] { color: var(--colorNeutralForeground1); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }

/* steps */
.steps { list-style: none; padding: 0; }
.step { padding: 32px 0; border-bottom: 1px solid var(--colorNeutralStroke2); }
.step:last-child { border-bottom: 0; }
.step__head { display: flex; gap: 12px; align-items: baseline; }
.step__num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; transform: translateY(-1px);
  font-size: 14px; font-weight: 700; color: #fff; background: var(--colorBrandBackground);
}
.step__title { font-size: 18px; font-weight: 650; }
.step__text { margin: 8px 0 0 40px; color: var(--colorNeutralForeground2); }
.step__text > * + * { margin-top: 10px; }
.step__figure { margin: 16px 0 0 40px; }
.after-steps { margin-top: 8px; padding: 14px 16px; background: var(--colorNeutralBackground3); border-radius: var(--radiusXLarge); }

/* allow-pasting callout */
.paste { padding: 14px 16px; border: 1px solid var(--colorStatusWarningBorder1); background: var(--colorStatusWarningBackground1); border-radius: var(--radiusXLarge); }
.paste__mock { margin-top: 10px; border: 1px solid #E3E3E3; border-radius: 6px; background: #fff; overflow: hidden; }
.paste__warn { padding: 8px 12px; background: #FEF7E0; color: #5C3C00; font: 12.5px/1.6 var(--mono); }
.paste__line { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px; font: 14px/1 var(--mono); }
.paste__prompt { color: #0B57D0; font-weight: 700; }
.paste__typed { white-space: pre; }
.paste__caret { width: 1.5px; height: 17px; background: #1f1f1f; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.paste__enter { opacity: 0; transition: opacity var(--durationNormal) var(--curveEasyEase); }
.paste__enter.is-on { opacity: 1; }
.paste ol { margin-top: 10px; padding-left: 1.3em; display: grid; gap: 4px; }
.chip { display: inline-block; padding: 0 8px; font: 600 14px/1.7 var(--mono); background: #fff; border: 1px solid var(--colorNeutralStroke1); border-bottom-width: 2px; border-radius: 6px; white-space: nowrap; }

/* scene */
.scene { position: relative; }
.scene__stage { position: relative; overflow: hidden; border: 1px solid var(--colorNeutralStroke2); border-radius: var(--radiusXLarge); background: var(--colorNeutralBackground3); cursor: zoom-in; }
.scene__camera { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.scene__camera img { width: 100%; height: 100%; }
.scene__ring { position: absolute; opacity: 0; pointer-events: none; border-radius: 6px; box-shadow: 0 0 0 2px var(--colorBrandBackground), 0 0 0 6px rgba(15,108,189,.2); }
.scene__box { position: absolute; display: none; pointer-events: none; border-radius: 6px; box-shadow: 0 0 0 3px var(--colorBrandBackground); }
.scene__cursor { position: absolute; left: 0; top: 0; width: 24px; height: 24px; opacity: 0; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.scene__cursor svg { display: block; width: 100%; height: 100%; }
.scene__ripple { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid var(--colorBrandBackground); opacity: 0; pointer-events: none; }
.scene__controls { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; }
.scene__controls .btn { background: rgba(255,255,255,.94); border-color: var(--colorNeutralStroke2); box-shadow: var(--shadow4); }
/* animation OFF: plain full screenshot, final states shown statically */
.is-reduced .scene__box, .is-reduced .scene__ring, .is-reduced .scene__cursor, .is-reduced .scene__ripple, .is-reduced [data-scene-play] { display: none; }
.anim-off .paste__caret { display: none; }
.anim-off .paste__enter { opacity: 1; transition: none; }
.anim-off .tab::after { transition: none; }

/* fixed animation toggle (bottom-right). Lightbox is a modal <dialog> in the top layer, so it always covers this. */
.anim-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 10px 20px 10px 16px;
  font: 600 16px/24px var(--font); color: var(--colorNeutralForeground1);
  background: rgba(255,255,255,.96); border: 1px solid var(--colorNeutralStroke1); border-radius: 999px;
  box-shadow: var(--shadow16); cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color var(--durationFaster) var(--curveEasyEase);
}
.anim-toggle:hover { background: var(--colorNeutralBackground1Hover); }
.anim-toggle .icon { width: 20px; height: 20px; color: var(--colorBrandForeground1); }
.anim-toggle[aria-pressed="true"] { color: var(--colorBrandForeground2); border-color: #B4D6FA; background: var(--colorBrandBackground2); }
.anim-toggle:focus-visible { outline-offset: 3px; border-radius: 999px; }

/* code */
.code { border: 1px solid var(--colorNeutralStroke2); border-radius: var(--radiusXLarge); overflow: hidden; }
.code__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; background: var(--colorNeutralBackground2); border-bottom: 1px solid var(--colorNeutralStroke2); font-size: 14px; }
.code__body { display: flex; max-height: 360px; overflow: auto; background: #FCFCFC; }
.code__gutter, .code__pre { margin: 0; padding: 12px 0; font: 13px/20px var(--mono); }
.code__gutter { position: sticky; left: 0; flex: none; padding: 12px 10px 12px 12px; text-align: right; color: #707070; background: #F5F5F5; user-select: none; }
.code__pre { flex: 1; padding-left: 14px; padding-right: 20px; }
.code__pre code { font-size: inherit; }

/* lists */
.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; }
.lists h3 { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.lists ul, .help { padding-left: 1.2em; display: grid; gap: 4px; color: var(--colorNeutralForeground2); }
.help { gap: 8px; }

/* lightbox */
.lightbox { width: min(96vw, 1600px); max-width: none; max-height: 94vh; padding: 0; border: 0; border-radius: var(--radiusXXLarge); box-shadow: var(--shadow64); overflow: auto; }
.lightbox::backdrop { background: rgba(0,0,0,.5); }
.lightbox[open] { animation: fade var(--durationGentle) var(--curveDecelerateMid); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__figure { margin: 0; }
.lightbox__figure img { width: 100%; }
.lightbox__figure figcaption { padding: 10px 56px 12px 16px; font-size: 14px; color: var(--colorNeutralForeground2); }
.lightbox__close { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.95); box-shadow: var(--shadow4); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 88px; z-index: 1001;
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: #fff; border-radius: var(--radiusXLarge); box-shadow: var(--shadow16);
  font-size: 15px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity var(--durationNormal) var(--curveEasyEase), transform var(--durationGentle) var(--curveDecelerateMid);
}
.toast .icon { color: var(--colorStatusSuccessForeground3); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error .icon { color: var(--colorStatusWarningForeground3); }

@media (max-width: 640px) {
  .page { padding: 32px 16px 96px; }
  .anim-toggle { right: 12px; bottom: 12px; }
  .block { margin-top: 48px; }
  .intro__actions .btn { width: 100%; }
  .btn--xl { width: 100%; }
  .tab { flex: 1; padding: 10px 8px; }
  .step__text, .step__figure { margin-left: 0; }
  .lists { grid-template-columns: minmax(0, 1fr); }
}

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