/* AGENT BREAK — base: tokens, reset, typography, layout, header/footer, shared controls.
   Tokens follow docs/DEV_CONTRACT.md §6. */

:root {
  --bg: #0A0A0B;
  --surface: #131315;
  --surface-2: #1C1C1F;
  --surface-3: #232327;
  --line: rgba(242, 242, 240, .12);
  --line-strong: rgba(242, 242, 240, .3);
  --line-soft: rgba(242, 242, 240, .1);
  --text: #F2F2F0;
  --text-2: #C9C9CC;
  --muted: #A1A1A6;
  --accent: #E8A23A;
  --accent-hover: #F2BE6B;
  --accent-soft: rgba(232, 162, 58, .45);
  --on-accent: #0A0A0B;
  --code: #E6E6E3;

  --font-display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --container: 1280px;
  --gutter: clamp(20px, 4vw, 64px);
  --section-gap: clamp(96px, 11vw, 160px);
  --header-h: 72px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

@media (max-width: 767px) {
  :root { --header-h: 60px; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
  color-scheme: dark;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.is-menu-open { overflow: hidden; }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-hover); }
[hidden] { display: none !important; }
:target { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
main:focus-visible, [tabindex="-1"]:focus-visible { outline: none; }

/* ---------- utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
}
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.display--xl { font-size: clamp(56px, 9vw, 140px); line-height: .9; }
.display--lg { font-size: clamp(44px, 6vw, 88px); }
.text-muted { color: var(--muted); }
.text-2 { color: var(--text-2); }

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform .15s ease;
}
.skip-link:focus, .skip-link:focus-visible {
  transform: translateY(0);
  color: var(--on-accent);
  outline-color: var(--text);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 11, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text);
  flex: none;
}
.brand img { width: 36px; height: 36px; }
.brand__word {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .06em;
  line-height: 1;
  white-space: nowrap;
}
.site-nav__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 32px;
}
.site-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
}
.site-nav__list a:hover { color: var(--accent-hover); }
.site-nav__list a[aria-current] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  margin-right: -8px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 767px) {
  .site-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .brand { gap: 10px; }
  .brand img { width: 30px; height: 30px; }
  .brand__word { font-size: 17px; }
}

/* ---------- mobile menu (AB-Mobile-Menu) ---------- */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 39;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}
.mobile-menu__nav { flex: 1 0 auto; padding: 40px 20px 0; position: relative; z-index: 1; }
.mobile-menu__list { list-style: none; }
.mobile-menu__list li { border-bottom: 1px solid var(--line); }
.mobile-menu__list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  color: var(--text);
}
.mobile-menu__label {
  font-family: var(--font-display);
  font-size: clamp(40px, 13vw, 52px);
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.mobile-menu__list a[aria-current] .mobile-menu__label { color: var(--accent); }
.mobile-menu__sub { font-size: 14px; color: var(--muted); flex: none; }
.mobile-menu__contact {
  position: relative;
  z-index: 1;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
}
.mobile-menu__contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.mobile-menu__contact a:hover { color: var(--accent-hover); }
.mobile-menu__mark {
  position: absolute;
  right: -60px;
  bottom: 60px;
  width: 220px;
  aspect-ratio: 800 / 793;
  background: url("/assets/logo/logo-outline-white.png") center / contain no-repeat;
  opacity: .12;
  pointer-events: none;
}
@media (min-width: 768px) {
  .mobile-menu { display: none !important; }
}

/* ---------- footer ---------- */
.site-footer { padding-top: 120px; padding-bottom: 48px; }
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.site-footer__partners { display: flex; flex-direction: column; gap: 16px; }
.site-footer__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .2em;
  color: var(--muted);
}
.site-footer__partner-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.partner-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--muted);
  text-align: center;
}
.partner-slot img { max-height: 40px; width: auto; }
.site-footer__brand { display: flex; align-items: center; gap: 14px; }
.site-footer__logo { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.site-footer__logo img { width: 32px; height: 32px; }
.site-footer__copy { font-size: 14px; color: var(--muted); }
@media (max-width: 767px) {
  .site-footer { padding-top: 72px; padding-bottom: 40px; }
  .site-footer__partner-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .partner-slot { min-height: 72px; font-size: 11px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  max-width: 100%;
  overflow-wrap: anywhere;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--text); color: var(--text); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn--light {
  background: var(--text);
  border-color: var(--text);
  color: var(--on-accent);
  font-weight: 600;
}
.btn--light:hover { background: #fff; color: var(--on-accent); }
.btn--lg { min-height: 52px; padding: 0 24px; }
.btn--mono {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .14em;
}
.text-link--underline { border-bottom: 1px solid var(--accent); align-self: flex-start; }
.text-link svg { flex: none; }

/* ---------- chips & tags ---------- */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.5;
  color: var(--text);
  white-space: nowrap;
  max-width: 100%;
}
.status-chip--active { border-color: var(--accent); color: var(--accent); }
.status-chip--active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-chip--paused { color: var(--muted); }

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.tag-list li { padding: 3px 8px; background: rgba(242, 242, 240, .06); max-width: 100%; overflow-wrap: anywhere; }

.type-badge {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  line-height: 1.5;
  text-transform: uppercase;
}
.type-badge--ctf { background: var(--accent); color: var(--on-accent); }
.type-badge--academic { background: var(--text); color: var(--on-accent); }
.type-badge--vulnerability { border: 1px solid var(--accent); color: var(--accent); padding: 3px 11px; }

.pill {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 10px;
  border: 1px solid rgba(242, 242, 240, .2);
  border-radius: 999px;
  font-size: 13px;
}

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--muted);
}
.input, .select {
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover, .select:hover { border-color: rgba(242, 242, 240, .5); }
.input:focus-visible, .select:focus-visible { outline-offset: 0; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A1A1A6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.select option { background: var(--surface); color: var(--text); }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 0; }
.search-box svg { flex: none; color: var(--muted); }
.search-box input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box input::-webkit-search-cancel-button { filter: invert(1) opacity(.6); }

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