/* ==========================================================================
   CORE IMEX Center — Style Sheet
   Editorial / institutional: ink on paper, hairline rules, one accent.
   ========================================================================== */

:root {
    /* Ink & paper */
    --ink:        #111111;
    --ink-2:      #4a4a4a;
    --ink-3:      #7a7a75;
    --paper:      #ffffff;
    --paper-2:    #f4f4f1;
    --paper-3:    #eaeae5;

    /* Rules */
    --rule:       #d7d7d1;
    --rule-light: #e9e9e4;
    --rule-heavy: #111111;

    /* Single accent, drawn from the IMEX mark */
    --accent:     #1f35c4;

    /* Type */
    --font-display: 'Inter Tight', 'IBM Plex Sans Thai', 'Noto Sans JP', system-ui, sans-serif;
    --font-body:    'Inter', 'IBM Plex Sans Thai', 'Noto Sans JP', system-ui, sans-serif;

    /* Metrics */
    --header-height: 72px;
    --container-max-width: 1320px;
    --gutter: clamp(20px, 5vw, 64px);
    --section-gap: clamp(60px, 8.5vw, 128px);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    letter-spacing: -0.006em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

[lang="ja"], [lang="ja"] body {
    --font-display: 'Noto Sans JP', 'Inter Tight', sans-serif;
    --font-body: 'Noto Sans JP', 'Inter', sans-serif;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.12;
}

::selection { background: var(--ink); color: var(--paper); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: #c4c4be; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section-padding { padding: var(--section-gap) 0; }
.alt-bg { background: var(--paper-2); }

.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }

/* --- Shared type objects --- */
.eyebrow,
.section-tagline,
.featured-tag,
.project-tag {
    display: block;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--accent);
}

/* --- Buttons & links --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 14px 26px;
    border: 1.5px solid transparent;
    border-radius: 0;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.005em;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--ink); }

.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.btn-sm { padding: 10px 18px; font-size: 0.8rem; }
.btn-lg { padding: 17px 32px; font-size: 0.95rem; }
.btn-block { display: flex; width: 100%; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    padding-bottom: 3px;
    border-bottom: 1.5px solid var(--ink);
    transition: color 0.2s ease, border-color 0.2s ease;
}
.link-arrow::after { content: '\2192'; margin-left: 0.5em; }
.link-arrow:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 800;
    height: var(--header-height);
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    transition: border-color 0.2s ease;
}
.header.scrolled { border-bottom-color: var(--ink); }

.header-container {
    max-width: var(--container-max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: clamp(20px, 4vw, 56px);
}

.logo-brand { display: flex; align-items: center; flex-shrink: 0; }
.header-logo { height: 48px; width: auto; }

.nav { margin-right: auto; }
.nav-list { display: flex; align-items: center; gap: clamp(14px, 1.9vw, 30px); }

.nav-link {
    position: relative;
    display: block;
    padding: 6px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-2);
    transition: color 0.18s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

/* Language switcher — squared segmented control */
.lang-switcher { display: flex; border: 1px solid var(--rule); }
.lang-btn {
    padding: 7px 11px;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--rule);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    color: var(--ink-3);
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.lang-btn:last-child { border-right: 0; }
.lang-btn:hover { color: var(--ink); }
.lang-btn.active { background: var(--ink); color: var(--paper); }

/* Mobile toggle */
.mobile-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--rule);
    cursor: pointer;
    position: relative;
}
.hamburger, .hamburger::before, .hamburger::after {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    transform: translateX(-50%);
    transition: transform 0.25s var(--ease), opacity 0.15s ease;
}
.hamburger { top: 50%; margin-top: -0.75px; }
.hamburger::before { content: ''; top: -6px; left: 0; transform: none; }
.hamburger::after { content: ''; top: 6px; left: 0; transform: none; }
.mobile-nav-toggle.open .hamburger { transform: translateX(-50%) rotate(45deg); }
.mobile-nav-toggle.open .hamburger::before { opacity: 0; }
.mobile-nav-toggle.open .hamburger::after { transform: rotate(-90deg); top: 0; }

