/* Sam Houghton: personal site, branded like a security product */

:root {
    --canvas:  #f4f5f7;
    --white:   #ffffff;
    --ink:     #0b1020;
    --ink-2:   #151b2e;
    --body:    #3d4558;
    --muted:   #6b7387;
    --line:    #dde1e8;
    --signal:  #ff5a1f;
    --signal-2:#e64a12;

    --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --wrap: 76rem;
    --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--signal); color: #fff; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

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

.skip {
    position: absolute; left: 1rem; top: -3rem; z-index: 100;
    background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

/* Headline face: Archivo, widened */
h1, h2, .product-name, .stats dd, .brand span {
    font-stretch: 118%;
    font-variation-settings: "wdth" 118;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0 1.4rem;
    border-radius: 8px;
    font-weight: 650;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { min-height: 2.5rem; padding: 0 1rem; font-size: .95rem; }
.btn-signal { background: var(--signal); color: #fff; }
.btn-signal:hover { background: var(--signal-2); }
.btn-ghost { border-color: #c3c9d4; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost-dark { border-color: #2c3550; color: #e6e9f0; }
.btn-ghost-dark:hover { border-color: #e6e9f0; }

/* Nav */
.nav {
    position: sticky; top: 0; z-index: 30;
    background: rgba(244, 245, 247, .88);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-row { display: flex; align-items: center; gap: 2rem; height: 4.25rem; }
.btn, .brand { white-space: nowrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-mark { width: 2rem; height: 2rem; }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { fill: none; stroke: var(--signal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nav-row nav { margin-left: auto; }
.nav-links { display: flex; gap: .25rem; }
.nav-links a { display: block; padding: .5rem .8rem; color: var(--body); text-decoration: none; font-weight: 550; border-radius: 6px; }
.nav-links a:hover { color: var(--ink); background: rgba(11, 16, 32, .05); }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 0; overflow: hidden; }
.hero-copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2rem clamp(2.5rem, 5vw, 5rem);
    align-items: end;
}
.hero-role { color: var(--signal-2); font-weight: 650; margin-bottom: 1.25rem; }
.hero h1 {
    font-size: clamp(2.75rem, 5.6vw, 5.25rem);
    line-height: .95;
    letter-spacing: -.04em;
    font-weight: 850;
}
.hero h1 span { display: block; white-space: nowrap; }
.hero-lede {
    max-width: 34rem;
    font-size: clamp(1.075rem, 1.5vw, 1.25rem);
    color: var(--body);
}
.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* The lifecycle rail: the brand's signature line */
.rail {
    --progress: 1;
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    margin-top: clamp(3rem, 6vw, 4.5rem);
    padding-top: 1.4rem;
    font-family: var(--mono);
    font-size: .82rem;
    color: var(--muted);
}
.rail::before, .rail::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: var(--line);
}
.rail::after {
    background: var(--signal);
    transform-origin: left;
    transform: scaleX(var(--progress));
}
.rail li { position: relative; }
.rail li::before {
    content: "";
    position: absolute;
    top: calc(-1.4rem - 5px);
    left: 0;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--canvas);
    border: 2px solid var(--signal);
    z-index: 1;
}
.rail li:last-child { text-align: right; }
.rail li:last-child::before { left: auto; right: 0; background: var(--signal); }

.js .rail::after { animation: sweep 1.6s cubic-bezier(.6, 0, .2, 1) .3s both; }
@keyframes sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Hero screenshots */
.hero-shots {
    position: relative;
    margin-top: clamp(2rem, 4vw, 3rem);
    padding-top: clamp(2rem, 6vw, 5rem);
    margin-bottom: -1px;
}
.frame {
    background: #0d0f14;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(11, 16, 32, .1), 0 24px 60px -24px rgba(11, 16, 32, .45);
}
.frame-bar {
    display: flex; align-items: center; gap: .4rem;
    height: 2.1rem; padding: 0 .9rem;
    background: #1b2030;
    font-family: var(--mono); font-size: .72rem; color: #8892a8;
}
.frame-bar i { width: .6rem; height: .6rem; border-radius: 50%; background: #3a4258; }
.frame-bar span { margin-left: .6rem; }
.frame-front { position: relative; z-index: 2; width: 84%; border-radius: 12px 12px 0 0; }
.frame-back {
    position: absolute;
    top: 0; right: 0;
    width: 58%;
    z-index: 1;
    opacity: .95;
}

/* Proof bar */
.proof { background: var(--ink); color: #e6e9f0; padding: 2.25rem 0; position: relative; z-index: 3; }
.proof-row { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem 4rem; align-items: center; }
.proof-orgs p { font-size: .85rem; color: #8892a8; }
.proof-orgs ul { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin-top: .3rem; font-weight: 700; font-size: 1.1rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; border-left: 2px solid var(--signal); padding-left: 1rem; }
.stats dt { font-size: .85rem; color: #a3abbf; line-height: 1.35; margin-top: .3rem; }
.stats dd { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }

/* Sections */
.section, .work { padding: clamp(4.5rem, 10vw, 7.5rem) 0; }
.section h2, .work h2, .contact h2 {
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.04;
    letter-spacing: -.03em;
    font-weight: 850;
}
.section-lede { margin-top: .9rem; color: var(--body); font-size: 1.15rem; max-width: 40rem; }

/* Approach */
.approach { margin-top: 3rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.approach article {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.75rem;
}
.phase { display: flex; flex-wrap: wrap; gap: .4rem; font-family: var(--mono); font-size: .78rem; }
.phase span { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem; border-radius: 99px; background: #fff1eb; color: var(--signal-2); }
.phase span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.approach h3 { margin-top: 1.25rem; font-size: 1.4rem; letter-spacing: -.015em; }
.approach p:not(.phase) { margin-top: .6rem; color: var(--body); }

/* Work */
.work { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.product {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    margin-top: clamp(4rem, 8vw, 6.5rem);
}
.product:nth-of-type(even) .product-copy { order: 2; }
.product h3 { font-size: 1.15rem; font-weight: 600; color: var(--body); line-height: 1.35; }
.product-name {
    display: block;
    font-size: clamp(2rem, 3.6vw, 2.75rem);
    font-weight: 850;
    letter-spacing: -.03em;
    color: var(--ink);
    line-height: 1.05;
    margin-bottom: .4rem;
}
.product-copy > p:not(.stack):not(.links) { margin-top: 1.1rem; color: var(--body); }
.points { margin-top: 1.1rem; display: grid; gap: .55rem; }
.points li { position: relative; padding-left: 1.5rem; color: var(--body); }
.points li::before {
    content: "";
    position: absolute; left: 0; top: .55em;
    width: .7rem; height: .7rem;
    border: 2px solid var(--signal);
    border-radius: 50%;
}
.stack { margin-top: 1.25rem; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.links { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.links a {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--signal);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}
.links a:hover { color: var(--signal-2); }

.duo { position: relative; padding-bottom: 3.5rem; }
.duo .frame { width: 88%; }
.led {
    position: absolute;
    right: 0; bottom: 0;
    width: 46%;
    background: #000;
    padding: .5rem;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 20px 40px -16px rgba(11, 16, 32, .6);
}
.led img { width: 100%; image-rendering: pixelated; border-radius: 4px; }

.freelance {
    margin-top: clamp(4rem, 8vw, 6rem);
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 12rem 1fr;
    gap: 1rem 2rem;
}
.freelance h3 { font-size: 1.15rem; }
.freelance ul { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.freelance a { font-weight: 700; text-decoration-color: var(--signal); text-underline-offset: 4px; }
.freelance span { display: block; color: var(--body); font-size: .97rem; margin-top: .2rem; }

/* Experience */
.roles { margin-top: 2.5rem; border-top: 1px solid var(--line); }
.roles > li {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 2rem;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--line);
}
.when { font-family: var(--mono); font-size: .85rem; color: var(--muted); padding-top: .3rem; }
.roles h3 { font-size: 1.3rem; letter-spacing: -.015em; }
.org { color: var(--signal-2); font-weight: 600; }
.roles p:not(.when):not(.org) { margin-top: .5rem; color: var(--body); max-width: 46rem; }
.roles a { text-decoration-color: var(--signal); text-underline-offset: 3px; }

.toolkit { margin-top: 3rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.toolkit h3 { font-size: 1rem; }
.toolkit p { margin-top: .35rem; color: var(--body); font-size: .97rem; }

/* Contact */
.contact { background: var(--ink); color: #e6e9f0; padding: clamp(4.5rem, 10vw, 7rem) 0; }
.contact p { margin-top: 1rem; color: #a3abbf; font-size: 1.15rem; max-width: 36rem; }
.contact-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }

.foot { background: var(--ink); color: #6b7387; border-top: 1px solid #1f2740; padding: 1.5rem 0; font-size: .9rem; }
.foot-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 1000px) {
    .hero-copy { grid-template-columns: minmax(0, 1fr); }
    .proof-row { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .approach { grid-template-columns: 1fr; }
    .product { grid-template-columns: minmax(0, 1fr); }
    .product:nth-of-type(even) .product-copy { order: 0; }
    .freelance { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .nav-links { display: none; }
    .nav-row .btn { margin-left: auto; }
    .hero h1 { font-size: clamp(2.4rem, 12vw, 3.6rem); }
    .rail { grid-template-columns: repeat(3, 1fr); row-gap: .35rem; font-size: .78rem; }
    .rail li:nth-child(3n+2) { text-align: center; }
    .rail li:nth-child(3n) { text-align: right; }
    .rail li::before { display: none; }
    .frame-front { width: 100%; }
    .frame-back { display: none; }
    .hero-shots { padding-top: 0; }
    .freelance ul { grid-template-columns: 1fr; }
    .roles > li { grid-template-columns: 1fr; gap: .25rem; }
    .toolkit { grid-template-columns: 1fr; gap: 1.25rem; }
    .duo .frame { width: 100%; }
    .led { position: relative; width: 70%; margin: -2rem 0 0 auto; }
    .duo { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .rail::after { animation: none; }
}
