/* ============================================================
   Stijn Adams — freelance solution architect & iOS developer
   ============================================================ */

:root {
    --paper: #ffffff;
    --ink: #181a20;
    --muted: #6b7078;
    --text: #3c4048;
    --text-2: #4a5162;
    --line: #e6e7ea;
    --soft: #f5f6fb;
    --accent: #4f46e5;
    --accent-strong: #4038c9;
    --accent-tint: #eeecfb;
    --green: #007a33;
    --itsme: #FF4612;

    --maxw: 820px;
    --sans: "Inter", -apple-system, system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    --radius: 14px;
    --transition: 200ms ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
    /* Keep content clear of the notch/rounded corners on viewport-fit=cover devices */
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 6px;
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span {
    font-size: 11.5px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 9px;
    color: #565d69;
}
.tags .tag-engagement {
    border-style: dashed;
    border-color: #cbc6f2;
    color: var(--accent);
}

/* Accessibility helpers */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 8px 0;
    z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}
#main:focus { outline: none; }

/* ---------- Header ---------- */
#site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(10px);
    backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--line);
    /* Reserve the notch/Dynamic Island area so the header clears it on viewport-fit=cover devices */
    padding-top: env(safe-area-inset-top);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.header-right { display: flex; align-items: center; gap: 32px; }
#nav { display: flex; align-items: center; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a { font-size: 14px; color: var(--muted); padding: 10px 0; transition: color var(--transition); }
.nav-links a:hover { color: var(--ink); }

