/* ========================================================================
   BAN Community — Y&Archer brand-aligned design system
   Reference: Y&Archer logo red #BC2113, dark burgundy #8B0607, gray #515151
   ======================================================================== */

:root {
  /* Surface — academic society convention: white-dominant with cool grays */
  --bg:          #FFFFFF;          /* page background — clean white */
  --paper:       #FFFFFF;
  --paper-2:     #F8F8F8;          /* tinted surface for sections */
  --paper-3:     #F1F1F2;          /* slightly darker */
  --ink:         #1A1A1A;          /* primary text */
  --ink-2:       #333333;          /* secondary text */
  --muted:       #666666;          /* tertiary text */
  --muted-2:     #9BA1AF;          /* slate, KSBV-style */
  --line:        #E5E5E5;          /* hairlines */
  --line-2:      #DDDDDD;

  /* Y&Archer brand */
  --brand:       #BC2113;          /* logo red */
  --brand-2:     #8B0607;          /* darker, hover/active */
  --brand-3:     #5C0407;          /* deepest, headers on red bg */
  --brand-bg:    #FBE9E7;          /* soft red wash */
  --brand-tint:  #FCF3F2;          /* very subtle */

  /* Neutral dark */
  --charcoal:    #515151;          /* logo gray */
  --charcoal-2:  #3A3A3A;
  --black-soft:  #1A1A1A;

  /* Status */
  --success:     #1F7A4D;
  --warn:        #B8763A;

  /* Legacy aliases (kept so existing markup keeps working,
     remapped to new brand) */
  --canvas:      var(--bg);
  --canvas-2:    var(--paper-2);
  --gold:        var(--brand);
  --gold-soft:   var(--brand-2);
  --gold-bg:     var(--brand-bg);
  --navy:        var(--charcoal-2);
  --navy-soft:   var(--charcoal);

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(19,19,19,0.04);
  --shadow-2: 0 8px 24px -10px rgba(19,19,19,0.10), 0 2px 6px rgba(19,19,19,0.04);
  --shadow-3: 0 24px 60px -20px rgba(19,19,19,0.18);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
               'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-feature-settings: 'ss06' on, 'tnum' on, 'case' on;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}

/* Typography — Pretendard, restrained weight + size contrast */
.font-display {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
}
.font-mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0; }
.numerals  { font-feature-settings: 'tnum' on; }

/* ---------- Layout ---------- */
.wrap     { max-width: 1240px; margin-inline: auto; padding-inline: 28px; }
.wrap-sm  { max-width: 880px;  margin-inline: auto; padding-inline: 28px; }
.hairline { border-color: var(--line); }

/* ---------- Utility top bar (academic society convention) ---------- */
.util-bar {
  background: var(--ink); color: rgba(255,255,255,0.78);
  font-size: 12px;
}
.util-bar a { color: rgba(255,255,255,0.78); transition: color .15s; }
.util-bar a:hover { color: #fff; }
.util-bar .divider { width: 1px; height: 10px; background: rgba(255,255,255,0.20); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
  font-size: 16px;
}
.brand-mark .dot {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px;
  letter-spacing: 0;
}
.brand-mark .brand-sub { color: var(--muted); font-weight: 500; }

.nav-link {
  position: relative; color: var(--ink-2); font-weight: 500; font-size: 14px;
  padding: 8px 2px; transition: color .15s ease;
  letter-spacing: -0.01em;
}
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 2px;
  background: var(--brand); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); font-weight: 600; }
