/* ==========================================================================
   케이티처 허브 (K-Teacher Hub)
   Glassmorphism × Neumorphism Hybrid + Debossed Hangul Jamo + Light/Dark
   ========================================================================== */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #ECEAE4;
  --bg-tinted: #E4E1D9;
  --surface: rgba(255, 255, 255, 0.68);
  --surface-solid: #F7F5F0;
  --surface-subtle: rgba(236, 234, 228, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.84);
  --ink: #16202C;
  --ink-muted: #4A596B;
  --ink-soft: #637183;
  --brand: #1C3B66;
  --brand-hover: #142C4E;
  --brand-soft: rgba(28, 59, 102, 0.10);
  --accent: #C24D2C;
  --accent-soft: rgba(194, 77, 44, 0.13);
  --success: #186F54;
  --success-soft: rgba(24, 111, 84, 0.13);
  --sponsored-bg: rgba(255, 243, 214, 0.85);
  --sponsored-ink: #824D00;

  /* Glassmorphism & Neumorphism Tokens */
  --glass-border: rgba(255, 255, 255, 0.76);
  --glass-border-subtle: rgba(22, 32, 44, 0.08);
  --border: rgba(22, 32, 44, 0.10);
  --border-strong: rgba(22, 32, 44, 0.18);
  --neu-out: -6px -6px 14px rgba(255, 255, 255, 0.86), 7px 7px 18px rgba(22, 34, 54, 0.09);
  --neu-out-sm: -3px -3px 8px rgba(255, 255, 255, 0.84), 4px 4px 10px rgba(22, 34, 54, 0.08);
  --neu-in: inset 3px 3px 7px rgba(22, 34, 54, 0.09), inset -3px -3px 7px rgba(255, 255, 255, 0.92);
  --shadow-card: var(--neu-out);
  --shadow-modal: 0 24px 60px rgba(15, 25, 42, 0.22), 0 1px 4px rgba(15, 25, 42, 0.08);
  --spotlight: rgba(255, 255, 255, 0.55);

  /* Debossed Hangul Jamo (한글 자모음 음각 — 표면 안으로 파인 질감) */
  --jamo-fill: rgba(196, 192, 183, 0.62);
  --jamo-shadow: 1.5px 1.5px 0 rgba(255, 255, 255, 0.92), -1.5px -1.5px 2.5px rgba(22, 34, 54, 0.16);

  /* Refractive Orbs */
  --orb-1: radial-gradient(circle, rgba(48, 102, 178, 0.16) 0%, rgba(48, 102, 178, 0) 68%);
  --orb-2: radial-gradient(circle, rgba(194, 77, 44, 0.13) 0%, rgba(194, 77, 44, 0) 68%);
  --orb-3: radial-gradient(circle, rgba(24, 111, 84, 0.12) 0%, rgba(24, 111, 84, 0) 68%);

  --header-bg: rgba(236, 234, 228, 0.76);
  --modal-backdrop: rgba(15, 23, 36, 0.45);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1724;
  --bg-tinted: #131E30;
  --surface: rgba(23, 34, 54, 0.66);
  --surface-solid: #162135;
  --surface-subtle: rgba(13, 21, 34, 0.72);
  --surface-strong: rgba(26, 39, 61, 0.86);
  --ink: #EEF3FA;
  --ink-muted: #AFC0D6;
  --ink-soft: #8599B4;
  --brand: #7AB2FF;
  --brand-hover: #99C5FF;
  --brand-soft: rgba(122, 178, 255, 0.15);
  --accent: #FF8A65;
  --accent-soft: rgba(255, 138, 101, 0.17);
  --success: #5CE0B2;
  --success-soft: rgba(92, 224, 178, 0.15);
  --sponsored-bg: rgba(245, 183, 66, 0.16);
  --sponsored-ink: #FFD580;

  /* Dark Glassmorphism & Neumorphism */
  --glass-border: rgba(148, 184, 232, 0.18);
  --glass-border-subtle: rgba(148, 184, 232, 0.11);
  --border: rgba(148, 184, 232, 0.14);
  --border-strong: rgba(148, 184, 232, 0.26);
  --neu-out: -5px -5px 14px rgba(255, 255, 255, 0.045), 9px 9px 22px rgba(0, 0, 0, 0.52);
  --neu-out-sm: -3px -3px 8px rgba(255, 255, 255, 0.04), 5px 5px 12px rgba(0, 0, 0, 0.45);
  --neu-in: inset 3px 3px 8px rgba(0, 0, 0, 0.56), inset -2px -2px 6px rgba(164, 198, 245, 0.07);
  --shadow-card: var(--neu-out);
  --shadow-modal: 0 28px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(148, 184, 232, 0.18);
  --spotlight: rgba(122, 178, 255, 0.12);

  /* Dark Debossed Hangul Jamo */
  --jamo-fill: rgba(7, 12, 20, 0.62);
  --jamo-shadow: 1.5px 1.5px 0 rgba(154, 190, 242, 0.12), -1.5px -1.5px 3px rgba(0, 0, 0, 0.85);

  /* Dark Refractive Orbs */
  --orb-1: radial-gradient(circle, rgba(72, 134, 235, 0.24) 0%, rgba(72, 134, 235, 0) 68%);
  --orb-2: radial-gradient(circle, rgba(255, 138, 101, 0.17) 0%, rgba(255, 138, 101, 0) 68%);
  --orb-3: radial-gradient(circle, rgba(64, 206, 158, 0.16) 0%, rgba(64, 206, 158, 0) 68%);

  --header-bg: rgba(15, 23, 36, 0.74);
  --modal-backdrop: rgba(4, 8, 15, 0.68);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg);
}

