/* ==========================================================================
   Home — 보다 안과의 기준 구현
   히어로(문장 · 광학 고리) → 세 갈래 진입 → 정밀검사 깊이 지도 → 의료진 → 대표 진료 → 장비 → 진료 과정 → 시설 → 예약
   ========================================================================== */

/* ---------------------------------------------------------------- hero */
.hero { padding-top: clamp(24px, 3.4vw, 48px); overflow-x: clip; }
.hero__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    min-height: clamp(560px, calc(100svh - var(--header-h) - 190px), 740px);
}
.hero__text {
    grid-column: 1 / span 5;
    display: flex;
    flex-direction: column;
    padding: 4px 0 clamp(20px, 2.4vw, 36px);
}
.hero__id { display: grid; gap: 8px; }
.hero__id-en {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}
.hero__id-ko { font-size: 16px; font-weight: 500; letter-spacing: -.01em; color: var(--ink-2); }

.hero__copy { display: grid; margin: auto 0; padding: clamp(40px, 5vw, 72px) 0; }
.hero__copy-item {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity .9s var(--ease), visibility .9s;
}
.hero__copy-item.is-active { opacity: 1; visibility: visible; }
.hero__headline {
    font-size: clamp(38px, 4.5vw, 68px);
    font-weight: 650;
    line-height: 1.17;
    letter-spacing: -.045em;
    text-wrap: balance;
}
.hero__caption {
    max-width: 28em;
    margin-top: 26px;
    font-size: clamp(17px, 1.3vw, 19px);
    line-height: 1.7;
    color: var(--ink-2);
}
.hero__more { margin-top: 28px; }

.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.hero__tel { display: inline-flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 17px; color: var(--ink); }
.hero__tel .mono { font-size: 12px; color: var(--accent); }
.hero__tel:hover { color: var(--accent); }

/* 그림 — 본문 폭(.wrap) 안에 놓여 아래 판독 줄 · 헤더 버튼과 오른쪽 끝이 맞는다. 처음 열릴 때 초점이 맞춰지듯 선명해진다 */
.hero__visual {
    grid-column: 6 / -1;
    position: relative;
    display: flex;
    flex-direction: column;
}
.hero__frame { position: relative; flex: 1; min-height: 460px; overflow: hidden; background: var(--bg-2); }
.hero__img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    filter: blur(14px);
    transform: scale(1.04);
    transition: opacity 1.2s var(--ease);
}
.hero__img.is-active { opacity: 1; }
.hero__img[data-focal="left"] { object-position: 22% 50%; }
.hero__img[data-focal="right"] { object-position: 78% 50%; }
.hero.is-focused .hero__img {
    filter: none;
    transform: none;
    transition: opacity 1.2s var(--ease), filter 1.5s var(--ease), transform 2s var(--ease);
}
.no-js .hero__img, html:not(.js) .hero__img { filter: none; transform: none; }


.hero__tag {
    position: absolute;
    z-index: 2;
    padding: 5px 9px;
    background: var(--bg);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .12em;
    color: var(--ink);
}
.hero__tag--tl { top: 0; left: 0; }
.hero__tag--br { right: 0; bottom: 0; }

