/* The Analog Dad — one stylesheet for the journal, the entry pages and /about.
   Tokens and components carried over from the original single-file landing page. */

:root {
    --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Space Grotesk", var(--font-body);
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --text: #111;
    --muted: rgba(0, 0, 0, .58);
    --muted2: rgba(0, 0, 0, .44);
    --hairline: rgba(0, 0, 0, .10);

    --bg: #fbfaf7;
    --focus: rgba(17, 17, 17, .28);

    --button-bg: #1C1917;
    --button-text: #FFFFFF;

    /* Used sparingly — this is the Substack brand colour, the one place the
       two visual worlds meet. Links and one rule, nothing more. */
    --accent: #FF6719;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.5;
    background: var(--bg);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
}

img,
video {
    max-width: 100%;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-family: var(--font-display);
    letter-spacing: -0.025em;
    line-height: 1.05;
}

/* ---- Shared bits ---- */

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

@media (min-width: 640px) {
    .container { padding: 0 32px; }
}

/* The journal is one column. Masthead and entries share this measure so the
   left edge is a single unbroken line down the page. */
.container--narrow { max-width: 824px; }

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--divider { border-top: 1px solid var(--hairline); }

.kicker,
.subhead {
    color: var(--muted);
    line-height: 1.45;
    font-size: 18px;
}

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

/* ---- Masthead: what is left of the old hero ---- */

.masthead {
    padding: 56px 0 32px;
    border-bottom: 1px solid var(--hairline);
}

.masthead .brand {
    font-family: var(--font-mono);
    letter-spacing: .14em;
    font-size: 12px;
    color: var(--muted2);
    text-transform: uppercase;
    display: block;
    margin-bottom: 14px;
}

.masthead h1 {
    font-size: 26px;
    font-weight: 500;
    max-width: 24ch;
}

.masthead .subhead {
    font-size: 16px;
    margin-top: 10px;
    max-width: 52ch;
}

.masthead-nav {
    margin-top: 22px;
    display: flex;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: var(--muted2);
}

.masthead-nav a {
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}

.masthead-nav a:hover {
    color: var(--text);
    border-bottom-color: var(--accent);
}

@media (max-width: 640px) {
    .masthead { padding: 36px 0 24px; }
    .masthead h1 { font-size: 22px; }
}

/* Inner pages: one line, brand left, nav right. */
.masthead--compact {
    padding: 22px 0 18px;
}

.masthead--compact .container {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}

.masthead--compact .brand { margin-bottom: 0; }
.masthead--compact .masthead-nav { margin-top: 0; }

@media (max-width: 480px) {
    .masthead--compact .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Previous / next, so an entry page is not a dead end. */
.entry-nav {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.entry-nav a { color: var(--muted2); max-width: 45%; }
.entry-nav a:hover { color: var(--accent); }
.entry-nav .is-next { margin-left: auto; text-align: right; }

/* ---- The journal feed ---- */

.entry {
    padding: 56px 0;
    border-bottom: 1px solid var(--hairline);
}

.entry:first-child { padding-top: 44px; }

.entry-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: var(--muted2);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 18px;
}

.entry-meta .entry-date { color: var(--muted2); }

.entry-meta .entry-type {
    color: var(--text);
}

.entry-meta .entry-gear {
    color: var(--muted2);
}

.entry-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 18px;
}

.entry-title a:hover { color: var(--accent); }

/* Media stack: one frame per row, breathing room between them. */
.entry-media {
    display: grid;
    gap: 12px;
    margin: 4px 0 22px;
}

.entry-media figure { margin: 0; }

.entry-media img,
.entry-media video {
    width: 100%;
    height: auto;
    background: rgba(0, 0, 0, .04);
}

/* YouTube stand-in — a still and a play button until it is clicked. */
.yt {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    line-height: 0;
}

.yt img { width: 100%; height: auto; }

.yt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 66px;
    height: 46px;
    border-radius: 12px;
    background: rgba(17, 17, 17, .78);
    transition: background .15s ease;
}

/* The triangle, drawn with borders so there is no asset to load. */
.yt-play::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 52%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
}

.yt:hover .yt-play { background: var(--accent); }
.yt:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }

.entry-media iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
}

/* Contact sheet — the film roll format. Frame numbers in mono, as on a real sheet. */
.contact-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.contact-sheet figure {
    margin: 0;
    position: relative;
}

.contact-sheet img { aspect-ratio: 1; object-fit: cover; }

.contact-sheet figcaption {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .08em;
    color: var(--muted2);
    padding-top: 4px;
}

.entry-body {
    color: var(--text);
    font-size: 17px;
    line-height: 1.65;
}

.entry-body p { margin: 0 0 1em; }
.entry-body p:last-child { margin-bottom: 0; }

.entry-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

a.entry-meta:hover .entry-type { color: var(--accent); }

/* Edge-to-edge frames on a phone: this is what makes it feel like a feed. */
@media (max-width: 640px) {
    .entry { padding: 40px 0; }

    .entry-media {
        margin-left: -24px;
        margin-right: -24px;
    }

    .contact-sheet {
        margin-left: 0;
        margin-right: 0;
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

.empty-state {
    padding: 80px 0;
    text-align: center;
    color: var(--muted);
}

/* ---- Buttons and the subscribe form ---- */

.btn-primary {
    display: inline-block;
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 16px 32px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: transform .1s ease, opacity .2s ease;
}

.btn-primary:hover { opacity: .9; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }

.cta-wrap { margin: 0 0 14px; }

.cta-note {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.bottom-cta { padding-bottom: 72px; }
.bottom-cta .container { text-align: center; }
.bottom-cta h2 { margin: 0 0 10px; }
.bottom-cta .subhead { margin: 0 0 18px; }

/* ---- /about ---- */

.about-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 24px;
    display: block;
    border: 3px solid var(--hairline);
}

.about-text {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
}

.follow-list { display: grid; gap: 10px; margin-top: 10px; }

.follow-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--hairline);
    background: rgba(255, 255, 255, .45);
    color: inherit;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.follow-item:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, .18);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
}

.follow-item:focus { outline: none; }
.follow-item:focus-visible { box-shadow: 0 0 0 4px var(--focus); }

.follow-name {
    font-family: var(--font-mono);
    letter-spacing: .10em;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--muted2);
}

.follow-desc { color: var(--text); line-height: 1.35; }
.follow-arrow { color: var(--muted2); font-size: 18px; }

@media (max-width: 800px) {
    .follow-item {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }

    .follow-name { grid-column: 1 / 2; grid-row: 1 / 2; }
    .follow-desc { grid-column: 1 / 2; grid-row: 2 / 3; }
    .follow-arrow { grid-column: 2 / 3; grid-row: 1 / 3; align-self: center; }
}

@media (max-width: 640px) {
    .section { padding: 56px 0; }
}

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

footer {
    padding: 32px 0 40px;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--hairline);
}

.footer-text { font-size: 14px; margin-bottom: 8px; }
.footer-sub { font-size: 13px; color: #A8A29E; }

footer a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

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