body {
  margin: 0;
  font-family: "Pretendard Variable", "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  position: relative;
  transition: background-color 220ms var(--ease-out), color 220ms var(--ease-out);
}

/* Keep main content cleanly above ambient background layer */
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
}

/* Scroll Progress Ribbon */
.kth-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}

.kth-scroll-progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
  transform-origin: 0 50%;
  transform: scaleX(0);
  will-change: transform;
}

/* Ambient Refractive Orbs + Debossed Hangul Jamo Stage */
.kth-ambient-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
}

.kth-orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.kth-orb-1 {
  width: min(68vw, 760px);
  height: min(68vw, 760px);
  top: -180px;
  left: -140px;
  background: var(--orb-1);
  animation: kthOrbDrift1 22s ease-in-out infinite alternate;
}

.kth-orb-2 {
  width: min(58vw, 640px);
  height: min(58vw, 640px);
  top: 22%;
  right: -180px;
  background: var(--orb-2);
  animation: kthOrbDrift2 26s ease-in-out infinite alternate;
}

.kth-orb-3 {
  width: min(62vw, 680px);
  height: min(62vw, 680px);
  bottom: -200px;
  left: 24%;
  background: var(--orb-3);
  animation: kthOrbDrift3 28s ease-in-out infinite alternate;
}

@keyframes kthOrbDrift1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(56px, 42px, 0) scale(1.07); }
}

@keyframes kthOrbDrift2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-48px, 52px, 0) scale(1.06); }
}

@keyframes kthOrbDrift3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(40px, -44px, 0) scale(1.05); }
}

.kth-jamo-field {
  position: absolute;
  inset: 0;
}

.kth-jamo-glyph {
  position: absolute;
  top: var(--j-top);
  left: var(--j-left);
  font-size: clamp(78px, 12vw, var(--j-size));
  font-weight: 900;
  line-height: 1;
  color: var(--jamo-fill);
  text-shadow: var(--jamo-shadow);
  transform: translate3d(0, var(--j-py, 0px), 0) rotate(var(--j-rot));
  animation: kthJamoFloat 16s ease-in-out var(--j-delay) infinite alternate;
  will-change: transform;
}

@keyframes kthJamoFloat {
  0% {
    transform: translate3d(0, var(--j-py, 0px), 0) rotate(var(--j-rot));
  }
  100% {
    transform: translate3d(0, calc(var(--j-py, 0px) - 14px), 0) rotate(calc(var(--j-rot) + 3deg));
  }
}

/* Staggered Scroll Reveals */
.kth-reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.988);
  transition: opacity 420ms var(--ease-out) var(--reveal-delay, 0ms),
              transform 460ms var(--ease-out) var(--reveal-delay, 0ms);
}

.kth-reveal.is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
  user-select: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--brand-soft);
  padding: 0.12em 0.38em;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

