/* v7.5 layout recovery — final cascade layer */

/* Content cleanup: removed redundant side labels now release their columns. */
main > .about .section-grid,
main > .experience .section-grid {
  grid-template-columns: minmax(0, 1fr);
}

.research .section-heading {
  grid-template-columns: minmax(0, 1fr);
}

/* Teaching heading and course list share the full content width. */
.teaching-layout {
  display: block;
}

.teaching-list {
  width: 100%;
}

.teaching-list div,
html[dir="rtl"] .teaching-list div {
  padding-inline: 0;
}

.teaching-list div::before {
  content: none;
}

@media (min-width: 1180px) {
  .hero { padding-top: 0; }

  .hero-layout {
    height: auto;
    min-height: 490px;
    grid-template-columns: minmax(0, .92fr) minmax(400px, 1.18fr) minmax(240px, .72fr);
    align-items: stretch;
  }

  .hero-copy {
    padding-block: 2.15rem 1.65rem;
    padding-inline: 0 2rem;
  }

  html[dir="rtl"] .hero-copy {
    padding-block: 2.15rem 1.65rem;
    padding-inline: 2rem 0;
  }

  .hero h1 {
    font-size: clamp(3.55rem, 4.7vw, 4.65rem);
    line-height: .86;
  }

  .hero-role { font-size: 1.16rem; }
  .hero-intro { font-size: .86rem; line-height: 1.5; }

  .research-atlas {
    height: 490px;
    min-height: 0;
    grid-column: 2;
    grid-row: 1;
    padding: 0;
    border-inline: 1px solid var(--line);
  }

  .profile-visual {
    width: min(100%, 292px);
    height: 430px;
    min-height: 0;
    align-self: end;
    justify-self: center;
    grid-column: 3;
    grid-row: 1;
  }

  .portrait-frame {
    width: 100%;
    height: 430px;
    min-height: 0;
  }

  .portrait-frame img { object-position: 50% 35%; }

  .atlas-title {
    inset-block-start: 1.35rem;
    inset-inline-start: 1.45rem;
  }

  html[dir="rtl"] .atlas-title { inset-inline-start: 1.45rem; }

  .atlas-map {
    inset: 3.4rem 0 0;
    width: 100%;
    height: calc(100% - 3.4rem);
  }

  .atlas-orbit {
    left: 50%;
    top: 54%;
    width: min(22vw, 304px);
    height: min(22vw, 304px);
  }

  .orbit-two {
    left: 50%;
    top: 54%;
    width: min(15.5vw, 214px);
    height: min(15.5vw, 214px);
  }

  .atlas-core {
    left: 50%;
    top: 54%;
    width: min(8.4vw, 116px);
    height: min(8.4vw, 116px);
    padding: .7rem;
  }

  .atlas-core strong {
    font-size: clamp(.65rem, .78vw, .78rem);
    line-height: 1.12;
  }

  .atlas-point {
    width: 2.1rem;
    height: 2.1rem;
    font-size: .56rem;
    box-shadow: 0 0 0 5px rgba(248,245,237,.72);
  }

  /* These coordinates exactly match the SVG connector endpoints. */
  .point-one { left: 35%; top: 31%; }
  .point-two { left: 65%; top: 31%; }
  .point-three { left: 35%; top: 77%; }
  .point-four { left: 65%; top: 77%; }

  .atlas-node { width: 27%; }
  .atlas-node b { font-size: clamp(.76rem, .88vw, .9rem); line-height: 1.12; }
  .atlas-node small { display: none; }
  .node-one { left: 2.5%; top: 24%; text-align: right; }
  .node-two { right: 2.5%; top: 24%; text-align: left; }
  .node-three { left: 2.5%; bottom: 10%; text-align: right; }
  .node-four { right: 2.5%; bottom: 10%; text-align: left; }

  html[dir="rtl"] .node-one,
  html[dir="rtl"] .node-three { text-align: right; }
  html[dir="rtl"] .node-two,
  html[dir="rtl"] .node-four { text-align: left; }

  .hero-footer { padding-block: .48rem; }
  .hero-footer b { font-size: .78rem; }

  main > .about,
  main > .research,
  main > .experience,
  main > .publications { padding-block: 2rem; }

  .section h2 { font-size: clamp(1.8rem, 2.2vw, 2.2rem); line-height: 1.02; }
  .about-columns { font-size: .79rem; line-height: 1.5; }
  main > .research .research-card p { font-size: .72rem; line-height: 1.38; }
  main > .experience .timeline-item p { font-size: .68rem; line-height: 1.35; }
  main > .publications .publication h3 { font-size: .78rem; line-height: 1.24; }

  html[lang="fa"] .hero h1,
  html[lang="ar"] .hero h1 {
    font-size: clamp(3.45rem, 4.6vw, 4.55rem);
    line-height: 1.28;
  }

  html[lang="fa"] .section h2,
  html[lang="ar"] .section h2,
  html[lang="fa"] .contact h2,
  html[lang="ar"] .contact h2 {
    font-size: clamp(2.2rem, 2.65vw, 2.75rem);
    line-height: 1.55;
  }
}

