/* ==========================================================================
   dave-steer.co.uk — homepage styles
   Dark by default, light when the visitor's system prefers it.
   ========================================================================== */

:root {
    --bg: #0d0f14;
    --bg-alt: #12151c;
    --surface: #171b24;
    --border: #262c38;
    --text: #e8ebf2;
    --muted: #9aa3b5;
    --accent: #d97757;          /* Claude orange */
    --accent-2: #8892f8;        /* PHP elephant violet */
    --tick: #6ad1a3;
    --radius: 16px;
    --shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #fbfaf7;
        --bg-alt: #f3f1ec;
        --surface: #ffffff;
        --border: #e3e0d8;
        --text: #1b1d22;
        --muted: #5d6472;
        --tick: #1e9e6a;
        --shadow: 0 30px 60px -25px rgba(30, 30, 40, .25);
    }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 17px/1.65 var(--sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #e4876a; }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn.is-disabled { opacity: .7; cursor: default; transform: none; }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
}
.logo-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font: 600 14px var(--mono);
}
.nav { display: flex; gap: 24px; }
.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}
.nav a:hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    padding: 96px 0 80px;
    overflow: hidden;
}
.hero::before {
    /* Soft glow behind the headline */
    content: "";
    position: absolute;
    inset: -40% -10% auto auto;
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
    pointer-events: none;
}
.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 56px;
    align-items: center;
}
.eyebrow {
    margin: 0 0 16px;
    font: 600 13px var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
}
h1 {
    margin: 0 0 20px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -.03em;
    font-weight: 800;
}
.grad {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lede { color: var(--muted); font-size: 19px; max-width: 34em; margin: 0 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Terminal */
.terminal {
    background: #0a0c10;
    border: 1px solid #262c38;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-width: 0;
}
.terminal-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 14px;
    border-bottom: 1px solid #1d222c;
}
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a404c; }
.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar em { margin-left: auto; font: 12px var(--mono); color: #6b7385; font-style: normal; }
.terminal-body {
    margin: 0;
    padding: 18px 20px 22px;
    min-height: 300px;
    font: 13.5px/1.7 var(--mono);
    color: #c9d1e0;
    white-space: pre-wrap;
    word-break: break-word;
}
.terminal-body .t-prompt { color: var(--tick); }
.terminal-body .t-claude { color: #d97757; }
.terminal-body .t-dim { color: #6b7385; }
.terminal-body .t-ok { color: #6ad1a3; }
.cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    vertical-align: text-bottom;
    background: #c9d1e0;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */

.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-title {
    margin: 0 0 12px;
    font-size: clamp(28px, 3.5vw, 40px);
    letter-spacing: -.02em;
    line-height: 1.15;
}
.section-sub { margin: 0 0 56px; color: var(--muted); max-width: 40em; font-size: 18px; }

/* ---------- Projects ---------- */

.project {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 56px;
    align-items: center;
    padding: 56px 0;
    border-top: 1px solid var(--border);
}
.project-flip .project-copy { order: 2; }
.project-copy { min-width: 0; }
.project-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.project-icon { width: 64px; height: 64px; border-radius: 15px; }
.project-kind {
    margin: 0;
    font: 600 12px var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.project h3 { margin: 0; font-size: 32px; letter-spacing: -.02em; line-height: 1.1; }
.project-tagline { margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.project-copy > p { color: var(--muted); }

.project-mysqldesk { --brand: #3d8fd8; }
.project-gitdesk   { --brand: #e8743b; }
.project-popdoku   { --brand: #e66fa8; }
.project-tagline { color: var(--brand); }

.ticks { list-style: none; padding: 0; margin: 20px 0; }
.ticks li { position: relative; padding-left: 28px; margin: 6px 0; font-size: 15.5px; }
.ticks li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--tick);
    font-weight: 700;
}

.chips { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font: 12.5px var(--mono);
    color: var(--muted);
}
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.project-actions .btn-primary { background: var(--brand); }
.project-actions .btn-primary:hover { filter: brightness(1.08); background: var(--brand); }

/* Screenshot frames */
.project-media { min-width: 0; }
.frame {
    position: relative;
    margin: 0 auto;
    box-shadow: var(--shadow);
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}
.frame-mac { border-radius: 12px; }
.frame-bar {
    display: flex;
    gap: 7px;
    padding: 11px 14px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}
.frame-bar span { width: 11px; height: 11px; border-radius: 50%; }
.frame-bar span:nth-child(1) { background: #ff5f57; }
.frame-bar span:nth-child(2) { background: #febc2e; }
.frame-bar span:nth-child(3) { background: #28c840; }
.frame-phone {
    width: min(300px, 80%);
    border-radius: 44px;
    border: 10px solid #1b1d22;
    background: #1b1d22;
}
.frame-phone .frame-img { border-radius: 34px; }
.frame-img { width: 100%; height: auto; transition: opacity .2s ease; }
.frame-img.is-swapping { opacity: 0; }

/* Phone gets a pink glow so the playful app stands apart from the Mac tools */
.project-popdoku .project-media { position: relative; }
.project-popdoku .project-media::before {
    content: "";
    position: absolute;
    inset: 5% 10%;
    background: radial-gradient(circle, rgba(230, 111, 168, .35), transparent 65%);
    filter: blur(20px);
    z-index: -1;
}

.shot-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.shot-tabs button {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: 500 13.5px var(--sans);
    cursor: pointer;
}
.shot-tabs button:hover { color: var(--text); }
.shot-tabs button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- PHP × Claude cards ---------- */

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
    padding: 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.card-num { font: 600 13px var(--mono); color: var(--accent); }
.card h3 { margin: 10px 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* ---------- GitHub ---------- */

.gh { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: center; }
.gh-profile { display: flex; align-items: center; gap: 28px; }
.gh-avatar { width: 120px; height: 120px; border-radius: 50%; border: 3px solid var(--border); flex-shrink: 0; }
.gh-handle { margin: 0 0 16px; font-family: var(--mono); color: var(--muted); font-size: 15px; }

.repos { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.repo a {
    display: grid;
    gap: 4px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color .15s ease;
}
.repo a:hover { border-color: var(--accent); }
.repo-name { font-family: var(--mono); font-size: 15px; color: var(--muted); }
.repo-name strong { color: var(--text); }
.repo-desc { font-size: 15px; }
.repo-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.repo-meta .sep { margin: 0 6px; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; background: #f05138; } /* Swift orange */

/* ---------- Footer ---------- */

.site-footer { padding: 48px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.footer-inner p { margin: 0; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px; }
.socials a { text-decoration: none; }
.socials a:hover { color: var(--text); }
.footnote { flex-basis: 100%; font-size: 12.5px; opacity: .8; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .hero-grid,
    .project,
    .gh { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .project-flip .project-copy { order: 0; }
    .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .wrap { padding: 0 16px; }
    .nav { gap: 14px; }
    .nav a { font-size: 14px; }
    .logo-text { display: none; }
    .hero { padding: 56px 0 48px; }
    .section { padding: 64px 0; }
    .cards { grid-template-columns: minmax(0, 1fr); }
    .gh-profile { flex-direction: column; align-items: flex-start; }
    .terminal-body { min-height: 260px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cursor { animation: none; }
    .btn:hover { transform: none; }
}