.container {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

/* Header — Frosted Glass */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border-bottom: 1px solid var(--glass-border-subtle);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, #27508A, #163056);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--neu-out-sm), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .brand-mark {
  background: linear-gradient(145deg, #3D74C4, #20457D);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-text small {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover {
    background: var(--brand-soft);
    color: var(--brand);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Neumorphic Theme Toggle Pill */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--neu-out-sm);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 140ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 160ms var(--ease-out);
}

.theme-toggle-btn:active {
  transform: scale(0.96);
  box-shadow: var(--neu-in);
}

.theme-icon {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  transition: transform 260ms var(--ease-out);
}

[data-theme="dark"] .theme-icon {
  transform: rotate(180deg);
}

/* Buttons — Tactile Neumorphic + Primary Depth */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 180ms var(--ease-out), color 160ms var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible,
.tab-btn:focus-visible,
.stat-card:focus-visible,
.theme-toggle-btn:focus-visible,
.icon-close:focus-visible,
.link-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(145deg, #254D85, #18365F);
  color: #FFFFFF;
  box-shadow: var(--neu-out-sm), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(145deg, #3A72C4, #255296);
  color: #FFFFFF;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
  }
}

.btn-secondary {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-color: var(--glass-border);
  box-shadow: var(--neu-out-sm);
  color: var(--ink);
}

.btn-secondary:active {
  box-shadow: var(--neu-in);
}

@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
  }
}

.btn-ghost {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--ink-muted);
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: transparent;
  }
}

.btn-sm {
  padding: 8px 13px;
  font-size: 13px;
}

.btn-xs {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-bookmark.is-saved {
  background: var(--accent-soft);
  border-color: rgba(194, 77, 44, 0.35);
  color: var(--accent);
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-indigo {
  background: var(--brand-soft);
  color: var(--brand);
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-success {
  background: var(--success-soft);
  color: var(--success);
}

.pill-neutral {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

.pill-sponsored {
  background: var(--sponsored-bg);
  color: var(--sponsored-ink);
}

/* Glass Surface Mixin Pattern */
.stat-card,
.notice-bar,
.filter-bar,
.job-card,
.newsletter-card,
.portal-card,
.guide-card,
.prompt-card,
.roadmap-card,
.article-card,
.article-cta,
.related-link,
.empty-state {
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--neu-out);
  position: relative;
  overflow: hidden;
}

/* Interactive cursor glass shimmer on desktop */
@media (hover: hover) and (pointer: fine) {
  .stat-card::before,
  .job-card::before,
  .portal-card::before,
  .guide-card::before,
  .prompt-card::before,
  .roadmap-card::before,
  .newsletter-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--spotlight), transparent 70%);
    transition: opacity 220ms var(--ease-out);
  }
  .stat-card:hover::before,
  .job-card:hover::before,
  .portal-card:hover::before,
  .guide-card:hover::before,
  .prompt-card:hover::before,
  .roadmap-card:hover::before,
  .newsletter-card:hover::before {
    opacity: 1;
  }
}

/* Hero */
.hero {
  padding: 40px 0 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: end;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.8vw, 40px);
  line-height: 1.24;
  letter-spacing: -0.028em;
  word-break: keep-all;
}

.hero-lead {
  margin: 0;
  max-width: 58ch;
  color: var(--ink-muted);
  font-size: 15px;
  word-break: keep-all;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 160ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.stat-card:active {
  transform: scale(0.97);
  box-shadow: var(--neu-in);
}

@media (hover: hover) and (pointer: fine) {
  .stat-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
  }
}

