/* Navigation */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-tight);
    padding-bottom: var(--space-tight);
}

.nav-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: var(--text-brand);
    color: var(--color-text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-brand-logo {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-component);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-family: var(--font-body);
    color: var(--color-text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease-out;
}

.nav-link:hover {
    color: var(--color-text-primary);
    text-decoration: none;
}

.nav-link-active {
    color: var(--color-text-primary);
    border-bottom: 2px solid var(--color-accent);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 101;
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text-primary);
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        inset: 0;
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-component);
        background-color: var(--color-bg-primary);
        z-index: 100;
    }

    .nav-open .nav-links {
        display: flex;
    }

    .nav-hamburger {
        display: flex;
    }
}

/* Hero */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(var(--space-hero-top) - var(--space-hero-line-shift));
    overflow: hidden;
}

.hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero h1 {
    font-size: var(--text-hero);
}

.hero-headline-box {
    border: 1px solid var(--color-accent);
    border-radius: 12px;
    padding: var(--space-component);
    margin-bottom: var(--space-hero-gap);
    box-shadow: 0 0 24px var(--color-accent-glow-outer), 0 0 8px var(--color-accent-glow-inner);
    position: relative;
}

.hero-sub {
    font-size: var(--text-hero-sub);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-hero-note-gap);
}

.hero-trust-note {
    font-size: var(--text-note-large);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-hero-note-gap);
}

.hero-scroll-indicator {
    position: absolute;
    left: 50%;
    bottom: calc(var(--space-component) + var(--space-hero-line-shift) + var(--space-tight));
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

.hero-scroll-indicator.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-scroll-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.hero-scroll-icon svg {
    position: relative;
    z-index: 1;
    color: var(--color-accent);
}

.hero-scroll-label {
    font-family: var(--font-heading);
    font-size: var(--text-small);
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    /* On short/narrow viewports the hero's content (headline, sub, trust note, button) can be
       taller than min-height: 100vh, so the min-height stops setting the section's actual height
       and the gap it would otherwise leave below the button disappears - the divider ends up flush
       against the button. This explicit padding guarantees a gap regardless of content height. */
    .hero {
        padding-bottom: var(--space-component);
    }
}

/* Section header */

.section-header {
    text-align: center;
    margin-bottom: var(--space-component);
}

.section-header .section-label {
    text-align: center;
}

/* The Problem */

.section-problem {
    padding: var(--space-section) 0;
    text-align: center;
}

.section-problem p {
    max-width: 60ch;
    margin: 0 auto;
    font-size: var(--text-problem);
}

/* Reusable visually-separated line within body copy - a block-level break with a clear gap above it, used wherever a sentence needs to read as a deliberate pause rather than a plain line break */

.copy-break {
    display: block;
    margin-top: var(--space-component);
}

/* What We Build */

.section-build {
    padding: var(--space-section) 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-component);
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

.card-grid .reveal-watch,
.portfolio-grid .reveal-watch {
    height: 100%;
}

.card-grid .reveal-watch .card,
.portfolio-grid .reveal-watch .card {
    height: 100%;
}

/* Portfolio Teaser */

.section-portfolio {
    padding: var(--space-section) 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-component);
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

.portfolio-client {
    color: var(--color-text-secondary);
    font-size: var(--text-small);
    margin-bottom: var(--space-tight);
}

/* Inline client-name link within secondary/muted text (portfolio-client, testimonial-attribution) - inherits the surrounding grey rather than the sitewide amber link colour, so it reads as a link without clashing with the muted text it sits in */

.client-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 2px;
}

.client-link:hover,
.client-link:focus-visible {
    color: var(--color-accent);
    text-decoration-color: currentColor;
}

.client-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.portfolio-link {
    display: inline-block;
    margin-top: var(--space-tight);
    color: var(--color-accent);
}

.portfolio-cta {
    text-align: center;
    margin-top: var(--space-component);
}

/* How It Works */

.section-process {
    padding: var(--space-section) 0;
}

.steps {
    display: flex;
    align-items: stretch;
    gap: var(--space-component);
}

@media (max-width: 768px) {
    .steps {
        flex-direction: column;
    }
}

.steps .reveal-watch {
    flex: 1;
}

.step-divider {
    width: 1px;
    align-self: stretch;
    background-color: var(--color-border);
}

