/* Ride Your Bike IT — colours and slanted shapes taken from the business card and letterhead. */

/* ---------- Theme tokens ----------
   Light is the default. Dark applies automatically when the device asks for it
   (prefers-color-scheme), unless data-theme="light" is set on <html>.
   data-theme="dark" forces dark. The two dark blocks below must stay identical. */

:root {
    color-scheme: light;

    /* Brand (same in both themes) */
    --teal: #55C5CE;
    --teal-light: #C6E8EC;
    --charcoal: #424343;

    /* Surfaces */
    --bg: #FFFFFF;
    --bg-soft: #EEF8F9;        /* cards, projects section */
    --bg-tint: #C6E8EC;        /* hero, contact */
    --bg-band: #424343;        /* "how it works" band */
    --bg-panel: #424343;       /* contact card, footer */
    --bg-raised: #FFFFFF;      /* cards sitting on --bg-soft */
    --hero-band: #55C5CE;
    --placeholder: #D3ECEF;
    --line: #CFE3E6;

    /* Text */
    --text: #2B2C2C;
    --muted: #424343;
    --accent: #17767F;         /* text-safe teal */
    --band-text: #FFFFFF;
    --band-muted: #E4E6E6;
    --band-lead: #C6E8EC;

    /* Buttons */
    --strong-bg: #424343;
    --strong-fg: #FFFFFF;
    --strong-hover: #2B2C2C;
    --outline: #424343;

    --skew: -10deg;            /* the lean of the logo */
    --font-body: "Red Hat Text", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-head: "Red Hat Display", "Red Hat Text", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #1A1B1B;
        --bg-soft: #232525;
        --bg-tint: #1D3336;
        --bg-band: #2C2E2E;
        --bg-panel: #111212;
        --bg-raised: #2D3030;
        --hero-band: #2A7279;
        --placeholder: #34393A;
        --line: #3A3E3E;
        --text: #F1F3F3;
        --muted: #C5CCCD;
        --accent: #6FD0D8;
        --band-text: #FFFFFF;
        --band-muted: #D5DADA;
        --band-lead: #C6E8EC;
        --strong-bg: #55C5CE;
        --strong-fg: #151616;
        --strong-hover: #C6E8EC;
        --outline: #C6E8EC;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1A1B1B;
    --bg-soft: #232525;
    --bg-tint: #1D3336;
    --bg-band: #2C2E2E;
    --bg-panel: #111212;
    --bg-raised: #2D3030;
    --hero-band: #2A7279;
    --placeholder: #34393A;
    --line: #3A3E3E;
    --text: #F1F3F3;
    --muted: #C5CCCD;
    --accent: #6FD0D8;
    --band-text: #FFFFFF;
    --band-muted: #D5DADA;
    --band-lead: #C6E8EC;
    --strong-bg: #55C5CE;
    --strong-fg: #151616;
    --strong-hover: #C6E8EC;
    --outline: #C6E8EC;
}

/* Swap the black-text logo for the white-text one in dark mode. */
.only-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .only-light { display: none; }
    :root:not([data-theme="light"]) .only-dark { display: block; }
}
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.05; }

h1, h2 {
    font-family: var(--font-head);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
h4 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }

p { margin: 0; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }

.skip {
    position: absolute; left: -999px; top: 0;
    background: var(--text); color: var(--bg); padding: .6rem 1rem; z-index: 20;
}
.skip:focus { left: 0; }

.eyebrow {
    margin-bottom: 1rem;
    font-weight: 700; font-style: italic; letter-spacing: .12em; text-transform: uppercase;
    font-size: .85rem; color: var(--accent);
}

/* ---------- Header ---------- */

.header {
    position: sticky; top: 0; z-index: 10;
    background: var(--bg);
    border-bottom: 4px solid var(--teal);
}
.header__inner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding-block: .7rem;
}
.header__logo img { width: clamp(7.5rem, 22vw, 10.5rem); }

