/* =====================================================================
   STYLES.CSS  -  read this file from top to bottom. Each section builds on the last.

   HOW ONE CSS RULE WORKS
       selector { property: value; }
   The SELECTOR says WHAT to style:  .card  means "anything with class="card"".
   Each  property: value;  line says HOW. If two rules disagree, the one lower
   in the file wins (when they are equally specific).

   TIP: in your browser press F12, click the pointer icon, then click anything on
   the page. The panel shows every rule that styles it, and you can edit the
   values live to experiment. Nothing is saved, so you cannot break anything.
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. VARIABLES  -  your whole design in one place
   A variable is a named value. Write it once here, use it everywhere as
   var(--name). Change a color here and every place that uses it updates.
   TRY IT: change --accent to #5b2a86 and watch the buttons, selected tab, and links change.
   (For a darker blue, try #0a2f5c.)
   --------------------------------------------------------------------- */
:root {
    /* Colors */
    --bg: #f6fbfe;          /* page background (very light blue) */
    --paper: #ffffff;       /* card background */
    --ink: #0b2239;         /* main text */
    --muted: #4a5d70;       /* softer text: summaries and captions */
    --accent: #0070ad;      /* buttons, selected tab, links, thin highlights */
    --accent-dark: #005a8c; /* button hover */
    --tint: #dff1fb;        /* light blue: shows behind an image that has not loaded yet */
    --line: #cfe0ea;        /* thin borders */
    --footer-bg: #d2ebf8;   /* footer */

    /* Fonts: the browser uses the first one it finds, then falls back */
    --font-head: "Times New Roman", Times, serif;
    --font: "Proxima Nova", "Montserrat", system-ui, sans-serif;

    /* Shape and spacing.
       clamp(smallest, preferred, largest) = flexible: it grows with the
       screen but never goes below or above the limits. */
    --radius: 16px;                         /* rounded corners */
    --gutter: clamp(1.25rem, 4vw, 3rem);    /* space at the left and right edges */
    --space: clamp(2rem, 4vw, 3rem);        /* space above and below sections */
   --gap: clamp(1.25rem, 3vw, 2.25rem);
   --width: 1280px;
}


/* ---------------------------------------------------------------------
   2. BASICS  -  rules for the whole page
   --------------------------------------------------------------------- */

/* * means "everything". border-box makes a box's width INCLUDE its padding
   and border, so boxes stop growing past the size you set. */
*, *::before, *::after { box-sizing: border-box; }

/* Always reserve room for the scrollbar so pages don't jump sideways
   when you move between a short page and a long one. */
html { overflow-y: scroll; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;                      /* browsers add a default margin; remove it */
    min-height: 100vh;              /* at least as tall as the window (100vh = 100% of window height) */
    display: flex;                  /* flexbox: lay children out in a row or column ... */
    flex-direction: column;         /* ... here a column: header, then main, then footer */
    background: var(--bg);
    color: var(--ink);
    font: 1rem/1.65 var(--font);    /* shorthand: size / line-height  font-family */
}

/* flex: 1 = "take all the leftover height". On a short page this pushes the
   footer to the bottom of the window. */
main { flex: 1; transition: opacity 0.2s ease; }
main.is-leaving { opacity: 0; }     /* script.js adds this for a quick fade in older browsers */

a { color: inherit; }               /* links take the color of their surroundings */
a:focus-visible,
.scroller:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }   /* ring for keyboard users */

img { display: block; max-width: 100%; }   /* images never overflow their box */

p { max-width: 62ch; margin: 0 0 1rem; }   /* ch = width of the letter "0"; about 62 characters per line reads best */

h1, h2, h3 { margin: 0 0 1rem; font-family: var(--font-head); font-weight: 400; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }

/* The centered column that holds each block of content. Use it ONCE per block,
   never inside another .container, or the side padding doubles up. */
.container { width: 100%; max-width: var(--width); margin: 0 auto; padding: 0 var(--gutter); }

.lead { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--muted); }   /* the larger intro line under a title */


/* ---------------------------------------------------------------------
   3. HEADER  -  light bar that stays at the top while you scroll.
   The logo sits on the left and the tabs sit on the top right.
   --------------------------------------------------------------------- */
