/* ============================================================
   LiDM Design System v2 - Core Styles
   Trust & Authority professional minimalism
   ============================================================ */

/* ------------------------------------------------------------
   0. Self-hosted Fonts (variable woff2, latin + latin-ext)
   Korean text intentionally falls back to system fonts.
   ------------------------------------------------------------ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------
   1. Design Tokens
   ------------------------------------------------------------ */
:root {
  /* Colors */
  --color-primary:      #0D1B2A;
  --color-secondary:    #1B4965;
  --color-accent:       #2C7DA0;
  --color-accent-light: #5FA8D3;
  --color-light:        #BEE9E8;
  --color-bg:           #F8FAFC;
  --color-surface:      #FFFFFF;
  --color-text:         #0F172A;
  --color-text-muted:   #475569;
  --color-border:       #E2E8F0;

  /* Gold accent (CMYK 0/30/94/0). Decorative, used very sparingly:
     thin rules, active nav underline, dark-surface focus rings only. */
  --color-gold:         #FFB30F;
  --color-gold-faint:   rgba(255, 179, 15, 0.35);

  /* Badge colors (4.5:1 contrast) */
  --badge-award-bg:        #FFE066;
  --badge-award-text:      #1A1A2E;
  --badge-publication-bg:  #2C7DA0;
  --badge-publication-text:#FFFFFF;
  --badge-conference-bg:   #475569;
  --badge-conference-text: #FFFFFF;
  --badge-event-bg:        #BEE9E8;
  --badge-event-text:      #0F3B52;
  --badge-notice-bg:       #1B4965;
  --badge-notice-text:     #FFFFFF;

  /* Typography */
  --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --size-h1:      clamp(28px, 3vw, 36px);
  --size-h2:      24px;
  --size-h3:      17px;
  --size-body:    15px;
  --size-caption: 13px;
  --size-nav:     13px;

  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Layout */
  --max-width:     1200px;
  --header-h:      64px;
  --section-pad-y: 64px;
  --section-pad-x: 24px;
  --card-gap:      20px;
  --radius-card:   10px;
  --radius-btn:    8px;
  --shadow-card:   0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-lift:   0 10px 28px rgba(13, 27, 42, 0.10);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

/* ------------------------------------------------------------
   2. Reset + Base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-normal);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  border: none;
  background: none;
}

button,
a,
select,
label[for],
[role="button"] {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* On dark surfaces the teal ring is hard to see; gold reads at ~9:1 */
.site-header :focus-visible,
.site-footer :focus-visible,
.stats-band :focus-visible,
.hero :focus-visible,
.page-hero :focus-visible {
  outline-color: var(--color-gold);
}

/* White sub-surfaces inside those regions keep the teal ring */
.dropdown-menu :focus-visible {
  outline-color: var(--color-accent);
}

/* Screen-reader-only utility */
.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;
}

/* Muted empty-state note (rendered by pages.js) */
.empty-note {
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------ */
h1,
.h1 {
  font-family: var(--font-heading);
  font-size: var(--size-h1);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--color-text);
}

h2,
.h2 {
  font-family: var(--font-heading);
  font-size: var(--size-h2);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

h3,
.h3 {
  font-family: var(--font-heading);
  font-size: var(--size-h3);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  color: var(--color-text);
}

.subtitle {
  font-size: 15px;
  font-weight: var(--weight-normal);
  line-height: 1.65;
  color: var(--color-text-muted);
}

.caption {
  font-size: var(--size-caption);
  line-height: 1.5;
  color: var(--color-text-muted);
}

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent);
  margin-bottom: 10px;
}

/* Line clamps */
.clamp-1,
.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

/* ------------------------------------------------------------
   4. Layout Helpers
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--section-pad-x);
}

.section {
  padding-block: var(--section-pad-y);
  background-color: var(--color-bg);
}

.section-alt {
  padding-block: var(--section-pad-y);
  background-color: var(--color-surface);
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  margin-bottom: 10px;
}

.section-title h2::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin: 10px auto 0;
  border-radius: 1px;
  background: var(--color-gold);
}

.section-title .subtitle {
  max-width: 600px;
  margin-inline: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}

.section-header .view-all {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: var(--weight-medium);
  color: var(--color-accent);
  white-space: nowrap;
  padding-bottom: 3px;
  background-image: linear-gradient(var(--color-gold), var(--color-gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: color var(--transition-fast), background-size 220ms ease;
}

.section-header .view-all:hover,
.section-header .view-all:focus-visible {
  color: var(--color-secondary);
  background-size: 100% 2px;
}

/* ------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  transition: background-color var(--transition-base),
              color var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--color-secondary);
  color: #FFFFFF;
  border: 1.5px solid var(--color-secondary);
}

.btn-primary:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-secondary);
  border: 1.5px solid var(--color-secondary);
}

.btn-secondary:hover {
  background-color: var(--color-secondary);
  color: #FFFFFF;
}

/* Buttons on dark backgrounds */
.btn-on-dark {
  background-color: #FFFFFF;
  color: var(--color-primary);
  border: 1.5px solid #FFFFFF;
}

.btn-on-dark:hover {
  background-color: var(--color-light);
  border-color: var(--color-light);
  color: var(--color-primary);
}

.btn-outline-light {
  background-color: transparent;
  color: #FFFFFF;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.btn-outline-light:hover {
  background-color: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--color-primary);
}

/* ------------------------------------------------------------
   6. Cards
   ------------------------------------------------------------ */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--color-accent);
}

.card-body {
  padding: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: var(--weight-semibold);
  margin-bottom: 8px;
  color: var(--color-text);
}

.card-text {
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Category top bar (news cards etc.) */
.card-topbar {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--color-accent);
}