@media (min-width: 761px) and (max-width: 1179px) {
  .profile-visual,
  .portrait-frame,
  .research-atlas { min-height: 460px; }
  .atlas-point { width: 2.35rem; height: 2.35rem; }
}

@media (max-width: 760px) {
  .hero-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-copy, .profile-visual, .research-atlas { grid-column: 1; min-width: 0; }
  .hero-copy { padding-block: 1.35rem 1.5rem; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .hero-intro { font-size: .9rem; }

  .profile-visual {
    width: min(82vw, 320px);
    min-height: 0;
    margin-inline: auto;
  }

  .portrait-frame {
    height: min(112vw, 440px);
    min-height: 0;
  }

  .research-atlas {
    min-height: 0;
    height: 560px;
    margin-top: 1rem;
  }

  .atlas-point {
    width: 2.2rem;
    height: 2.2rem;
    font-size: .58rem;
  }

  .section { padding-block: 2.35rem; }
  .section h2 { line-height: 1.12; }
  .section-heading { gap: .8rem; }
  .research-card,
  .research-card.featured,
  .research-card.accent-card { min-height: 0; }
}

@media (max-width: 420px) {
  .research-atlas { height: 525px; }
  .atlas-node { width: 33%; }
  .atlas-node b { font-size: .72rem; }
}

/* The atlas core, rings and connector origin share one coordinate system. */
.atlas-map { margin: 0; }
.atlas-orbit, .orbit-two, .atlas-core { top: 54%; }

/* RTL selectors in the base sheet must not retain obsolete physical offsets. */
@media (min-width: 1180px) {
  html[dir="rtl"] .node-one,
  html[dir="rtl"] .node-three { left: 2.5%; right: auto; }
  html[dir="rtl"] .node-two,
  html[dir="rtl"] .node-four { right: 2.5%; left: auto; }
  main > .experience .timeline-item {
    grid-template-columns: var(--date-column) var(--marker-column) minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  html[dir="rtl"] .atlas-title,
  html[dir="rtl"] .atlas-intro { inset-inline-start: 1.2rem; }
  .atlas-title { max-width: calc(100% - 2.4rem); }
}

.teaching-layout > h2 { margin: 0 0 1.5rem; }

/* Korean system fonts and line spacing accommodate Hangul glyphs. */
html[lang="ko"] {
  --font-body: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-display: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
html[lang="ko"] .section h2,
html[lang="ko"] .contact h2 { line-height: 1.4; letter-spacing: -.025em; }
html[lang="ko"] .atlas-node b,
html[lang="ko"] .atlas-core strong { line-height: 1.4; }

/* Keep connector lines behind the central disc. */
.atlas-core { z-index: 2; }

/* Editorial preview */
body,.hero { background-color:#f3efe6; color:#102d3b }
.hero-copy .eyebrow {color:#176965}
.portrait-frame {border-radius:50% 50% 0 0 / 33% 33% 0 0; overflow:hidden}
.atlas-node {pointer-events:auto;z-index:4;text-decoration:none;color:inherit}
.atlas-node:hover b,.atlas-node:focus-visible b {text-decoration:underline}
.publication:target {outline:2px solid #a4522c;outline-offset:3px;scroll-margin-block:5rem}
.orbit-one em {transform:translateY(-1em)}
@media(min-width:1180px){
.hero-layout {grid-template-columns:minmax(0,1fr) minmax(390px,1.2fr) minmax(220px,.72fr)}
.hero-copy {align-self:center}
.hero-intro {font-size:clamp(1rem,1.05vw,1.22rem);line-height:1.55}
.profile-visual {align-self:center}
.atlas-core strong {font-size:.88rem}
}
@media(max-width:760px){
.research-atlas {max-width:100%}
.atlas-node b {overflow-wrap:anywhere}
}
