/* TSMC MODEL PAGE */

.model-hero {
    min-height: calc(100vh - 102px);
    padding: 8vh 0 10vh;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 72px;
    align-items: center;
}

.model-title {
    max-width: 1120px;

    font-size: clamp(54px, 7vw, 106px);
    line-height: 0.96;
    letter-spacing: -0.058em;
    font-weight: 500;
}

.model-title span {
    color: var(--accent);
}

.model-lede {
    max-width: 720px;
    margin-top: 38px;

    font-size: clamp(17px, 1.4vw, 20px);
    line-height: 1.6;
    letter-spacing: -0.01em;
    color: #4f5355;
}

.model-actions {
    margin-top: 36px;

    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.model-tags {
    width: 180px;

    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.model-tags span {
    padding: 8px 11px;

    border: 1px solid var(--line);
    border-radius: 999px;

    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--muted);
}


/* KPI STRIP */

.model-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.model-kpi {
    min-height: 188px;
    padding: 30px 28px 28px 0;

    display: flex;
    flex-direction: column;

    border-right: 1px solid var(--line);
}

.model-kpi:not(:first-child) {
    padding-left: 28px;
}

.model-kpi:last-child {
    border-right: 0;
}

.model-kpi-label {
    margin-bottom: auto;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8c9092;
}

.model-kpi strong {
    margin-top: 34px;

    font-size: clamp(31px, 3.3vw, 50px);
    line-height: 1;
    letter-spacing: -0.045em;
    font-weight: 500;
}

.model-kpi-note {
    margin-top: 10px;

    font-size: 12px;
    color: #868a8c;
}


/* GENERIC MODEL SECTION */

.model-section {
    scroll-margin-top: 24px;
}

.model-section .section-heading {
    margin-bottom: 58px;
}


/* ARCHITECTURE */

.architecture {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr) auto);
    align-items: stretch;
}

.architecture-step {
    min-height: 230px;
    padding: 26px;

    display: flex;
    flex-direction: column;

    border: 1px solid var(--line);
    border-radius: 18px;

    transition:
        transform 0.35s var(--ease-out),
        border-color 0.3s ease,
        background 0.3s ease;
}

.architecture-step:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.architecture-input,
.architecture-output {
    background: rgba(31, 83, 102, 0.045);
}

.architecture-number {
    margin-bottom: auto;

    font-size: 11px;
    color: #9b9ea0;
}

.architecture-step strong {
    margin-top: 56px;

    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.architecture-step p {
    margin-top: 10px;

    font-size: 13px;
    line-height: 1.55;
    color: #686c6e;
}

.architecture-arrow {
    width: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #a1a4a5;
}

.architecture-caption {
    margin-top: 20px;

    font-size: 12px;
    color: #8c9092;
}


/* OPERATING FORECAST */

.forecast-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.65fr);
    gap: clamp(48px, 7vw, 110px);
    align-items: start;
}

.forecast-chart {
    min-width: 0;
}

.chart-heading {
    margin-bottom: 22px;

    display: flex;
    justify-content: space-between;
    gap: 32px;
    align-items: end;
}

.chart-kicker {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #929698;
}

.chart-heading h3 {
    margin-top: 5px;

    font-size: 30px;
    font-weight: 500;
    letter-spacing: -0.035em;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;

    font-size: 12px;
    color: #707476;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-line {
    width: 18px;
    height: 2px;
    display: inline-block;
}

.revenue-line {
    background: var(--accent);
}

.ebitda-line {
    background: #91979a;
}

.forecast-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart-grid line {
    stroke: #deded9;
    stroke-width: 1;
}

.chart-grid .forecast-divider {
    stroke: #aeb3b5;
    stroke-dasharray: 5 7;
}

