/* Epsone Trading
   Palette comes from the logo red and the harbor photography.
   Big Shoulders echoes the lettering on the side of a shipping container. */

:root {
    --deep: #0a3d45;
    --deep-2: #0d4c55;
    --teal: #127580;
    --fog: #e8f1f0;
    --ink: #10292e;
    --muted: #4a6267;
    --red: #e21b23;
    --red-dark: #bd1219;
    --amber: #f4b43c;
    --white: #fff;
    --rule: #c9d9d8;

    --display: "Big Shoulders", "Arial Narrow", Impact, sans-serif;
    --text: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

    --gutter: clamp(16px, 4vw, 48px);
    --section: clamp(56px, 8vw, 112px);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font: 400 1.0625rem/1.65 var(--text);
    overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--red); }

h1, h2, h3 {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .005em;
    text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.wrap {
    width: min(100%, 1320px);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.wrap--narrow { width: min(100%, 820px); }

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--white);
}
.skip-link:focus { top: 8px; color: var(--white); }

/* Buttons and links */

.button {
    display: inline-block;
    padding: .72em 1.5em;
    border: 2px solid var(--red);
    border-radius: 3px;
    background: var(--red);
    color: var(--white);
    font: 600 1rem/1.3 var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.button:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }

.button--ghost { background: transparent; border-color: rgb(255 255 255 / .55); }
.button--ghost:hover { background: var(--white); border-color: var(--white); color: var(--deep); }

.button--dark { background: var(--deep); border-color: var(--deep); }
.button--dark:hover { background: var(--teal); border-color: var(--teal); }

.button--light { background: var(--white); border-color: var(--white); color: var(--deep); }
.button--light:hover { background: var(--amber); border-color: var(--amber); color: var(--ink); }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; }

.text-link { font-weight: 600; color: var(--teal); }

/* Top bar and header */

.topbar { background: var(--deep); color: #cfe2e1; font-size: .875rem; }
.topbar__inner { display: flex; justify-content: space-between; gap: 24px; padding-block: 7px; }
.topbar p { margin: 0; }
.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { color: var(--white); text-decoration: underline; }
.topbar__links { display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--white);
    border-bottom: 1px solid var(--rule);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }

.site-logo img { width: clamp(170px, 20vw, 232px); }

.nav-toggle {
    display: none;
    padding: .45em .95em;
    border: 2px solid var(--deep);
    border-radius: 3px;
    background: none;
    color: var(--deep);
    font: 600 .95rem/1.3 var(--text);
    cursor: pointer;
}

.site-nav__list { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }

.site-nav__list > li > a:not(.site-nav__cta),
.site-nav__parent {
    display: block;
    padding: .5em .85em;
    border: 0;
    background: none;
    color: var(--ink);
    font: 500 1rem/1.3 var(--text);
    text-decoration: none;
    cursor: pointer;
}
.site-nav__list > li > a:not(.site-nav__cta):hover,
.site-nav__parent:hover { color: var(--red); }
.site-nav__list > li > a[aria-current="page"]:not(.site-nav__cta),
.site-nav__parent[data-current] { color: var(--red); font-weight: 600; }

.site-nav__parent::after {
    content: "";
    display: inline-block;
    width: .45em;
    height: .45em;
    margin-left: .5em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-.2em) rotate(45deg);
}

.site-nav__cta {
    display: block;
    margin-left: 10px;
    padding: .5em 1.1em;
    border-radius: 3px;
    background: var(--red);
    color: var(--white);
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}
.site-nav__cta:hover { background: var(--red-dark); color: var(--white); }

.has-menu { position: relative; }

.site-nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    min-width: 290px;
    margin: 0;
    padding: 8px 0;
    border: 1px solid var(--rule);
    background: var(--white);
    list-style: none;
}
.has-menu:hover .site-nav__menu,
.has-menu:focus-within .site-nav__menu,
.has-menu.is-open .site-nav__menu { display: block; }
.site-nav__menu a { display: block; padding: .55em 1.1em; color: var(--ink); text-decoration: none; }
.site-nav__menu a:hover { background: var(--fog); color: var(--deep); }

/* Sections */

.section { padding-block: var(--section); }
.section--fog { background: var(--fog); }

.section__title { font-size: clamp(2.5rem, 5.2vw, 4.25rem); }

.section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 32px;
}

/* Hero: the route map is the one loud moment on the site */

.hero {
    position: relative;
    overflow: hidden;
    padding-top: clamp(40px, 6vw, 80px);
    background: var(--deep);
    color: var(--white);
}

