/* Minimal, white-first launch page with SNU/AIDAS-style point color.
   Accent: SNU Blue RGB(15,15,112) => #0f0f70. */

   :root {
    --accent: #0f0f70;
    --text: #111827;
    --muted: #4b5563;
    --bg: #ffffff;
    --bg-alt: #f7f8fb;
    --line: rgba(15, 15, 112, 0.14);
    --shadow: 0 14px 40px rgba(2, 6, 23, 0.08);
    --radius: 16px;
    --container: 860px;
  }
  
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  html { font-size: 17px; }
  
  body {
    margin: 0;
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
  }
  
  a { color: inherit; text-decoration: none; }
  .container { width: min(var(--container), calc(100% - 2.5rem)); margin: 0 auto; }
  
  /* Header / Nav */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background:
      linear-gradient(180deg, rgba(15, 15, 112, 0.05) 0%, rgba(255, 255, 255, 0.94) 70%),
      rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 15, 112, 0.14);
  }
  
  .nav {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    width: min(1100px, calc(100% - 2.5rem));
    margin: 0 auto;
  }
  
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .brand__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(15, 15, 112, 0.10);
  }
  .brand__text { font-size: 1.05rem; }
  
  .nav__links {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
    color: rgba(17, 24, 39, 0.78);
    font-weight: 500;
  }
  .nav__links a { transition: color 0.18s ease; }
  .nav__links a:hover { color: var(--accent); }
  
  .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(15, 15, 112, 0.06);
    font-weight: 600;
    color: var(--accent);
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  }
  .pill--ghost { background: transparent; color: rgba(17, 24, 39, 0.70); }
  
  .nav__toggle {
    display: none;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: transparent;
    font-weight: 650;
    color: var(--accent);
  }
  
  /* Hero */
  .hero { padding: 54px 0 56px; }
  .hero__inner { text-align: center; }
  
  .hero__meta {
    font-size: 0.92rem;
    color: rgba(17, 24, 39, 0.55);
    margin-bottom: 14px;
  }
  
  .hero__title {
    margin: 0;
    font-size: clamp(2rem, 4.3vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.12;
  }
  
  .hero__subtitle {
    margin: 12px auto 22px;
    max-width: 68ch;
    color: rgba(17, 24, 39, 0.66);
    font-size: 1rem;
  }
  
  .hero__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 26px;
  }
  
  .btn {
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
  }
  .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
  
  .btn--primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
  }
  .btn--secondary {
    background: #fff;
    color: var(--accent);
  }
  
  /* Video placeholder */
  .video { display: block; }
  .video__frame {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: calc(var(--radius) + 8px);
    background: linear-gradient(180deg, rgba(17,24,39,0.95), rgba(17,24,39,0.85));
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
  }
  .video__frame::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.10);
    pointer-events: none;
  }
  
  .video__play {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -60%);
  }
  
  .video__triangle {
    width: 0;
    height: 0;
    border-left: 14px solid rgba(255, 255, 255, 0.85);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 4px;
  }
  
  .video__text {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 18px 18px 16px;
    color: rgba(255,255,255,0.92);
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.55));
    text-align: left;
  }
  
  .video__title { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
  .video__desc { margin-top: 3px; color: rgba(255,255,255,0.75); font-weight: 550; }
  
  /* Sections */
  .section { padding: 58px 0; }
  .section--alt {
    background: var(--bg-alt);
    border-top: 1px solid rgba(17, 24, 39, 0.06);
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
  }
  
  .section__title {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
  }
  
  .section__lead {
    margin: 0 0 18px;
    color: rgba(17, 24, 39, 0.65);
    font-weight: 500;
    max-width: 70ch;
  }
  
  .prose { max-width: 80ch; color: rgba(17, 24, 39, 0.74); }
  .prose p { margin: 0 0 12px; }
  .prose .eq { overflow-x: auto; }
  .prose .method__title { margin: 22px 0 10px; }
  .prose .method__title:first-child { margin-top: 0; }
  
  /* Figures */
  .figure{
    margin: 26px auto 0;     /* center the whole figure block */
    max-width: 80ch;         /* match .prose */
  }
  
  .figure__box{
    height: 220px;
    border-radius: var(--radius);
    border: 1px dashed rgba(15, 15, 112, 0.25);
    background: rgba(15, 15, 112, 0.04);
    display: grid;
    place-items: center;
    color: rgba(17, 24, 39, 0.55);
    font-weight: 750;
  }
  
  .figure__box--tall{ height: 280px; }
  
  .figure__img{
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;          /* ensure image is centered */
    border-radius: var(--radius);
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
  
    /* guardrails */
    max-width: 100%;
  }
  
  .figure__img--tall{ height: auto; }
  
  .figure__cap{
    margin-top: 10px;
    margin-bottom: 18px;
    color: rgba(17, 24, 39, 0.60);
    font-size: 0.9rem;
    line-height: 1.45;
  }
  
  .cap__label{ font-weight: 800; color: var(--accent); }
  
  /* Methods */
  .method-list { display: grid; gap: 16px; margin-top: 18px; }
  .method {
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--radius);
    padding: 16px 16px 14px;
  }
  .method__title { margin: 0 0 6px; font-size: 1.05rem; letter-spacing: -0.02em; }
  .method__text { margin: 0; color: rgba(17, 24, 39, 0.68); font-weight: 500; }
  
  /* Stats */
  .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 18px 0 0;
  }
  .stat {
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--radius);
    padding: 14px 14px 12px;
  }
  .stat__k { color: rgba(17, 24, 39, 0.60); font-weight: 600; font-size: 0.9rem; }
  .stat__v { margin-top: 6px; font-size: 1.15rem; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
  
  /* Resources */
  .resource-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .resource {
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--radius);
    padding: 14px 14px 12px;
  }
  .resource:hover { border-color: rgba(15, 15, 112, 0.22); }
  .resource__title { font-weight: 800; }
  .resource__desc { margin-top: 4px; color: rgba(17, 24, 39, 0.62); font-weight: 550; }
  
  /* Footer */
  .footer {
    margin-top: 36px;
    border-top: 1px solid rgba(15, 15, 112, 0.16);
    background:
      radial-gradient(120% 120% at 50% 0%, rgba(15, 15, 112, 0.14), rgba(15, 15, 112, 0) 52%),
      linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
  }
  .footer__wrap {
    width: min(1280px, calc(100% - 3rem));
    margin: 0 auto;
  }
  .footer__top {
    padding: 26px 0 22px;
    display: block;
  }
  .footer__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
  }
  .footer__head {
    margin: 0;
    color: #0c1b4d;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .footer__col {
    display: grid;
    grid-template-rows: 1.45rem 1.6rem 1.6rem 1.6rem;
    align-items: center;
  }
  .footer__col a {
    color: rgba(17, 24, 39, 0.75);
    font-weight: 550;
    font-size: 0.82rem;
    width: fit-content;
    margin: 0;
  }
  .footer__col span {
    color: rgba(17, 24, 39, 0.75);
    font-weight: 550;
    font-size: 0.82rem;
    margin: 0;
  }
  .footer__col a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .footer__bottom {
    border-top: 1px solid rgba(15, 15, 112, 0.14);
    background: rgba(255, 255, 255, 0.45);
  }
  .footer__bottom-inner {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(17, 24, 39, 0.66);
    font-weight: 500;
    font-size: 0.95rem;
  }
  .footer__bottom-inner > div:first-child {
    font-size: 0.72rem;
    opacity: 0.75;
  }
  
  /* icon image fit */
  .cap-icon__img{
    width: 140px;
    height: 140px;
    object-fit: contain;
    display: block;
  }
  /* make back image clickable without changing layout */
  .cap-icon__btn{
    all: unset;
    cursor: pointer;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
  }
  .cap-icon__btn:focus-visible{
    outline: 2px solid rgba(15,15,112,.35);
    outline-offset: 4px;
    border-radius: 12px;
  }
  
  /* modal */
  .img-modal{
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
  }
  .img-modal.is-open{ display: block; }
  
  .img-modal__backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
  }
  
  .img-modal__dialog{
    position: relative;
    margin: 6vh auto 0;
    width: min(900px, 92vw);
    max-height: 88vh;
    background: rgba(255,255,255,.96);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    padding: 18px;
  }
  
  .img-modal__img{
    width: 100%;
    height: auto;
    max-height: calc(88vh - 60px);
    object-fit: contain;
    display: block;
    border-radius: 12px;
  }
  
  .img-modal__close{
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(15,15,112,.08);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
  }
  
  /* ===============================
    Capabilities (Gemini-style cards)
    - Card: icon only (flip preserved)
    - Text: title + description below
    - FIXES:
      1) back face actually shows (translateZ + strict 3D context)
      2) back button clickable only when flipped (pointer-events)
      3) icon perfectly centered (container controls)
  ================================ */

  /* 2x3 grid */
  #capabilities .card-group__cards {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  /* Each grid item stacks: [card] then [text] */
  #capabilities .generic-card-group-container {
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Responsive */
  @media (max-width: 860px) {
    #capabilities .card-group__cards {
      grid-template-columns: 1fr 1fr;
    }
  }
  @media (max-width: 560px) {
    #capabilities .card-group__cards {
      grid-template-columns: 1fr;
    }
  }

  /* Flip wrapper provides perspective */
  #capabilities .flip-card {
    perspective: 1200px;
    display: block;
    cursor: pointer;
  }

  /* Rotating element (MUST contain both faces) */
  #capabilities .flip-card__inner {
    position: relative;
    width: 100%;
    min-height: 210px;

    transform-style: preserve-3d;
    transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);

    border-radius: var(--radius);
    border: 1px solid rgba(17, 24, 39, 0.10);
    background: #fff;
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
    overflow: hidden;

    /* helps some browsers keep 3D stable */
    will-change: transform;
  }

  /* Flip state */
  #capabilities .flip-card.is-flipped .flip-card__inner {
    transform: rotateY(180deg);
  }

  /* Faces (must fully cover) */
  #capabilities .flip-card__face {
    position: absolute;
    inset: 0;

    display: grid;
    place-items: center;
    padding: 18px;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    /* keep 3D context consistent */
    transform-style: preserve-3d;
  }

  /* IMPORTANT: translateZ avoids z-fighting (front bleeding through back) */
  #capabilities .flip-card__face--front {
    transform: rotateY(0deg) translateZ(1px);
  }
  #capabilities .flip-card__face--back {
    transform: rotateY(180deg) translateZ(1px);
  }

  /* Make only the visible face clickable (so back button works) */
  #capabilities .flip-card__face--back { pointer-events: none; }
  #capabilities .flip-card__face--front { pointer-events: auto; }

  #capabilities .flip-card.is-flipped .flip-card__face--front { pointer-events: none; }
  #capabilities .flip-card.is-flipped .flip-card__face--back  { pointer-events: auto; }

  /* Center the icon regardless of nested wrappers */
  #capabilities .cap-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* If you use .cap-icon__img, make it fill its immediate container nicely */
  #capabilities .cap-icon__img{
    width: 96px;           /* tweak as you like */
    height: 96px;          /* keep square for nicer centering */
    object-fit: contain;
    display: block;
  }

  /* Title + description BELOW the card */
  #capabilities .capability-meta {
    margin-top: 12px;
  }
  #capabilities .capability-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }
  #capabilities .capability-desc {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(17, 24, 39, 0.65);
    font-weight: 500;
    line-height: 1.55;
  }

  /* Hover lift WITHOUT breaking flip (no transform here) */
  #capabilities .flip-card:hover .flip-card__inner {
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.10);
    border-color: rgba(15, 15, 112, 0.18);
  }

  /* ===============================
   Examples: gallery nav + stacked collections
  ================================ */

  /* Offset when jumping via hash */
  #examples {
    scroll-margin-top: 96px; /* adjust if you have fixed header */
  }

  /* Each target section should also respect offset */
  #examples .collection-container,
  #examples [data-collection]{
    scroll-margin-top: 96px; /* same as #examples */
  }

  /* =========================================
    GALLERY-STYLE NAVIGATOR (sticky)
  ========================================= */

  #examples .gallery-nav-container {
    position: relative;
    width: 100%;
    z-index: 40;
    margin-top: 18px;
    margin-bottom: 18px;
  }

  /* Optional placeholder (only needed if you do layout tricks).
    If you keep it, it just provides vertical breathing room. */
  #examples .gallery-nav-placeholder {
    width: 100%;
    height: 52px;
  }
  @media (min-width: 640px) {
    #examples .gallery-nav-placeholder { height: 60px; }
  }

  /* Sticky wrapper */
  #examples .gallery-nav-wrapper {
    position: sticky;
    top: 12px; /* adjust if needed */
    z-index: 40;

    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border-radius: 14px;
    border: 1px solid rgba(15, 15, 112, 0.10);

    transition: box-shadow 200ms ease, transform 120ms ease, border-color 200ms ease;
    will-change: transform, position;
  }

  /* Shadow when stuck */
  #examples .gallery-nav-wrapper.gallery-nav-sticky {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
  }

  /* Row inside wrapper */
  #examples .gallery-nav-row {
    display: flex;
    justify-content: center;
    padding: 10px 6px;
  }

  /* Horizontal scroll pills */
  #examples .nav-buttons {
    width: 100%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    padding: 2px 4px 4px 4px;

    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  #examples .nav-buttons::-webkit-scrollbar { display: none; }

  /* =========================================
    NAV BUTTONS (use <a> or <button>)
    If you use <a href="#...">, these styles apply too.
  ========================================= */

  #examples .nav-button {
    position: relative;
    flex-shrink: 0;
    height: 32px;
    border-radius: 999px;

    padding: 0 14px;

    border: 1px solid transparent;
    background: transparent;

    cursor: pointer;
    user-select: none;
    white-space: nowrap;

    font-size: 0.875rem;
    line-height: 32px;
    color: rgba(17, 24, 39, 0.85);

    transition:
      background-color 200ms ease,
      border-color 200ms ease,
      transform 120ms ease,
      color 200ms ease;

    /* for <a> */
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Hover */
  #examples .nav-button:hover {
    background: #E2E2E2;
  }

  /* Pressed scale */
  #examples .nav-button:active {
    transform: scale(0.97);
  }

  /* Active pill */
  #examples .nav-button-active {
    background: #F5F5F5;
    border-color: rgba(0, 0, 0, 0.06);
    color: rgba(17, 24, 39, 0.92);
  }

  /* Optional background span (if you use it) */
  #examples .nav-button__bg {
    position: absolute;
    inset: 0;
    border-radius: 999px;
  }

  /* Label */
  #examples .nav-button__label {
    position: relative;
    z-index: 1;
    display: inline-block;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }

  /* Mobile adjustments */
  @media (max-width: 639px) {
    #examples .nav-button {
      font-size: 0.75rem;
      padding-left: 12px;
      padding-right: 12px;
    }
    #examples .nav-buttons {
      justify-content: flex-start;
    }
  }
  @media (min-width: 640px) {
    #examples .nav-buttons {
      justify-content: center;
    }
  }

  /* =========================================
    STACKED EXAMPLE COLLECTIONS (not tabs)
  ========================================= */

  #examples .examples-collections {
    margin-top: 14px;
  }

  /* Each modality section block */
  #examples .collection-container {
    margin-bottom: 22px;
  }

  /* Title band (similar to your reference) */
  #examples .collection-title {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 16px 10px;
    border-radius: 14px;

    border: 1px solid rgba(15, 15, 112, 0.10);
    background: rgba(15, 15, 112, 0.02);

    margin-bottom: 12px;
  }

  #examples .collection-title h3 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: rgba(17, 24, 39, 0.90);
  }

  /* Intro text per modality */
  #examples .collection-desc {
    margin: 0 0 12px 0;
    color: rgba(17, 24, 39, 0.72);
    font-size: 14.5px;
    line-height: 1.6;
  }

  /* Example content shell (your later UI goes inside) */
  #examples .collection-surface {
    border-radius: 16px;
    border: 1px solid rgba(15, 15, 112, 0.10);
    background: rgba(15, 15, 112, 0.02);
    overflow: hidden;
  }

  /* Placeholder you can remove later */
  #examples .examples-placeholder__box {
    height: 280px;
    border-radius: 14px;
    border: 1px dashed rgba(15, 15, 112, 0.22);
    background: rgba(15, 15, 112, 0.04);
    display: grid;
    place-items: center;
    color: rgba(17, 24, 39, 0.55);
    font-weight: 650;
    margin: 16px;
  }

  /* Optional: subtle divider between blocks on small screens */
  @media (max-width: 560px) {
    #examples .collection-title {
      padding: 14px 10px;
    }
    #examples .collection-title h3 {
      font-size: 18px;
    }
  }
  
  /* Mobile */
  @media (max-width: 860px) {
    .nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
  
    .nav__links {
      display: none;
      position: absolute;
      top: 64px;
      left: 50%;
      transform: translateX(-50%);
      width: min(520px, calc(100% - 2.5rem));
      flex-direction: column;
      gap: 10px;
      padding: 12px;
      background: #fff;
      border: 1px solid rgba(17, 24, 39, 0.10);
      border-radius: 14px;
      box-shadow: var(--shadow);
    }
  
    .nav__links.is-open { display: flex; }
  
    .stats { grid-template-columns: 1fr; }
    .resource-grid { grid-template-columns: 1fr; }
    .footer__wrap { width: calc(100% - 2rem); }
    .footer__top { padding: 24px 0 20px; }
    .footer__links { grid-template-columns: 1fr 1fr; justify-content: flex-start; }
    .footer__bottom-inner { flex-direction: column; align-items: flex-start; padding: 10px 0; }
  }
  
  @media (max-width: 620px) {
    .footer__links { grid-template-columns: 1fr; }
  }
  