.stat-label {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-urgent .stat-value {
  color: var(--accent);
}

.notice-bar {
  margin-top: 22px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border-color: rgba(194, 77, 44, 0.25);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.notice-bar p {
  margin: 0;
  min-width: 0;
  word-break: keep-all;
}

.notice-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(194, 77, 44, 0.45);
  animation: kthBeacon 2.4s var(--ease-out) infinite;
}

@keyframes kthBeacon {
  0% { box-shadow: 0 0 0 0 rgba(194, 77, 44, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(194, 77, 44, 0); }
  100% { box-shadow: 0 0 0 0 rgba(194, 77, 44, 0); }
}

/* Sections */
.section {
  padding: 38px 0 46px;
}

.section-tinted {
  background: rgba(255, 255, 255, 0.18);
  border-top: 1px solid var(--glass-border-subtle);
  border-bottom: 1px solid var(--glass-border-subtle);
}

[data-theme="dark"] .section-tinted {
  background: rgba(8, 14, 24, 0.36);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.022em;
}

.section-sub {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
  word-break: keep-all;
}

.result-meta {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* Category Tabs — Neumorphic Pills */
.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--neu-out-sm);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 160ms var(--ease-out);
}

.tab-btn:active {
  transform: scale(0.96);
  box-shadow: var(--neu-in);
}

.tab-btn.is-active {
  background: linear-gradient(145deg, #254D85, #18365F);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: var(--neu-out-sm);
}

[data-theme="dark"] .tab-btn.is-active {
  background: linear-gradient(145deg, #3A72C4, #255296);
  color: #FFFFFF;
}

@media (hover: hover) and (pointer: fine) {
  .tab-btn:not(.is-active):hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
  }
}

/* Filter Bar — Neumorphic Inset Inputs */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.search-field {
  flex: 1 1 240px;
  min-width: 0;
}

.search-field input,
.filter-controls select,
.newsletter-inputs input,
.newsletter-inputs select,
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  box-shadow: var(--neu-in);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.search-field input::placeholder,
.newsletter-inputs input::placeholder,
.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--ink-soft);
}

.search-field input:focus,
.filter-controls select:focus,
.newsletter-inputs input:focus,
.newsletter-inputs select:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  background: var(--surface-strong);
  border-color: var(--brand);
}

.filter-controls {
  display: flex;
  gap: 8px;
  flex: 0 1 auto;
}

.filter-controls select {
  width: auto;
  min-width: 118px;
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  box-shadow: var(--neu-in);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
}

.chip-toggle input {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  margin: 0;
}

/* Job Cards */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.job-card {
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  transition: border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.job-card.is-sponsored {
  border-color: rgba(212, 152, 34, 0.45);
}

.job-card.is-expired {
  opacity: 0.65;
}

@media (hover: hover) and (pointer: fine) {
  .job-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
  }
}

.job-main {
  min-width: 0;
}

.job-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.job-title {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.job-org {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.job-summary {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink);
  max-width: 68ch;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.job-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.dday-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--brand-soft);
  color: var(--brand);
  white-space: nowrap;
}

.dday-badge.is-urgent {
  background: var(--accent-soft);
  color: var(--accent);
}

.dday-badge.is-expired {
  background: var(--surface-subtle);
  color: var(--ink-soft);
}

.job-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 44px 20px;
  border-style: dashed;
  border-radius: var(--radius-lg);
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.empty-state p {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 14px;
}

/* Newsletter */
.newsletter-card {
  margin-top: 28px;
  padding: 26px;
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.newsletter-copy h3 {
  margin: 10px 0 6px;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.newsletter-copy p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  word-break: keep-all;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 8px;
}

.form-feedback {
  margin: 0;
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
}

.form-feedback.is-success {
  color: var(--success);
}

.form-feedback.is-error {
  color: var(--accent);
}

/* Portals Grid */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px;
}

.portal-card {
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 160ms var(--ease-out), border-color 180ms var(--ease-out);
}

.portal-card:active {
  transform: scale(0.98);
  box-shadow: var(--neu-in);
}

@media (hover: hover) and (pointer: fine) {
  .portal-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
  }
}

.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-card h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.portal-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
  flex: 1;
  word-break: keep-all;
}

.portal-link-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
}

/* Guides Grid */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.guide-card {
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 160ms var(--ease-out), border-color 180ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .guide-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
  }
}

.guide-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.guide-read-time {
  font-size: 12px;
  color: var(--ink-soft);
}

.guide-card h3 {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.38;
  letter-spacing: -0.015em;
  word-break: keep-all;
}

.guide-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  flex: 1;
  word-break: keep-all;
}

/* Prompts Grid */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.prompt-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prompt-card h3 {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.35;
}

.prompt-usecase {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.prompt-code {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  box-shadow: var(--neu-in);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  max-height: 150px;
  overflow-y: auto;
  overflow-wrap: anywhere;
}

/* Roadmap / Toolbox */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.roadmap-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 160ms var(--ease-out), border-color 180ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .roadmap-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
  }
}

.roadmap-card h3 {
  margin: 0;
  font-size: 16.5px;
  letter-spacing: -0.015em;
}

.roadmap-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  flex: 1;
  word-break: keep-all;
}