@media (max-width: 768px) {
    .step-divider {
        display: none;
    }
}

.step {
    text-align: center;
}

.step-number {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--color-accent);
    font-size: var(--text-h1);
    line-height: 1;
    margin-bottom: var(--space-tight);
}

.step-text {
    font-size: var(--text-step);
}

/* Testimonial quote component - italic quote plus attribution, reused on the homepage carousel and on portfolio project cards */

.testimonial-quote {
    max-width: 65ch;
}

.testimonial-quote p {
    font-size: var(--text-testimonial);
    font-style: italic;
}

.testimonial-attribution {
    display: block;
    font-style: normal;
    color: var(--color-text-secondary);
    font-size: var(--text-small);
    margin-top: var(--space-tight);
}

/* Homepage testimonial carousel */

.section-testimonial {
    padding: var(--space-section) 0;
}

.testimonial-inner {
    text-align: center;
}

.testimonial-inner .testimonial-quote {
    margin: 0 auto;
}

.testimonial-carousel {
    display: grid;
}

.testimonial-slide {
    grid-area: 1 / 1;
    display: block;
    color: inherit;
    text-decoration: none;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    pointer-events: none;
}

.testimonial-slide:hover {
    text-decoration: none;
}

.testimonial-slide.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.testimonial-slide.is-exit {
    opacity: 0;
    transform: translateX(-40px);
}

.testimonial-slide.no-transition {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .testimonial-slide {
        transform: none;
        transition: opacity 0.6s ease-out;
    }
}

/* Footer CTA */

.section-cta {
    text-align: center;
    background-color: var(--color-bg-secondary);
    padding: var(--space-section) 0;
}

.section-cta p {
    color: var(--color-text-secondary);
    margin-top: var(--space-tight);
    margin-bottom: var(--space-component);
}

.cta-sub {
    font-size: var(--text-h2);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-component);
}

/* Buttons */

.btn-primary {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-text-inverted);
    font-family: var(--font-heading);
    font-weight: 700;
    padding: var(--space-tight) var(--space-component);
    border-radius: var(--border-radius);
    border: none;
    text-decoration: none;
    transition: background-color 0.2s ease-out;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    text-decoration: none;
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-weight: 700;
    padding: var(--space-tight) var(--space-component);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-accent);
    text-decoration: none;
    transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.btn-secondary:hover {
    background-color: var(--color-accent);
    color: var(--color-text-inverted);
    text-decoration: none;
}

/* Cards */

.card {
    background-color: var(--color-bg-secondary);
    border-radius: var(--border-radius-large);
    border: 1px solid var(--color-border);
    padding: var(--space-component);
}

.card h3 {
    min-height: calc(1.15em * 2);
    display: flex;
    align-items: flex-start;
}

.card-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-tight) 0;
}

.card-accent {
    border-left: 3px solid var(--color-accent);
}

.card-accent-narrow {
    max-width: calc(65ch * 1.25); /* +25% on the About page's Who I Am / How I Work cards, the only current users of this class */
}

/* Section labels */

.section-label {
    display: block;
    color: var(--color-accent);
    font-size: var(--text-label);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-component);
}

/* Footer */

.footer {
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-tight);
    padding-bottom: var(--space-tight);
}

.footer-copy {
    color: var(--color-text-secondary);
    font-size: var(--text-small);
}

.footer-link {
    color: var(--color-text-secondary);
    font-size: var(--text-small);
    text-decoration: none;
}

.footer-link:hover {
    color: var(--color-text-primary);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--space-component);
}

.footer-social-link {
    display: flex;
    align-items: center;
}

.footer-social-link svg {
    width: 1.35em;
    height: 1.35em;
    fill: currentColor;
}

.footer-divider {
    color: var(--color-border);
    font-size: var(--text-small);
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        gap: calc(var(--space-tight) / 2);
        text-align: center;
    }

    .footer-links {
        gap: var(--space-component);
    }
}

/* Section dividers - Cylon scanner effect */

.section-divider {
    position: relative;
    width: 100%;
    height: 1px;
    background-color: var(--color-border);
    overflow: hidden;
}

