/* ========================================
   George Alexander — Light editorial theme
   ======================================== */

@view-transition {
    navigation: auto;
}

:root {
    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --ink: #0E0E12;
    --ink-soft: #2A2A33;
    --muted: #5B5B66;
    --line: #E6E4DE;
    --accent: #3D5AFE;
    --accent-soft: rgba(61, 90, 254, 0.08);

    --display: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --max: 1120px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* Small mono label used above headings */
.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

/* ========================================
   Navigation
   ======================================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.25rem 5%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
}

nav.scrolled {
    background: rgba(250, 250, 247, 0.82);
    backdrop-filter: saturate(1.4) blur(16px);
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-bottom-color: var(--line);
    padding-block: 0.85rem;
}

.logo {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2.25rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    position: relative;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.25s ease;
}

.nav-links > li > a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s var(--ease);
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-links > li > a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-dropdown {
    position: relative;
}

/* Invisible bridge so the menu doesn't close while moving the mouse down */
.nav-dropdown::after {
    content: '';
    position: absolute;
    left: -20px;
    right: -20px;
    top: 100%;
    height: 18px;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 200px;
    list-style: none;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px -12px rgba(14, 14, 18, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 0.9rem;
    border-radius: 9px;
    color: var(--ink-soft);
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--bg);
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.nav-cta {
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.25s ease, transform 0.25s var(--ease);
}

.nav-cta:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-hamburger span {
    width: 22px;
    height: 1.5px;
    background: var(--ink);
    display: block;
}

/* ========================================
   Hero
   ======================================== */
.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 5.5rem 5% 5rem;
    border-block: 1px solid var(--line);
}

.connect-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin-bottom: 1.25rem;
}

/* Revealed on scroll rather than on page load */
.connect .hero-tagline,
.connect .hero-cta {
    animation: none;
}

/* Dot grid, faded towards the edges */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(14, 14, 18, 0.13) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 70% 75% at 50% 45%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 75% at 50% 45%, #000 30%, transparent 75%);
    animation: gridDrift 30s linear infinite;
}

/* Soft accent glow that slowly breathes */
.hero::after {
    content: '';
    position: absolute;
    width: 620px;
    height: 620px;
    left: 50%;
    top: 35%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(61, 90, 254, 0.13), transparent 62%);
    filter: blur(10px);
    animation: glow 9s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes gridDrift {
    to { background-position: 22px 22px; }
}

@keyframes glow {
    from { opacity: 0.55; transform: translate(-50%, -50%) scale(0.9); }
    to   { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    width: 100%;
}

.hero .eyebrow {
    animation: fadeInUp 0.9s var(--ease) both;
}

.hero-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(3.4rem, 8.5vw, 6.8rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--ink);
    margin-bottom: 1.5rem;
    min-height: 1.2em;
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.hero-title .george,
.hero-title .last-name {
    color: var(--accent);
}

.hero-title .hi-text,
.hero-title .george,
.hero-title .emoji {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s var(--ease);
}

.hero-title .emoji {
    transform-origin: 70% 80%;
    font-size: 0.8em;
}

.hero-title .emoji.waving {
    animation: wave 1.8s ease-in-out;
}

@keyframes wave {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(14deg); }
    30%  { transform: rotate(-8deg); }
    45%  { transform: rotate(14deg); }
    60%  { transform: rotate(-4deg); }
    75%  { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

/* Greeting and intro are stacked and swapped by JS */
.hero-title #greeting,
.hero-title #intro {
    display: block;
    position: absolute;
    left: 50%;
    top: 0;
    width: max-content;
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
    white-space: nowrap;
}

.hero-title #intro .im-text {
    display: inline-block;
    white-space: nowrap;
}

.hero-title #finalName {
    display: none;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    width: max-content;
}

/* Final words resolve from a soft blur */
.hero-title #finalName .first-name,
.hero-title #finalName .last-name {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px);
    filter: blur(8px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

.hero-title #finalName .last-name {
    transition-delay: 0.12s;
}

.hero-title #finalName.shown .first-name,
.hero-title #finalName.shown .last-name {
    filter: blur(0);
}

