/* =========================================================
   Raon FS — Design tokens
   Style: Quiet corporate minimalism (navy + signal blue)
   ========================================================= */
:root {
  --color-primary: #0F172A;
  --color-secondary: #334155;
  --color-accent: #0369A1;
  --color-accent-strong: #075985;
  --color-background: #FFFFFF;
  --color-surface: #F8FAFC;
  --color-foreground: #0B1220;
  --color-muted-bg: #EFF3F8;
  --color-muted-fg: #5A6B80;
  --color-border: #E2E8F0;
  --color-border-strong: #CBD5E1;

  --font-sans: 'Lexend', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  --font-body: 'Noto Sans KR', 'Lexend', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;

  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .07);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, .1);

  --header-h: 68px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* #0369A1 clears 3:1 on white but only grazes it on navy — dark surfaces get their own ring. */
  --focus-ring: #0369A1;
  --focus-ring-on-dark: #7CC6F5;

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-foreground);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 600; line-height: 1.25; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
a { color: inherit; text-decoration: none; text-underline-offset: .18em; text-decoration-thickness: 1px; }
button { font: inherit; cursor: pointer; }

/* Browser surfaces we did not draw, themed from the palette */
::selection { background: #CFE4F2; color: var(--color-primary); }
.section-dark ::selection, .site-footer ::selection { background: #1E4A6B; color: #fff; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}
.section-dark :where(a, button, [tabindex]):focus-visible,
.site-footer :where(a, button, [tabindex]):focus-visible {
  outline-color: var(--focus-ring-on-dark);
}

.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: 50%; top: -100px; transform: translateX(-50%);
  z-index: 200; background: var(--color-primary); color: #fff;
  padding: 10px 20px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 48px; padding: 12px 26px;
  font-family: var(--font-sans); font-weight: 500; font-size: 15px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-strong); }
.btn-ghost { background: transparent; color: var(--color-primary); border-color: var(--color-border-strong); }
.btn-ghost:hover { background: var(--color-muted-bg); border-color: var(--color-primary); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-outline:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .7); }
.btn-sm { min-height: 44px; padding: 8px 18px; font-size: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--color-border); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; gap: var(--space-3); min-height: var(--header-h); }
.brand { flex-shrink: 0; display: flex; align-items: center; min-height: 44px; }
.brand img { width: 150px; height: auto; }

/* Pulled right by the link's own inline padding so the last item's *text*
   lands on the container edge the logo and section headings align to,
   instead of sitting 12px inside it. */
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; margin-right: -12px; }
.nav a {
  position: relative; padding: 8px 12px; font-size: 15px; font-weight: 500;
  color: var(--color-secondary); border-radius: var(--radius-sm);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav a:hover { color: var(--color-primary); background: var(--color-muted-bg); }
.nav a.is-current { color: var(--color-accent); }
.nav a.is-current::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 2px; background: var(--color-accent); border-radius: 2px;
}
.nav-cta { display: none; }