.header {
    position: sticky;                       /* sticks to the top of the window as you scroll ... */
    top: 0;
    z-index: 10;                            /* ... and stays in front of the page content */
    padding: 0.9rem 0;          /* top/bottom 0.9rem, left/right the gutter */
    background: rgba(246, 251, 254, 0.88);  /* see-through page color ... */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);            /* ... that blurs what scrolls behind it */
    border-bottom: 1px solid var(--line);
    view-transition-name: site-header;      /* keeps the header still during page changes */
}

/* justify-content: space-between pushes the first child (logo) to the far
   left and the last child (tabs) to the far right. */
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: var(--width); margin: 0 auto; padding: 0 var(--gutter); }

.home-logo { display: block; width: 48px; height: 48px; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: var(--tint); color: var(--muted); font-size: 0.6rem; line-height: 1.1; }
.home-logo img { width: 100%; height: 100%; object-fit: cover; }   /* cover = fill the circle, crop the edges, never stretch */

nav { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
nav a { padding: 0.55rem 1.25rem; border-radius: 999px; font-weight: 600; text-decoration: none; transition: background 0.2s, color 0.2s; }
nav a:hover { background: var(--tint); }

/* [aria-current] selects only the link marked aria-current in the HTML,
   which is the page you are on. That tab becomes the filled blue pill. */
nav a[aria-current] { background: var(--accent); color: #fff; }


/* ---------------------------------------------------------------------
   4. BUTTONS  -  every button is a pill
   999px radius is bigger than the button, so the ends become fully round.
   --------------------------------------------------------------------- */
.pill {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}
a.pill:hover { background: var(--accent-dark); transform: translateY(-2px); }   /* lifts 2px on hover */


/* ---------------------------------------------------------------------
   5. HOME INTRO  -  headline with a circle photo on the right
   --------------------------------------------------------------------- */
.hero { padding-block: var(--space); }

/* A floated element sits to one side and the text wraps around it.
   flow-root makes the container grow to include the floated photo. */
.hero .container { display: flow-root; }

.hero-photo {
    float: right;
    width: clamp(150px, 24vw, 340px);
    aspect-ratio: 1;                        /* width : height = 1 : 1, a perfect square ... */
    border-radius: 50%;                     /* ... and 50% rounding turns a square into a circle */
    margin: 0 0 1rem clamp(1rem, 3vw, 3rem);
    overflow: hidden;                       /* crop the image to the circle */
    border: 3px solid var(--accent);
    shape-outside: circle(50%);             /* text wraps around the curve, not a box */
    background: var(--tint);
    color: var(--ink);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { max-width: 20ch; }               /* keeps long headlines from stretching too wide */


/* ---------------------------------------------------------------------
   6. SECTIONS  -  the blocks down the home page
   --------------------------------------------------------------------- */
.section { padding-block: var(--space); border-top: 1px solid var(--line); }
.hero + .section { padding-top: 1.5rem; }   /* + means "the section right after the hero": tighter gap */

.section-title { margin-bottom: 1.5rem; }
/* ::before adds a decorative piece before the title without extra HTML. It needs content: "". */
.section-title::before { content: ""; display: block; width: 2.5rem; height: 3px; margin-bottom: 0.75rem; background: var(--accent); border-radius: 2px; }


/* ---------------------------------------------------------------------
   7. CARDS  -  the clickable project tiles
   The whole card is one link. The title is the "button": it underlines on hover.
   --------------------------------------------------------------------- */

/* flex-wrap: wrap lets cards drop to the next row when the screen is narrow. */
.cards { display: flex; flex-wrap: wrap; gap: var(--gap); }

/* flex: 1 1 300px = "grow to share the row, may shrink, start at 300px".
   Two cards each take half the row, three take a third. */
.card {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;                       /* clips the image to the rounded corners */
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(11, 34, 57, 0.06);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(11, 34, 57, 0.14); }

/* The image area. position: relative lets the image be placed "absolutely"
   inside it. inset: 0 stretches it to touch all four edges: wall to wall. */
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tile, var(--accent)); color: #fff; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* var(--tile, var(--accent)) = use this card's own --tile color from the HTML,
   and if it has none, use the accent blue. */

.card-body { padding: 1.25rem 1.5rem 1.5rem; }
.card h3 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.card:hover h3 { text-decoration: underline; }
.card p { margin: 0; color: var(--muted); }


/* ---------------------------------------------------------------------
   8. CASE-STUDY PAGES  -  title on the left, image on the right
   --------------------------------------------------------------------- */
.case-top { display: grid; grid-template-columns: minmax(0, 1fr) min(40%, 440px); gap: 1.5rem clamp(2rem, 6vw, 5rem); align-items: start; padding-block: var(--space); }
.case-top + .section { padding-top: 1.5rem; border-top: 0; }
.case-head { grid-row: 1 / span 2; min-width: 0; }
.case-head h1 { margin-bottom: 0.5rem; }
.back { display: inline-block; margin-bottom: 1.5rem; font-weight: 600; }

.hero-art, .case-img { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.hero-art { background: var(--tile, var(--accent)); color: #fff; }
.case-img { background: var(--tint); }
.hero-art img, .case-img img { max-height: 80vh; object-fit: contain; }
.hero-art img, .case-img img { width: 100%; height: auto; }
.hero-art.duo { display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: #fff; color: var(--ink); }   /* a logo on white */
.hero-art.duo img { width: auto; max-width: 60%; height: auto; max-height: 70%; object-fit: contain; }   /* contain = show the whole logo, never crop */

/* Capgemini and Climatebase: labeled facts */
.facts { display: grid; gap: 1rem; margin: 1.5rem 0 0; }
.facts div { padding-top: 1rem; border-top: 1px solid var(--line); }
.facts dt { font-size: 0.9rem; font-weight: 600; color: var(--accent); }
.facts dd { margin: 0.25rem 0 0; }

/* Skills: a plain bullet list */
.chips { margin: 0; padding-left: 1.25rem; }
.chips li { margin-bottom: 0.35rem; }

/* Columns that wrap on small screens: each child starts at 320px wide */
.two { display: flex; flex-wrap: wrap; gap: 2rem 4rem; margin-bottom: 2.5rem; }
.two > * { flex: 1 1 320px; }               /* > means "direct children only" */
.two h2, .two h3 { font-size: 1.4rem; }
.two .scroller { flex-grow: 2; margin-bottom: 0; }   /* the image scroller gets twice the width */

/* A paragraph with a clickable image beside it */
.story { display: flex; flex-wrap: wrap; align-items: center; gap: 2rem clamp(2rem, 5vw, 4rem); margin-bottom: 3rem; }
.story > * { flex: 1 1 340px; }
.story p { max-width: none; }
.story-img { text-decoration: none; }
.story-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); }
.story-img .pill { margin-top: 0.75rem; }
.story-img:hover .pill { background: var(--accent-dark); }

/* PostHog and Start-ups: each company is one .entry */
.entry + .entry { margin-top: 3.5rem; padding-top: 3.5rem; border-top: 1px solid var(--line); }
.entry > h2 { margin-bottom: 1.5rem; }

/* Swipeable images. overflow-x: auto adds a sideways scroll; scroll-snap makes
   each image click into place as you scroll. */
.scroller { display: flex; gap: 1rem; padding-bottom: 1rem; margin-bottom: 2rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-color: var(--accent) var(--tint); }
.scroller a { flex: 0 0 min(85%, 640px); scroll-snap-align: start; }   /* min() picks the smaller: 85% of the scroller or 640px */
.scroller img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); }

/* The "View next page" button: margin-left: auto pushes it to the right edge. */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.actions .next { margin-left: auto; }


/* ---------------------------------------------------------------------
   9. ABOUT PAGE  -  photo on the left, bullets on the right, text across the full width below
   --------------------------------------------------------------------- */
/* CSS grid: two columns. 7fr and 5fr are shares of the row: the photo gets 7 parts, the bullets 5.
   minmax(0, ...) lets a column shrink instead of overflowing. align-items: center lines the bullets
   up with the middle of the photo. */
.about-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; margin-bottom: 3rem; }
.about-photo { margin: 0; }
.about-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); }
.about-top ul { margin: 0; padding-left: 1.25rem; font-size: 1.1rem; }
.about-top li { margin-bottom: 0.75rem; }
.about-text p { max-width: none; font-size: 1.1rem; }               /* none = text runs the full width */
.about-text a { color: var(--accent); text-underline-offset: 3px; }