.hero-tagline {
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto 2.25rem;
    animation: fadeInUp 1s var(--ease) 0.2s both;
}

.hero-tagline span {
    color: var(--ink);
    font-weight: 500;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s var(--ease) 0.4s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.9rem 1.6rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.btn-primary {
    background: var(--ink);
    color: #fff;
    border: 1px solid var(--ink);
}

.btn-primary::after {
    content: '→';
    transition: transform 0.3s var(--ease);
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -10px rgba(61, 90, 254, 0.55);
}

.btn-primary:hover::after {
    transform: translateX(4px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-secondary:hover {
    border-color: var(--ink);
    transform: translateY(-2px);
}

/* ========================================
   Section headings
   ======================================== */
.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3.5rem;
}

.section-title,
.about-content h2,
.cta h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.section-title,
.about-content h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.9rem;
    margin-bottom: 1.25rem;
}

/* Accent rule that draws in when the heading is revealed */
.section-title::after,
.about-content h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 56px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.9s var(--ease) 0.35s;
}

.section-title::after {
    left: calc(50% - 28px);
    transform-origin: center;
}

.section-header.in .section-title::after,
.about-content h2.in::after,
html:not(.js) .section-title::after,
html:not(.js) .about-content h2::after {
    transform: scaleX(1);
}

.section-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
}

/* ========================================
   About
   ======================================== */
/* About now opens the page, so clear the fixed nav */
.about {
    padding: 8.5rem 5% 5rem;
}

.about-container {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 5rem;
    align-items: center;
}

.about-image {
    position: relative;
    width: 100%;
    max-width: 360px;
    justify-self: center;
}

/* Offset dotted frame behind the photo */
.about-image::before {
    content: '';
    position: absolute;
    inset: 18px -18px -18px 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background-image: radial-gradient(rgba(14, 14, 18, 0.12) 1px, transparent 1px);
    background-size: 14px 14px;
}

.about-image img {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: 0 30px 60px -30px rgba(14, 14, 18, 0.35);
}

.about-greeting {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.6rem, 5.5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-bottom: 1.5rem;
}

.about-greeting .accent,
.connect-title .accent {
    color: var(--accent);
}

.about-greeting .wave {
    display: inline-block;
    font-size: 0.8em;
    transform-origin: 70% 80%;
}

/* Greeting plays in on load: "Hi…", then "I'm George", then the wave */
.about-greeting .hi,
.about-greeting .accent,
.about-greeting .wave {
    display: inline-block;
    opacity: 0;
    animation: greetIn 0.9s var(--ease) both;
}

.about-greeting .hi     { animation-delay: 0.3s; }
.about-greeting .accent { animation-delay: 1.1s; }

.about-greeting .wave {
    animation: greetIn 0.9s var(--ease) 1.8s both, wave 1.8s ease-in-out 2.5s;
}

@keyframes greetIn {
    from { opacity: 0; transform: translateY(22px); filter: blur(6px); }
    to   { opacity: 1; transform: none; filter: none; }
}

.about-content p {
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.about-content strong {
    color: var(--ink);
    font-weight: 600;
}

.about-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 2rem;
}

.stat h4 {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    transition: border-color 0.3s ease, color 0.3s ease;
}

