/* =========================================================
   Typography system (loaded last).
   - Inter: body copy, navigation, buttons, labels (variable font)
   - Playfair Display: h1/h2 display titles and editorial accents
   - Fluid modular scale, comfortable measure, tabular figures,
     metric-matched fallback to avoid layout shift while fonts load.
   ========================================================= */

/* Arial tuned to Inter's metrics, shown until Inter arrives (no jump on swap) */
@font-face {
    font-family: "Inter Fallback";
    src: local("Arial");
    ascent-override: 90.49%;
    descent-override: 22.56%;
    line-gap-override: 0%;
    size-adjust: 107.64%;
}
@font-face {
    font-family: "Playfair Fallback";
    src: local("Georgia");
    ascent-override: 93%;
    descent-override: 22%;
    line-gap-override: 0%;
    size-adjust: 99%;
}

:root {
    --font-body: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-ui: var(--font-body);
    --font-display: "Playfair Display", "Playfair Fallback", Georgia, "Times New Roman", serif;

    /* fluid scale: 360px -> 1440px viewport */
    --fs-xs: clamp(.75rem, .73rem + .1vw, .8125rem);      /* 12 -> 13   captions, legal */
    --fs-sm: clamp(.8125rem, .79rem + .12vw, .875rem);    /* 13 -> 14   secondary text, nav */
    --fs-md: clamp(.9375rem, .91rem + .15vw, 1rem);       /* 15 -> 16   body */
    --fs-lg: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);    /* 17 -> 19   lead paragraphs */
    --fs-h4: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
    --fs-h3: clamp(1.25rem, 1.1rem + .7vw, 1.625rem);
    --fs-h2: clamp(1.875rem, 1.45rem + 1.9vw, 2.875rem);
    --fs-h1: clamp(2.25rem, 1.5rem + 3.4vw, 4.25rem);
    --fs-display: clamp(2.5rem, 1.5rem + 4.2vw, 4.75rem);

    --lh-tight: 1.1;
    --lh-heading: 1.18;
    --lh-body: 1.7;
    --measure: 64ch;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-size: var(--fs-md);
    line-height: var(--lh-body);
    font-optical-sizing: auto;
    font-kerning: normal;
    font-feature-settings: "kern", "liga", "calt";
    letter-spacing: -.003em;
    hyphens: manual;
}

/* ---------- headings ---------- */
h1, h2, h3, h4 { font-family: var(--font-body); font-weight: 650; line-height: var(--lh-heading); letter-spacing: -.015em; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.018em; line-height: var(--lh-tight); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

/* hero titles: uppercase display serif with open tracking */
.hero h1, .hero-ports-text h1 { font-size: var(--fs-h1); text-transform: uppercase; letter-spacing: .035em; font-weight: 700; line-height: 1.08; }
.hero-band h2 { font-size: var(--fs-display); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; line-height: 1.04; }
.hero-history h1 { font-size: var(--fs-display); letter-spacing: .02em; line-height: 1.04; }
.hero-history em { font-style: normal; }
.hero-band p { font-family: var(--font-body); font-size: var(--fs-lg); letter-spacing: .01em; }

/* section titles */
.background h2, .services-main h2, .about h2, .expertise h2, .clients h2, .founders h2, .directors h2, .contact-block h2, .growth h2, .history-card h2 { font-size: var(--fs-h2); }
.growth h2, .history-card h2 { font-size: var(--fs-h3); font-weight: 600; }
.port-row h2 { font-size: var(--fs-h3); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; line-height: 1.2; }
.underlined { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); letter-spacing: -.01em; line-height: 1.2; }
.facilities h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h2); letter-spacing: -.01em; }
.checks li, .expertise p { font-size: var(--fs-md); }
.timeline h3, .port-list strong, .founders figcaption, .people figcaption, .history-card h2 { font-family: var(--font-display); }
.timeline h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; }
.port-list strong { font-size: 1.1875rem; font-weight: 600; letter-spacing: 0; }

