﻿/* 에너지그리드코리아 — bento_research style
   기술 지식 포털. 벤토 타일 + 사이드바 내비게이션.
   외부 폰트/스크립트 로드 없음. */

:root {
  --bg: #F5F5F7;
  --tile: #FFFFFF;
  --bg-soft: #EEF2F7;
  --ink: #18181B;
  --ink-2: #3F3F46;
  --ink-3: #71717A;
  --ink-4: #A1A1AA;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --accent: #1E40AF;
  --accent-2: #1E3A8A;
  --accent-soft: #DBEAFE;
  --accent-tint: #EFF4FF;
  --focus: #2563EB;
  --shadow-1: 0 1px 2px rgba(24,24,27,.04), 0 1px 3px rgba(24,24,27,.05);
  --shadow-2: 0 4px 14px rgba(24,24,27,.06), 0 2px 6px rgba(24,24,27,.04);
  --shadow-3: 0 12px 32px rgba(24,24,27,.10), 0 4px 10px rgba(24,24,27,.05);
  --radius: 1.5rem;
  --radius-sm: 0.875rem;
  --radius-xs: 0.5rem;
  --sidebar-w: 260px;
  --max-main: 1180px;
  --font: "Pretendard","Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { line-height: 1.28; color: var(--ink); letter-spacing: -0.012em; }
h1 { font-size: clamp(1.7rem, 3.1vw, 2.35rem); margin: 0 0 .55em; }
h2 { font-size: clamp(1.3rem, 2.1vw, 1.62rem); margin: 1.7em 0 .55em; }
h3 { font-size: 1.1rem; margin: 1.3em 0 .5em; color: var(--ink-2); }
h4 { font-size: .98rem; margin: 1.1em 0 .45em; color: var(--ink-2); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: .32em; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ============ Skip link ============ */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff;
  padding: .6rem 1rem; z-index: 1000;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ============ App shell: sidebar + main ============ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ============ Sidebar nav (topic_sidebar_nav) ============ */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--tile);
  border-right: 1px solid var(--line);
  padding: 1.6rem 1.1rem;
  z-index: 60;
}
.sidebar__brand {
  display: block;
  margin-bottom: 1.5rem;
  padding: 0 .25rem;
}
.sidebar__name {
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}
.sidebar__tag {
  display: block;
  font-size: .74rem;
  color: var(--ink-3);
  margin-top: .2rem;
}
.sidebar__group-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  margin: 1.2rem .5rem .5rem;
  font-weight: 700;
}
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li { margin-bottom: .15rem; }
.sidebar-nav a {
  display: block;
  padding: .55rem .7rem;
  border-radius: var(--radius-xs);
  color: var(--ink-2);
  font-size: .92rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover {
  background: var(--bg-soft);
  color: var(--accent-2);
  text-decoration: none;
}
.sidebar-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 700;
}
.sidebar__foot {
  margin-top: 1.6rem;
  padding: .8rem .7rem;
  border-top: 1px solid var(--line);
  font-size: .76rem;
  color: var(--ink-3);
  line-height: 1.55;
}
.sidebar__foot a { color: var(--ink-3); }

/* ============ Mobile top bar + drawer ============ */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--tile);
  border-bottom: 1px solid var(--line);
  padding: .7rem 1rem;
  align-items: center;
  justify-content: space-between;
}
.mobile-topbar__name { font-weight: 800; font-size: .98rem; }
.drawer-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: .5rem .6rem;
  cursor: pointer;
}
.drawer-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--ink); border-radius: 2px;
}
.drawer-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(24,24,27,.4);
  z-index: 55;
}
.drawer-backdrop.is-open { display: block; }

/* ============ Main area ============ */
.main-area {
  min-width: 0;
  padding: 2rem clamp(1.1rem, 3.5vw, 3rem) 3rem;
}
.main-area__inner { max-width: var(--max-main); margin: 0 auto; }

/* ============ Bento hero (directory_matrix) ============ */
.bento-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(118px, auto);
  gap: 1rem;
  margin-bottom: 2.4rem;
}
.tile {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
}
a.tile { cursor: pointer; color: inherit; text-decoration: none; }
a.tile:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-3);
  border-color: var(--line-2);
  text-decoration: none;
}
.tile--lead {
  grid-column: span 2;
  grid-row: span 2;
  background:
    linear-gradient(160deg, rgba(30,64,175,.92), rgba(30,58,138,.95)),
    var(--accent);
  color: #fff;
  border-color: transparent;
}
.tile--lead h1 { color: #fff; margin-bottom: .4em; }
.tile--lead p { color: rgba(255,255,255,.86); margin-bottom: 0; }
.tile--lead .tile__tag { background: rgba(255,255,255,.18); color: #fff; }

.tile--wide { grid-column: span 2; }
.tile--tall { grid-row: span 2; }
.tile__tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent-2);
  background: var(--accent-soft);
  padding: .22rem .55rem;
  border-radius: 999px;
  align-self: flex-start;
  margin-bottom: .6rem;
}
.tile__title {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 .35rem;
}
.tile--lead .tile__title { font-size: 1.6rem; }
.tile__desc {
  font-size: .87rem;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.55;
}
.tile__arrow {
  margin-top: auto;
  padding-top: .7rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-2);
}
.tile--lead .tile__arrow { color: rgba(255,255,255,.9); }