.hero__controls { display: flex; gap: 4px; margin-top: 10px; }
.hero__go {
    min-width: 44px;
    min-height: 40px;
    padding: 0 6px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink-3);
    border-bottom: 2px solid transparent;
}
.hero__go:hover { color: var(--ink); }
.hero__go.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* 첫 화면 아래 — 진료 영역 · 오늘 진료 · 위치 */
.hero__readout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--col-gap);
    border-top: 2px solid var(--ink);
    margin-top: clamp(28px, 3vw, 44px);
}
.hero__readout > div { padding: 16px 0 4px; display: grid; gap: 4px; }
.hero__readout dt {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}
/* 글과 링크가 한 줄에 안 들어가면 링크가 다음 줄 왼쪽 끝에서 시작한다(들여쓰기 없이) */
.hero__readout dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 16.5px; font-weight: 500; line-height: 1.6; }
.hero__readout dd .mono { font-size: 15.5px; }
.hero__readout-link { font-size: 15px; line-height: 1.4; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.hero__readout-link:hover { color: var(--accent); border-bottom-color: currentColor; }

/* ---------------------------------------------------------------- care paths */
/* 세 칸은 폭이 같다(안쪽 여백 대신 칸 사이 간격 + 가운데 세로선) → 그림 높이 · 제목 · 링크가 한 줄에 맞는다 */
.entry__paths {
    --path-gap: clamp(32px, 4vw, 64px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--path-gap);
    border-top: 2px solid var(--ink);
}
.entry-path { position: relative; }
.entry-path + .entry-path::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: calc(var(--path-gap) / -2);
    border-left: 1px solid var(--line);
}
.entry-path:nth-child(2) { transition-delay: .08s; }
.entry-path:nth-child(3) { transition-delay: .16s; }
.entry-path__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 0 8px;
}
.entry-path__top { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.entry-path__index { font-size: 13px; font-weight: 500; color: var(--accent); }
.entry-path__area { font-size: 16px; font-weight: 600; }
.entry-path__focus { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.entry-path__focus-label { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.entry-path__glyph { width: 34px; height: 34px; }
.depth-glyph__ring { fill: none; stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.depth-glyph__ring.is-on { stroke: var(--accent); stroke-width: 2.5; }
.depth-glyph__core { fill: var(--ink); }
.entry-path__media { display: block; margin-top: 18px; }
.entry-path__media img { transition: transform 1s var(--ease); }
.entry-path__body { display: flex; flex-direction: column; flex: 1; }
.entry-path__title {
    display: block;
    margin-top: 26px;
    font-size: clamp(24px, 2.1vw, 31px);
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -.035em;
    transition: color .3s var(--ease);
}
.entry-path__keywords { display: block; margin-top: 10px; font-size: 15.5px; font-weight: 600; color: var(--accent-2); }
.entry-path__summary { display: block; margin-top: 12px; font-size: 16.5px; line-height: 1.75; color: var(--ink-2); }
.entry-path__more { align-self: flex-start; margin-top: auto; }
.entry-path__body > :nth-last-child(2) { margin-bottom: 28px; }
@media (hover: hover) {
    .entry-path__link:hover .entry-path__title { color: var(--accent); }
    .entry-path__link:hover .entry-path__media img { transform: scale(1.025); }
    .entry-path__link:hover .entry-path__more { color: var(--accent); gap: 16px; }
}

/* ---------------------------------------------------------------- examination */
.exam__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
}
.exam__intro { grid-column: 1 / span 5; position: sticky; top: calc(var(--header-h) + 32px); }
.exam__intro .lead { margin-top: 26px; max-width: 30em; }
.exam__map { margin-top: clamp(36px, 4vw, 56px); max-width: 400px; }
.exam__body { grid-column: 7 / span 6; }
.exam__more { margin-top: 36px; }

/* ---------------------------------------------------------------- doctors */
.roster__care { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.roster__care li + li { margin-top: 0; }

/* ---------------------------------------------------------------- treatments index */
.treat-index__ruler,
.facility__ruler { margin-bottom: clamp(56px, 6vw, 96px); }
.tx-table { --tx-cols: 128px minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1fr) 20px; }
.tx-table__head {
    display: grid;
    grid-template-columns: var(--tx-cols);
    column-gap: var(--col-gap);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ink);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-3);
}
.tx-row {
    display: grid;
    grid-template-columns: var(--tx-cols);
    column-gap: var(--col-gap);
    align-items: baseline;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
    transition: background-color .25s var(--ease);
}
.tx-row:hover { background: var(--bg-2); }
.tx-row__area { font-size: 15px; font-weight: 600; color: var(--accent-2); }
.tx-row__name { font-size: clamp(19px, 1.45vw, 21px); font-weight: 650; letter-spacing: -.02em; line-height: 1.4; }
.tx-row__en { display: block; margin-top: 2px; font-family: var(--mono); font-size: 12.5px; font-weight: 400; letter-spacing: .02em; color: var(--ink-3); }
.tx-row__summary { font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.tx-row__fact { font-size: 15.5px; line-height: 1.6; }
.tx-row__fact-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tx-row .arrow { align-self: center; transition: transform .3s var(--ease); }
.tx-row:hover .arrow { transform: translateX(4px); color: var(--accent); }
.tx-row:hover .tx-row__name { color: var(--accent-2); }

/* ---------------------------------------------------------------- equipment */
.equip__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: end;
}
.equip__intro { grid-column: 1 / span 4; }
.equip__intro .lead { margin-top: 24px; }
.equip__others { margin-top: 24px; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.equip__others .mono { margin-right: 10px; font-size: 12px; color: var(--accent); }
.equip__intro .text-link { margin-top: 32px; }
.equip__list {
    grid-column: 6 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--col-gap);
}
.equip-item:nth-child(2) { transition-delay: .06s; }
.equip-item:nth-child(3) { transition-delay: .12s; }
.equip-item:nth-child(4) { transition-delay: .18s; }
.equip-item .media { background: var(--bg); }
.equip-item__name { margin-top: 12px; font-size: 16px; font-weight: 600; line-height: 1.45; }
.equip-item__use { display: flex; gap: 6px; margin-top: 4px; font-size: 14.5px; line-height: 1.55; color: var(--ink-3); }
.equip-item__use .mono { color: var(--accent); }

/* ---------------------------------------------------------------- process */
.process__track { position: relative; padding-top: 48px; --gap: 18px; }
.process__steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: var(--gap);
}
.process__steps::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 7px;
    height: 1px;
    background: var(--ink);
}
.process-step { position: relative; }
.process-step__node {
    position: relative;
    display: block;
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 1.5px solid var(--ink);
    background: var(--bg);
}
.process-step.is-judge .process-step__node {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 5.5px var(--accent);
}
.process-step__num { display: block; margin-top: 24px; font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.process-step.is-judge .process-step__num { color: var(--accent); }
.process-step__title { margin-top: 6px; font-size: 18.5px; font-weight: 650; letter-spacing: -.02em; line-height: 1.4; }
.process-step__text { margin-top: 8px; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }

/* 02–05 위의 괄호 — '검사와 판단' 구간 */
.process__bracket {
    position: absolute;
    top: 0;
    left: calc((100% - 6 * var(--gap)) / 7 + var(--gap) - 6px);
    width: calc((100% - 6 * var(--gap)) / 7 * 4 + 3 * var(--gap));
    height: 24px;
    border: 1.5px solid var(--accent);
    border-bottom: 0;
}
.process__bracket span {
    position: absolute;
    left: 50%; top: -12px;
    transform: translateX(-50%);
    padding: 0 12px;
    background: var(--bg);
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
    white-space: nowrap;
    color: var(--accent);
}

/* ---------------------------------------------------------------- facilities */
.facility__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
}
/* 같은 크기의 두 장, 한 윗선 */
.facility__item--a { grid-column: 1 / span 6; }
.facility__item--b { grid-column: 7 / span 6; transition-delay: .1s; }