/* Mobile drawer */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.4);
    z-index: 850;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}
.mobile-nav-overlay.open { opacity: 1; visibility: visible; }

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 860;
    width: min(340px, 86vw);
    background: var(--paper);
    border-left: 1.5px solid var(--ink);
    padding: calc(var(--header-height) + 16px) 28px 32px;
    transform: translateX(100%);
    transition: transform 0.32s var(--ease);
    overflow-y: auto;
}
.mobile-nav-drawer.open { transform: none; }

.mobile-nav-list { border-top: 1px solid var(--rule); }
.mobile-nav-link {
    display: block;
    padding: 15px 0;
    border-bottom: 1px solid var(--rule);
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
}
.mobile-nav-link:hover, .mobile-nav-link.active { color: var(--accent); }

/* --- Hero --- */
.hero {
    padding-top: calc(var(--header-height) + clamp(44px, 6.5vw, 96px));
    padding-bottom: clamp(52px, 7vw, 96px);
}

.hero-head {
    border-top: 1.5px solid var(--rule-heavy);
    padding-top: clamp(20px, 2.4vw, 30px);
}

.hero-head .eyebrow { margin-bottom: clamp(24px, 3.4vw, 44px); }

.hero-title {
    font-size: clamp(2.55rem, 6.4vw, 5.6rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.038em;
    margin-bottom: clamp(30px, 4vw, 54px);
}

.hero-lead {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(22px, 3.5vw, 56px);
    align-items: start;
    border-top: 1px solid var(--rule);
    padding-top: clamp(20px, 2.4vw, 30px);
}

.hero-desc {
    font-size: clamp(1.02rem, 1.25vw, 1.24rem);
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 60ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    justify-content: flex-end;
}

.hero-figure { margin: clamp(40px, 5.5vw, 76px) 0 0; }
.hero-figure img { width: 100%; }
.hero-figure figcaption {
    border-top: 1px solid var(--rule);
    margin-top: 16px;
    padding-top: 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--ink-3);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1.5px solid var(--rule-heavy);
    margin-top: clamp(40px, 5.5vw, 76px);
}
.stat-item {
    padding: clamp(18px, 2.2vw, 28px) clamp(16px, 2.2vw, 32px) clamp(6px, 1vw, 12px) 0;
    border-right: 1px solid var(--rule);
}
.stat-item:last-child { border-right: 0; }

.stat-item dt {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 4.6vw, 4.2rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.042em;
    font-variant-numeric: tabular-nums;
}
.stat-plus { color: var(--accent); }

.stat-label {
    display: block;
    margin-top: 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ink-3);
}

/* --- Section header (editorial two-column) --- */
.section-header {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 3.1fr);
    gap: clamp(18px, 3.5vw, 60px);
    border-top: 1.5px solid var(--rule-heavy);
    padding-top: clamp(20px, 2.4vw, 30px);
    margin-bottom: clamp(38px, 5.5vw, 76px);
}

.section-title {
    font-size: clamp(1.85rem, 3.5vw, 3.05rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.028em;
}

.section-desc {
    margin-top: 18px;
    font-size: clamp(0.98rem, 1.1vw, 1.14rem);
    line-height: 1.65;
    color: var(--ink-2);
    max-width: 66ch;
}

/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: clamp(30px, 4.5vw, 76px);
    align-items: start;
}

.image-wrapper { margin: 0; }
.image-wrapper img { width: 100%; }
.image-wrapper figcaption {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-top: 1px solid var(--rule);
    margin-top: 16px;
    padding-top: 12px;
}
.tni-card-title {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
}
.tni-card-subtitle { font-size: 0.82rem; color: var(--ink-3); }

.info-title {
    font-size: clamp(1.3rem, 2.1vw, 1.85rem);
    line-height: 1.2;
    margin-bottom: clamp(18px, 2vw, 26px);
}
.info-text { color: var(--ink-2); margin-bottom: 1.1em; }
.info-text strong { color: var(--ink); font-weight: 600; }