.chart-y-labels text,
.chart-x-labels text,
.forecast-label {
    fill: #8a8e90;
    font-size: 11px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.chart-x-labels text {
    text-anchor: middle;
}

.forecast-label {
    fill: var(--accent);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.data-line {
    fill: none;
    stroke-width: 2.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.data-line-revenue {
    stroke: var(--accent);
}

.data-line-ebitda {
    stroke: #91979a;
}

.key-findings {
    border-top: 1px solid var(--line);
}

.finding {
    padding: 24px 0 28px;
    border-bottom: 1px solid var(--line);
}

.finding span {
    display: block;
    margin-bottom: 10px;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.finding p {
    font-size: 15px;
    line-height: 1.6;
    color: #5b5f61;
}


/* VALUATION */

.valuation-intro {
    margin-bottom: 54px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 60px;
    align-items: end;
}

.valuation-label {
    margin-bottom: 8px;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #8b8f91;
}

.valuation-big {
    font-size: clamp(56px, 8vw, 108px);
    line-height: 0.95;
    letter-spacing: -0.06em;
    color: var(--accent);
}

.valuation-big span {
    font-size: 0.24em;
    letter-spacing: -0.01em;
    color: #777b7d;
}

.valuation-reference {
    min-width: 190px;
    padding-bottom: 8px;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.valuation-reference span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8d9193;
}

.valuation-reference strong {
    margin-top: 5px;

    font-size: 30px;
    letter-spacing: -0.035em;
    font-weight: 500;
}

.valuation-reference small {
    margin-top: 7px;

    font-size: 10px;
    color: #989b9d;
}

.valuation-field {
    position: relative;
    padding-top: 34px;
}

.valuation-scale {
    position: absolute;
    left: 150px;
    right: 100px;
    top: 0;

    display: flex;
    justify-content: space-between;

    font-size: 10px;
    color: #9a9d9f;
}

.valuation-row {
    min-height: 62px;

    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 80px;
    gap: 20px;
    align-items: center;

    border-top: 1px solid var(--line);
}

.valuation-row:last-child {
    border-bottom: 1px solid var(--line);
}

.valuation-method {
    font-size: 13px;
    color: #5d6163;
}

.valuation-track {
    position: relative;
    height: 1px;
    background: #dadbd7;
}

.valuation-track i {
    position: absolute;
    top: 50%;
    left: var(--position);

    width: 9px;
    height: 9px;

    border-radius: 50%;
    background: var(--accent);

    transform: translate(-50%, -50%);
}

.valuation-row strong {
    text-align: right;

    font-size: 13px;
    font-weight: 500;
}

.valuation-note {
    max-width: 730px;
    margin-top: 22px;

    font-size: 12px;
    line-height: 1.55;
    color: #85898b;
}


/* DCF */

.dcf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.dcf-assumption {
    min-height: 164px;
    padding: 24px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.dcf-assumption span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8f9395;
}

.dcf-assumption strong {
    font-size: clamp(30px, 3vw, 46px);
    line-height: 1;
    letter-spacing: -0.045em;
    font-weight: 500;
}


/* SENSITIVITY */

.sensitivity-wrap {
    display: grid;
    grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
    gap: clamp(40px, 7vw, 100px);
    align-items: start;
}

.sensitivity-copy p {
    max-width: 420px;

    font-size: 17px;
    line-height: 1.6;
    color: #55595b;
}

.sensitivity-copy span {
    display: block;
    margin-top: 18px;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #939799;
}

.sensitivity-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.sensitivity-table th,
.sensitivity-table td {
    height: 66px;
    padding: 0 18px;

    border: 1px solid var(--line);

    text-align: right;
    font-size: 14px;
    font-weight: 400;
}

.sensitivity-table thead th,
.sensitivity-table tbody th {
    font-size: 12px;
    color: #767a7c;
}

.sensitivity-table thead th:first-child,
.sensitivity-table tbody th {
    text-align: left;
}

.sensitivity-table .sensitivity-base {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}


/* EXCEL PREVIEWS */

.model-preview {
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
}

.preview-tabs {
    min-height: 64px;
    padding: 0 28px;

    display: flex;
    align-items: center;
    gap: 36px;

    border-bottom: 1px solid var(--line);
    background: var(--background);
}

.preview-tab {
    position: relative;
    padding: 21px 0 19px;

    border: 0;
    background: transparent;
    cursor: pointer;

    font: inherit;
    font-size: 12px;
    color: #7a7e80;

    transition: color 0.25s ease;
}

.preview-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;

    height: 1px;
    background: var(--accent);

    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out);
}

.preview-tab:hover {
    color: var(--accent);
}

.preview-tab.active {
    color: var(--text);
}

.preview-tab.active::after {
    transform: scaleX(1);
}

.preview-stage {
    width: 100%;
    background: #ffffff;
    overflow: hidden;
}

.preview-panel {
    width: 100%;
    margin: 0;
    padding: 0;
}

.preview-panel[hidden] {
    display: none;
}

.preview-panel img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}


/* FEATURES */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.feature-item {
    position: relative;

    min-height: 250px;
    padding: 26px;

    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);

    background: transparent;

    transition:
        transform 0.35s var(--ease-out),
        background 0.3s ease,
        box-shadow 0.35s var(--ease-out);
}