.stat:hover h4 {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========================================
   Experience logos
   ======================================== */
.experience-bar {
    padding: 4.5rem 5% 5rem;
    background: var(--surface);
    border-block: 1px solid var(--line);
}

.experience-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.experience-text {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2.5rem;
}

.experience-logos {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 2.5rem 2rem;
    width: 100%;
}

.experience-item {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.experience-item > a {
    display: flex;
}

.experience-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.experience-item:nth-child(1) { transition-delay: 0.1s; }
.experience-item:nth-child(2) { transition-delay: 0.2s; }
.experience-item:nth-child(3) { transition-delay: 0.3s; }
.experience-item:nth-child(4) { transition-delay: 0.4s; }
.experience-item:nth-child(5) { transition-delay: 0.5s; }

/* Greyscale until hovered */
.experience-logo {
    height: 120px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.65;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.experience-logo:hover {
    filter: grayscale(0);
    opacity: 1;
}

.experience-logo.sion-hill {
    height: 58px;
}

.experience-logo.tlc {
    height: 88px;
}

.experience-logo.orrick {
    height: 100px;
    /* the green "o" sits above the wordmark, so lift the image to centre the lettering */
    transform: translateY(-30%);
}

/* Trimmed logos have no built-in whitespace, so give them breathing room */
.experience-item:has(.linklaters),
.experience-item:has(.marsh),
.experience-item:has(.tlc),
.experience-item:has(.sion-hill) {
    padding: 0 1.5rem;
}

.experience-logo.linklaters {
    height: 32px;
}

/* Logos for experiences added through the admin panel (sizes set per logo) */
.experience-logo.custom {
    height: var(--logo-h, 48px);
}

.experience-logo.marsh {
    height: 36px;
}

/* ========================================
   Testimonials
   ======================================== */
.testimonials {
    padding: 7rem 5%;
}

.testimonial-grid {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.testimonial-card {
    position: relative;
    padding: 2.75rem 2rem 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: opacity 0.9s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s ease;
}

.testimonial-card::before {
    content: '“';
    position: absolute;
    top: 0.5rem;
    left: 1.6rem;
    font-family: var(--display);
    font-size: 4rem;
    line-height: 1;
    color: var(--accent);
    opacity: 0.35;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    border-color: rgba(61, 90, 254, 0.35);
    box-shadow: 0 24px 48px -28px rgba(14, 14, 18, 0.3);
}

.testimonial-hint {
    display: none;
    text-align: center;
    margin-top: 1rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.testimonial-card p {
    position: relative;
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.75;
}

/* ========================================
   CTA
   ======================================== */
.cta {
    padding: 0;
}

.cta-container {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 6.5rem 5%;
    background: var(--ink);
    color: #fff;
}

.cta-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, #000 20%, transparent 75%);
}

.cta-container::after {
    content: '';
    position: absolute;
    width: 560px;
    height: 560px;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(61, 90, 254, 0.45), transparent 65%);
    pointer-events: none;
}

.cta-container > * {
    position: relative;
    z-index: 1;
}

.cta h2 {
    margin-bottom: 1rem;
}

.cta p {
    color: rgba(255, 255, 255, 0.68);
    font-size: 1.08rem;
    max-width: 520px;
    margin: 0 auto 2.25rem;
}

.cta .btn-primary {
    background: #fff;
    color: var(--ink);
    border-color: #fff;
}

.cta .btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ========================================
   Experience pages
   ======================================== */
/* Fixed-height title panel so every experience page matches */
.xp-hero {
    position: relative;
    overflow: hidden;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6.5rem 5% 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.xp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(14, 14, 18, 0.12) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 40%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse 60% 80% at 50% 40%, #000 25%, transparent 75%);
    animation: gridDrift 30s linear infinite;
}

/* Faded photo behind the page title, slowly drifting */
.xp-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.16;
    filter: saturate(0.7);
    -webkit-mask-image: radial-gradient(ellipse 75% 90% at 50% 50%, #000 35%, transparent 85%);
    mask-image: radial-gradient(ellipse 75% 90% at 50% 50%, #000 35%, transparent 85%);
    animation: heroBgIn 1.4s var(--ease) both, heroDrift 24s ease-in-out 1.4s infinite alternate;
    pointer-events: none;
}

@keyframes heroBgIn {
    from { opacity: 0; transform: scale(1.06); }
    to   { opacity: 0.16; transform: scale(1); }
}

@keyframes heroDrift {
    to { transform: scale(1.06); }
}

.xp-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.xp-hero h1 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin-bottom: 1.1rem;
    animation: fadeInUp 0.9s var(--ease) both;
}

.xp-summary {
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    max-width: 620px;
    margin: 0 auto;
    animation: fadeInUp 0.9s var(--ease) 0.12s both;
}

/* Stats */
.xp-stats {
    max-width: var(--max);
    margin: 0 auto;
    padding: 4rem 5% 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.xp-stat {
    padding: 1.75rem 1.75rem 1.5rem;
    border-left: 2px solid var(--accent);
    background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
    border-radius: 0 14px 14px 0;
}

.xp-stat-value {
    display: block;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.4rem, 4.5vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--ink);
    margin-bottom: 0.6rem;
    font-variant-numeric: tabular-nums;
}

/* "15 min → seconds": strike through the old time, then reveal the new one */
.xp-stat-value.xp-morph {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.3em;
    row-gap: 0.1em;
}

.xp-morph .from {
    flex-basis: 100%;
    width: max-content;
    max-width: max-content;
}

.xp-morph .from {
    position: relative;
    transition: opacity 0.6s ease 0.9s, color 0.6s ease 0.9s;
}

.xp-morph .from::after {
    content: '';
    position: absolute;
    left: -4%;
    right: -4%;
    top: 55%;
    height: 0.08em;
    border-radius: 1em;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease) 0.4s;
}

.xp-morph .to-arrow,
.xp-morph .to {
    display: inline-block;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.xp-morph .to-arrow {
    font-size: 0.7em;
    color: var(--muted);
    transition-delay: 1.2s;
}

.xp-morph .to {
    color: var(--accent);
    transition-delay: 1.45s;
}

.xp-stat.in .xp-morph .from,
html:not(.js) .xp-morph .from {
    opacity: 0.35;
}

.xp-stat.in .xp-morph .from::after,
html:not(.js) .xp-morph .from::after {
    transform: scaleX(1);
}

.xp-stat.in .xp-morph .to-arrow,
.xp-stat.in .xp-morph .to,
html:not(.js) .xp-morph .to-arrow,
html:not(.js) .xp-morph .to {
    opacity: 1;
    transform: none;
}

.xp-stat-label {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Connected stats: tool -> change -> impact */
.xp-flow {
    max-width: var(--max);
    margin: 0 auto;
    padding: 4rem 5% 1rem;
}

.xp-flow-lead {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--muted);
    max-width: 860px;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--line);
    text-wrap: balance;
}

.xp-flow-lead strong {
    color: var(--ink);
    font-weight: 600;
}

.xp-flow-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.xp-step {
    position: relative;
}

/* Arrow connecting each step to the next */
.xp-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -1.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.3rem;
    text-align: center;
    font-size: 1.2rem;
    color: var(--accent);
}

.xp-step-tag {
    display: block;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

/* Highlights */
.xp-highlights {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3rem 5% 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.xp-highlights.three {
    grid-template-columns: repeat(3, 1fr);
}

.xp-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: opacity 0.9s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s ease;
}

.xp-card:hover {
    border-color: rgba(61, 90, 254, 0.35);
    box-shadow: 0 24px 48px -28px rgba(14, 14, 18, 0.3);
}

.xp-card.reveal.in:hover {
    transform: translateY(-4px);
    transition-delay: 0s;
}

.xp-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--ink);
    transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease, transform 0.5s var(--ease);
}

