:root {
    --bg: #fafaf9;
    --text: #161513;
    --muted: #4a4844;
    --subtle: #9a9791;
    --border: #e5e3e0;
    --accent: #d6482f;
    --box: #f2f1ee;
    --box-border: #d8d5d0;
    --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
  ::selection { background: var(--accent); color: var(--bg); }
  a { color: inherit; }

  header, section#hero, section#research, section#contact {
    padding-left: 48px;
    padding-right: 48px;
    max-width: 1100px;
    margin: 0 auto;
  }

  /* ===== header / nav ===== */
  header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
    background: rgba(250,250,249,0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
  }
  header p { font-family: var(--mono); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; margin: 0; }
  header nav { display: flex; gap: 32px; font-family: var(--mono); font-size: 13px; }
  header nav a { text-decoration: none; }
  header nav a:hover { color: var(--accent); }

  /* ===== hero ===== */
  #hero { padding-top: 120px; padding-bottom: 100px; border-bottom: 1px solid var(--border); }
  #hero .eyebrow { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 20px; }
  #hero h1 { font-size: clamp(40px,6vw,76px); line-height: 1.02; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 28px; max-width: 900px; }
  #hero p:nth-of-type(2) { font-family: var(--mono); font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 640px; margin: 0 0 40px; }
  #hero p:nth-of-type(3) { font-size: 17px; line-height: 1.7; color: var(--muted); max-width: 680px; margin: 0; }

  /* ===== research ===== */
  #research { padding-top: 100px; padding-bottom: 100px; border-bottom: 1px solid var(--border); }
  #research > h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
  #research > p { font-family: var(--mono); font-size: 13px; color: var(--subtle); margin: 0 0 56px; max-width: 560px; }

  article { border-bottom: 1px solid var(--border); padding: 32px 0; }
  article:last-of-type { border-bottom: none; }
  article[id^="area-"] { scroll-margin-top: 100px; }
  article h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; }
  article > p:first-of-type { font-size: 15px; line-height: 1.65; color: var(--muted); max-width: 640px; margin: 0 0 14px; }
  article p.tags { font-family: var(--mono); font-size: 12px; color: var(--accent); margin: 0 0 16px; }

  /* ===== pipeline (steps card) ===== */
  .pipeline { background: var(--box); border: 1px solid var(--box-border); border-radius: 10px; padding: 24px 32px; }
  .pipeline h4 { font-family: var(--mono); font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 400; margin: 0 0 20px; }
  .pipeline > ol { list-style: none; margin: 0 auto; padding: 0; max-width: 480px; }
  .pipeline > ol > li { padding: 16px 0; }
  .step-label { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
  .step-label .kind { font-family: var(--mono); font-size: 10px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.06em; }
  .step-label .title {
    background: var(--text); color: var(--bg);
    padding: 14px 18px; border-radius: 8px;
    font-size: 14px; font-weight: 600; line-height: 1.45;
    display: inline-block;
  }
  .pipeline figure { margin: 0 0 12px; }
  .pipeline figure:last-child { margin-bottom: 0; }
  .pipeline figcaption { font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.5; margin: 0 0 8px; }
  .pipeline figcaption a { color: var(--accent); text-decoration: none; }
  .pipeline img {
    display: block; width: 100%; max-height: 320px; object-fit: contain;
    background: #ffffff; border: 1px solid var(--box-border); border-radius: 8px; padding: 8px;
  }

  /* ===== references ===== */
  .references { max-width: 480px; margin: 12px auto 0; padding-top: 16px; border-top: 1px solid var(--border); }
  .references h4 { font-family: var(--mono); font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 400; margin: 0 0 10px; }
  .references ol { list-style: none; margin: 0; padding: 0; counter-reset: refs; }
  .references li { font-size: 13px; line-height: 1.6; color: var(--muted); margin-bottom: 8px; counter-increment: refs; scroll-margin-top: 100px; }
  .references li::before { content: '[' counter(refs) '] '; color: var(--subtle); }
  .references a { color: var(--accent); text-decoration: none; }
  .references a:hover { text-decoration: underline; }

  /* ===== contact ===== */
  #contact { padding-top: 120px; padding-bottom: 60px; }
  #contact h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 40px; }
  #contact > p { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 560px; margin: 0 0 44px; }
  #contact ul { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; }
  #contact a {
    display: flex; align-items: center; gap: 10px; padding: 14px 22px;
    border: 1px solid var(--text); border-radius: 2px; text-decoration: none;
    font-family: var(--mono); font-size: 14px;
  }
  #contact a:hover { background: var(--text); color: var(--bg); }

  /* ===== footer ===== */
  footer { max-width: 1100px; margin: 0 auto; padding: 24px 48px 60px; border-top: 1px solid var(--border); }
  footer p { font-family: var(--mono); font-size: 12px; color: var(--subtle); margin: 0; }

  @media (max-width: 640px) {
    header, section#hero, section#research, section#contact, footer {
      padding-left: 20px !important;
      padding-right: 20px !important;
    }
    header nav { display: none; }
  }

  /* ===== language switch ===== */
  .lang-switch { display: flex; gap: 4px; border: 1px solid var(--box-border); border-radius: 20px; padding: 3px; margin-left: 20px; }
  .lang-btn { border: none; background: transparent; font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 16px; cursor: pointer; color: var(--subtle); }
  .lang-btn.active { background: var(--text); color: var(--bg); }

  /* ===== table of contents (research areas) ===== */
  .toc ul { display: flex; gap: 16px; flex-wrap: wrap; list-style: none; margin: 0 0 56px; padding: 0; }
  .toc li { flex: 1 1 240px; }
  .toc-card {
    height: 100%;
    background: var(--box); border: 1px solid var(--box-border); border-radius: 10px;
    padding: 20px 22px; text-decoration: none; color: var(--text);
    display: flex; flex-direction: column; gap: 8px;
    transition: border-color 0.15s ease;
  }
  .toc-card:hover { border-color: var(--accent); }
  .toc-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
  .toc-tags { font-family: var(--mono); font-size: 11px; color: var(--accent); }

  /* ===== back to areas ===== */
  .back-to-areas { margin: 24px 0 0; }
  .back-to-areas a {
    font-family: var(--mono); font-size: 12px; color: var(--subtle); text-decoration: none;
  }
  .back-to-areas a:hover { color: var(--accent); }