.divider-scanner {
    position: absolute;
    top: 0;
    left: -20%;
    width: 20%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--color-accent) 50%,
        transparent 100%
    );
    box-shadow: 0 0 12px 4px var(--color-accent-glow-scanner);
    animation: cylon-scan 4s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

@keyframes cylon-scan {
    0% { left: -20%; }
    50% { left: 120%; }
    100% { left: -20%; }
}

/* Contact page */

.contact-page-intro-wrap {
    padding: calc(var(--space-component) * 2) var(--space-tight);
}

.contact-page-intro-wrap .contact-intro {
    margin-bottom: 0;
}

.section-contact-form {
    padding: calc(var(--space-component) * 2) 0;
}

.section-contact-notes {
    padding: calc(var(--space-component) * 2) 0 calc(var(--space-section) / 2);
}

.contact-container {
    max-width: 640px;
    margin: 0 auto;
}

.contact-intro {
    text-align: center;
    font-size: var(--text-intro-large);
    margin-bottom: var(--space-component);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: calc(var(--space-tight) / 2);
}

.contact-form label {
    font-size: var(--text-small);
    color: var(--color-text-secondary);
}

.contact-form label:not(:first-child) {
    margin-top: var(--space-component);
}

.contact-form input,
.contact-form textarea {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-small);
    padding: var(--space-tight);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-tight);
}

.contact-form .btn-primary {
    cursor: pointer;
}

.contact-note {
    font-size: var(--text-note-large);
    color: var(--color-text-secondary);
    margin-top: var(--space-tight);
}

/* About page */

.about-intro-wrap {
    padding: calc(var(--space-component) * 2) var(--space-tight);
}

.about-intro-wrap .contact-intro {
    margin-bottom: 0;
}

.section-who-i-am,
.section-how-i-work {
    padding: var(--space-section) 0;
}

.section-who-i-am h2,
.section-how-i-work h2 {
    margin-bottom: var(--space-component);
}

.section-who-i-am .card p,
.section-how-i-work .card p {
    max-width: 65ch;
    font-size: var(--text-detail);
    text-align: left;
}

.section-who-i-am .card p + p {
    margin-top: var(--space-tight);
}

.section-how-i-work .container {
    text-align: right;
}

.section-how-i-work .card-accent-narrow {
    margin-left: auto;
}

.section-trust {
    padding: var(--space-section) 0;
}

.section-trust .section-header h2 {
    display: inline-block;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-component);
    max-width: var(--trust-grid-width, 100%);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .trust-grid {
        grid-template-columns: 1fr;
    }
}

.trust-grid .reveal-watch {
    height: 100%;
}

.trust-grid .reveal-watch .card {
    height: 100%;
}

/* Portfolio page */

.portfolio-intro-wrap {
    padding: calc(var(--space-component) * 2) var(--space-tight);
}

.portfolio-intro-wrap .contact-intro {
    margin-bottom: 0;
}

/* Equal gap above and below the divider under the portfolio intro line - matches the intro wrap's own bottom padding so text-to-divider and divider-to-first-card are the same distance */

.portfolio-intro-divider {
    margin-bottom: calc(var(--space-component) * 2);
}

.section-portfolio-projects {
    padding: var(--space-section) 0;
}

.section-portfolio-projects-first {
    padding-top: 0;
}

.portfolio-projects {
    display: flex;
    flex-direction: column;
    gap: var(--space-section);
}

.portfolio-project {
    display: flex;
    align-items: center;
    gap: var(--space-component);
    scroll-margin-top: var(--nav-height);
}

.portfolio-project-reverse {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    .portfolio-project {
        flex-direction: column;
    }

    /* Title, meta, and written content should read before the screenshot/diagram on mobile,
       rather than a visitor scrolling past an image before knowing what it's showing. Reordered
       visually only (order affects paint order, not the DOM), so desktop layout, DOM order,
       reveal-watch's querySelector lookup, and the diagram's arrow draw-in animation are untouched. */
    .portfolio-project-body {
        order: 1;
    }

    .portfolio-project-media {
        order: 2;
    }
}

.portfolio-project-media {
    flex: 1;
    align-self: stretch;
    min-height: 240px;
    background-color: var(--color-bg-tertiary);
    border-radius: var(--border-radius);
}

.portfolio-project-media-diagram {
    display: flex;
    flex-direction: column;
    align-self: center;
    padding: var(--space-diagram-frame) var(--space-tight);
}