.nav { display: flex; align-items: center; gap: clamp(.9rem, 2.6vw, 2rem); }
.nav a {
    color: var(--text); text-decoration: none; font-weight: 500; font-style: italic;
}
.nav a:hover { color: var(--accent); }

/* Slanted buttons: the box leans, the label is leaned back upright. */
.btn, .nav__cta {
    display: inline-block;
    padding: .7rem 1.5rem;
    background: var(--teal);
    color: #1F2020;
    font-weight: 700;
    font-style: normal;
    text-decoration: none;
    transform: skewX(var(--skew));
    transition: background-color .15s ease, color .15s ease;
}
.btn > span, .nav__cta > span { display: inline-block; transform: skewX(calc(var(--skew) * -1)); }
.nav a.nav__cta { color: #1F2020; padding: .45rem 1.1rem; }
.nav a.nav__cta:hover { background: var(--strong-bg); color: var(--strong-fg); }

.btn--strong { background: var(--strong-bg); color: var(--strong-fg); }
.btn--strong:hover { background: var(--strong-hover); }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--outline); }
.btn--ghost:hover { background: var(--strong-bg); color: var(--strong-fg); box-shadow: none; }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    background: var(--bg-tint);
}
/* The teal band that runs off the right-hand edge of the business card. */
.hero::after, .phero::after {
    content: "";
    position: absolute; top: 0; bottom: 0; right: -12rem;
    width: clamp(15rem, 34vw, 30rem);
    background: var(--hero-band);
    transform: skewX(var(--skew));
}
.hero__inner {
    position: relative; z-index: 1;
    padding-block: clamp(3.5rem, 10vw, 7.5rem);
}
.hero h1 { max-width: 13ch; }
.hero__lead { max-width: 36rem; margin-top: 1.5rem; font-size: 1.2rem; color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; margin-top: 2.25rem; padding-left: .4rem; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section__lead { max-width: 38rem; margin-top: .9rem; font-size: 1.15rem; color: var(--muted); }

.section--soft { background: var(--bg-soft); }

.section--band { background: var(--bg-band); color: var(--band-text); }
.section--band .section__lead { color: var(--band-lead); }

/* ---------- Service cards ---------- */

.cards {
    list-style: none; padding: 0; margin: 2.5rem 0 0;
    display: grid; gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
}
.card {
    position: relative;
    padding: 1.75rem 1.5rem 1.6rem;
    background: var(--bg-soft);
    border-bottom-right-radius: 1rem;
    overflow: hidden;
}
/* Fading bar from the logo underline. */
.card::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, var(--bg-tint) 5%, var(--teal) 65%);
}
.card__num {
    display: block; margin-bottom: .6rem;
    font-family: var(--font-head); font-style: italic; font-weight: 900; font-size: 1.5rem;
    color: var(--accent);
}
.card p { margin-top: .5rem; color: var(--muted); }

/* ---------- Projects: home page cards ---------- */

.pcards {
    list-style: none; padding: 0; margin: 2.5rem 0 0;
    display: grid; gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr));
}
.pcard {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--bg-raised);
    border-bottom-right-radius: 1rem;
    overflow: hidden;
}
.pcard .media { border-radius: 0; }
.pcard .media img { transition: transform .3s ease; }
.pcard:hover .media img { transform: scale(1.03); }
.pcard__body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem 1.4rem 1.4rem; }
.pcard .eyebrow { margin-bottom: .4rem; }
.pcard h3 {
    font-family: var(--font-head); font-style: italic; font-weight: 900; text-transform: uppercase;
    font-size: 1.4rem; line-height: 1.1;
}
.pcard h3 a { color: inherit; text-decoration: none; }
.pcard h3 a::after { content: ""; position: absolute; inset: 0; }   /* whole card is the link */
.pcard__summary { margin-top: .6rem; color: var(--muted); }
.pcard__more { margin-top: auto; padding-top: 1rem; font-weight: 700; color: var(--accent); }
.pcard:hover .pcard__more { text-decoration: underline; }

/* ---------- Project page ---------- */