.feature-item:hover {
    z-index: 2;

    transform: translateY(-4px);
    background: rgba(31, 83, 102, 0.045);

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.035);
}

.feature-item > span {
    display: block;
    margin-bottom: 78px;

    font-size: 11px;
    color: #9b9ea0;
}

.feature-item h3 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.025em;

    transition: color 0.25s ease;
}

.feature-item:hover h3 {
    color: var(--accent);
}

.feature-item p {
    max-width: 330px;
    margin-top: 12px;

    font-size: 14px;
    line-height: 1.6;
    color: #666a6c;
}

@media (hover: none) {
    .feature-item:hover {
        transform: none;
        background: transparent;
        box-shadow: none;
    }

    .feature-item:hover h3 {
        color: inherit;
    }
}


/* DOWNLOAD + NOTES */

.model-download-section {
    padding-bottom: 80px;
}

.download-card {
    padding: clamp(34px, 5vw, 68px);

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 60px;
    align-items: end;

    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--accent-soft);
}

.download-card .eyebrow {
    margin-bottom: 18px;
}

.download-card h2 {
    max-width: 780px;

    font-size: clamp(38px, 5vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.05em;
    font-weight: 500;
}

.download-card p:not(.eyebrow) {
    max-width: 680px;
    margin-top: 20px;

    font-size: 15px;
    line-height: 1.6;
    color: #5c6264;
}

.download-button {
    white-space: nowrap;
}

.model-notes {
    padding: 0 0 88px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
}

.model-notes > div {
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.model-notes span {
    display: block;
    margin-bottom: 10px;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #919597;
}

.model-notes p {
    max-width: 560px;

    font-size: 12px;
    line-height: 1.6;
    color: #7b7f81;
}


/* RESPONSIVE */

@media (max-width: 1100px) {
    .architecture {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .architecture-arrow {
        display: none;
    }

    .forecast-layout {
        grid-template-columns: 1fr;
    }

    .key-findings {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .finding {
        padding-right: 28px;
        border-right: 1px solid var(--line);
    }

    .finding + .finding {
        padding-left: 28px;
    }

    .finding:last-child {
        border-right: 0;
    }
}

@media (max-width: 900px) {
    .model-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .model-kpi:nth-child(2) {
        border-right: 0;
    }

    .model-kpi:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .dcf-grid,
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sensitivity-wrap {
        grid-template-columns: 1fr;
    }

    .download-card {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

@media (max-width: 800px) {
    .model-hero {
        min-height: calc(100vh - 86px);
        padding: 6vh 0 8vh;
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .model-title {
        font-size: clamp(46px, 12vw, 72px);
    }

    .model-tags {
        width: auto;
        justify-content: flex-start;
    }

    .architecture-step {
        min-height: 210px;
    }

    .valuation-intro {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .valuation-reference {
        align-items: flex-start;
    }

    .valuation-scale {
        display: none;
    }

    .valuation-field {
        padding-top: 0;
    }

    .valuation-row {
        grid-template-columns: 110px minmax(0, 1fr) 72px;
        gap: 14px;
    }

    .model-notes {
        grid-template-columns: 1fr;
        gap: 34px;
    }
}

@media (max-width: 640px) {
    .model-kpis,
    .dcf-grid,
    .feature-grid,
    .architecture,
    .key-findings {
        grid-template-columns: 1fr;
    }

    .model-kpi {
        min-height: 150px;
        padding: 24px 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .model-kpi:not(:first-child) {
        padding-left: 0;
    }

    .model-kpi:last-child {
        border-bottom: 0;
    }

    .architecture-step {
        min-height: 190px;
    }

    .finding,
    .finding + .finding {
        padding-left: 0;
        padding-right: 0;
        border-right: 0;
    }

    .chart-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .forecast-svg {
        min-width: 650px;
    }

    .forecast-chart {
        overflow-x: auto;
    }

    .valuation-row {
        grid-template-columns: 96px minmax(70px, 1fr) 64px;
    }

    .valuation-method,
    .valuation-row strong {
        font-size: 11px;
    }

    .sensitivity-table th,
    .sensitivity-table td {
        height: 58px;
        padding: 0 10px;
        font-size: 12px;
    }

    .preview-tabs {
        overflow-x: auto;
    }

    .preview-tab {
        white-space: nowrap;
    }
}