.roadmap-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--glass-border-subtle);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-note {
  margin: 6px 0 0;
  max-width: 62ch;
  font-size: 12.5px;
  color: var(--ink-soft);
  word-break: keep-all;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

.inline-link {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Standalone Article / Privacy / Guide Pages */
.article-wrap {
  max-width: 780px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--brand);
  font-weight: 600;
}

.article-title {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.26;
  letter-spacing: -0.025em;
  word-break: keep-all;
}

.article-lead {
  margin: 0 0 24px;
  font-size: 15.5px;
  color: var(--ink-muted);
  max-width: 65ch;
  word-break: keep-all;
}

.article-card {
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.5vw, 34px);
}

.article-card h2 {
  margin: 26px 0 10px;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--brand);
  word-break: keep-all;
}

.article-card h2:first-child {
  margin-top: 0;
}

.article-card p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.75;
  max-width: 65ch;
  word-break: keep-all;
}

.article-card ul {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.7;
}

.article-card li {
  margin-bottom: 6px;
  word-break: keep-all;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  box-shadow: var(--neu-in);
  padding: 12px 14px;
}

.faq-item summary {
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--ink);
  list-style-position: outside;
}

.faq-item p {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.article-cta {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.article-cta h3 {
  margin: 0 0 4px;
  font-size: 16.5px;
}

.article-cta p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.related-guides {
  margin-top: 28px;
}

.related-guides h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--ink);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.related-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-md);
  transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .related-link:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
  }
}

.related-link span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand);
}

.related-link strong {
  font-size: 14px;
  line-height: 1.4;
  word-break: keep-all;
}

/* Modals — Frosted Glass */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--modal-backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 180ms var(--ease-out);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal-dialog {
  width: min(580px, 100%);
  max-height: min(88dvh, 760px);
  background: var(--surface-strong);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 200ms var(--ease-out), opacity 180ms var(--ease-out);
}

.modal-wide {
  width: min(680px, 100%);
}

.modal-backdrop.is-open .modal-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-heading {
  margin: 8px 0 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  box-shadow: var(--neu-out-sm);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-body h3.detail-title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.32;
  letter-spacing: -0.02em;
}

.detail-org {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 14px;
}

.detail-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  box-shadow: var(--neu-in);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.detail-kv div {
  min-width: 0;
}

.detail-kv dt {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.detail-kv dd {
  margin: 2px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.detail-section-title {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink);
}

.detail-list li {
  margin-bottom: 6px;
}

.checklist-box {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-box label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  box-shadow: var(--neu-in);
  border: 1px solid var(--border);
  font-size: 13.5px;
  cursor: pointer;
}

.checklist-box input {
  margin-top: 3px;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.affiliate-preview {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: var(--brand-soft);
  font-size: 12.5px;
  color: var(--ink-muted);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-footer-inline {
  padding: 16px 0 0;
  margin-top: 14px;
}

/* Submit Form */
.submit-intro {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.form-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink);
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 500 !important;
  cursor: pointer;
}

.inline-check input {
  width: auto !important;
  accent-color: var(--brand);
}

.json-preview-wrap {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  box-shadow: var(--neu-in);
  border: 1px solid var(--border);
}

.json-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.json-preview-wrap pre {
  margin: 0;
  font-size: 12px;
  overflow-x: auto;
  max-height: 160px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  z-index: 200;
  opacity: 0;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
  max-width: min(92vw, 420px);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .site-nav {
    display: none;
  }
  .hero-grid,
  .newsletter-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1120px, 100% - 24px);
  }
  .brand-text small {
    display: none;
  }
  .theme-label {
    display: none;
  }
  .theme-toggle-btn {
    padding: 7px 10px;
  }
  .job-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 16px;
  }
  .job-aside {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .newsletter-inputs,
  .form-grid,
  .detail-kv {
    grid-template-columns: 1fr;
  }
  .filter-controls {
    width: 100%;
  }
  .filter-controls select {
    flex: 1;
  }
}

/* Prevent iOS Safari input auto-zoom */
@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .kth-orb,
  .kth-jamo-glyph,
  .notice-dot {
    animation: none !important;
  }
  .kth-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .kth-ambient-stage,
  .kth-scroll-progress,
  .theme-toggle-btn {
    display: none !important;
  }
}