.director-card {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 24px);
    border-top: 1.5px solid var(--rule-heavy);
    margin-top: clamp(26px, 3vw, 38px);
    padding-top: clamp(18px, 2vw, 24px);
    cursor: pointer;
}
.director-avatar { flex-shrink: 0; }
.director-avatar img {
    width: clamp(62px, 7vw, 84px);
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center top;
}
.director-name { font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.25; transition: color 0.18s ease; }
.director-title { margin-top: 5px; font-size: 0.85rem; line-height: 1.5; color: var(--ink-3); }
.director-card:hover .director-name { color: var(--accent); }

/* --- Team directory --- */
.team-section {
    margin-top: var(--section-gap);
    border-top: 1.5px solid var(--rule-heavy);
    padding-top: clamp(20px, 2.4vw, 30px);
}
.team-section .team-title {
    text-align: left;
    font-size: clamp(1.15rem, 1.8vw, 1.5rem);
    margin-bottom: clamp(28px, 3.5vw, 48px);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: clamp(30px, 3vw, 48px) clamp(20px, 2.4vw, 36px);
}

.team-card { cursor: pointer; }
.member-avatar { overflow: hidden; background: var(--paper-3); }
.member-avatar img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.5s var(--ease);
}
.team-card:hover .member-avatar img { transform: scale(1.04); }

.member-name {
    margin-top: 14px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.012em;
    transition: color 0.18s ease;
}
.team-card:hover .member-name { color: var(--accent); }
.member-role { margin-top: 6px; font-size: 0.78rem; line-height: 1.5; color: var(--ink-3); }

/* --- Expertise pillars --- */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.expertise-card {
    border-top: 1.5px solid var(--rule-heavy);
    border-right: 1px solid var(--rule);
    padding: clamp(18px, 2.2vw, 26px) clamp(18px, 2.2vw, 32px) clamp(24px, 3vw, 38px) 0;
}
.expertise-card:last-child { border-right: 0; }

.card-num {
    display: block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-bottom: clamp(16px, 2vw, 26px);
}

.card-title {
    font-size: clamp(1.05rem, 1.35vw, 1.2rem);
    line-height: 1.25;
    margin-bottom: 12px;
}
.card-desc { font-size: 0.88rem; line-height: 1.65; color: var(--ink-2); }

.card-features { margin-top: clamp(16px, 2vw, 24px); border-top: 1px solid var(--rule-light); }
.card-features li {
    padding: 9px 0;
    border-bottom: 1px solid var(--rule-light);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--ink-2);
}

/* --- Immersive lab --- */
.immersive-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: clamp(32px, 5vw, 80px);
    align-items: start;
}

.immersive-content .section-tagline { margin-bottom: clamp(16px, 2vw, 24px); }
.immersive-content .section-desc { max-width: 52ch; }

.feature-checklist {
    margin-top: clamp(26px, 3.2vw, 44px);
    border-top: 1.5px solid var(--rule-heavy);
}
.checklist-item { padding: clamp(15px, 1.8vw, 21px) 0; border-bottom: 1px solid var(--rule); }
.checklist-item h4 { font-size: 0.98rem; font-weight: 600; letter-spacing: -0.012em; margin-bottom: 6px; }
.checklist-item p { font-size: 0.85rem; line-height: 1.6; color: var(--ink-3); }

.lab-viewer { margin: 0; }
.room-viewport {
    position: relative;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    background: var(--paper-3);
}
.room-viewport img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.lab-caption {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 20px;
    border-top: 1px solid var(--rule);
    margin-top: 16px;
    padding-top: 12px;
}
.scene-title {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
}
.lab-caption-note { font-size: 0.78rem; color: var(--ink-3); }

.room-specs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1.5px solid var(--rule-heavy);
    margin-top: clamp(22px, 2.6vw, 34px);
}
.spec-row { padding: 15px clamp(10px, 1.4vw, 20px) 0 0; border-right: 1px solid var(--rule); }
.spec-row:last-child { border-right: 0; }
.spec-val {
    display: block;
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}
.spec-lbl { display: block; margin-top: 6px; font-size: 0.74rem; line-height: 1.45; color: var(--ink-3); }