.btn-hire {
    background: var(--green);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 8px;
    transition: background var(--transition);
}
.btn-hire:hover { background: #006a2c; }

.menu-toggle {
    display: none;
    width: 42px; height: 42px;
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 9px;
    cursor: pointer;
    position: relative;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
    position: absolute;
    left: 50%;
    width: 18px; height: 2px;
    background: var(--ink);
    transform: translateX(-50%);
    transition: transform var(--transition), opacity var(--transition);
}
.menu-icon { top: 50%; margin-top: -1px; }
.menu-icon::before { content: ""; top: -6px; }
.menu-icon::after { content: ""; top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateX(-50%) translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateX(-50%) translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 9px;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-outline { border: 1px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-link { color: var(--accent); font-weight: 600; padding: 12px 4px; }
.btn-link:hover { color: var(--accent-strong); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    /* Fit one screen minus the header and both safe-area insets. Use dvh, not
       svh: iOS Chrome misreports 100svh as the toolbar-hidden height, which
       overshoots the visible area; dvh tracks the current viewport. */
    min-height: calc(100vh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: calc(100dvh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0 96px;
    scroll-margin-top: 100px;
}
/* Desktop scroll cue. Mobile hides it (browser toolbars overlap the bottom) and
   shows the in-flow "View my work" button instead. */
.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--accent);
    background: var(--paper);
    border: 1px solid var(--accent);
    animation: scroll-bounce 1.8s ease-in-out infinite;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
/* Only fill on real hover devices; on touch, :hover sticks after a tap */
@media (hover: hover) {
    .scroll-cue:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
}
@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}
/* Button is the mobile-only affordance; the arrow covers desktop */
.hero-cta { display: none; }
.hero-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "photo name"
        "photo headline"
        ".     intro"
        ".     cta";
    column-gap: 44px;
    row-gap: 24px;
    align-items: start;
    justify-content: center;
}
/* Center the portrait on the whole name + role identity cluster, not the name alone */
.hero-photo { grid-area: photo; align-self: center; }
.hero-headline { grid-area: headline; margin-top: 0; }
.hero-photo img {
    width: 180px; height: 180px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--line), 0 22px 45px -22px rgba(24, 26, 32, 0.28);
}
.kicker {
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 12px;
}
.hero-name {
    grid-area: name;
    font-family: var(--sans);
    font-weight: 700;
    font-size: clamp(2.75rem, 10vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    white-space: nowrap;
    color: var(--accent);
    margin: 0;
}
.hero-title {
    font-size: clamp(1.15rem, 2.6vw, 1.45rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--ink);
    margin: 0 0 12px;
    overflow-wrap: break-word;
}
.hero-title span { white-space: nowrap; }
.hero-intro {
    grid-area: intro;
    font-size: 1.125rem;
    color: var(--text);
    max-width: 54ch;
    margin: 0;
}
.hero-intro .itsme { color: var(--itsme); font-weight: 600; }
.hero-cta { grid-area: cta; margin-top: 8px; }
.hero-cta .btn-outline { border-color: var(--accent); color: var(--accent); }
.hero-cta .btn-outline:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Sections ---------- */
.section { padding: clamp(84px, 9vw, 96px) 0; scroll-margin-top: 0; }
#work { background: var(--soft); }
#services { padding-bottom: 0; }

.work-head { margin-bottom: 24px; }
.work-head h2, .services-head h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 6px 0 6px; }
.section-subtitle { font-size: 15px; color: var(--muted); margin: 0; }

/* ---------- Work: shared card bits ---------- */
.work-image {
    width: 46px; height: 46px;
    border-radius: 11px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--soft);
}
.work-image img { width: 100%; height: 100%; object-fit: cover; }
.work-image-icon { color: var(--accent); }
.work-image-moma { background: #111; }
.work-image-moma img { width: 74%; height: auto; object-fit: contain; }

.work-info { display: flex; flex-direction: column; min-width: 0; }
.work-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.work-role { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.work-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* Heading wrappers around the disclosure buttons stay layout-neutral */
.work-card-heading,
.work-featured-heading { margin: 0; font: inherit; }

/* No-JS baseline: reveal the collapsed panels and drop the toggle affordances */
:root:not(.js) .work-detail,
:root:not(.js) .work-featured-detail { display: block; }
:root:not(.js) .work-detail-inner,
:root:not(.js) .work-featured-detail-inner { overflow: visible; }
:root:not(.js) .work-chevron { display: none; }
:root:not(.js) .work-card-header,
:root:not(.js) .work-featured-header { cursor: default; }

/* ---------- Featured card (itsme) ---------- */
.work-featured {
    background: var(--paper);
    border: 1px solid var(--accent-tint);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 16px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.work-featured:hover {
    border-color: #d8d2f6;
    box-shadow: 0 6px 22px -14px rgba(24, 26, 32, 0.35);
}
/* Remove the grey tap-highlight flash when tapping a card on touch devices */
.work-card-header,
.work-featured-header { -webkit-tap-highlight-color: transparent; }
.work-featured-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.work-featured .work-meta { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.work-featured .work-chevron { color: var(--muted); display: flex; transition: transform var(--transition); }
.work-featured.open .work-chevron { transform: rotate(180deg); }
.work-featured-detail {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 300ms ease;
}
.work-featured.open .work-featured-detail { grid-template-rows: 1fr; }
.work-featured-detail-inner { overflow: hidden; }

.work-timeline {
    list-style: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
    padding: 0;
}
.work-timeline li {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
}
.tl-period { font-size: 11.5px; color: var(--muted); }
.tl-role { font-size: 13px; font-weight: 600; }

.work-outcomes {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.work-outcomes li { display: flex; gap: 10px; font-size: 14px; color: var(--text-2); }
.work-outcomes svg { color: var(--green); flex-shrink: 0; margin-top: 3px; }

/* ---------- Work grid: expandable cards ---------- */
.work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.work-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.work-card:hover { border-color: #d4d6de; box-shadow: 0 6px 22px -14px rgba(24, 26, 32, 0.35); }
.work-card.open { border-color: var(--accent-tint); }

.work-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 20px 22px;
    background: none;
    border: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.work-card-header .work-title { font-size: 16px; }
.work-meta { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.work-chevron { color: var(--muted); display: flex; transition: transform var(--transition); }
.work-card.open .work-chevron { transform: rotate(180deg); }

.work-detail {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 300ms ease;
}
.work-card.open .work-detail { grid-template-rows: 1fr; }
.work-detail-inner { overflow: hidden; }
.work-detail-inner > * { padding: 0 22px; }
.work-detail-inner p {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-2);
}
.work-detail-inner .tags { padding-bottom: 20px; }

/* ---------- Services ---------- */
.services-head { margin-bottom: 24px; }
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.service-card::before {
    content: "";
    display: block;
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent);
    margin-bottom: 14px;
}
.service-card h3 { font-size: 16px; margin: 0 0 4px; }
.service-line { font-size: 14px; line-height: 1.5; color: var(--text-2); margin: 0; }
.service-highlight { color: var(--ink); font-weight: 600; }

/* ---------- Contact ---------- */
.contact-band {
    background: var(--soft);
    border-radius: 16px;
    padding: 48px 44px;
    text-align: center;
}
.contact-band h2 { font-size: clamp(1.5rem, 4vw, 1.75rem); letter-spacing: -0.02em; margin: 0 0 8px; }
.contact-band p { color: var(--muted); margin: 0 auto 22px; max-width: 46ch; }
.contact-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
/* Add the bottom safe-area inset so the last line clears the iOS Safari
   bottom toolbar / home indicator (content sits under it with viewport-fit=cover) */
footer { padding: 30px 0 calc(48px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .menu-toggle { display: block; }

    /* Extra 16px so the footer sits a touch higher above the iOS Safari bar */
    footer { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

    .hero-content {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "photo"
            "name"
            "headline"
            "intro"
            "cta";
        row-gap: clamp(1rem, 4vw, 1.5rem);
    }
    .hero-name { margin-bottom: 0; }
    .hero-headline { margin-top: 0; align-self: center; }
    .hero-title { margin-bottom: 0; }
    .hero-photo img { width: 92px; height: 92px; }
    #nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 16px 30px -18px rgba(24, 26, 32, 0.35);
        padding: 8px 24px 18px;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    }
    #nav.open { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-links a { display: block; padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--line); }
    .nav-links li:last-child a { border-bottom: 0; }

    .services-grid { grid-template-columns: 1fr; gap: 24px; }
    .contact-band { padding: 40px 26px; }
}

@media (max-width: 480px) {
    .header-right { gap: 14px; }
    /* Card headers: title+logo fill the row; date sits tight beneath, chevron centered on the right */
    .work-featured-header,
    .work-card-header { flex-wrap: wrap; align-items: flex-start; row-gap: 4px; position: relative; }
    .work-featured-header .work-info,
    .work-card-header .work-info { flex: 1 1 0; padding-right: 26px; }
    .work-featured .work-meta,
    .work-card .work-meta { flex-basis: 100%; margin-left: 60px; margin-top: 0; }
    .work-card .work-chevron,
    .work-featured .work-chevron { position: absolute; top: 0; bottom: 0; margin: auto 0; height: 18px; }
    .work-card .work-chevron { right: 22px; }
    .work-featured .work-chevron { right: 0; }
    .contact-actions { flex-direction: column; }
    .contact-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition-duration: 0.01ms !important; }
    .work-detail { transition: none; }
    .scroll-cue { animation: none; }
}