.hero__title {
    font-size: clamp(3.25rem, 7.1vw, 6.6rem);
    line-height: .96;
}

.no-break { white-space: nowrap; }

.hero__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 40px;
    margin-top: clamp(20px, 2.5vw, 32px);
}
.hero__sub { margin: 0; font-size: clamp(1.125rem, 1.7vw, 1.4rem); color: #d7e7e6; }

.hero__map {
    width: min(100%, 1560px);
    margin: clamp(8px, 2vw, 24px) auto 0;
    padding-inline: var(--gutter);
}

.routes { display: block; width: 100%; height: auto; }

.routes__land { fill: none; stroke: #3f8088; stroke-width: 3.4; stroke-linecap: round; }

.routes__lane {
    fill: none;
    stroke: var(--amber);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: lane-draw 1.5s cubic-bezier(.3, .1, .2, 1) .25s backwards;
}
.routes__lane:nth-of-type(3) { animation-delay: .45s; }
.routes__lane:nth-of-type(4) { animation-delay: .65s; }
.routes__lane:nth-of-type(5) { animation-delay: .85s; }

.routes__stop circle { fill: var(--deep); stroke: var(--amber); stroke-width: 2.5; }
.routes__stop text,
.routes__hub text {
    fill: var(--white);
    font: 700 15px/1 var(--text);
    paint-order: stroke;
    stroke: var(--deep);
    stroke-width: 5px;
    stroke-linejoin: round;
}
.routes__stop { animation: stop-in .4s ease-out 1.5s backwards; }

.routes__dot { fill: var(--red); stroke: var(--white); stroke-width: 2; }
.routes__ring { fill: rgb(226 27 35 / .28); }
.routes__hub text { font-size: 18px; }

@keyframes lane-draw { from { stroke-dashoffset: 1; } }
@keyframes stop-in { from { opacity: 0; } }

.hero__regions { display: none; }

/* Why */

.why__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(28px, 4vw, 64px);
    margin-top: clamp(32px, 4vw, 56px);
}
.why__item h3 { margin-bottom: .55em; font-size: clamp(1.75rem, 2.5vw, 2.25rem); line-height: 1.05; color: var(--deep); }
.why__item p { color: var(--muted); }
.why__item strong { color: var(--ink); font-weight: 600; }

/* Service switcher */

.switcher { margin-top: clamp(32px, 4vw, 56px); }
.switcher__tabs { display: none; }

.switcher__panel + .switcher__panel { margin-top: 56px; }
.switcher__panel img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

.switcher__name { margin-top: 20px; font-size: 2.25rem; color: var(--deep); }
.switcher__tagline { margin: 10px 0 18px; font-size: 1.1875rem; font-weight: 600; line-height: 1.35; }

.ticks { margin: 0 0 22px; padding: 0; list-style: none; }
.ticks li { position: relative; padding: 5px 0 5px 22px; line-height: 1.4; }
.ticks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .78em;
    width: 10px;
    height: 10px;
    background: var(--red);
}

@media (min-width: 860px) {
    .switcher.is-ready {
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        gap: clamp(32px, 5vw, 80px);
        align-items: start;
    }
    .switcher.is-ready .switcher__tabs { display: block; }
    .switcher.is-ready .switcher__name { display: none; }
    .switcher.is-ready .switcher__panel { margin-top: 0; }

    .switcher__tab {
        display: block;
        width: 100%;
        padding: .42em 0 .42em .55em;
        border: 0;
        border-left: 6px solid transparent;
        background: none;
        color: var(--muted);
        font: 800 clamp(2.25rem, 4vw, 3.5rem)/1 var(--display);
        text-align: left;
        cursor: pointer;
        transition: color .15s, border-color .15s;
    }
    .switcher__tab:hover { color: var(--deep); }
    .switcher__tab[aria-selected="true"] { border-left-color: var(--red); color: var(--deep); }

    .switcher.is-ready .switcher__tagline { margin-top: 22px; }
    .switcher.is-ready .ticks { columns: 2; column-gap: 32px; }
    .switcher.is-ready .ticks li { break-inside: avoid; }
}

/* Mobile keeps every service visible, so the hidden state only applies to the tabbed layout. */
@media (max-width: 859.98px) {
    .switcher__panel[hidden] { display: block; }
}

/* About band over the container ship photo */

