/* ==========================================================================
   FEARLESS DINOSAUR - main stylesheet
   1. Brand settings (colours, fonts, sizes): change these first
   2. Base
   3. Header and footer
   4. Buttons
   5. Home: hero
   6. Home: what I do
   7. Home: track record
   8. Home: contact
   9. Simple pages (news, privacy, posts, 404)
   10. Dinosaur shake animation
   11. Small screens
   ========================================================================== */


/* 1. Brand settings ------------------------------------------------------- */
:root {
    /* Colours taken from the logos */
    --green:      #62B646;
    --lime:       #A9C552;
    --aubergine:  #251B25;
    --ink:        #040707;
    --white:      #FFFFFF;
    --paper:      #F5F6F0;   /* soft off-white page background */
    --muted:      #5C5A5C;   /* secondary text on light backgrounds */

    /* Fonts */
    --font-title: "Fraunces", Georgia, serif;
    --font-text:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Layout */
    --max-width: 1120px;
    --gutter: 24px;
    --section-space: 112px;  /* vertical space around each section */
}


/* 2. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-title);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em;
}

a { color: inherit; }

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.icon { flex-shrink: 0; }

.section-title {
    font-size: 15px;
    font-family: var(--font-text);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 40px;
}


/* 3. Header and footer ---------------------------------------------------- */
.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.site-header__name {
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 600;
    text-decoration: none;
}

.site-header__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}
.site-header__link:hover { color: var(--green); }

.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}
.site-footer__inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
    padding-bottom: 24px;
}
.site-footer a:hover { color: var(--lime); }

/* The "end credits" line in the middle of the footer (text in _config.yml) */
.site-footer__credits {
    font-family: var(--font-title);
    font-style: italic;
    color: var(--lime);
}


/* 4. Buttons -------------------------------------------------------------- */
.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease;
}
.button:hover { transform: translateY(-2px); }

.button--dark { background: var(--ink); color: var(--white); }
.button--dark:hover { background: var(--aubergine); }


/* 5. Home: hero ----------------------------------------------------------- */
.hero__inner {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 64px;
    align-items: start;
}

.hero__text {
    padding: 96px 0 var(--section-space);
}

.hero__headline {
    font-size: clamp(40px, 5.5vw, 72px);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.hero__accent {
    display: block;
    color: var(--green);
    font-style: italic;
}

.hero__intro {
    max-width: 560px;
    font-size: 21px;
    color: var(--muted);
    margin: 0 0 40px;
}

.hero__logo { margin: 0; }

/* The logo is a button so the dinosaur can be clicked with mouse or keyboard */
.logo {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.hero__hint {
    margin-top: 12px;
    font-size: 14px;
    font-style: italic;
    color: var(--muted);
    text-align: right;
}


/* 6. Home: what I do ------------------------------------------------------ */
.services {
    background: var(--aubergine);
    color: var(--white);
    padding: var(--section-space) 0;
}

.services .section-title { color: var(--lime); }

.services__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 56px 64px;
}

.services__item {
    border-top: 2px solid var(--green);
    padding-top: 24px;
}

.services__item h3 {
    font-size: 30px;
    font-weight: 400;
}

.services__item p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}


/* 7. Home: track record --------------------------------------------------- */
.track-record {
    padding: var(--section-space) 0;
}

.track-record__text {
    font-family: var(--font-title);
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.3;
    max-width: 820px;
    margin: 0 0 56px;
}

/* Scrolling logo strip (marquee). Speed: the 45s in .clients-track.
   The bottom padding leaves room for the keyword panels under the logos. */
.track-record { padding-bottom: 24px; }