.card-topbar--award       { background: var(--badge-award-bg); }
.card-topbar--publication { background: var(--badge-publication-bg); }
.card-topbar--conference  { background: var(--badge-conference-bg); }
.card-topbar--event       { background: var(--badge-event-bg); }
.card-topbar--notice      { background: var(--badge-notice-bg); }

/* ------------------------------------------------------------
   7. Grids
   ------------------------------------------------------------ */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--card-gap);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ------------------------------------------------------------
   8. Badges
   ------------------------------------------------------------ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-award {
  background-color: var(--badge-award-bg);
  color: var(--badge-award-text);
}

.badge-publication {
  background-color: var(--badge-publication-bg);
  color: var(--badge-publication-text);
}

.badge-conference {
  background-color: var(--badge-conference-bg);
  color: var(--badge-conference-text);
}

.badge-event {
  background-color: var(--badge-event-bg);
  color: var(--badge-event-text);
}

.badge-notice {
  background-color: var(--badge-notice-bg);
  color: var(--badge-notice-text);
}

/* ------------------------------------------------------------
   9. Stats Band
   ------------------------------------------------------------ */
.stats-band {
  position: relative;
  background: var(--color-primary);
  border-top: 1px solid var(--color-gold-faint);
  padding-block: 56px;
  overflow: hidden;
}

.stats-band::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 320px at 12% 20%, rgba(95, 168, 211, 0.09), transparent 70%),
    radial-gradient(520px 300px at 88% 85%, rgba(190, 233, 232, 0.07), transparent 70%);
}

.stats-band .container {
  position: relative;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: var(--weight-bold);
  color: #FFFFFF;
  line-height: 1.15;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Preserve brand casing (LiDM) instead of forcing uppercase */
.stat-label--brand {
  text-transform: none;
}

/* ------------------------------------------------------------
   10. Header
   ------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: background-color var(--transition-base),
              box-shadow var(--transition-base);
}

.site-header.scrolled {
  background: var(--color-primary);
  box-shadow: 0 1px 10px rgba(6, 13, 20, 0.35);
}

.site-header.transparent {
  background: transparent;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.logo-img {
  height: 30px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  font-size: var(--size-nav);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.site-header.transparent .nav-links a {
  color: rgba(255, 255, 255, 0.85);
}

.site-header.transparent .nav-links a:hover {
  color: #FFFFFF;
}

.site-header.scrolled .nav-links a {
  color: rgba(255, 255, 255, 0.85);
}

.site-header.scrolled .nav-links a:hover {
  color: #FFFFFF;
}

.nav-links a.active {
  text-decoration: underline;
  text-decoration-color: var(--color-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.site-header.transparent .nav-links a.active,
.site-header.scrolled .nav-links a.active {
  color: #FFFFFF;
  text-decoration-color: var(--color-gold);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  box-shadow: 0 8px 24px rgba(13, 27, 42, 0.12);
  padding: 8px 0;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.dropdown-menu a {
  display: block;
  padding: 8px 22px;
  font-size: 12.5px;
  color: var(--color-text) !important;
  white-space: nowrap;
  text-decoration: none !important;
}

.dropdown-menu a:hover {
  background: var(--color-bg);
  color: var(--color-secondary) !important;
}

/* Hamburger */
.hamburger {
  display: none;
  padding: 11px;
  border-radius: 6px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #FFFFFF;
  margin: 5px 0;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Mobile header */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    right: -100%;
    width: 280px;
    height: calc(100vh - var(--header-h));
    background: #FFFFFF;
    flex-direction: column;
    align-items: stretch;
    padding: 28px 24px;
    gap: 0;
    box-shadow: -4px 0 16px rgba(13, 27, 42, 0.10);
    transition: right 0.3s ease;
    overflow-y: auto;
  }

  .site-header.open .nav-links {
    right: 0;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
    color: var(--color-text) !important;
    font-size: 14px;
  }

  .nav-links a.active {
    color: var(--color-accent) !important;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    border: none;
    box-shadow: none;
    padding: 0 0 0 16px;
    opacity: 1;
    visibility: visible;
    display: none;
  }

  .dropdown.dropdown-open .dropdown-menu {
    display: block;
  }

  .site-header.open .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.open .hamburger span:nth-child(2) {
    opacity: 0;
  }

  .site-header.open .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ------------------------------------------------------------
   11. Footer
   ------------------------------------------------------------ */
.site-footer {
  background: #0A1622;
  color: rgba(255, 255, 255, 0.72);
  padding-top: 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: end;
  padding-bottom: 32px;
}

/* Match the brand blurb metrics so the two text blocks align line-for-line */
.footer-contact p {
  font-size: 12.5px;
  line-height: 1.55;
}

/* LiDM x Yonsei lockup above the brand blurb */
.footer-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.footer-lockup-x {
  font-size: 21px;
  line-height: 1;
  font-weight: var(--weight-medium);
  color: var(--color-gold);
}

.footer-lockup-emblem {
  height: 42px;
  width: auto;
  opacity: 0.95;
}

.footer-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.footer-blurb {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
  max-width: 520px;
}

.footer-tagline {
  margin-top: 4px;
}

.footer-col p {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 4px;
}

.footer-col a {
  color: var(--color-light);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
  }
}

/* ------------------------------------------------------------
   12. Skip Link
   ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 2000;
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 0 0 8px 8px;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 0;
}

/* ------------------------------------------------------------
   13. Scroll Reveal
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   14. Responsive Type + Layout
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  :root {
    --section-pad-y: 44px;
    --size-body: 16px;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-title {
    margin-bottom: 28px;
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --size-h1: 26px;
    --size-h2: 21px;
    --size-body: 16px;
    --section-pad-x: 16px;
  }

  body {
    font-size: 16px;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