.xp-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.xp-card:hover .xp-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: rotate(-6deg) scale(1.05);
}

.xp-card h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.xp-card p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.xp-card a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* Side note, visually separate from the main highlights */
.xp-aside {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1rem 5% 1rem;
}

.xp-aside-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    border: 1px dashed #CFCBC2;
    border-radius: 18px;
}

.xp-aside-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.xp-aside p {
    color: var(--ink-soft);
    font-size: 0.97rem;
    line-height: 1.6;
}

.xp-aside a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* Carousel */
.xp-carousel {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3rem 5% 6rem;
}

.xp-carousel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.xp-carousel-head h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.xp-carousel-nav {
    display: flex;
    gap: 0.5rem;
}

.xp-carousel-nav button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease);
}

.xp-carousel-nav button:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    transform: scale(1.05);
}

.xp-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    cursor: grab;
}

.xp-track.static {
    justify-content: center;
    cursor: default;
}

.xp-track::-webkit-scrollbar {
    display: none;
}

.xp-track.dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.xp-slide {
    position: relative;
    flex: 0 0 auto;
    height: 440px;
    scroll-snap-align: start;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
}

.xp-slide img {
    height: 100%;
    width: auto;
    max-width: none;
    display: block;
    pointer-events: none;
    user-select: none;
    transition: transform 1.2s var(--ease);
}