/* ============ Section ============ */
.section { margin-bottom: 2.6rem; }
.section__head { margin-bottom: 1.1rem; }
.section__eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: .3rem;
}
.section__title {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin: 0 0 .35em;
}
.section__lede {
  color: var(--ink-3);
  max-width: 60ch;
  margin: 0;
  font-size: .96rem;
}

/* ============ Learning path bento ============ */
.path-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.path-stage {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-1);
}
.path-stage--1 { grid-column: span 1; }
.path-stage--2 { grid-column: span 2; }
.path-stage--3 { grid-column: span 1; }
.path-stage__badge {
  font-size: .7rem; font-weight: 700;
  color: var(--accent-2); background: var(--accent-soft);
  padding: .2rem .55rem; border-radius: 999px;
  display: inline-block; margin-bottom: .55rem;
}
.path-stage__h { font-size: 1rem; font-weight: 700; margin: 0 0 .45rem; color: var(--ink); }
.path-stage a {
  display: block;
  padding: .35rem 0;
  font-size: .9rem;
  color: var(--ink-2);
}
.path-stage a:hover { color: var(--accent-2); }

/* ============ Mission split ============ */
.mission-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.2rem;
}
.info-card {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-1);
}
.info-card h3 { margin-top: 0; }
.info-card .pill-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.info-card .pill-list li {
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .28rem .75rem;
  font-size: .82rem;
  color: var(--ink-2);
  margin: 0 .3rem .4rem 0;
}

/* ============ Glossary preview tiles ============ */
.gloss-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.gloss-tile {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-1);
}
.gloss-tile__term {
  font-size: .96rem; font-weight: 700; color: var(--accent-2); margin: 0 0 .3rem;
}
.gloss-tile__def { font-size: .86rem; color: var(--ink-3); margin: 0; line-height: 1.55; }

/* ============ Source method ============ */
.source-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.source-card {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-1);
}
.source-card strong { color: var(--ink); }
.source-card a {
  display: inline-block;
  margin-top: .3rem;
  font-size: .85rem;
  word-break: break-all;
}
.source-note {
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  margin-top: 1rem;
  font-size: .86rem;
  color: var(--ink-2);
}

/* ============ Trust aside ============ */
.trust-box {
  background: var(--tile);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.35rem;
  box-shadow: var(--shadow-1);
}
.trust-box p { margin: 0; color: var(--ink-2); font-size: .94rem; }
.trust-box p + p { margin-top: .5rem; }
.trust-box small { color: var(--ink-3); }

/* ============ Footer (resource_directory) ============ */
.site-footer {
  background: var(--tile);
  border-top: 1px solid var(--line);
  padding: 1.8rem clamp(1.1rem, 3.5vw, 3rem);
}
.footer-inner {
  max-width: var(--max-main);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.6rem;
}
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 0 0 .5rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .3rem; }
.footer-col a { font-size: .86rem; color: var(--ink-2); }
.footer-disclaim {
  font-size: .8rem; color: var(--ink-3); line-height: 1.55; margin-top: .5rem;
}
.footer-bottom {
  max-width: var(--max-main);
  margin: 1.3rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  font-size: .78rem; color: var(--ink-3);
}

/* ============ Lesson hub page ============ */
.breadcrumb {
  font-size: .82rem; color: var(--ink-3);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--ink-3); }
.breadcrumb span { margin: 0 .35rem; color: var(--ink-4); }
.page-title-block { margin-bottom: 1.6rem; }
.page-title-block h1 { margin-bottom: .3em; }
.page-title-block p { color: var(--ink-3); max-width: 60ch; }