.nav-link.is-active::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 600; font-size: 13.5px; line-height: 1;
  padding: 11px 18px; border-radius: 8px;
  transition: all .15s ease; cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap; letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--brand); color: #fff;
}
.btn-primary:hover { background: var(--brand-2); }
.btn-dark {
  background: var(--ink); color: #fff;
}
.btn-dark:hover { background: #000; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--paper); border-color: var(--ink); }
.btn-on-dark {
  background: #fff; color: var(--ink);
}
.btn-on-dark:hover { background: var(--brand); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-lg { padding: 14px 22px; font-size: 14.5px; border-radius: 10px; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card-hover:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.card-flat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ---------- Chips / Badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: -0.005em;
  background: var(--paper-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.chip-brand   { background: var(--brand-bg); color: var(--brand-2); border-color: #F4CFCB; }
.chip-navy    { background: #ECECEA; color: var(--charcoal-2); border-color: #DAD9D5; }
.chip-gold    { background: var(--brand-bg); color: var(--brand-2); border-color: #F4CFCB; } /* legacy → brand */
.chip-live    { background: var(--brand); color: #fff; border-color: transparent; }
.chip-soft    { background: var(--paper); color: var(--muted); border-color: var(--line); }
.chip-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor;
}
.chip-pill { border-radius: 999px; }

/* ---------- Editorial ---------- */
.kicker {
  /* Subtle label, not "AI-tic" all-caps tracking */
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.eyebrow {
  font-size: 12px; color: var(--muted); font-weight: 500;
}
/* Section heading used across pages */
.section-title {
  font-size: 13px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 3px; height: 13px; background: var(--brand); border-radius: 1px;
}
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
hr.rule-strong { border: 0; border-top: 1px solid var(--ink); margin: 0; }

/* ---------- Avatar ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff;
  font-weight: 700;
  border-radius: 999px;
  letter-spacing: -0.02em;
}
.avatar-brand { background: var(--brand); color: #fff; }

/* ---------- Decorative ---------- */
.divider-fancy {
  display: flex; align-items: center; gap: 18px;
  color: var(--muted-2); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  font-weight: 600;
}
.divider-fancy::before, .divider-fancy::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.bg-grid-faint {
  background-image:
    linear-gradient(to right, rgba(19,19,19,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(19,19,19,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.bg-grid-on-dark {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Brand corner ribbon */
.brand-ribbon { position: relative; }
.brand-ribbon::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--brand);
}

/* ---------- Forms ---------- */
.field-label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  letter-spacing: -0.005em;
}
.field-input {
  width: 100%; padding: 12px 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; color: var(--ink);
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(188,33,19,0.10);
}

/* ---------- Lists ---------- */
.dotline {
  background-image: linear-gradient(to right, var(--line) 50%, transparent 50%);
  background-size: 8px 1px; background-repeat: repeat-x;
  height: 1px;
}

/* ---------- Society-style board table ---------- */
.board-table { width: 100%; font-size: 14px; }
.board-table thead th {
  background: var(--paper-2);
  border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--line-2);
  padding: 12px 10px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  text-align: center;
}
.board-table tbody td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  text-align: center;
  font-size: 13.5px;
}
.board-table tbody td.subject { text-align: left; }
.board-table tbody tr:hover { background: var(--paper-2); }
.board-table tbody tr a { color: var(--ink); font-weight: 500; }
.board-table tbody tr a:hover { color: var(--brand); }
.board-table .num    { width: 60px;  color: var(--muted-2); font-size: 12.5px; font-family: 'JetBrains Mono', monospace; }
.board-table .cat    { width: 100px; color: var(--charcoal); font-weight: 600; font-size: 12px; }
.board-table .author { width: 110px; color: var(--muted); font-size: 12.5px; }
.board-table .date   { width: 90px;  color: var(--muted-2); font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.board-table .views  { width: 70px;  color: var(--muted-2); font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.board-table .new {
  display: inline-block; width: 14px; height: 14px; line-height: 14px;
  text-align: center; font-size: 9px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: 2px; margin-left: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- Main banner (society convention) ---------- */
.main-banner {
  background: var(--ink); color: #fff;
  position: relative; overflow: hidden;
  border-bottom: 4px solid var(--brand);
}
.main-banner .ribbon {
  position: absolute; top: 0; bottom: 0; right: 0;
  width: 42%;
  background:
    linear-gradient(135deg, rgba(188,33,19,0.0) 0%, rgba(188,33,19,0.18) 60%, rgba(188,33,19,0.35) 100%),
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(255,255,255,0.025) 22px 23px);
}

/* ---------- Society-style 4-up grid headers ---------- */
.box-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.box-head h3 {
  font-size: 16px; font-weight: 700; color: var(--ink);
}
.box-head .more {
  font-size: 12px; color: var(--muted); font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.box-head .more:hover { color: var(--brand); }

/* ---------- Sub-page header (society convention) ---------- */
.page-head {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  padding: 36px 0 30px;
}
.page-head h1 {
  font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -0.025em;
}
.page-head .breadcrumb {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.page-head .breadcrumb a:hover { color: var(--brand); }

/* ---------- Sub-page side menu (LNB) ---------- */
.lnb-title {
  background: var(--ink); color: #fff;
  padding: 22px 18px;
  font-size: 17px; font-weight: 700;
  border-radius: 6px 6px 0 0;
}
.lnb-list {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: #fff;
}
.lnb-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-2); font-weight: 500;
  transition: all .15s;
}
.lnb-list a:last-child { border-bottom: 0; }
.lnb-list a:hover { background: var(--paper-2); color: var(--brand); }
.lnb-list a.is-active {
  background: var(--brand-bg); color: var(--brand);
  font-weight: 600; border-left: 3px solid var(--brand); padding-left: 15px;
}

/* ---------- Pagination ---------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 2px;
  padding-top: 32px;
}
.pager button, .pager a {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
  border: 1px solid var(--line); background: #fff;
  transition: all .12s;
}
.pager button:hover, .pager a:hover {
  border-color: var(--ink); color: var(--ink);
}
.pager .is-active {
  background: var(--ink); color: #fff; border-color: var(--ink);
  font-weight: 700;
}

/* Inline notice list (사이드/박스용) */
.inline-list li {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.inline-list li:last-child { border-bottom: 0; }
.inline-list .cat {
  flex-shrink: 0; width: 56px;
  font-size: 11.5px; font-weight: 700; color: var(--brand);
  letter-spacing: -0.01em;
}
.inline-list .ttl {
  flex: 1; min-width: 0;
  color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inline-list .ttl:hover { color: var(--brand); }
.inline-list .date {
  flex-shrink: 0;
  font-size: 11.5px; color: var(--muted-2);
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,0.70);
  padding: 56px 0 36px;
}
.site-footer a { transition: color .15s ease; }
.site-footer a:hover { color: var(--brand); }
.site-footer .brand-mark { color: #fff; }
.site-footer .brand-mark .brand-sub { color: rgba(255,255,255,0.45); }

/* ---------- Animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise   { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.rise-2 { animation: rise .5s .08s cubic-bezier(.2,.7,.2,1) both; }
.rise-3 { animation: rise .5s .16s cubic-bezier(.2,.7,.2,1) both; }

/* ---------- Misc ---------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Dark page support (videos) */
body.is-dark { background: var(--ink); color: #FAFAFA; }
body.is-dark .site-header { background: rgba(19,19,19,0.78); border-color: rgba(255,255,255,0.08); }
body.is-dark .site-header .brand-mark { color: #fff; }
body.is-dark .site-header .brand-mark .brand-sub { color: rgba(255,255,255,0.45); }
body.is-dark .site-header .nav-link { color: rgba(255,255,255,0.7); }
body.is-dark .site-header .nav-link.is-active { color: #fff; }
body.is-dark .site-header .nav-link::after { background: var(--brand); }
body.is-dark .site-header button[title="검색"],
body.is-dark .site-header button[title="알림"] {
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
}
body.is-dark .site-header button[title="검색"]:hover,
body.is-dark .site-header button[title="알림"]:hover {
  color: #fff; background: rgba(255,255,255,0.05);
}

/* ---------- BAN Impact 성과 셀 hover (살짝 흔들림) ---------- */
.stat-cell { transition: background-color .3s ease; }
.stat-cell:hover { background: rgba(255,255,255,0.025); }
.stat-num { display: inline-block; will-change: transform; }
.stat-cell:hover .stat-num { animation: statWobble .55s ease both; }

@keyframes statWobble {
  0%   { transform: translateY(0)   rotate(0); }
  30%  { transform: translateY(-2px) rotate(-1.2deg); }
  55%  { transform: translateY(-1px) rotate(0.9deg); }
  80%  { transform: translateY(-1px) rotate(-0.4deg); }
  100% { transform: translateY(0)   rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .stat-cell:hover .stat-num { animation: none; }
}

/* ---------- 모바일 최적화 ---------- */
@media (max-width: 640px) {
  .wrap, .wrap-sm { padding-inline: 16px; }
  .page-head { padding: 24px 0 20px; }
  .page-head h1 { font-size: 22px; }

  /* 공지 게시판: 좁은 화면에서 번호·작성자·조회 열 숨김 */
  .board-table .num, .board-table .author, .board-table .views { display: none; }
  .board-table thead th, .board-table tbody td { padding: 11px 6px; }
  .board-table { font-size: 13px; }

  /* 성과 숫자 살짝 축소 */
  #home-stats .numerals { font-size: 40px; }
}