/* Very wide graphics: show the whole image inside a standard-width tile */
.xp-slide.fit {
    width: 420px;
    display: grid;
    place-items: center;
    background: #fff;
}

.xp-slide.fit img {
    width: 100%;
    height: auto;
}

.xp-slide:hover img {
    transform: scale(1.04);
}

.xp-progress {
    height: 2px;
    background: var(--line);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.xp-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.4s var(--ease);
}

/* ========================================
   Footer
   ======================================== */
footer {
    padding: 4.5rem 5% 2.5rem;
    border-top: 1px solid var(--line);
    background: var(--bg);
}

.footer-container {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand p {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 0.75rem;
    max-width: 320px;
}

.footer-links h4 {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 1.1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.25s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    max-width: var(--max);
    margin: 3.5rem auto 0;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

/* ========================================
   Floating contact button (added by main.js)
   ======================================== */
.float-contact {
    position: fixed;
    right: max(1.5rem, env(safe-area-inset-right));
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.35rem 0.85rem 1.1rem;
    border-radius: 999px;
    /* Frosted glass */
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.75);
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 14px 40px -14px rgba(14, 14, 18, 0.28), 0 2px 6px rgba(14, 14, 18, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.97);
    filter: blur(4px);
    transition: opacity 1.4s var(--ease), transform 1.4s var(--ease), filter 1.4s var(--ease), visibility 1.4s, background 0.4s ease, box-shadow 0.4s ease;
}

/* A soft band of colour that flows continuously around the edge of the glass */
@property --flow {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.float-contact::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--flow),
        rgba(61, 90, 254, 0) 0deg,
        rgba(61, 90, 254, 0.85) 70deg,
        rgba(125, 211, 252, 0.9) 130deg,
        rgba(61, 90, 254, 0) 210deg,
        rgba(61, 90, 254, 0) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0;
    transition: opacity 1.6s ease 1.2s;
    animation: flowRound 5s linear infinite;
    pointer-events: none;
}

.float-contact.shown::before {
    opacity: 1;
}

@keyframes flowRound {
    to { --flow: 360deg; }
}

/* Gentle drift once it has arrived */
.float-contact.shown {
    opacity: 1;
    visibility: visible;
    transform: none;
    filter: none;
    animation: floatBob 6s ease-in-out 1.6s infinite;
}

@keyframes floatBob {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -4px; }
}

.float-contact.shown.tucked {
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.97);
    filter: blur(4px);
}

.float-contact:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 18px 44px -14px rgba(61, 90, 254, 0.35), 0 2px 6px rgba(14, 14, 18, 0.05);
    transform: translateY(-2px);
}

.float-contact::after {
    content: '→';
    color: var(--accent);
    transition: transform 0.3s var(--ease);
}

.float-contact:hover::after {
    transform: translateX(3px);
}

/* Small "online" dot with a soft pulse */
.float-contact-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22C55E;
}

.float-contact-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22C55E;
    animation: dotPulse 2s ease-out infinite;
}

@keyframes dotPulse {
    from { transform: scale(1); opacity: 0.7; }
    to   { transform: scale(2.8); opacity: 0; }
}

/* ========================================
   Scroll reveal (classes added by main.js)
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--delay, 0s);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* Cards keep their hover lift once revealed */
.testimonial-card.reveal.in:hover {
    transform: translateY(-4px);
    transition-delay: 0s;
}

/* Page-to-page fade */
::view-transition-old(root) {
    animation: vtOut 0.25s var(--ease) both;
}

::view-transition-new(root) {
    animation: vtIn 0.45s var(--ease) both;
}

@keyframes vtOut {
    to { opacity: 0; transform: translateY(-8px); }
}

@keyframes vtIn {
    from { opacity: 0; transform: translateY(12px); }
}

/* ========================================
   Tablet
   ======================================== */
@media (max-width: 1024px) {
    .experience-logos {
        flex-wrap: wrap;
        gap: 2.5rem 3rem;
    }

    .experience-logo.sion-hill {
        height: 50px;
    }

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

    .about-container {
        gap: 3.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