.voyage { position: relative; background: var(--deep); color: var(--white); }
.voyage__image { width: 100%; }
.voyage__inner { padding-block: 40px 56px; }
.voyage__text p { color: #dbe9e8; }
.voyage__text strong { color: var(--white); font-weight: 600; }
.voyage__text .section__title { margin-bottom: .45em; }
.voyage__text .button-row { margin-top: 26px; }

@media (min-width: 980px) {
    .voyage { display: grid; min-height: clamp(620px, 52vw, 800px); }
    .voyage__image { position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: 70% 50%; }
    .voyage__inner { position: relative; align-self: center; width: min(100%, 1320px); padding-block: 72px; }
    .voyage__text { width: min(46%, 560px); padding: clamp(28px, 3vw, 44px); background: var(--deep); }
}

/* Articles */

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px clamp(24px, 3vw, 40px); }
.section__head + .post-grid { margin-top: clamp(28px, 3.5vw, 44px); }
.section__title + .post-grid { margin-top: clamp(28px, 3.5vw, 44px); }

.post-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post-card__image { display: block; }
.post-card time { display: block; margin-top: 16px; font-size: .9rem; color: var(--muted); }
.post-card h3 { margin: 6px 0 10px; font-size: 1.875rem; line-height: 1.05; }
.post-card h3 a { color: var(--deep); text-decoration: none; }
.post-card h3 a:hover { color: var(--red); text-decoration: underline; text-decoration-thickness: 2px; }
.post-card p { color: var(--muted); }

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

@media (min-width: 860px) {
    .post-grid--lead { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: auto auto; }
    .post-grid--lead .post-card:first-child { grid-row: span 2; }
    .post-grid--lead .post-card:first-child h3 { font-size: clamp(2.25rem, 3.4vw, 3rem); }
    .post-grid--lead .post-card:not(:first-child) {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        grid-template-rows: auto auto 1fr;
        column-gap: 20px;
    }
    .post-grid--lead .post-card:not(:first-child) .post-card__image { grid-row: 1 / span 3; }
    .post-grid--lead .post-card:not(:first-child) img { height: 100%; aspect-ratio: 1; }
    .post-grid--lead .post-card:not(:first-child) time { margin-top: 0; }
    .post-grid--lead .post-card:not(:first-child) h3 { font-size: 1.625rem; }
    .post-grid--lead .post-card:not(:first-child) p {
        align-self: start;
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        font-size: 1rem;
    }
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 48px; }

/* Call to action band */

.cta { background: var(--red); color: var(--white); }
.cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px 48px;
    padding-block: clamp(36px, 5vw, 60px);
}
.cta__text {
    flex: 1 1 480px;
    max-width: 22em;
    margin: 0;
    font: 800 clamp(2rem, 3.8vw, 3.25rem)/1.02 var(--display);
    text-wrap: balance;
}

/* Footer */