.nav-toggle {
  display: none; width: 44px; height: 44px; margin-left: auto;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
}
.nav-toggle span {
  display: block; width: 18px; height: 2px; background: var(--color-primary);
  border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop { display: none; }

/* ---------- Sticky call bar (mobile only) ---------- */
.callbar { display: none; }
@media (max-width: 900px) {
  .callbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    display: flex; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .06);
    transform: translateY(110%);
    transition: transform .28s var(--ease);
  }
  .callbar.is-shown { transform: none; }
  .callbar-call {
    flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 12px 20px;
    background: var(--color-accent); color: #fff;
    font-family: var(--font-sans); font-weight: 500; font-size: 15px;
    border-radius: var(--radius-sm);
  }
  .callbar-call svg { width: 18px; height: 18px; }
  .callbar-alt {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 12px 16px;
    color: var(--color-primary); font-family: var(--font-sans); font-size: 14px; font-weight: 500;
    border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  }
  /* Clear the bar so it never covers the footer's last line. */
  .site-footer { padding-bottom: calc(var(--space-5) + 72px); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(72px, 12vw, 140px) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(120% 90% at 90% -10%, rgba(3, 105, 161, .12) 0%, rgba(3, 105, 161, 0) 60%),
    linear-gradient(180deg, var(--color-surface) 0%, #FFFFFF 100%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--color-border) 1px, transparent 1px);
  background-size: 100% 72px;
  opacity: .22; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.hero-inner { position: relative; z-index: 1; }
.hero-title {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  font-weight: 700; letter-spacing: -.04em; line-height: 1.08;
  color: var(--color-primary); margin-bottom: var(--space-4);
}
.hero-title .dot { color: var(--color-accent); }
/* Measured in em, not ch: Hangul is full-width, so ch under-counts the real line. */
.hero-lead {
  max-width: 38em; font-size: clamp(1rem, 1.6vw, 1.125rem);
  color: var(--color-muted-fg); line-height: 1.85; margin-bottom: var(--space-5);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--space-7); }

/* Credentials read as one line of record, not a scoreboard of big numbers. */
.hero-facts {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 10px var(--space-3);
  padding-top: var(--space-3); border-top: 1px solid var(--color-border);
  font-size: 14px;
}
.hero-facts li { display: flex; align-items: baseline; gap: 8px; }
.hero-facts li + li { padding-left: var(--space-3); border-left: 1px solid var(--color-border); }
.hero-facts span { color: var(--color-muted-fg); }
.hero-facts b {
  font-family: var(--font-sans); font-weight: 500; color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-muted { background: var(--color-surface); }
.section-dark { background: var(--color-primary); color: #E6EDF5; }
.section-dark .section-title { color: #fff; }
.section-dark .section-desc { color: #A9BACE; }
.section-dark .section-title .en { color: #8FB8D6; }

.section-head { max-width: 46em; margin-bottom: var(--space-6); }
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 600;
  letter-spacing: -.035em; color: var(--color-primary);
}
/* The deck titles every section bilingually; the English rides with the heading, not above it. */
.section-title .en {
  font-size: max(.42em, 15px); font-weight: 400; letter-spacing: -.005em;
  color: var(--color-muted-fg); white-space: nowrap;
}
.section-desc { margin-top: var(--space-2); color: var(--color-muted-fg); font-size: 1rem; }

/* ---------- About / fields ---------- */
/* Three registered business categories: parallel content, ruled columns rather than card chrome. */
.fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5) var(--space-5); margin-bottom: var(--space-7);
}
.field-card { padding-top: var(--space-3); border-top: 2px solid var(--color-primary); }
.field-card .icon { width: 26px; height: 26px; color: var(--color-accent); margin-bottom: var(--space-3); }
.field-card h3 { font-size: 1.1875rem; margin-bottom: 4px; color: var(--color-primary); }
.field-card > p { font-family: var(--font-sans); font-size: 13px; color: var(--color-muted-fg); letter-spacing: .01em; }
.field-card .field-body { margin-top: var(--space-2); font-family: var(--font-body); font-size: 15px; color: var(--color-secondary); line-height: 1.75; }

.profile { border-top: 2px solid var(--color-primary); }
.profile-list { display: grid; grid-template-columns: repeat(2, 1fr); }
.profile-row { display: flex; gap: var(--space-3); padding: var(--space-3) 4px; border-bottom: 1px solid var(--color-border); }
.profile-row dt {
  flex: 0 0 132px; font-family: var(--font-sans); font-weight: 500;
  font-size: 15px; color: var(--color-primary);
}
.profile-row dt span { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted-fg); font-weight: 400; }
.profile-row dd { font-size: 15px; line-height: 1.7; }
.profile-row dd a { color: var(--color-accent); border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.profile-row dd a:hover { border-bottom-color: var(--color-accent); }

/* Contact links are the conversion path: grow the hit box without moving the line. */
.profile-row dd a, .contact-meta dd a { padding-block: 11px; margin-block: -11px; }
.muted { color: var(--color-muted-fg); }

/* ---------- About statement (the former 미션 section, folded in) ---------- */
.about-statement {
  max-width: 46em; margin-bottom: var(--space-6);
  padding-left: var(--space-4); border-left: 2px solid var(--color-accent);
}
.about-statement p { font-size: 1.0625rem; line-height: 1.9; color: var(--color-secondary); }
.about-statement p.about-statement-en {
  margin-top: var(--space-3); padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-sans); font-size: 14px;
  color: var(--color-muted-fg); line-height: 1.8;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 0; }
.timeline::before {
  content: ''; position: absolute; left: 96px; top: 12px; bottom: 12px;
  width: 1px; background: var(--color-border);
}
.timeline li { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: var(--space-4); padding-bottom: var(--space-5); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: 92px; top: 10px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--color-accent);
}
.tl-date { text-align: right; padding-right: var(--space-2); }
.tl-year { display: block; font-family: var(--font-sans); font-size: 1.375rem; font-weight: 600; color: var(--color-primary); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tl-month { display: block; font-size: 13px; color: var(--color-muted-fg); }
.tl-body { padding-left: var(--space-2); }
.tl-body h3 { font-size: 1.0625rem; color: var(--color-primary); margin-bottom: 4px; }
.tl-body p { font-size: 14px; color: var(--color-muted-fg); }

/* ---------- Organization ---------- */
.org { text-align: center; }
.org-node {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 72px; padding: 12px 18px; background: #fff;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-weight: 500; font-size: 15px; color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.org-node span { font-family: var(--font-sans); font-size: 12px; font-weight: 400; color: var(--color-muted-fg); letter-spacing: .02em; }
.org-ceo { background: var(--color-primary); color: #fff; border-color: var(--color-primary); min-width: 220px; }
.org-ceo span { color: #A9BACE; }
.org-accent { border-color: var(--color-accent); color: var(--color-accent-strong); }
.org-accent span { color: var(--color-accent); }
.org-top { display: flex; justify-content: center; }
.org-connector { width: 1px; height: 28px; margin: 0 auto; background: var(--color-border-strong); }
.org-row { display: grid; gap: var(--space-2); margin-bottom: var(--space-2); }
.org-directors { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; margin-inline: auto; }
.org-divisions { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; margin-inline: auto; margin-top: var(--space-5); }
.org-teams { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--space-5); }
/* A horizontal rail joins the drop-lines, so each stub actually connects to
   the level above instead of rising into empty space. */
.org-divisions, .org-teams { position: relative; }
.org-divisions::before, .org-teams::before {
  content: ''; position: absolute;
  top: calc(-1 * (var(--space-5) + var(--space-2)) / 2);
  height: 1px; background: var(--color-border-strong);
}
.org-divisions::before { left: 25%; right: 25%; }
.org-teams::before { left: 12.5%; right: 12.5%; }

.org-divisions .org-node, .org-teams .org-node { position: relative; }
.org-divisions .org-node::before, .org-teams .org-node::before {
  content: ''; position: absolute; left: 50%; top: calc(-1 * var(--space-5) - var(--space-2));
  width: 1px; height: calc(var(--space-5) + var(--space-2));
  background: var(--color-border-strong);
}

/* ---------- Project categories ----------
   Derived in OKLCH, shipped as hex (one source of truth, no gamut surprises).
   Pills sit at one fixed weight so no category outranks another:
     bg oklch(.950 .040 H) · fg oklch(.400 .110 H)  → 7.7–8.3:1
   Dot lightness varies (.50/.58/.66) on purpose. Six hues cannot stay apart
   under red-green deficiency by hue alone — with a single lightness the
   공공/호텔 pair collapsed to ΔE 5. Staggering lightness lifts the worst case
   across protan-, deutan- and tritanopia to ΔE 16. Dots hold ≥3:1 on both the
   white and the navy (selected) chip.
   Hues skip the 220–265 band so nothing competes with the action blue, and
   colour never codes alone — every row and chip still carries its own label,
   which matters because '업무시설' appears under three different categories. */
[data-cat="industrial"], [data-filter="industrial"] { --cat-bg: #D1F8F4; --cat-fg: #035350; --cat-dot: #02736E; }
[data-cat="military"],   [data-filter="military"]   { --cat-bg: #E3F5DA; --cat-fg: #2B5409; --cat-dot: #3C740D; }
[data-cat="public"],     [data-filter="public"]     { --cat-bg: #FBEDD1; --cat-fg: #5C4300; --cat-dot: #B88A06; }
[data-cat="hotel"],      [data-filter="hotel"]      { --cat-bg: #FEE9E5; --cat-fg: #782B21; --cat-dot: #BF5546; }
[data-cat="medical"],    [data-filter="medical"]    { --cat-bg: #FEE7F3; --cat-fg: #6F2B55; --cat-dot: #CD6CA6; }
[data-cat="office"],     [data-filter="office"]     { --cat-bg: #ECEDFF; --cat-fg: #433C80; --cat-dot: #736BC9; }

/* ---------- Works ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-4); }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 18px; font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  color: var(--color-secondary); background: #fff;
  border: 1px solid var(--color-border-strong); border-radius: 999px;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.chip:hover { border-color: var(--color-secondary); background: var(--color-muted-bg); }
.chip.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* The filter carries the same code as the rows it reveals. */
.chip[data-filter]:not([data-filter="all"])::before {
  content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--cat-dot);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12) inset;
}
.chip.is-active::before { box-shadow: 0 0 0 1px rgba(255, 255, 255, .45) inset; }

.table-wrap {
  position: relative;
  overflow-x: auto; overscroll-behavior-x: contain;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  scrollbar-width: thin; scrollbar-color: var(--color-border-strong) transparent;
}
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: var(--color-surface); }
.table-wrap::-webkit-scrollbar-thumb {
  background: var(--color-border-strong); border-radius: 999px;
  border: 3px solid var(--color-surface);
}
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--color-muted-fg); }

.works-table { width: 100%; min-width: 660px; border-collapse: collapse; }
.works-table thead th {
  padding: 14px 20px; text-align: left; background: var(--color-muted-bg);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  color: var(--color-secondary);
  border-bottom: 1px solid var(--color-border);
}
.works-table td { padding: 15px 20px; font-size: 15px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.works-table tbody tr:last-child td { border-bottom: 0; }
.works-table tbody tr { transition: background-color .15s var(--ease); }
.works-table tbody tr:hover { background: var(--color-surface); }
.col-client { width: 26%; }
.col-type { width: 16%; }
.works-table td:first-child { font-weight: 500; color: var(--color-primary); }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--cat-bg, var(--color-muted-bg));
  color: var(--cat-fg, var(--color-secondary));
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.works-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-2); margin-top: var(--space-3);
}
.works-count { font-size: 13px; color: var(--color-muted-fg); font-variant-numeric: tabular-nums; }
#worksMore[hidden] { display: none; }

/* ---------- Systems ---------- */
.systems { display: grid; gap: var(--space-3); }
.system-card {
  display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: var(--space-5); align-items: center;
  padding: var(--space-5); background: #fff;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
}
.system-media {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; padding: var(--space-3);
  background: var(--color-muted-bg); border-radius: var(--radius-md);
}
.system-media img { max-height: 260px; width: auto; object-fit: contain; }
.system-text h3 { font-size: clamp(1.25rem, 2.4vw, 1.625rem); color: var(--color-primary); margin-bottom: var(--space-2); }
.system-text h3 .model {
  display: block; margin-top: 4px; font-family: var(--font-sans);
  font-size: 13px; font-weight: 400; letter-spacing: .04em; color: var(--color-muted-fg);
}
.system-text > p { color: var(--color-muted-fg); font-size: 15px; line-height: 1.85; }
.system-list { margin-top: var(--space-3); display: grid; gap: 8px; }
.system-list li { position: relative; padding-left: 22px; font-size: 14.5px; color: var(--color-secondary); }
.system-list li::before {
  content: ''; position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent);
}

/* ---------- Certifications ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-3); }
.cert-card {
  padding: var(--space-4); background: #fff;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.cert-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); }
.cert-badge {
  display: inline-block; margin-bottom: var(--space-3); padding: 4px 12px;
  border-radius: 999px; background: var(--color-muted-bg); color: var(--color-secondary);
  font-family: var(--font-sans); font-size: 12px; font-weight: 500; letter-spacing: .04em;
}
.cert-badge-accent { background: rgba(3, 105, 161, .1); color: var(--color-accent-strong); }
.cert-card h3 { font-size: 1.125rem; color: var(--color-primary); margin-bottom: 6px; }
.cert-card p { font-size: 14px; color: var(--color-muted-fg); }
.cert-year {
  font-family: var(--font-sans); font-variant-numeric: tabular-nums;
  color: var(--color-secondary);
}
.cert-year::before { content: '· '; color: var(--color-border-strong); }

/* Clickable certificate cards */
.cert-card-linked { position: relative; }
.cert-card-linked:hover { border-color: var(--color-accent); }

.cert-open {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--space-3); padding: 0;
  background: none; border: 0;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  color: var(--color-accent);
  transition: color .2s var(--ease);
}
.cert-open svg { width: 17px; height: 17px; }
/* stretched hit area: the button stays in flow, so inset:0 resolves against the card */
.cert-open::after { content: ''; position: absolute; inset: 0; }
.cert-card-linked:hover .cert-open { color: var(--color-accent-strong); }
.cert-open:focus-visible { outline: none; }
.cert-card-linked:focus-within {
  border-color: var(--color-accent);
  outline: 2px solid var(--color-accent); outline-offset: 3px;
}

/* The whole record as one file — same family as the certificates above it,
   so it sits with them rather than competing with the contact actions. */
.doc-download {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: var(--space-3); padding: 20px var(--space-4);
  background: var(--color-primary); border-radius: var(--radius-md);
  transition: background-color .2s var(--ease);
}
.doc-download:hover { background: #16233D; }
.doc-download > svg { flex: none; width: 24px; height: 24px; color: #7CC6F5; }
.dd-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.dd-text strong { font-family: var(--font-sans); font-size: 1.0625rem; font-weight: 600; color: #fff; }
.dd-text span { font-size: 13.5px; color: #A9BACE; }
.dd-meta {
  flex: none; font-family: var(--font-sans); font-size: 12.5px; color: #8FA5BD;
  padding: 5px 12px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .doc-download { flex-wrap: wrap; padding: 18px var(--space-3); }
  .dd-meta { margin-left: 40px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-3);
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(6, 12, 22, .78); backdrop-filter: blur(4px); }

.lightbox-panel {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  /* Definite height, not max-height — the body below flexes into it, which is
     what makes the image's percentage box resolve instead of collapsing. */
  width: min(920px, 100%); height: min(92vh, 1000px); max-height: 100%;
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: lightbox-in .22s var(--ease);
}
@keyframes lightbox-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.lightbox-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border);
}
.lightbox-title { font-size: 1.0625rem; color: var(--color-primary); }
.lightbox-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lightbox-close {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0; background: transparent;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  color: var(--color-secondary);
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.lightbox-close:hover { background: var(--color-muted-bg); border-color: var(--color-border-strong); }
.lightbox-close svg { width: 18px; height: 18px; }

/* flex:1 + min-height:0 gives the body a definite height, which is what lets the
   image's max-height:100% actually resolve. Without it the parent sizes to the
   image and the tail of a tall certificate becomes unreachable at any scroll. */
.lightbox-body {
  position: relative;
  flex: 1 1 0; min-height: 0;
  background: var(--color-muted-bg);
}
/* The panel is max-height'd, not height'd, so the body's height is indefinite
   and any percentage height on the image silently resolves to auto — which is
   what let a tall certificate run past the panel. Absolute insets give the
   image a definite box; object-fit letterboxes the page inside it. */
.lightbox-body img {
  position: absolute;
  top: var(--space-3); left: var(--space-3);
  width: calc(100% - var(--space-3) * 2);
  height: calc(100% - var(--space-3) * 2);
  object-fit: contain;
}

.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--color-border-strong);
  color: var(--color-primary); box-shadow: var(--shadow-md);
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.lightbox-nav:hover { background: #fff; border-color: var(--color-primary); }
.lightbox-nav svg { width: 20px; height: 20px; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-foot {
  padding: 12px var(--space-3); border-top: 1px solid var(--color-border);
  font-size: 13px; color: var(--color-muted-fg);
}

body.is-locked { overflow: hidden; }

@media (max-width: 640px) {
  .lightbox { padding: 0; }
  .lightbox-panel { width: 100%; height: 100%; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .lightbox-head { flex-wrap: wrap; }
  .lightbox-title { font-size: .9375rem; flex: 1 1 100%; order: -1; }
  .lightbox-tools { width: 100%; justify-content: space-between; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.contact-primary { display: grid; gap: 10px; }

/* Three ways to act, ranked. The phone leads on weight, not on colour alone. */
.contact-action {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 16px 20px; min-height: 72px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius-md);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.contact-action:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .38); }
.contact-action:active { transform: translateY(1px); }
.contact-action svg { flex: none; width: 22px; height: 22px; color: #7CC6F5; }
.ca-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ca-text strong { font-family: var(--font-sans); font-size: 1.0625rem; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.ca-text span { font-size: 13px; color: #A9BACE; }

.contact-action-lead {
  background: var(--color-accent); border-color: var(--color-accent);
  min-height: 88px;
}
.contact-action-lead:hover { background: var(--color-accent-strong); border-color: var(--color-accent-strong); }
.contact-action-lead svg { color: #fff; width: 26px; height: 26px; }
.contact-action-lead .ca-text strong { font-size: 1.5rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.contact-action-lead .ca-text span { color: #D6ECF8; }

.contact-meta { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.contact-meta > div { display: flex; gap: var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid rgba(255, 255, 255, .12); }
.contact-meta dt { flex: 0 0 60px; font-family: var(--font-sans); font-size: 14px; color: #8FA5BD; }
.contact-meta dd { font-size: 15px; color: #E6EDF5; line-height: 1.7; }
.contact-meta dd a { color: #7CC6F5; border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.contact-meta dd a:hover { border-bottom-color: #7CC6F5; }
.muted-dark { color: #A9BACE; }

.contact-map { margin: 0; background: #fff; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-lg); }
.contact-map img { width: 100%; }
.contact-map figcaption {
  display: flex; flex-wrap: wrap; gap: 4px var(--space-2); justify-content: space-between;
  padding: 14px 20px; font-size: 13px; color: var(--color-muted-fg); border-top: 1px solid var(--color-border);
}
.contact-map figcaption a {
  color: var(--color-accent); border-bottom: 1px solid transparent;
  padding-block: 11px; margin-block: -11px;
}
.contact-map figcaption a:hover { border-bottom-color: var(--color-accent); }

/* ---------- Footer ---------- */
.site-footer { padding: var(--space-5) 0; background: #060C16; color: #8FA5BD; }
.footer-inner { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: flex-start; }
.footer-brand img { width: 140px; background: #fff; padding: 6px 10px; border-radius: var(--radius-sm); }
.footer-brand p { margin-top: var(--space-2); font-family: var(--font-sans); font-size: 13px; letter-spacing: .06em; color: #6E839B; }
.footer-meta { font-size: 13.5px; line-height: 1.9; text-align: right; font-variant-numeric: tabular-nums; }
.footer-meta .copyright { margin-top: 8px; color: #7A8FA6; font-size: 12.5px; }

/* ---------- Reveal animation ----------
   Gated on .js so a blocked or failed script can never leave the page blank. */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.is-visible { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav { margin-right: -9px; }
  .nav a { padding: 8px 9px; font-size: 14px; }
  .brand img { width: 130px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--space-2); margin-left: 0; margin-right: 0;
    background: #fff; border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 12px; font-size: 15px; border-radius: var(--radius-sm); }
  .nav a.is-current::after { display: none; }
  .nav a.nav-cta {
    display: block; margin-top: var(--space-2); text-align: center;
    background: var(--color-accent); color: #fff; font-weight: 500;
  }
  .nav a.nav-cta:hover { background: var(--color-accent-strong); color: #fff; }

  .nav-backdrop {
    display: block; position: fixed; inset: var(--header-h) 0 0; z-index: -1;
    background: rgba(6, 12, 22, .45);
  }
  .nav-backdrop[hidden] { display: none; }

  .contact-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .system-card { grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-4); }
  .system-media { min-height: 180px; }
  .org-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-list { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
}

/* Below 768px the table becomes stacked cards. The horizontal scroll used to
   push the 건물 유형 column — every colour tag the filters exist to reveal —
   entirely off-screen, which made tapping a chip do nothing visible. */
@media (max-width: 767px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .works-table, .works-table tbody, .works-table tr, .works-table td { display: block; }
  .works-table { min-width: 0; }
  .works-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .works-table tbody tr {
    position: relative;
    padding: var(--space-3) var(--space-3) var(--space-3) 18px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
  }
  .works-table tbody tr::before {
    content: ''; position: absolute; left: 0; top: -1px; bottom: -1px; width: 5px;
    background: var(--cat-dot, var(--color-border-strong));
    border-radius: var(--radius-md) 0 0 var(--radius-md);
  }
  .works-table tbody tr:hover { background: #fff; }
  .works-table tbody tr:last-child td { border-bottom: 0; }

  .works-table td { padding: 0; border-bottom: 0; font-size: 15px; }
  .works-table td[data-label="발주처"] {
    font-family: var(--font-sans); font-size: 13px; font-weight: 500;
    color: var(--color-muted-fg); margin-bottom: 4px;
  }
  .works-table td[data-label="주요 공사명"] {
    font-size: 15.5px; font-weight: 500; color: var(--color-primary); line-height: 1.55;
  }
  .works-table td[data-label="건물 유형"] { margin-top: 10px; }
}

@media (max-width: 640px) {
  .section-title .en { display: block; margin-top: 6px; white-space: normal; }
  .hero-facts { display: grid; gap: 8px; }
  .hero-facts li + li { padding-left: 0; border-left: 0; }
  .hero-facts span { flex: 0 0 68px; }
  .hero-lead br { display: none; }
  .hero-actions .btn { flex: 1 1 auto; }
  .timeline::before { left: 5px; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; padding-left: 28px; padding-bottom: var(--space-4); }
  .timeline li::before { left: 1px; top: 8px; }
  .tl-date { display: flex; align-items: baseline; gap: 8px; text-align: left; padding-right: 0; }
  .tl-year { font-size: 1.125rem; }
  .tl-body { padding-left: 0; }
  .profile-row { flex-direction: column; gap: 4px; }
  .profile-row dt { flex: none; }
  .org-directors, .org-divisions { grid-template-columns: 1fr; }
  .org-teams { grid-template-columns: 1fr; }
  .org-divisions .org-node::before, .org-teams .org-node::before { display: none; }
  .works-foot { flex-direction: column; align-items: stretch; }
  .contact-meta > div { flex-direction: column; gap: 2px; }
}

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

/* 회사지명원 is routinely printed or saved as PDF — the full record has to survive it. */
@media print {
  .site-header, .nav-toggle, .filters, .hero-actions,
  .works-foot, .cert-open, .skip-link, .lightbox,
  .callbar, .nav-backdrop { display: none !important; }

  .js .reveal { opacity: 1 !important; transform: none !important; }
  .section { padding: 24px 0; break-inside: avoid; }
  .section-dark, .site-footer { background: #fff !important; color: #000 !important; }
  .section-dark .section-title, .ca-text strong,
  .contact-meta dd { color: #000 !important; }
  .contact-meta dt, .ca-text span, .footer-meta, .footer-brand p { color: #333 !important; }

  /* The 12-row collapse is a screen affordance; print those rows but respect the active filter. */
  #worksBody tr[data-fold] { display: table-row !important; }
  .table-wrap { overflow: visible !important; border-color: #999; }
  .works-table { min-width: 0 !important; }
  .works-table thead { display: table-header-group; }
  .works-table tr { break-inside: avoid; }

  a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: 11px; color: #555; }
}