.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.lesson-card {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow-1);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column;
}
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.lesson-card__badge {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  padding: .22rem .6rem; border-radius: 999px; align-self: flex-start;
  margin-bottom: .6rem;
}
.badge--basic { background: #DCFCE7; color: #166534; }
.badge--mid { background: #FEF3C7; color: #92400E; }
.badge--adv { background: #FEE2E2; color: #991B1B; }
.lesson-card__h { font-size: 1.04rem; font-weight: 700; margin: 0 0 .4rem; color: var(--ink); }
.lesson-card__obj { font-size: .87rem; color: var(--ink-3); margin: 0; flex: 1; line-height: 1.55; }
.lesson-card__link { margin-top: .8rem; font-size: .85rem; font-weight: 600; color: var(--accent-2); }
.curriculum-group-label {
  grid-column: 1 / -1;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-2);
  margin: .5rem 0 -.2rem;
}

/* ============ Lesson article page ============ */
.lesson-header {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 1.6rem;
}
.lesson-header h1 { margin-bottom: .35em; }
.objective-box {
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-top: 1rem;
}
.objective-box h2 { margin: 0 0 .4rem; font-size: 1rem; color: var(--accent-2); }
.objective-box p { margin: 0; font-size: .92rem; color: var(--ink-2); }
.lesson-meta {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem;
  font-size: .82rem; color: var(--ink-3); margin-top: .8rem;
}
.lesson-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.lesson-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.6rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.lesson-body {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  box-shadow: var(--shadow-1);
  overflow-x: hidden;}
.lesson-body h2 { margin-top: 2em; }
.lesson-body h2:first-child { margin-top: 0; }
.lesson-body .step-num {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  color: var(--accent-2); background: var(--accent-soft);
  padding: .2rem .6rem; border-radius: 999px;
  margin-bottom: .4rem;
}
.article-aside {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  font-size: .88rem;
  color: var(--ink-2);
}
.article-aside strong { color: var(--ink); }
.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.prevnext a {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  box-shadow: var(--shadow-1);
  font-size: .9rem;
  color: var(--ink-2);
}
.prevnext a:hover { border-color: var(--accent); color: var(--accent-2); text-decoration: none; }
.prevnext a span { display: block; font-size: .74rem; color: var(--ink-4); margin-bottom: .2rem; }
.prevnext--end { grid-template-columns: 1fr; }

/* ============ Glossary index page ============ */
.glossary-list {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-1);
}
.glossary-entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.glossary-entry:last-child { border-bottom: none; }
.glossary-entry__term { font-size: 1.05rem; font-weight: 700; color: var(--accent-2); margin: 0 0 .3rem; }
.glossary-entry__def { margin: 0 0 .4rem; color: var(--ink-2); }
.glossary-entry__rel { font-size: .82rem; color: var(--ink-3); }
.glossary-group-label {
  font-size: .78rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-4);
  margin: 1.4rem 0 .3rem;
}
.glossary-group-label:first-child { margin-top: 0; }

/* ============ Contact page ============ */
.contact-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-bottom: 1.6rem;
}
.contact-card {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-1);
}
.contact-card h2 { margin-top: 0; font-size: 1.15rem; }
.contact-card dl { margin: 0; }
.contact-card dt { font-weight: 700; color: var(--ink); margin-top: .6rem; font-size: .9rem; }
.contact-card dd { margin: .15rem 0 0; color: var(--ink-2); font-size: .92rem; }
.mailto-form {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-1);
}
.form-row { margin-bottom: .9rem; }
.form-row label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .3rem; color: var(--ink-2); }
.form-row input, .form-row textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: .92rem;
  color: var(--ink);
  background: #fff;
}
.form-row textarea { min-height: 110px; resize: vertical; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  padding: .65rem 1.3rem;
  font-size: .92rem; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--accent-2); }
.btn--ghost {
  background: transparent; color: var(--accent-2);
  border: 1px solid var(--line-2);
}
.btn--ghost:hover { background: var(--bg-soft); }
.map-note { font-size: .82rem; color: var(--ink-3); margin: .5rem 0 0; }
.map-frame {
  width: 100%; height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: .8rem;
}

/* ============ Legal / text pages ============ */
.legal-body {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  box-shadow: var(--shadow-1);
  max-width: 820px;
  overflow-x: hidden;}
.legal-body h2 { margin-top: 1.8em; }
.legal-body h2:first-child { margin-top: 0; }

/* ============ Responsive ============ */
@media (max-width: 1023px) {
  .app-shell { grid-template-columns: 1fr; }
  .mobile-topbar { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 65;
  }
  .sidebar.is-open { transform: translateX(0); }
  .main-area { padding: 1.4rem 1rem 2.4rem; }
  .bento-hero { grid-template-columns: repeat(2, 1fr); }
  .tile--lead { grid-column: span 2; grid-row: span 1; }
  .tile--wide { grid-column: span 2; }
  .path-grid { grid-template-columns: repeat(2, 1fr); }
  .path-stage--1, .path-stage--2, .path-stage--3 { grid-column: span 1; }
  .mission-grid { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .gloss-grid { grid-template-columns: 1fr; }
  .curriculum-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-split { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .lesson-body { padding: 1.3rem 1.2rem;   overflow-x: hidden;}
}
@media (max-width: 620px) {
  .bento-hero { grid-template-columns: 1fr; }
  .tile--lead, .tile--wide, .tile--tall { grid-column: span 1; grid-row: span 1; }
  .path-grid { grid-template-columns: 1fr; }
  .curriculum-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .prevnext { grid-template-columns: 1fr; }
  .legal-body, .lesson-header { padding: 1.3rem 1.1rem; }
}

/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  a.tile:hover, .lesson-card:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}