/* --- Featured projects --- */
.featured-project {
    border-top: 1.5px solid var(--rule-heavy);
    padding-top: clamp(20px, 2.4vw, 30px);
    margin-bottom: clamp(40px, 5.5vw, 80px);
}

.featured-project-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(26px, 4vw, 60px);
    align-items: start;
}
.featured-project-image img { width: 100%; }

.featured-tag { margin-bottom: clamp(12px, 1.6vw, 18px); }
.featured-title {
    font-size: clamp(1.25rem, 2.1vw, 1.85rem);
    line-height: 1.16;
    margin-bottom: clamp(12px, 1.6vw, 18px);
}
.featured-desc { font-size: 0.92rem; line-height: 1.7; color: var(--ink-2); }

.featured-specs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(18px, 2.2vw, 28px); }
.spec-tag {
    padding: 6px 11px;
    border: 1px solid var(--rule);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* --- Publication filters --- */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    border-top: 1.5px solid var(--rule-heavy);
    border-bottom: 1px solid var(--rule);
    margin-bottom: clamp(4px, 1vw, 10px);
}
.filter-btn {
    padding: 14px 16px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}
.filter-btn:first-child { padding-left: 0; }
.filter-btn:hover { color: var(--ink); }
.filter-btn:hover, .filter-btn.active { color: var(--ink); border-bottom-color: var(--accent); }
.filter-btn.active { font-weight: 600; }

/* --- Publication list --- */
.projects-grid { transition: opacity 0.25s ease; }

.project-card { display: flex; border-bottom: 1px solid var(--rule); }

.project-content {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr) max-content;
    column-gap: clamp(16px, 3vw, 48px);
    width: 100%;
    padding: clamp(20px, 2.4vw, 30px) 0;
}
.project-tag   { grid-column: 1; grid-row: 1 / span 3; padding-top: 4px; }
.project-title { grid-column: 2; grid-row: 1; font-size: clamp(0.98rem, 1.15vw, 1.1rem); font-weight: 600; line-height: 1.4; letter-spacing: -0.012em; transition: color 0.18s ease; }
.project-desc  { grid-column: 2; grid-row: 2; margin-top: 9px; font-size: 0.84rem; line-height: 1.65; color: var(--ink-3); }
.project-desc strong { color: var(--ink-2); font-weight: 600; }
.project-desc em { font-style: italic; }
.project-meta  { grid-column: 2; grid-row: 3; display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; }
.project-meta span { font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }

.project-link {
    grid-column: 3;
    grid-row: 1 / span 3;
    align-self: start;
    display: inline-flex;
    align-items: center;
    padding-bottom: 3px;
    border-bottom: 1.5px solid var(--ink);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.18s ease, border-color 0.18s ease;
}
.project-link::after { content: '\2197'; margin-left: 0.4em; }
.project-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.project-card:hover .project-title { color: var(--accent); }

/* --- Contact --- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 76px);
    align-items: start;
}

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.form-group { margin-bottom: clamp(18px, 2.2vw, 26px); }
.form-group label {
    display: block;
    margin-bottom: 9px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 14px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 0;
    font-size: 0.92rem;
    transition: border-color 0.18s ease;
}
.form-group textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.form-group input::placeholder, .form-group textarea::placeholder { color: #a9a9a3; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group option { color: var(--ink); }

.form-status { margin-top: 14px; font-size: 0.85rem; color: var(--ink-3); }
.form-status.success { color: var(--accent); }
.form-status.error { color: #b3261e; }

.info-card { border-top: 1.5px solid var(--rule-heavy); padding-top: clamp(20px, 2.4vw, 30px); }
.info-card-title { font-size: clamp(1.1rem, 1.5vw, 1.3rem); margin-bottom: clamp(16px, 2vw, 24px); }
.info-details-item { padding: clamp(14px, 1.8vw, 20px) 0; border-bottom: 1px solid var(--rule); }
.info-details-item h5 {
    margin-bottom: 7px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.info-details-item p { font-size: 0.9rem; line-height: 1.6; }

/* --- Footer --- */
.footer {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.68);
    margin-top: var(--section-gap);
    padding-top: clamp(44px, 6vw, 80px);
}