.phero { position: relative; overflow: hidden; background: var(--bg-tint); }
.phero__inner { position: relative; z-index: 1; padding-block: clamp(2.25rem, 6vw, 4.5rem); }
.phero h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); max-width: 18ch; }
.phero .eyebrow { margin-bottom: .6rem; }
.phero__lead { max-width: 40rem; margin-top: 1.2rem; font-size: 1.2rem; color: var(--muted); }
.back {
    display: inline-block; margin-bottom: 1.75rem;
    font-weight: 500; font-style: italic; color: var(--text); text-decoration: none;
}
.back:hover { color: var(--accent); }

.facts { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 2rem 0 0; }
.facts div { padding-left: .9rem; border-left: 4px solid var(--teal); }
.facts dt { font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.facts dd { margin: 0; font-weight: 500; }

/* Photo frames. An <img> fills the frame; without one it shows a placeholder. */
.media {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    background: var(--placeholder);
    border-bottom-right-radius: 1rem;
    overflow: hidden;
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--wide { aspect-ratio: 16 / 10; }
.media--cover { aspect-ratio: 2 / 1; }
.media--photo { aspect-ratio: 3 / 2; }
.media--square { aspect-ratio: 1; }
.media--empty {
    display: grid; place-items: center;
    background:
        linear-gradient(100deg, transparent 0 62%, color-mix(in srgb, var(--teal) 28%, transparent) 62% 100%),
        var(--placeholder);
}
.media--empty span {
    font-style: italic; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
    font-size: .8rem; color: var(--muted); opacity: .8;
}
.media figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 1.5rem 1rem .6rem;
    font-size: .85rem; color: #FFFFFF;
    background: linear-gradient(transparent, rgba(0, 0, 0, .7));
}

.tags { list-style: none; padding: 0 0 0 .25rem; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem .6rem; }
.tags li {
    padding: .2rem .8rem;
    font-size: .85rem; font-weight: 500;
    color: var(--text);
    box-shadow: inset 0 0 0 1.5px var(--teal);
    transform: skewX(var(--skew));
}
.tags li span { display: inline-block; transform: skewX(calc(var(--skew) * -1)); }

/* A section of a project page. */
.block {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    padding-top: clamp(2.5rem, 6vw, 4rem);
    border-top: 1px solid var(--line);
}
.block__title { font-size: clamp(1.4rem, 3.2vw, 1.9rem); line-height: 1.1; }
.prose { max-width: 44rem; color: var(--muted); }
.block__title + .prose:not(:empty) { margin-top: .8rem; }
.prose p + p { margin-top: 1rem; }

.ticks { list-style: none; padding: 0; margin: 1.25rem 0 0; max-width: 44rem; }
.ticks li { position: relative; padding-left: 1.6rem; color: var(--muted); }
.ticks li + li { margin-top: .4rem; }
.ticks li::before {
    content: ""; position: absolute; left: .15rem; top: .5em;
    width: .7rem; height: .7rem; background: var(--teal); transform: skewX(var(--skew));
}

.specs { margin: 1.4rem 0 0; border-top: 1px solid var(--line); }
.specs div {
    display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem;
    padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.specs dt { font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); padding-top: .15rem; }
.specs dd { margin: 0; color: var(--muted); }

/* Layout: feature — big photo beside the write-up. */
.block--feature {
    display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}
.block--feature.block--flip .media { order: 2; }

/* Layout: gallery — three photos: one large and two small. Otherwise an even grid. */
.mosaic, .shots { display: grid; gap: 1rem; }
.block__body + .mosaic, .block__body + .shots { margin-top: 1.75rem; }
.mosaic { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic .media { aspect-ratio: auto; min-height: 9rem; }
.mosaic .media:first-child { grid-row: span 2; aspect-ratio: 3 / 2; }
.shots { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

/* Layout: story — stages side by side. */
.stages {
    list-style: none; padding: 0; margin: 1.75rem 0 0;
    display: grid; gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    counter-reset: stage;
}
.stage { counter-increment: stage; }
.stage h3 { margin-top: 1rem; font-size: 1.05rem; }
.stage h3::before { content: counter(stage) ". "; color: var(--accent); }
.stage p { margin-top: .35rem; color: var(--muted); }

/* Layout: grid — small cards for the bits and pieces. */
.minis {
    list-style: none; padding: 0; margin: 1.75rem 0 0;
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.mini { background: var(--bg-soft); border-bottom-right-radius: 1rem; overflow: hidden; padding-bottom: 1rem; }
.mini .media { border-radius: 0; }
.mini h3, .mini p { padding-inline: 1rem; }
.mini h3 { margin-top: .9rem; font-size: 1.05rem; }
.mini p { margin-top: .2rem; font-size: .95rem; color: var(--muted); }

/* Layout: work — numbered run-down of the core parts of the job. */
.work {
    list-style: none; padding: 0; margin: 1.75rem 0 0;
    display: grid; gap: 1.5rem 2.5rem;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    counter-reset: work;
}
.work li {
    counter-increment: work;
    position: relative;
    padding: 1rem 0 0 3.4rem;
    border-top: 4px solid var(--teal);
}
.work li::before {
    content: counter(work, decimal-leading-zero);
    position: absolute; left: 0; top: .85rem;
    font-family: var(--font-head); font-style: italic; font-weight: 900; font-size: 1.6rem; line-height: 1;
    color: var(--accent);
}
.work p { margin-top: .35rem; color: var(--muted); }

/* Previous / next project */
.pager {
    display: flex; justify-content: space-between; gap: 1.5rem;
    margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}
.pager a { display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: var(--text); }
.pager a span { font-size: .85rem; font-style: italic; color: var(--accent); }
.pager a strong { font-weight: 700; }
.pager a:hover strong { text-decoration: underline; }
.pager__next { margin-left: auto; text-align: right; }

/* Closing call to action */
.cta__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.cta h2 { font-size: clamp(1.5rem, 3.6vw, 2.2rem); }
.cta .btn:hover { background: #FFFFFF; color: #1F2020; }

/* ---------- Steps ---------- */

.steps {
    list-style: none; padding: 0; margin: 2.5rem 0 0;
    display: grid; gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    counter-reset: step;
}
.step { counter-increment: step; padding-top: 1.1rem; border-top: 4px solid var(--teal); }
.step h3::before {
    content: counter(step) ". ";
    color: var(--teal);
}
.step p { margin-top: .5rem; color: var(--band-muted); }

/* ---------- Contact (laid out like the business card) ---------- */

.contact { background: var(--bg-tint); border-bottom: 1.25rem solid var(--teal); }
.contact__inner {
    display: grid; gap: 2.5rem; align-items: center;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
/* The framed logo badge, same as the email signature. */
.contact__brand img { width: min(100%, 30rem); margin-inline: auto; }
.contact__details .section__lead { margin: 0 0 1.4rem; }
.contact__details { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.contact__details h2 { margin-bottom: .6rem; }
.contact__name { font-weight: 700; }
.contact__details a {
    font-size: clamp(1.35rem, 4vw, 1.9rem); font-style: italic; line-height: 1.3;
    color: var(--text); text-decoration: none;
    overflow-wrap: anywhere;
}
.contact__details a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Footer ---------- */

.footer { background: var(--bg-panel); color: #FFFFFF; font-size: .95rem; }
.footer__inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem;
    padding-block: 1.1rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 46rem) {
    .block--feature { grid-template-columns: 1fr; }
    .block--feature.block--flip .media { order: 0; }
    .media--cover { aspect-ratio: 3 / 2; }
}

@media (max-width: 40rem) {
    .nav a:not(.nav__cta) { display: none; }
}

@media (max-width: 34rem) {
    .hero::after, .phero::after { right: -13.5rem; }
    .mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
    .mosaic .media:first-child { grid-column: span 2; grid-row: auto; }
    .mosaic .media { aspect-ratio: 1; min-height: 0; }
    .mosaic .media:first-child { aspect-ratio: 3 / 2; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .nav__cta { transition: none; }
}