.portfolio-project-media-diagram svg {
    display: block;
    width: 100%;
    height: auto;
}

.portfolio-project-media-diagram .portfolio-label {
    margin-top: 0;
}

.portfolio-label-center {
    text-align: center;
}

.portfolio-project-body {
    flex: 1;
}

.portfolio-project-body p {
    margin-bottom: var(--space-tight);
}

.portfolio-label {
    display: block;
    color: var(--color-accent);
    font-size: var(--text-small);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--space-component);
    margin-bottom: var(--space-tight);
}

.portfolio-tech {
    color: var(--color-text-secondary);
    font-size: var(--text-small);
    margin-bottom: 0;
}

/* Portfolio screenshot + lightbox trigger */

.portfolio-project-media-image {
    padding: 0;
    overflow: hidden;
}

.portfolio-screenshot {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Diagonal tile preview (replaces the single full-size trigger screenshot) */

.portfolio-project-media-tiles {
    display: flex;
    flex-direction: column;
    align-self: center;
    align-items: center;
    justify-content: center;
    gap: var(--space-tight);
    padding: var(--space-component) var(--space-tight);
    overflow: visible;
}

.portfolio-tiles-label {
    margin: 0;
    text-align: center;
}

.portfolio-tile-group {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-tight) 0;
}

.portfolio-tile {
    display: block;
    position: relative;
    width: 230px;
    height: 168px;
    padding: 0;
    border: 2px solid var(--color-border-accent);
    border-radius: var(--border-radius);
    background: none;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.4s ease-out, margin-left 0.4s ease-out;
}

.portfolio-tile-back {
    transform: rotate(-6deg);
    z-index: 1;
}

.portfolio-tile-front {
    transform: rotate(6deg);
    z-index: 2;
    margin-left: -18px;
}

.portfolio-tile-group:hover .portfolio-tile,
.portfolio-tile-group:focus-within .portfolio-tile {
    transform: rotate(0deg);
}

.portfolio-tile-group:hover .portfolio-tile-front,
.portfolio-tile-group:focus-within .portfolio-tile-front {
    margin-left: 8px;
}

.portfolio-tile:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.portfolio-tile-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    color: var(--color-text-secondary);
    font-family: var(--font-heading);
    font-size: var(--text-small);
    text-align: center;
}

.portfolio-tile-hint-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-tile {
        transition: none;
    }
}

/* Lightbox */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-component);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-out, visibility 0s linear 0.6s;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-out, visibility 0s linear 0s;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background-color: var(--color-overlay);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-component);
    max-width: 100%;
}

.lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(90vw, 100%);
    max-height: 70vh;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.lightbox-close {
    position: fixed;
    top: var(--space-component);
    right: var(--space-component);
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: var(--text-h2);
    line-height: 1;
    cursor: pointer;
    padding: var(--space-tight);
    z-index: 1;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    color: var(--color-accent);
}

.lightbox-close:focus-visible {
    outline: 2px solid var(--color-accent);
}

.lightbox-thumbs {
    display: flex;
    gap: var(--space-tight);
}

.lightbox-thumbs[hidden] {
    display: none;
}

.lightbox-thumb {
    display: block;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: none;
    cursor: pointer;
}

.lightbox-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lightbox-thumb:hover,
.lightbox-thumb:focus-visible {
    border-color: var(--color-accent-hover);
}

.lightbox-thumb.is-active {
    border-color: var(--color-accent);
}

.lightbox-thumb:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: var(--space-tight);
        right: var(--space-tight);
    }
}

/* Privacy notice page */

.section-privacy {
    padding: calc(var(--space-component) * 2) 0 var(--space-section);
}

.privacy-container {
    max-width: calc(65ch * 1.25);
    margin: 0 auto;
}

.section-privacy h3 {
    display: block;
    color: var(--color-accent);
    font-family: var(--font-body);
    font-size: var(--text-small);
    font-weight: normal;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--space-component);
    margin-bottom: var(--space-tight);
}

.section-privacy p {
    margin-bottom: var(--space-tight);
}

.privacy-link {
    display: inline-block;
    color: var(--color-text-secondary);
    font-size: var(--text-small);
    text-decoration: none;
}

.privacy-link:hover {
    color: var(--color-text-primary);
}