.footer-container {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
    gap: clamp(30px, 4vw, 64px);
    padding-bottom: clamp(38px, 5vw, 64px);
}

.footer-logo { height: 40px; width: auto; }
.footer-tagline { margin-top: 16px; font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); }

.social-links { display: flex; margin-top: clamp(20px, 2.4vw, 28px); }
.social-links a {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-right: -1px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.social-links a:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.footer-links h4 {
    margin-bottom: clamp(14px, 1.8vw, 20px);
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--paper);
}
.footer-links ul li { margin-bottom: 11px; }
.footer-links a { font-size: 0.87rem; line-height: 1.5; color: rgba(255, 255, 255, 0.62); transition: color 0.18s ease; }
.footer-links a:hover { color: var(--paper); }

.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.14); padding: 22px 0 26px; }
.footer-bottom p { font-size: 0.76rem; line-height: 1.5; color: rgba(255, 255, 255, 0.42); }

/* --- Assistant widget --- */
.ai-widget-container {
    position: fixed;
    right: clamp(16px, 3vw, 32px);
    bottom: clamp(16px, 3vw, 32px);
    z-index: 900;
}

.ai-widget-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 46px;
    padding: 0 20px;
    background: var(--ink);
    color: var(--paper);
    border: 0;
    border-radius: 0;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.ai-widget-toggle:hover { background: var(--accent); }
.widget-pulse { display: none; }

.ai-widget-window {
    position: absolute;
    right: 0;
    bottom: 58px;
    width: min(384px, calc(100vw - 32px));
    height: min(540px, 70vh);
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1.5px solid var(--ink);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.22s ease, transform 0.28s var(--ease), visibility 0.22s;
}
.ai-widget-window.open { opacity: 1; visibility: visible; transform: none; }

.ai-widget-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--rule);
}
.ai-avatar { position: relative; flex-shrink: 0; }
.ai-avatar-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.online-dot {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border: 2px solid var(--paper);
}
.ai-widget-header h4 { font-size: 0.9rem; font-weight: 600; letter-spacing: -0.012em; }
.ai-status { font-size: 0.72rem; color: var(--ink-3); }

.ai-widget-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message { display: flex; }
.chat-message.user { justify-content: flex-end; }
.message-content { max-width: 84%; padding: 11px 14px; font-size: 0.86rem; line-height: 1.6; }
.bot .message-content { background: var(--paper-2); }
.user .message-content { background: var(--ink); color: var(--paper); }
.message-content strong { font-weight: 600; }

.typing-dot { animation: blink 1.1s infinite; }

/* Suggested questions read better as a ruled list — the labels are too long to pair as pills */
.chat-chips { margin-top: 6px; border-top: 1px solid var(--rule); }
.chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 11px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: left;
    color: var(--ink-2);
    cursor: pointer;
    transition: color 0.18s ease;
}
.chip::after { content: '\2192'; color: var(--ink-3); transition: color 0.18s ease; }
.chip:hover, .chip:hover::after { color: var(--accent); }

.ai-widget-footer { display: flex; border-top: 1px solid var(--rule); }
.ai-widget-footer input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    background: transparent;
    border: 0;
    font-size: 0.86rem;
}
.ai-widget-footer input:focus { outline: none; }
.chat-send-btn {
    width: 52px;
    flex-shrink: 0;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--rule);
    color: var(--ink);
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.chat-send-btn:hover { background: var(--ink); color: var(--paper); }

/* --- Faculty profile modal --- */
.profile-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(14px, 4vw, 56px);
    background: rgba(17, 17, 17, 0.5);
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    transition: opacity 0.22s ease, visibility 0.22s;
}
.profile-modal-overlay.active { opacity: 1; visibility: visible; }

