/* hornof.org — all styling isolated here (a future skin swap touches only this
   file). Earth-tone palette; system serif stack; no web font, no hero photo. */

:root {
    --ink: #5a3825;        /* dark brown — signature ink */
    --ink-soft: rgba(90, 56, 37, 0.6);
    --cream: #f2ebe0;      /* light earth tone (background top) */
    --tan: #cbb391;        /* warm earth tone (background bottom) */
    --card: rgba(255, 255, 255, 0.92);
    --icon-filter: none;   /* social icons: brown PNGs, untouched in light mode */
    --serif: Garamond, Baskerville, "Hoefler Text", "Times New Roman", Times, serif;
}

/* F7: dark variant — same earth family, inverted. Only colour values change; the
   whole skin stays isolated in this file. data-theme is set before paint. */
[data-theme="dark"] {
    --ink: #ece0cb;        /* warm cream ink on dark ground */
    --ink-soft: rgba(236, 224, 203, 0.6);
    --cream: #2a1d12;      /* deep roasted brown (background top) */
    --tan: #17100a;        /* near-black brown (background bottom) */
    --card: rgba(42, 29, 18, 0.95);
    /* Recolour the brown social PNGs to the cream ink so they stay legible. */
    --icon-filter: brightness(0) invert(0.88) sepia(0.25);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--cream) 0%, var(--tan) 100%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--serif);
    line-height: 1.6;
}

/* ---- Layout: fixed left sidebar + scrolling content (F5) ---- */
.layout {
    max-width: 1200px;
    margin: 0 auto;
}

.sidebar {
    padding: 2.5rem;
}

.content {
    padding: 2.5rem;
    padding-bottom: 35vh; /* room so any section can scroll under the spy line */
}

@media (min-width: 880px) {
    .layout {
        display: grid;
        grid-template-columns: minmax(300px, 42%) 1fr;
        align-items: start;
    }
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 3rem;
    }
}

/* ---- Intro (name · tagline · positioning) ---- */
.intro {
    max-width: 30rem;
}

.name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: normal;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tagline {
    margin: 1rem 0 1.25rem;
    font-size: 1.7rem;
    font-weight: normal;
}

.positioning {
    margin: 0;
    font-size: 1.1rem;
}

/* ---- Scroll-spy nav ---- */
.section-nav {
    margin: 2.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.section-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.15rem 0;
    width: max-content;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

/* Growing indicator line, Chiang-style. */
.section-nav a::before {
    content: "";
    width: 1.5rem;
    height: 1px;
    background: var(--ink-soft);
    transition: width 0.2s ease, background-color 0.2s ease;
}

.section-nav a:hover,
.section-nav a:focus-visible,
.section-nav a.active,
.section-nav a[aria-current="true"] {
    color: var(--ink);
}

.section-nav a.active::before,
.section-nav a[aria-current="true"]::before,
.section-nav a:hover::before,
.section-nav a:focus-visible::before {
    width: 2.75rem;
    background: var(--ink);
}

.section-nav a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* ---- Social row ---- */
.social {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social a {
    display: inline-flex;
    line-height: 0;
    border-radius: 4px;
}

.social img {
    width: 24px;
    height: 24px;
    filter: var(--icon-filter);
    transition: transform 0.2s ease;
}

.social a:hover img,
.social a:focus-visible img {
    transform: scale(1.2);
}

.social a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
}

/* ---- Content sections ---- */
.content section {
    min-height: 70vh;
    max-width: 42rem;
    padding: 1rem 0;
    scroll-margin-top: 1.5rem;
}

.content h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: normal;
    letter-spacing: 0.02em;
}

.content section p {
    margin: 0;
    font-size: 1.15rem;
    max-width: 34rem;
}

.content a {
    color: var(--ink);
}

/* Experience / Publications / Talks lists */
.cv,
.pubs,
.talks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv li {
    margin-bottom: 1.1rem;
    max-width: 36rem;
}

.cv-role {
    font-size: 1.1rem;
}