/* ---------- reading comfort ---------- */
.background-text p, .services-main p, .about p, .expertise p, .growth p, .hero-ports-text p, .port-row-text p { max-width: var(--measure); }
.background-text p, .about p, .services-main p, .port-row-text p { font-size: var(--fs-md); line-height: 1.75; }
.growth p { font-size: var(--fs-md); line-height: 1.75; margin-inline: auto; }
.hero-ports-text p { font-size: var(--fs-md); }
.timeline li { font-size: var(--fs-sm); line-height: 1.7; }
.history-card p { font-size: var(--fs-md); }
.feature-cols h4 { font-size: 1.0625rem; letter-spacing: -.005em; }
.feature-cols p { font-size: var(--fs-sm); line-height: 1.75; }
.cta-card p, .cta-card { font-size: var(--fs-sm); line-height: 1.8; }
.clients li { font-size: var(--fs-md); }
figcaption, .founder-grid figcaption, .people figcaption { font-size: var(--fs-sm); line-height: 1.4; }
.founder-grid figcaption, .people figcaption { font-weight: 500; }
.port-list small { font-size: var(--fs-xs); }
.contact-cols p { font-size: var(--fs-md); line-height: 1.6; }
.contact-block h2 { font-size: var(--fs-h2); }
h6 { font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .16em; text-transform: uppercase; opacity: .75; }