.profile-modal-container {
    position: relative;
    width: min(880px, 100%);
    background: var(--paper);
    border: 1.5px solid var(--ink);
    transform: translateY(12px);
    transition: transform 0.3s var(--ease);
}
.profile-modal-overlay.active .profile-modal-container { transform: none; }

.profile-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 46px;
    height: 46px;
    background: var(--ink);
    color: var(--paper);
    border: 0;
    cursor: pointer;
    transition: background-color 0.18s ease;
}
.profile-modal-close:hover { background: var(--accent); }

.profile-modal-content {
    padding: clamp(24px, 4vw, 46px);
    max-height: calc(100vh - clamp(28px, 8vw, 112px));
    overflow-y: auto;
}

.pm-header-card {
    display: flex;
    gap: clamp(18px, 3vw, 32px);
    align-items: flex-start;
    border-bottom: 1.5px solid var(--rule-heavy);
    padding-bottom: clamp(20px, 2.6vw, 30px);
    margin-bottom: clamp(22px, 3vw, 32px);
}
.pm-avatar-wrap { flex-shrink: 0; }
.pm-avatar { width: clamp(88px, 11vw, 128px); aspect-ratio: 1; object-fit: cover; object-position: center top; }

.pm-name-th { font-size: clamp(1.25rem, 2.3vw, 1.8rem); line-height: 1.15; }
.pm-name-en { margin-top: 6px; font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.pm-name-jp { margin-top: 4px; font-size: 0.84rem; color: var(--ink-3); }
.pm-affiliation { display: flex; align-items: baseline; gap: 8px; margin-top: 13px; font-size: 0.82rem; line-height: 1.5; color: var(--ink-3); }
.pm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(14px, 2vw, 20px); }
.pm-actions .btn { padding: 10px 16px; font-size: 0.78rem; }

.pm-bio-card { background: var(--paper-2); padding: clamp(16px, 2vw, 22px); margin-bottom: clamp(24px, 3vw, 34px); }
.pm-bio-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sparkle-icon { font-size: 0.85rem; }
.pm-bio-title { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.pm-bio-text { font-size: 0.88rem; line-height: 1.7; color: var(--ink-2); }

.pm-section-intro { border-top: 1.5px solid var(--rule-heavy); padding-top: clamp(16px, 2vw, 22px); margin-bottom: clamp(20px, 2.6vw, 28px); }
.pm-section-intro h3 { font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.pm-sub-tag { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--ink-3); }

.pm-block { margin-bottom: clamp(24px, 3vw, 34px); }
.pm-block:last-child { margin-bottom: 0; }
.pm-block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 10px;
}
.pm-block-icon { font-size: 0.8rem; color: var(--accent); }
.pm-block-header h4 { font-family: var(--font-body); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

.pm-list-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule-light); }
.pm-num {
    flex-shrink: 0;
    width: 20px;
    padding-top: 2px;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.pm-item-text { font-size: 0.87rem; line-height: 1.65; color: var(--ink-2); }
.text-muted { color: var(--ink-3); }
.pm-copy-btn.copied { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* --- Motion --- */
.fade-in { animation: riseIn 0.65s var(--ease) both; }
.hero-figure.fade-in { animation-delay: 0.08s; }
.hero-stats.fade-in { animation-delay: 0.14s; }

.scroll-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s var(--ease);
}
.scroll-reveal.active { opacity: 1; transform: none; }

@keyframes riseIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}
@keyframes blink {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 1; }
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .project-content { grid-template-columns: 150px minmax(0, 1fr) max-content; }
}