/* ---------------------------------------------------------------- tablet */
@media (max-width: 1099px) {
    .hero__grid { min-height: 0; }
    .hero__text { grid-column: 1 / span 6; }
    .hero__visual { grid-column: 7 / -1; }
    .hero__frame { min-height: 420px; }

    .exam__intro { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: var(--col-gap); }
    .exam__intro > :not(.exam__map) { grid-column: 1; }
    .exam__map { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; align-self: center; }
    .exam__body { grid-column: 1 / -1; margin-top: 56px; }

    .tx-table { --tx-cols: 104px minmax(0, 1fr) minmax(0, 1.6fr) 20px; }
    .tx-table__head span:nth-child(4), .tx-row__fact { display: none; }

    .equip__intro { grid-column: 1 / span 9; }
    .equip__list { grid-column: 1 / -1; margin-top: 48px; }

    .process__track { padding-top: 0; }
    .process__bracket { display: none; }
    .process__steps { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
    .process__steps::before { left: 7px; right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; }
    .process-step {
        display: grid;
        grid-template-columns: 52px minmax(0, 220px) minmax(0, 1fr);
        column-gap: var(--col-gap);
        align-items: baseline;
        padding: 0 0 28px;
    }
    .process-step__node { position: absolute; left: 0; top: 6px; }
    .process-step__num { grid-column: 1; margin: 0; padding-left: 30px; }
    .process-step__title { grid-column: 2; margin: 0; }
    .process-step__text { grid-column: 3; margin: 0; }
    .process-step.is-judge::after {
        content: "";
        position: absolute;
        left: 6px; top: -2px; bottom: 0;
        width: 3px;
        background: var(--accent);
        z-index: 0;
    }
    .process-step.is-judge + .process-step:not(.is-judge)::before { content: none; }
    .process-step__node { z-index: 1; }
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 767px) {
    .hero__grid { display: flex; flex-direction: column; }
    .hero__copy { padding: 36px 0 32px; }
    .hero__visual { margin-top: 28px; }
    .hero__frame { min-height: 0; aspect-ratio: 4 / 3.2; flex: none; }
    .hero__readout { grid-template-columns: minmax(0, 1fr); margin-top: 0; border-top: 0; }
    .hero__readout > div { grid-template-columns: 92px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }

    .entry__paths { grid-template-columns: minmax(0, 1fr); }
    .entry-path + .entry-path::before { content: none; }
    .entry-path { border-bottom: 1px solid var(--line); }
    .entry-path__link {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        column-gap: 18px;
        padding: 18px 0 24px !important;
    }
    .entry-path__top { grid-column: 1 / -1; margin-bottom: 14px; }
    .entry-path__media { grid-column: 1; margin-top: 4px; }
    .entry-path__body { grid-column: 2; }
    .entry-path__title { margin-top: 0; font-size: 22px; }
    .entry-path__summary { font-size: 15.5px; }
    .entry-path__body > :nth-last-child(2) { margin-bottom: 18px; }

    .exam__intro { display: block; }
    .exam__map { max-width: 300px; margin: 40px auto 0; }

    .tx-table__head { display: none; }
    .tx-table__rows { border-top: 2px solid var(--ink); }
    .tx-row { grid-template-columns: minmax(0, 1fr) 20px; row-gap: 6px; }
    .tx-row > :not(.arrow) { grid-column: 1; }
    .tx-row .arrow { grid-column: 2; grid-row: 1 / span 4; }
    .tx-row__fact { display: block; font-size: 15px; color: var(--ink-2); }
    .tx-row__fact-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; margin-right: 8px; color: var(--ink-3); }

    .equip__intro { grid-column: 1 / -1; }
    .equip__list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }

    .process-step { grid-template-columns: minmax(0, 1fr); padding: 0 0 26px 34px; }
    .process-step__num, .process-step__title, .process-step__text { grid-column: 1; padding-left: 0; }
    .process-step__title { margin-top: 2px; }
    .process-step__text { margin-top: 6px; }

    .facility__item--a { grid-column: 1 / -1; }
    .facility__item--b { grid-column: 1 / -1; margin-top: 36px; }
}