.cv-when {
    color: var(--ink-soft);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.cv-what {
    display: block;
    margin-top: 0.15rem;
    font-size: 1rem;
}

.pubs li,
.talks li {
    margin-bottom: 0.9rem;
    max-width: 36rem;
    font-size: 1.05rem;
}

.more {
    margin-top: 1.25rem;
    font-size: 1rem;
}

/* ---- Colophon (F8): subtle link on the one-pager + the built-with page ---- */
.colophon-link {
    margin-top: 3rem;
    max-width: 42rem;
}

.colophon-link a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.colophon-link a:hover,
.colophon-link a:focus-visible {
    color: var(--ink);
}

.colophon-link a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.colophon {
    max-width: 40rem;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

.colophon-back a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.colophon-back a:hover,
.colophon-back a:focus-visible {
    color: var(--ink);
}

.colophon h1 {
    margin: 1.5rem 0 1.5rem;
    font-size: 1.7rem;
    font-weight: normal;
}

.colophon p {
    font-size: 1.15rem;
    max-width: 34rem;
}

.colophon a {
    color: var(--ink);
}

.colophon code {
    font-family: "SF Mono", "Menlo", "Consolas", monospace;
    font-size: 0.9em;
    padding: 0.05em 0.3em;
    border-radius: 3px;
    background: rgba(90, 56, 37, 0.1);
}

[data-theme="dark"] .colophon code {
    background: rgba(236, 224, 203, 0.12);
}

.colophon-repo {
    margin-top: 2rem;
}

/* ---- Projects wall (F11) ---- */
.projects {
    max-width: 44rem;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

.projects h1 {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.7rem;
    font-weight: normal;
}

.projects-intro {
    margin: 0 0 2.5rem;
    font-size: 1.1rem;
    max-width: 34rem;
    color: var(--ink-soft);
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-card {
    padding: 1.5rem 1.6rem;
    background: var(--card);
    border: 1px solid var(--ink-soft);
    border-radius: 10px;
}

.project-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: normal;
}

.project-date {
    color: var(--ink-soft);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.project-blurb {
    margin: 0.6rem 0 0;
    font-size: 1.05rem;
}

.project-build {
    margin: 0.9rem 0 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

.project-build-label {
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.project-cost {
    display: block;
    margin-top: 0.3rem;
    font-style: italic;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.1rem;
}

.project-links a {
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--ink-soft);
    padding-bottom: 1px;
    transition: border-color 0.2s ease;
}

.project-links a:hover,
.project-links a:focus-visible {
    border-color: var(--ink);
}

.project-links a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* ---- SoundCloud (F10): click-to-load player ---- */
.soundcloud {
    margin-top: 1.75rem;
    max-width: 36rem;
}

.sc-play {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--ink-soft);
    border-radius: 6px;
    background: var(--card);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.sc-play:hover,
.sc-play:focus-visible {
    border-color: var(--ink);
    transform: translateY(-1px);
}

.sc-play:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.sc-play-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.sc-frame {
    width: 100%;
    height: 166px;
    border: 0;
    border-radius: 6px;
}

/* ---- Breton Easter egg (F9): faint fleur-de-lis → nod to Brittany ---- */
.breton {
    position: relative;
    display: inline-block;
    margin-left: 0.75rem;
}

.breton-toggle {
    padding: 0 0.2rem;
    border: none;
    background: none;
    color: var(--ink-soft);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.breton-toggle:hover,
.breton-toggle:focus-visible,
.breton-toggle[aria-expanded="true"] {
    opacity: 1;
    color: var(--ink);
}

.breton-toggle:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
    border-radius: 3px;
}

.breton-panel {
    position: absolute;
    left: 0;
    bottom: 140%;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: max-content;
    max-width: 18rem;
    padding: 0.6rem 0.85rem;
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(90, 56, 37, 0.25);
}

.breton-panel[hidden] {
    display: none; /* attribute stays authoritative over display:flex */
}

.breton-text {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--ink);
}

.breton-text span {
    font-style: normal;
    color: var(--ink-soft);
}

/* Gwenn ha Du — 9 stripes (black at top) with a white ermine canton. */
.gwenn-ha-du {
    position: relative;
    flex: none;
    width: 42px;
    height: 27px;
    border: 1px solid var(--ink-soft);
    background: repeating-linear-gradient(
        to bottom,
        #1a1a1a 0, #1a1a1a 3px,
        #fff 3px, #fff 6px
    );
}

.gwenn-ha-du::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 52%;
    height: 56%;
    background:
        radial-gradient(circle at 32% 42%, #1a1a1a 14%, transparent 15%),
        radial-gradient(circle at 68% 64%, #1a1a1a 14%, transparent 15%),
        #fff;
}

/* ---- Theme toggle (F7) — top-right corner control ---- */
.theme-toggle {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--ink-soft);
    background: var(--card);
    color: var(--ink);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    opacity: 1;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.theme-toggle-icon::before {
    content: "\263E"; /* ☾ crescent — "switch to dark" while in light mode */
}

[data-theme="dark"] .theme-toggle-icon::before {
    content: "\2600"; /* ☀ sun — "switch to light" while in dark mode */
}

/* ---- Tardis time-machine (F4) — subtle corner control ---- */
.tardis {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 10;
    display: flex;
    flex-direction: column-reverse; /* button at the corner, panel opens above it */
    align-items: flex-end;
    gap: 8px;
}

.tardis-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(90, 56, 37, 0.35);
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.tardis-toggle:hover,
.tardis-toggle:focus-visible,
.tardis-toggle[aria-expanded="true"] {
    opacity: 1;
}

.tardis-toggle:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.tardis-panel {
    list-style: none;
    margin: 0;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(90, 56, 37, 0.25);
}

.tardis-panel[hidden] {
    display: none; /* keep the attribute authoritative over display:flex */
}

.tardis-panel a {
    display: block;
    padding: 6px 16px;
    border-radius: 4px;
    color: var(--ink);
    text-decoration: none;
    text-align: right;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.tardis-panel a:hover,
.tardis-panel a:focus-visible {
    background: rgba(90, 56, 37, 0.08);
}

.tardis-panel a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

/* ---- Small screens ---- */
@media (max-width: 480px) {
    .sidebar,
    .content {
        padding: 1.75rem;
    }
    .tagline {
        font-size: 1.45rem;
    }
    .social {
        gap: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    * {
        animation: none !important;
        transition: none !important;
    }
}