.clients-marquee {
    overflow: hidden;
    padding-bottom: 88px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
            mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.clients-track {
    display: flex;
    width: max-content;
    animation: clients-scroll 45s linear infinite;
}

.clients-marquee:hover .clients-track,
.clients-marquee:focus-within .clients-track { animation-play-state: paused; }

@keyframes clients-scroll { to { transform: translateX(-50%); } }

.clients {
    list-style: none;
    margin: 0;
    padding: 0 72px 0 0;   /* same as the gap, so the loop has no jump */
    display: flex;
    align-items: center;
    gap: 72px;
}

/* Visitors who turn off animations in their system get a centred, static grid */
@media (prefers-reduced-motion: reduce) {
    .clients-track { animation: none; width: auto; }
    .clients-track .clients[aria-hidden] { display: none; }
    .clients { flex-wrap: wrap; justify-content: center; gap: 32px 56px; padding: 0; }
    .clients-marquee { -webkit-mask-image: none; mask-image: none; }
}

.clients__item {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Every logo fits the same 140 x 56 box: wide logos are limited by the width,
   square ones by the height, so they look about the same size. */
.clients__item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    outline: none;
}

.clients__item img {
    max-width: 140px;
    max-height: 56px;
    width: auto;
    height: auto;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}
.clients__item:hover img,
.clients__item:focus img { opacity: 1; }

/* Keywords panel: appears under the logo on hover (desktop) or tap (phone).
   Text comes from `work:` in index.markdown. */
.clients__item[tabindex] { cursor: help; }

.clients__work {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 5;
    width: 220px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--white);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.clients__item:hover .clients__work,
.clients__item:focus .clients__work {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}


/* 8. Home: contact -------------------------------------------------------- */
.contact {
    background: var(--green);
    padding: 96px 0;
}

.contact__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.contact__title {
    font-size: clamp(30px, 3.6vw, 46px);
    font-weight: 400;
    max-width: 640px;
    margin: 0;
}


/* 8b. Home: point of view ------------------------------------------------- */
.viewpoint {
    padding: 0 0 var(--section-space);
}

.viewpoint__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    border-top: 1px solid rgba(4, 7, 7, 0.15);
    padding-top: 72px;
}

.viewpoint__statement {
    font-family: var(--font-title);
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.25;
    margin: 0;
}

/* Stained-glass illustration (_includes/illustration-viewpoint.svg) */
.illustration {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
    margin-top: 40px;
}

.viewpoint__text p {
    margin: 0 0 1.2em;
    color: var(--muted);
    text-align: justify;
    hyphens: auto;          /* splits long words so justified lines keep even spacing */
}
.viewpoint__text p:first-child::first-letter {
    font-family: var(--font-title);
    font-size: 3.2em;
    float: left;
    line-height: 0.9;
    margin: 6px 10px 0 0;
    color: var(--green);
}


/* 8c. Home: news ---------------------------------------------------------- */
.news {
    background: var(--white);
    padding: var(--section-space) 0;
}

.news__list {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
}

.news__item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid rgba(4, 7, 7, 0.1);
}

.news__item time {
    font-size: 15px;
    color: var(--muted);
    padding-top: 4px;
}

.news__item h3 { font-size: 24px; font-weight: 400; margin-bottom: 6px; }
.news__item p  { margin: 0 0 0.6em; color: var(--muted); font-size: 17px; }
.news__item a  { color: var(--green); }

.news__all {
    font-weight: 600;
    text-decoration: none;
}
.news__all:hover { color: var(--green); }


/* 9. Simple pages (news, privacy, posts, 404) ----------------------------- */
.page-content {
    max-width: 760px;
    padding-top: 64px;
    padding-bottom: var(--section-space);
}

.page-content h1 { font-size: clamp(36px, 4.5vw, 56px); font-weight: 400; }
.page-content h2 { font-size: 30px; font-weight: 400; margin-top: 1.5em; }
.page-content a { color: var(--green); }
.page-content .post-date { color: var(--muted); font-size: 15px; }

/* Pirate images on the privacy page */
.pirate-left   { float: left;  margin-right: 30px; }
.pirate-right  { float: right; margin-left: 30px; }
.pirate-center { margin: 24px auto; }


/* 10. Dinosaur shake animation -------------------------------------------- */
@keyframes shake {
    0%   { transform: translate(2px, 1px)   rotate(0deg); }
    20%  { transform: translate(-3px, 0px)  rotate(1deg); }
    40%  { transform: translate(1px, -1px)  rotate(1deg); }
    60%  { transform: translate(-3px, 1px)  rotate(0deg); }
    80%  { transform: translate(-1px, -1px) rotate(1deg); }
    100% { transform: translate(1px, -2px)  rotate(-1deg); }
}

.shake { animation: shake 0.4s infinite; }


/* 11. Small screens ------------------------------------------------------- */
@media (max-width: 800px) {
    :root { --section-space: 72px; }

    .hero__inner { grid-template-columns: 1fr; gap: 0; }
    .hero__logo  { order: -1; width: 140px; margin-left: auto; }
    .hero__text  { padding-top: 24px; }
    .hero__hint  { display: none; }

    .services__list { grid-template-columns: 1fr; gap: 40px; }

    .viewpoint__inner { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; }

    .news__item { grid-template-columns: 1fr; gap: 4px; }

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

    .site-footer__inner { flex-direction: column; gap: 8px; }
}