@media (max-width: 1024px) {
    :root { --header-height: 64px; }

    .nav { display: none; }
    .mobile-nav-toggle { display: block; }
    .header-actions { margin-left: auto; }

    .hero-lead { grid-template-columns: minmax(0, 1fr); }
    .hero-actions { justify-content: flex-start; }

    .section-header { grid-template-columns: minmax(0, 1fr); gap: 16px; }

    .about-grid,
    .immersive-grid,
    .featured-project-grid,
    .contact-grid { grid-template-columns: minmax(0, 1fr); }

    .expertise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .expertise-card:nth-child(2n) { border-right: 0; }
    .expertise-card:nth-child(n + 3) { border-top-width: 1px; border-top-color: var(--rule); }

    .team-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 820px) {
    .project-content {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
    }
    .project-tag   { grid-column: 1; grid-row: 1; padding-top: 0; margin-bottom: 10px; }
    .project-title { grid-column: 1; grid-row: 2; }
    .project-desc  { grid-column: 1; grid-row: 3; }
    .project-meta  { grid-column: 1; grid-row: 4; }
    .project-link  { grid-column: 1; grid-row: 5; margin-top: 16px; }

    .header-actions .btn-sm { display: none; }
}

@media (max-width: 620px) {
    .hero-stats { grid-template-columns: minmax(0, 1fr); }
    .stat-item {
        border-right: 0;
        border-bottom: 1px solid var(--rule);
        padding: 16px 0;
        display: flex;
        align-items: baseline;
        gap: 16px;
    }
    .stat-item:last-child { border-bottom: 0; }
    .stat-item dt { font-size: 2.4rem; min-width: 88px; }
    .stat-label { margin-top: 0; }

    .expertise-grid { grid-template-columns: minmax(0, 1fr); }
    .expertise-card { border-right: 0; padding-right: 0; }
    .expertise-card:nth-child(n + 2) { border-top-width: 1px; border-top-color: var(--rule); }

    .room-specs { grid-template-columns: minmax(0, 1fr); }
    .spec-row { border-right: 0; border-bottom: 1px solid var(--rule); padding: 13px 0; }
    .spec-row:last-child { border-bottom: 0; }

    .form-row { grid-template-columns: minmax(0, 1fr); }
    .footer-container { grid-template-columns: minmax(0, 1fr); }

    .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .director-card { align-items: flex-start; }
}

@media (max-width: 480px) {
    .gallery-filters { border-bottom: 0; }
    .filter-btn { padding: 11px 12px; font-size: 0.78rem; }
    .filter-btn:first-child { padding-left: 0; }
    .ai-widget-toggle { height: 42px; padding: 0 16px; font-size: 0.8rem; }
}

/* ==========================================================================
   Legal document pages (privacy policy, etc.)
   ========================================================================== */

.legal-hero {
    border-top: 1.5px solid var(--rule-heavy);
    padding-top: clamp(20px, 2.4vw, 30px);
    padding-bottom: clamp(28px, 3.5vw, 44px);
}
.legal-updated { margin-top: 14px; font-size: 0.85rem; color: var(--ink-3); }

.legal-body { max-width: 74ch; }

.legal-section {
    border-top: 1px solid var(--rule);
    padding: clamp(28px, 3.5vw, 44px) 0;
}
.legal-section:first-child { border-top: 0; padding-top: 0; }

.legal-section h2 {
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    line-height: 1.3;
    margin-bottom: clamp(14px, 1.8vw, 20px);
}
.legal-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.4em 0 0.6em;
}
.legal-section p { color: var(--ink-2); line-height: 1.75; margin-bottom: 1em; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section a { color: var(--accent); border-bottom: 1px solid currentColor; }
.legal-section a:hover { color: var(--ink); }

.legal-list { margin: 0.4em 0 1.2em; border-top: 1px solid var(--rule-light); }
.legal-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule-light);
    color: var(--ink-2);
    line-height: 1.65;
}
.legal-list strong { color: var(--ink); font-weight: 600; }

.legal-table { width: 100%; border-collapse: collapse; margin: 0.4em 0 1.2em; font-size: 0.92rem; }
.legal-table th, .legal-table td {
    text-align: left;
    padding: 11px 14px 11px 0;
    border-bottom: 1px solid var(--rule-light);
    vertical-align: top;
    color: var(--ink-2);
}
.legal-table th { color: var(--ink); font-weight: 600; border-bottom-color: var(--rule); }

[data-lang-panel] { display: none; }
[data-lang-panel].active { display: block; }