/* ---------- UI text: nav, buttons, labels ---------- */
.menu-link { font-size: var(--fs-sm); font-weight: 600; letter-spacing: -.005em; }
.topbar { font-size: var(--fs-xs); font-weight: 500; }
.lang-switch a { font-size: .6875rem; font-weight: 650; letter-spacing: .1em; }
.btn, .menu-cta, .install-btn, .cta-schedule { font-family: var(--font-ui); }
.btn, .menu-cta { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.cta-schedule { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem); }
.mega-title { font-size: .6875rem; font-weight: 650; letter-spacing: .16em; }
.mega-text strong { font-size: var(--fs-sm); font-weight: 650; letter-spacing: -.005em; }
.mega-text small { font-size: var(--fs-xs); }
.mega-tag { font-size: .6875rem; font-weight: 650; }
.mega-all { font-size: var(--fs-sm); font-weight: 650; }
.tile { font-size: var(--fs-sm); font-weight: 650; letter-spacing: .05em; }
.tab-cards a { font-size: var(--fs-sm); font-weight: 650; letter-spacing: .04em; }
.pill-nav { font-size: var(--fs-sm); font-weight: 600; }
.pwa-toast, .pwa-toast button { font-size: var(--fs-sm); }
form label { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; }
form input, form textarea { font-family: var(--font-body); font-size: var(--fs-md); }
.error { font-size: var(--fs-xs); }
.offices { font-size: var(--fs-sm); }
.site-footer h3 { font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.site-footer li a { font-size: var(--fs-sm); line-height: 2.1; }
.copy { font-size: var(--fs-xs); letter-spacing: .1em; }
.ship-stage figcaption { font-size: .6875rem; letter-spacing: .13em; }
.scroll-progress { font-size: 0; }

/* figures line up in columns */
.topbar, .menu-meta, .contact-cols, .ship-stage figcaption, .copy, .timeline h3, .hero-history em { font-variant-numeric: tabular-nums lining-nums; }

/* nothing below 11px anywhere: raise the stragglers */
.preloader-label, .preloader-signature { font-size: .6875rem; }

@media (max-width: 980px) {
    .hero-band h2, .hero-history h1 { letter-spacing: .02em; }
    .background-text p, .about p, .services-main p { max-width: none; }
    .menu-link { font-size: 1.0625rem; }
}

/* Subagent contact directory. */
.subagents-hero { padding: 72px 0 56px; background: radial-gradient(ellipse at 90% 0, #254d86, transparent 65%), #0d1748; color: #fff; }
.subagents-eyebrow { display: block; font: 600 11px/1.6 var(--font-ui); letter-spacing: .15em; text-transform: uppercase; }
.subagents-hero .subagents-eyebrow { color: #b8c9e5; }
.subagents-hero h1 { margin: 18px 0; color: #fff; }
.subagents-hero p { max-width: 56ch; color: #d5dff0; }
.subagents-coasts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.subagents-coasts a { display: inline-flex; align-items: center; gap: 20px; padding: 12px 20px; border: 1px solid #6e84a8; border-radius: 8px; text-decoration: none; font-size: 14px; }
.subagents-coasts a:hover { background: rgba(255, 255, 255, .12); }
.subagents-coasts a span:first-child { color: #c3d3ee; font-size: 12px; }
.subagents-directory { padding-block: 56px 80px; }
.subagents-region { scroll-margin-top: 160px; }
.subagents-region + .subagents-region { margin-top: 64px; }
.subagents-region-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; border-bottom: 1px solid #d5ddeb; padding-bottom: 22px; }
.subagents-region-heading .subagents-eyebrow { color: #596d8c; margin-bottom: 10px; }
.subagents-region-heading h2 { margin: 0; }
.subagents-region-heading > span { color: #5b6980; font-size: 13px; white-space: nowrap; }
.subagents-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.subagent-card { min-width: 0; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.subagent-card-heading { border-left: 3px solid var(--red); padding-left: 16px; margin-bottom: 24px; }
.subagent-port-label { display: block; color: #5d6a80; font-size: 10px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 6px; }
.subagent-card h3 { color: var(--navy); font-size: 23px; line-height: 1.3; }
.subagent-agency { font-size: 12px; font-weight: 650; letter-spacing: .025em; line-height: 1.65; color: var(--ink); }
.subagent-card address { font-size: 14px; font-style: normal; line-height: 1.8; color: #526079; }
.subagent-office { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 16px; font-size: 13px; }
.subagent-office > span { width: 100%; color: #6a7587; font-size: 11px; }
.subagent-office a, .subagent-phone { text-decoration: none; color: var(--ink); font-variant-numeric: tabular-nums; }
.subagent-contacts { margin-top: 24px; }
.subagent-person { padding-top: 20px; border-top: 1px solid var(--line); }
.subagent-person + .subagent-person { margin-top: 20px; }
.subagent-role { color: #546d93; font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.subagent-person h4 { margin: 6px 0 12px; font-size: 16px; }
.subagent-aoh { display: block; color: #68758b; font-size: 11px; margin-bottom: 4px; }
.subagent-phone { display: inline-block; margin-right: 14px; font-size: 14px; }
.subagent-email { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 12px; color: #175b99; font-size: 13px; text-decoration: none; overflow-wrap: anywhere; }
.subagent-card a:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 700px) {
    .subagents-grid { grid-template-columns: 1fr; gap: 18px; }
    .subagents-hero { padding-block: 48px 40px; }
    .subagent-card { padding: 24px; }
    .subagents-region-heading { align-items: start; flex-direction: column; gap: 12px; }
}

/* Port directory in the footer. */
.site-footer .footer-ports { padding-block: 8px 56px; }
.footer-ports-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.footer-ports-eyebrow { display: block; margin-bottom: 12px; color: #c5d0ec; font: 500 10px/1.5 var(--font-ui); letter-spacing: .18em; }
.site-footer .footer-ports h3 { margin: 0; color: #fff; font: 600 clamp(26px, 3vw, 36px)/1.2 var(--font-display); letter-spacing: -.02em; text-transform: none; }
.footer-ports-all { display: inline-flex; align-items: center; gap: 18px; padding-block: 8px; color: #e4eaf8; font-size: 13px; text-decoration: none; border-bottom: 1px solid #7b8dc0; }
.footer-port-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.site-footer li .footer-port-card { display: flex; flex-direction: column; min-height: 190px; height: 100%; padding: 24px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px; opacity: 1; text-decoration: none; transition: background .25s ease, border-color .25s ease, transform .3s var(--ease-out); }
.footer-port-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 25px; color: #bacbeb; }
.footer-port-top svg { width: 26px; height: 26px; }
.footer-port-top > span { font-size: 11px; font-weight: 500; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.footer-port-name { color: #fff; font: 600 clamp(18px, 1.6vw, 22px)/1.3 var(--font-ui); letter-spacing: -.02em; }
.footer-port-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 18px; color: #c5d0ec; font-size: 12px; line-height: 1.5; }
.footer-port-bottom > span { color: #fff; font-size: 20px; transition: transform .25s ease; }
.site-footer li .footer-port-card:hover, .site-footer li .footer-port-card:focus-visible { transform: translateY(-4px); background: rgba(255, 255, 255, .1); border-color: #a8bce8; }
.footer-port-card:hover .footer-port-bottom > span { transform: translate(2px, -2px); }
@media (max-width: 980px) {
    .footer-port-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .footer-ports-heading { align-items: start; flex-direction: column; gap: 16px; }
    .footer-port-grid { grid-template-columns: 1fr; gap: 12px; }
    .site-footer li .footer-port-card { min-height: 160px; padding: 20px; }
    .footer-port-top { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .site-footer li .footer-port-card, .footer-port-bottom > span { transition: none; }
    .site-footer li .footer-port-card:hover, .site-footer li .footer-port-card:focus-visible, .footer-port-card:hover .footer-port-bottom > span { transform: none; }
}

/* History: generous reading columns with a clear date hierarchy. */
.page-history .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-block: 48px 64px; align-items: start; }
.page-history .timeline li { min-width: 0; margin-top: 0; padding: 28px; background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.page-history .timeline-year { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; margin-bottom: 24px; background: #eef2f8; border-left: 3px solid var(--red); border-radius: 3px; color: var(--navy); font: 700 13px/1.4 var(--font-ui); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.page-history .timeline h3 { margin: 0 0 16px; color: var(--ink); font-family: var(--font-ui); font-size: clamp(1.2rem, 1rem + .5vw, 1.5rem); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; }
.page-history .timeline p { margin: 0; color: #45536b; font-size: 15px; font-weight: 400; line-height: 1.85; letter-spacing: 0; text-align: start; text-wrap: pretty; overflow-wrap: break-word; }
/* Each chapter settles into view once; the text stays still while reading. */
.page-history .timeline li[data-reveal="timeline"] { transition: opacity .7s ease, transform .7s var(--ease-out), box-shadow .3s ease, border-color .3s ease; transition-delay: var(--d, 0ms), var(--d, 0ms), 0ms, 0ms; }
.js .page-history .timeline li[data-reveal="timeline"]:not(.is-visible) { opacity: 0; transform: translateY(28px); }
.js .page-history .timeline li[data-reveal="timeline"].is-visible { opacity: 1; transform: none; }
.page-history .timeline h3::after { content: ""; display: block; width: 42px; height: 2px; margin-top: 14px; background: var(--red); transform-origin: left; }
.js .page-history .timeline li[data-reveal="timeline"] .timeline-year { transition: opacity .55s ease, transform .65s var(--ease-out); transition-delay: calc(var(--d, 0ms) + 140ms); }
.js .page-history .timeline li[data-reveal="timeline"]:not(.is-visible) .timeline-year { opacity: 0; transform: translateX(-8px); }
.js .page-history .timeline li[data-reveal="timeline"] h3::after { transition: transform .65s var(--ease-out); transition-delay: calc(var(--d, 0ms) + 200ms); }
.js .page-history .timeline li[data-reveal="timeline"]:not(.is-visible) h3::after { transform: scaleX(0); }
@media (hover: hover) and (pointer: fine) {
    .page-history .timeline li[data-reveal="timeline"].is-visible:hover { transform: translateY(-4px); border-color: #bccbdd; box-shadow: var(--shadow-md); transition-delay: 0ms; }
}
@media (prefers-reduced-motion: reduce) {
    .js .page-history .timeline li[data-reveal="timeline"]:is(.is-visible, :not(.is-visible)),
    .js .page-history .timeline li[data-reveal="timeline"]:is(.is-visible, :not(.is-visible)) .timeline-year,
    .js .page-history .timeline li[data-reveal="timeline"]:is(.is-visible, :not(.is-visible)) h3::after { opacity: 1; transform: none; transition: none; }
}
@media print {
    .js .page-history .timeline li[data-reveal="timeline"]:is(.is-visible, :not(.is-visible)),
    .js .page-history .timeline li[data-reveal="timeline"]:is(.is-visible, :not(.is-visible)) .timeline-year { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 980px) {
    .page-history .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-history .hero-history-grid { text-align: center; }
}
@media (max-width: 600px) {
    .page-history .timeline { grid-template-columns: 1fr; gap: 16px; padding-block: 32px; }
    .page-history .timeline li { padding: 24px; }
    .page-history .pill-nav { flex-wrap: wrap; gap: 18px; border-radius: 18px; }
}

@media print {
    body { font-size: 11pt; line-height: 1.5; color: #000; }
    h1, h2, h3 { color: #000; }
}
