/* Shared, restrained type scale. Loaded after each page's original design. */
:root {
  --type-title: clamp(2rem, 3.8vw, 3.5rem);
  --type-section: clamp(1.65rem, 2.7vw, 2.5rem);
  --type-card: clamp(1.35rem, 2vw, 1.85rem);
  --p-space: clamp(3rem, 6vw, 6rem);
}
.identity-title { font-size: clamp(1.65rem, 3.1vw, 3rem); font-weight: 400; letter-spacing: -.04em; line-height: 1.12; }
.display-title,
.toolkit-copy .display-title,
.photos .display-title { font-size: var(--type-section); font-weight: 400; letter-spacing: -.035em; line-height: 1.18; }
.contact-surface .display-title { font-size: min(8vw, var(--type-title)); white-space: nowrap; }
.section-heading { margin-bottom: clamp(2rem, 3.5vw, 3rem); }
.section-lead { font-size: 1rem; }
.certificate h3,
.project-title,
.project-card:has(.project-visual--sat) .project-title,
.category-title { font-size: var(--type-card); font-weight: 400; line-height: 1.2; letter-spacing: -.025em; }
.project-card:has(.project-visual--sat) .project-title { max-width: 20ch; }
.category-description { font-size: .95rem; }
.category-card { min-height: 26rem; }
.project-visual { min-height: 26rem; }
.pill, .certificate-label, .project-tag { font-weight: 400; }
.detail-title { font-size: var(--type-section); font-weight: 400; line-height: 1.2; letter-spacing: -.035em; }
.detail-metric { font-size: clamp(2rem, 4vw, 3.5rem); }
.footer a:first-child { font-weight: 500; }

/* Data stories: preserve the chart and illustration sizes. */
.cardio h2, .cyclistic h2, .sat h2 { font-size: var(--type-section); font-weight: 400; line-height: 1.2; letter-spacing: -.03em; }
.cardio .cover h1, .cyclistic .cover h1, .sat .opener .display-title { font-size: var(--type-title); font-weight: 400; line-height: 1.16; letter-spacing: -.035em; }
.cardio .cover { min-height: 560px; padding-block: 4.5rem; }
.cyclistic .cover { min-height: 540px; padding-block: 4rem; }
.cardio .chapter, .cyclistic .chapter { padding-block: clamp(3rem, 5vw, 5rem); }
.cardio .section-intro { margin-bottom: 2.5rem; }
.cardio .objective .section-intro { margin-bottom: 0; }
.cardio .objective-statement { font-size: clamp(1.25rem, 2.2vw, 1.85rem); line-height: 1.45; }
.cardio .methods-copy h3, .cyclistic h3, .sat h3 { font-size: var(--type-card); font-weight: 400; line-height: 1.3; }
.cardio .numbers strong { font-size: clamp(1.65rem, 2.6vw, 2.4rem); }
.cardio .rate-example > strong { font-size: clamp(1.8rem, 2.8vw, 2.6rem); }
.cardio .annual-section { padding-top: clamp(3rem, 5vw, 5rem); }
.cardio .finding-comment p { font-size: 1rem; }
.cardio .lead, .cyclistic .lead, .cyclistic .cover .lead { font-size: 1rem; line-height: 1.7; }
.cardio strong, .cyclistic strong, .sat strong { font-weight: 500; }
.cyclistic .takeaway, .cyclistic p.takeaway { font-size: clamp(1.2rem, 1.8vw, 1.5rem); font-weight: 400; line-height: 1.45; }
.cyclistic .source-card h3, .cyclistic .method-panel h3, .cyclistic .strategy-cards h3 { font-size: 1.3rem; min-height: 0; }
.cyclistic .source-card p, .cyclistic .method-panel p, .cyclistic .note-panel, .cyclistic .icon-list, .cyclistic .cleaning-list li { font-size: 1rem; }
.cyclistic .final-dataset { font-size: 1.15rem; font-weight: 400; }
.cyclistic .chart h3 { font-size: 1.15rem; }
.sat .opener { min-height: 620px; }
.sat blockquote, .sat .proof blockquote { font-size: clamp(1.25rem, 2.2vw, 1.85rem); font-weight: 400; line-height: 1.45; letter-spacing: -.025em; }
.sat .big-score strong { font-size: clamp(3rem, 6vw, 5rem); font-weight: 400; }
.sat .metrics strong, .sat .bench strong { font-size: clamp(1.5rem, 2.6vw, 2.25rem); font-weight: 400; }
.sat .week-panel h3 { font-size: var(--type-section); }
.sat .photo-essay p { font-size: clamp(1.25rem, 2.6vw, 2rem); font-weight: 400; line-height: 1.25; letter-spacing: -.025em; }
.sat #analysis :is(.plot,.tiles,.chart-heading) h3 { font-size: 1.3rem; font-weight: 400; }
.sat .introtext { font-size: 1rem; }
.site-header .wordmark { font-weight: 500; font-size: 1rem; }