/* ---------------------------------------------------------------------
   10. FOOTER
   --------------------------------------------------------------------- */
.site-footer { padding: var(--space) 0; border-radius: 28px 28px 0 0; background: var(--footer-bg); }   /* radius: top two corners only */
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-name { margin: 0 0 1rem; font-family: var(--font-head); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; letter-spacing: -0.02em; }
.footer-note { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.footer-links a { text-decoration: none; border-bottom: 1px solid currentColor; }


/* ---------------------------------------------------------------------
   11. PAGE MOTION  -  script.js gives the clicked card's image one shared name
   (shared-img). The browser then glides it to the matching image on the next page.
   --------------------------------------------------------------------- */
::view-transition-group(shared-img) { animation-duration: 0.55s; animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
::view-transition-old(shared-img), ::view-transition-new(shared-img) { height: 100%; object-fit: cover; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }


/* ---------------------------------------------------------------------
   12. SMALL SCREENS AND ACCESSIBILITY
   A media query applies its rules only when its condition is true.
   --------------------------------------------------------------------- */
@media (max-width: 860px) { .about-top { grid-template-columns: 1fr; } }                    /* photo, then bullets, one column */
@media (max-width: 820px) { nav a { padding: 0.5rem 0.9rem; } }                              /* smaller tabs on tablets and phones */
@media (max-width: 720px) { .case-top { grid-template-columns: 1fr; } .case-head { grid-row: auto; } }
@media (prefers-reduced-motion: reduce) { main, .pill, .card, nav a { transition: none; } }   /* respect "reduce motion" settings */

/* ===== CASE-STUDY UPGRADE: paste at the very END of styles.css ===== */
.case-top { display: grid; grid-template-columns: minmax(0, 1fr) min(40%, 440px); gap: 1.5rem clamp(2rem, 6vw, 5rem); align-items: start; padding-block: var(--space); }
.case-top.solo { grid-template-columns: 1fr; }
.case-head { grid-row: 1 / span 2; min-width: 0; }
.case-top.solo .case-head { grid-row: auto; }
.fig { margin: 0; }
.fig figcaption { margin-top: 0.6rem; font-size: 0.9rem; color: var(--muted); }
.hero-art, .case-img { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.hero-art { flex: none; aspect-ratio: auto; background: var(--tile, var(--accent)); color: #fff; }
.case-img { background: var(--tint); }
.hero-art img, .case-img img { width: 100%; height: auto; object-fit: fill; }
.native .case-img { width: fit-content; max-width: 100%; margin-inline: auto; }
.native img { width: auto; margin: 0 auto; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) min(40%, 440px); gap: 2rem clamp(2rem, 6vw, 5rem); align-items: center; margin-bottom: 2.5rem; }
.feature .two { margin-bottom: 0; }
.divider { max-width: 900px; margin: 3rem auto; }
@media (max-width: 720px) { .case-top, .feature { grid-template-columns: 1fr; } .case-head { grid-row: auto; } }

/* ===== WIDER PICTURE COLUMNS: add "wide" or "wider" to a case-top or feature to give the picture more room ===== */
.case-top.wide, .feature.wide { grid-template-columns: minmax(0, 1fr) min(50%, 600px); }
.case-top.wider, .feature.wider { grid-template-columns: minmax(0, 1fr) min(58%, 700px); }
@media (max-width: 720px) { .case-top.wide, .case-top.wider, .feature.wide, .feature.wider { grid-template-columns: 1fr; } }

/* ===== READING VIEW: add class "reading" to a <figure> and its area becomes one column,
   so the picture shows at its real size (as wide as the page allows) ===== */
.case-top:has(.reading), .feature:has(.reading) { grid-template-columns: 1fr; }
.case-top:has(.reading) .case-head { grid-row: auto; }
.reading .case-img, .reading .hero-art { width: fit-content; max-width: 100%; margin-inline: auto; }
.reading img { width: auto; margin: 0 auto; }