.site-footer { padding-top: clamp(48px, 6vw, 72px); background: var(--deep); color: #cfe2e1; font-size: 1rem; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.site-footer__brand img { width: 230px; margin-bottom: 20px; }
.site-footer address { font-style: normal; }
.site-footer h2 { margin-bottom: 10px; font-size: 1.5rem; color: var(--white); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { padding: 3px 0; }
.site-footer__legal {
    margin-top: 40px;
    padding-block: 0 28px;
    font-size: .875rem;
}
.site-footer__legal p { margin-bottom: .3em; }

/* Inner pages */

.page-head { padding-block: clamp(44px, 6vw, 88px); background: var(--deep); color: var(--white); }
.page-head h1 { font-size: clamp(3rem, 8vw, 7rem); line-height: .96; }
.page-head__lead { max-width: 34em; margin: 16px 0 0; font-size: clamp(1.125rem, 2vw, 1.5rem); line-height: 1.35; color: #d7e7e6; }
.page-head__meta { margin-bottom: 14px; color: #cfe2e1; }
.page-head__meta a { color: var(--white); }
.page-head--service { padding-bottom: clamp(120px, 15vw, 210px); }
.page-head--post { padding-bottom: clamp(100px, 12vw, 170px); }
.page-head--post h1 { font-size: clamp(2.5rem, 5.6vw, 4.75rem); line-height: 1; max-width: 16em; }

.service-image { margin-top: calc(-1 * clamp(88px, 12vw, 170px)); }
.service-image img { width: 100%; max-height: 620px; object-fit: cover; }

.post-image { margin-top: calc(-1 * clamp(72px, 9vw, 130px)); }
.post-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-body { padding-block: clamp(32px, 4vw, 48px) var(--section); }

.prose { max-width: 40em; }
.prose h2 { margin: 1.2em 0 .35em; font-size: 2.5rem; line-height: 1.05; color: var(--deep); }
.prose h3 { margin: 1.3em 0 .35em; font-size: 2rem; line-height: 1.05; color: var(--deep); }
.prose h4 { margin: 1.3em 0 .3em; font: 600 1.1875rem/1.3 var(--text); color: var(--deep); }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin-bottom: .3em; }
.prose blockquote { margin: 1.4em 0; padding-left: 20px; border-left: 6px solid var(--red); font-weight: 500; }
.prose strong { font-weight: 600; }

.service {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}
.service__closing { margin-top: 1.6em; padding-left: 20px; border-left: 6px solid var(--red); font-weight: 500; }
.service__list { position: sticky; top: 104px; padding: clamp(24px, 3vw, 36px); background: var(--fog); }
.service__list h2 { margin-bottom: 14px; font-size: 2rem; color: var(--deep); }
.service__list .ticks { margin-bottom: 0; }

.brand { border-block: 1px solid var(--rule); }
.brand__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 48px; padding-block: 32px; }
.brand img { width: clamp(180px, 22vw, 280px); }
.brand__name { margin: 0; font: 800 2.25rem/1 var(--display); color: var(--deep); }

.more-services .section__title { font-size: clamp(2.25rem, 4vw, 3.25rem); }
.more-services ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); margin: 28px 0 0; padding: 0; list-style: none; }
.more-services a { display: block; color: var(--muted); text-decoration: none; }
.more-services__name { display: block; margin-bottom: 6px; font: 800 1.875rem/1.05 var(--display); color: var(--deep); }
.more-services a:hover .more-services__name { color: var(--red); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.about__image { position: sticky; top: 104px; }

/* Contact */

.contact { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.contact__details h2 { margin-bottom: 18px; font-size: clamp(2rem, 3vw, 2.5rem); color: var(--deep); }
.contact__details dl { margin: 0; }
.contact__details dt { margin-top: 16px; font-weight: 600; }
.contact__details dd { margin: 0; }

.form { scroll-margin-top: 110px; }
.form__row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__notice { margin-bottom: 22px; padding: 12px 16px; font-weight: 500; }
.form__notice--ok { background: #dff1e6; color: #0e4a2a; }
.form__notice--error { background: #fde5e6; color: #8f0d13; }

.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 5px; font-weight: 600; }
.field label span { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
    display: block;
    width: 100%;
    padding: .62em .75em;
    border: 1px solid #8ba4a6;
    border-radius: 3px;
    background: var(--white);
    color: var(--ink);
    font: 400 1rem/1.4 var(--text);
}
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--red); border-width: 2px; }
.field__error { margin: 5px 0 0; font-size: .9375rem; color: #a80f16; }

.contact-map iframe { display: block; width: 100%; height: clamp(320px, 38vw, 460px); border: 0; }

/* Smaller screens */

@media (max-width: 979.98px) {
    .nav-toggle { display: block; }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - 76px);
        overflow-y: auto;
        padding: 8px var(--gutter) 20px;
        border-bottom: 1px solid var(--rule);
        background: var(--white);
    }
    .site-nav.is-open { display: block; }
    .site-nav__list { display: block; }
    .site-nav__list > li > a:not(.site-nav__cta), .site-nav__parent { width: 100%; padding: .7em 0; text-align: left; }
    .site-nav__menu { position: static; display: block; min-width: 0; padding: 0 0 6px 14px; border: 0; }
    .site-nav__menu a { padding: .45em 0; }
    .site-nav__parent { pointer-events: none; }
    .site-nav__parent::after { display: none; }
    .site-nav__cta { margin: 10px 0 0; text-align: center; }

    .service, .about, .contact { grid-template-columns: minmax(0, 1fr); }
    .service__list, .about__image { position: static; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 859.98px) {
    .why__grid, .post-grid, .post-grid--two { grid-template-columns: minmax(0, 1fr); }
    .more-services ul { grid-template-columns: minmax(0, 1fr); }
    .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .topbar__inner p { display: none; }
    .topbar__links { justify-content: space-between; width: 100%; gap: 12px; font-size: .8125rem; }

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

    /* Region names are unreadable at this scale, so they move out of the map. */
    .routes text { display: none; }
    .routes__land { stroke-width: 4.6; }
    .routes__lane { stroke-width: 3.2; }
    .routes__stop circle { stroke-width: 4; }
    .hero__regions {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 20px;
        margin: 10px 0 0;
        padding: 0 0 24px;
        list-style: none;
        font-size: .9375rem;
        font-weight: 600;
    }

    .form__row { grid-template-columns: minmax(0, 1fr); }
    .site-footer__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