/* Gallery keeps its expressive serif accent with a quieter overall scale. */
[data-page="graphics-design"] h1 { font-size: var(--type-title); font-weight: 400; line-height: 1.12; letter-spacing: -.035em; }
[data-page="graphics-design"] h1 span { font-weight: 400; }
[data-page="graphics-design"] h2 { font-size: var(--type-section); font-weight: 400; line-height: 1.2; letter-spacing: -.03em; }
[data-page="graphics-design"] .hero p { font-size: 1rem; }
[data-page="graphics-design"] p { font-size: 1rem; }
[data-page="graphics-design"] .wordmark { font-size: 1.05rem; font-weight: 500; }
[data-page="graphics-design"] .hero { height: clamp(540px, 76svh, 720px); min-height: 0; }
[data-page="graphics-design"] .contributor { padding-top: 72px; }
[data-page="graphics-design"] .collection { padding-block: 48px; }

/* Imported case studies have inline type tokens and fixed artwork grids.
   Override only text; retain their layout and original reference styles. */
:is([data-page="trendy-florist"], [data-page="cure-net"]) .text-box .body-large { font-size: 1rem; line-height: 1.65; }
:is([data-page="trendy-florist"], [data-page="cure-net"]) .text-box :is(h1,h2,h3,h4) { font-size: clamp(1.25rem, 2.1vw, 1.5rem); line-height: 1.3; font-weight: 400; }
:is([data-page="trendy-florist"], [data-page="cure-net"]) .text-box :is(h1,h2,h3,h4,.body-large) :is(span,strong,b) { font-size: inherit; line-height: inherit; }
:is([data-page="trendy-florist"], [data-page="cure-net"]) .text-box :is(h1,h2,h3,h4) :is(span,strong,b),
:is([data-page="trendy-florist"], [data-page="cure-net"]) .text-box strong { font-weight: 500 !important; }
:is([data-page="trendy-florist"], [data-page="cure-net"]) .text-box [style*="--fontSizeDesktop: 48px"] { font-size: var(--type-section); line-height: 1.3; }
:is([data-page="trendy-florist"], [data-page="cure-net"]) .text-box [style*="--fontSizeDesktop: 32px"] { font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.35; }
[data-page="trendy-florist"] .text-box [aria-level="1"] { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.cure-intro h1 { font-size: var(--type-title); font-weight: 400; line-height: 1.15; letter-spacing: -.035em; }
.cure-intro-copy p { font-size: 1rem; line-height: 1.7; }
.cure-intro-content { gap: 60px; padding-block: 48px; }
.cure-team li { font-size: 1rem; font-weight: 400; }
body[data-page] :is(.site-header, .page-nav, .cure-nav, .nav-inner) a,
body[data-page="home"] .intro h1,
.sat .opener .project-back { font-weight: 400; }

.project-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding-inline: .7rem;
  border-radius: 999px;
  color: inherit;
  font-size: .9rem;
  line-height: 1;
  text-decoration: none;
}
.project-back:hover { background: #eaf0ff; }
.project-back span { font-size: 1.25rem; }
.sat .nav-inner .project-back { min-height: 0; padding-inline: 0; }
.sat .nav-inner { align-items: center; }
:is([data-page="youth-cardiomyopathy"], [data-page="cyclistic-ride-analysis"]) .site-header .wordmark {
  justify-self: end;
  margin-inline-start: auto;
}
[data-page="youth-cardiomyopathy"] .site-header .wordmark { grid-area: 1 / 2; }

@media (max-width: 700px) {
  .identity-title { font-size: clamp(1.6rem, 5.5vw, 2rem); }
  .category-title { font-size: clamp(1.15rem, 4.2vw, 1.5rem); }
  .category-description { font-size: .8rem; }
  .category-card { min-height: 20rem; }
  .project-visual { min-height: 0; }
  .cardio .cover, .cyclistic .cover { min-height: 0; padding-block: 3.5rem; }
  .cardio .cover h1 { max-width: 22ch; }
  [data-page="youth-cardiomyopathy"] .site-header .project-back { justify-self: start; }
  [data-page="youth-cardiomyopathy"] .chapters { justify-content: space-between; gap: .5rem; }
  [data-page="youth-cardiomyopathy"] .cardio .cover { gap: 1rem; padding-bottom: 1.75rem; }
  [data-page="youth-cardiomyopathy"] .cover-copy { grid-row: 1; }
  [data-page="youth-cardiomyopathy"] .heart-home {
    position: relative;
    grid-row: 2;
    inset: auto;
    width: clamp(8rem, 38vw, 12.5rem);
  }
  [data-page="youth-cardiomyopathy"] #heart-traveler { opacity: .8; }
  .sat .opener { min-height: 0; }
  .cure-intro-content { gap: 32px; padding-block: 32px; }
  [data-page="graphics-design"] .hero { height: 560px; }
}

@media (max-width: 600px) {
  :is(.site-header, .page-nav) > .wordmark,
  .cure-nav > .cure-wordmark { display: none; }

  [data-page="home"] .hero {
    min-height: auto;
    gap: 1.5rem;
    padding: 2.25rem var(--page-gutter) 1rem;
  }
  [data-page="home"] .identity-grid {
    max-width: 30rem;
    grid-template-rows: auto auto;
    gap: .65rem 1rem;
    text-align: center;
  }
  [data-page="home"] .portrait {
    grid-area: 1 / 1 / 2 / 3;
    width: min(100%, 22rem);
    justify-self: center;
  }
  [data-page="home"] .portrait__canvas { aspect-ratio: 1 / .92; }
  [data-page="home"] .portrait__image { object-position: center 38%; }
  [data-page="home"] .identity-heading--data { grid-area: 2 / 1; }
  [data-page="home"] .identity-heading--design { grid-area: 2 / 2; text-align: center; }
  [data-page="home"] .identity-title { font-size: clamp(1.2rem, 5.5vw, 1.75rem); }
  [data-page="home"] :is(.identity-description, .identity-kicker, .hero__signature) { display: none; }

  .contact-surface { padding: 2.25rem 1rem 1.15rem; }
  .contact-surface .display-title {
    font-size: clamp(1.65rem, 7.3vw, 2.8rem);
    white-space: normal;
  }
  .contact-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 24rem);
    margin: 1.5rem auto 0;
  }
  .contact-actions .contact-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contact-actions .pill { width: 100%; padding-inline: .35rem; }
  .contact-actions #gmail-link { display: none; }
  .contact-actions #copy-email {
    grid-column: 1 / -1;
    background: #fff;
    color: var(--p-ink);
  }
  .contact-actions #copy-email:hover { background: #eaf0ff; }
  .contact-surface .copy-status:not(:empty) {
    margin-block-start: .85rem;
    overflow-wrap: anywhere;
  }
  .contact-links a[href^="https://github.com/"] > [aria-hidden],
  .contact-links a[href^="https://www.linkedin.com/"] > [aria-hidden] { display: none; }
  [data-page="home"] .footer { flex-wrap: nowrap; gap: .5rem; padding: .9rem 0 0; }
  [data-page="home"] .footer a:first-child {
    flex-direction: row;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
  }
  [data-page="home"] .footer a:first-child > span { font-size: .68rem; }
  [data-page="home"] .footer a:last-child { white-space: nowrap; }

  body[data-page]:not([data-page="home"]) :is(footer.case-footer, footer.site-footer, main footer) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    align-items: center;
    padding-block: 1.25rem 1.65rem;
    font-size: .85rem;
  }
  body[data-page]:not([data-page="home"]) footer > :is(.wordmark, .case-wordmark) {
    grid-column: 1 / -1;
    width: auto;
    margin: 0 0 .25rem;
    font-size: 1rem;
    justify-self: center;
  }
  body[data-page]:not([data-page="home"]) footer > :is(a:not(.wordmark, .case-wordmark), #motion-toggle:not([hidden])) {
    display: inline-flex;
    min-height: 44px;
    margin: 0;
    padding: .35rem;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid #dbe2ed;
    border-radius: .7rem;
    color: #283750;
    font-size: .8rem;
    text-align: center;
    text-decoration: none;
  }
}
