:root {
    --ink: #101014;
    --paper: #F3EFE7;
    --amber: #E8A93B;
    --scrim: rgba(8, 8, 10, 0.86);
    --display: var(--gh-font-heading, "Fraunces", Georgia, serif);
    --utility: var(--gh-font-body, "Archivo", -apple-system, sans-serif);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: #ffffff;
    color: var(--ink);
    font-family: var(--utility);
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: auto; /* our JS drives the animated transitions directly */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}
html::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ---------- frame: constrains layout to a phone-width column on desktop ---------- */
.frame {
    position: relative;
    width: 100%;
    margin: 0 auto;
}
@media (min-width: 661px) {
    body { background: #ffffff; }
    .frame { max-width: 580px; }
}

/* ---------- top bar ---------- */
.site-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    pointer-events: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
    transition: transform 0.25s ease;
}
.site-bar--hidden {
    transform: translateY(-100%) translateZ(0) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
@media (min-width: 661px) {
    .site-bar { left: 50%; right: auto; width: 100%; max-width: 580px; transform: translateX(-50%); }
    .site-bar--hidden { transform: translateX(-50%) translateY(-100%) !important; }
}
.site-bar__mark {
    color: var(--paper);
    text-decoration: none;
    font-family: "Inter", var(--utility);
    font-weight: 700;
    font-size: 18px;
    pointer-events: auto;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    position: relative;
    top: -3px;
}
.people-nav-open .site-bar__mark {
    color: var(--ink);
    text-shadow: none;
}
.site-bar__tag {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amber);
    opacity: 0.9;
}

/* ---------- feed: custom transform-driven paging (one full-screen post per swipe, we control it) ---------- */
.feed {
    position: fixed;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: contain;
}
.pull-refresh-indicator {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) scale(0.7);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(243,239,231,0.35);
    border-top-color: var(--paper);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}
.feed.is-pulling-refresh .pull-refresh-indicator {
    opacity: 1;
    transform: translateX(-50%) scale(1) rotate(180deg);
}
.feed-track {
    position: relative;
    width: 100%;
    will-change: transform;
}

.feed-item {
    position: relative;
    width: 100%;
}
@media (min-width: 661px) {
    .feed { left: 50%; right: auto; width: 100%; max-width: 580px; transform: translateX(-50%); }
}

.feed-item__link {
    display: block;
    position: relative;
    height: 100%;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.feed-item__media {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #1a1a1e;
}
.feed-item__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.feed-item__media--fallback {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 32px;
    color: rgba(243,239,231,0.25);
}
.feed-item__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8,8,10,0.05) 0%, rgba(8,8,10,0.15) 45%, var(--scrim) 100%);
}

.feed-item__body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 0 20px 34px;
    z-index: 2;
}
.feed-item__eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 10px;
}
.feed-item__title {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(20px, 5.5vw, 30px);
    line-height: 1.08;
    margin: 0 0 10px;
    text-wrap: balance;
    color: var(--paper);
}
.feed-item__excerpt {
    font-size: 14.5px;
    line-height: 1.5;
    color: rgba(243,239,231,0.82);
    margin: 0 0 14px;
    max-width: 46ch;
}
.feed-item__meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: rgba(243,239,231,0.6);
}
.feed-item__meta span:not(:last-child)::after {
    content: "·";
    margin-left: 14px;
    opacity: 0.6;
}

/* ---------- signature: reel rail ---------- */
.reel-rail {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
@media (min-width: 661px) {
    .reel-rail { right: calc(50vw - 278px); }
}
.reel-rail__fill {
    width: 5px;
    height: 90px;
    background: rgba(243,239,231,0.2);
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}
.reel-rail__fill::after {
    content: "";
    position: absolute;
    left: 0; top: 0; width: 100%;
    height: 0%;
    background: var(--amber);
    transition: height 0.25s ease;
}
.reel-rail__count {
    font-family: var(--utility);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: rgba(243,239,231,0.75);
    writing-mode: vertical-rl;
}

/* ---------- single post ---------- */
.post { background: #ffffff; min-height: 100dvh; }
.post__hero {
    position: relative;
    height: 72dvh;
    min-height: 420px;
    overflow: hidden;
    background: var(--ink);
}
.post__hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post__hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(8,8,10,0.1) 0%, rgba(8,8,10,0.2) 50%, var(--ink) 100%);
}
.post__hero-body {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 0 20px 32px;
}
.post__title {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(28px, 6vw, 48px);
    line-height: 1.08;
    margin: 0 0 12px;
    color: var(--paper);
}
.post__content {
    max-width: 68ch;
    margin: 0 auto;
    padding: 40px 20px 60px;
    font-size: 17px;
    line-height: 1.7;
    color: rgba(16,16,20,0.88);
}
.post__content img { max-width: 100%; border-radius: 4px; }
.post__content a { color: var(--amber); }
.post__content .kg-width-wide {
    width: 100%;
    max-width: calc(68ch + 200px);
    margin-left: 50%;
    transform: translateX(-50%);
}
.post__content .kg-width-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
.post__content .kg-width-full img { border-radius: 0; }
.post__back {
    display: block;
    text-align: center;
    padding: 0 0 60px;
    color: rgba(16,16,20,0.55);
    text-decoration: none;
    font-size: 13px;
}

/* ---------- burger + mobile menu (adapted from People theme) ---------- */
.site-bar__right {
    display: flex;
    align-items: center;
    gap: 14px;
    pointer-events: auto;
}
.gh-burger {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    display: block;
    width: 26px;
    height: 26px;
    padding: 0;
    position: relative;
}
.gh-burger::before,
.gh-burger::after {
    content: "";
    position: absolute;
    left: 1px;
    width: 24px;
    height: 2px;
    background-color: var(--paper);
    border-radius: 2px;
    transition: transform 0.25s ease, top 0.25s ease, background-color 0.25s ease;
}
.gh-burger::before { top: 5px; }
.gh-burger::after { top: 16px; }
.people-nav-open .gh-burger::before { top: 12px; transform: rotate(45deg); background-color: var(--ink); }
.people-nav-open .gh-burger::after { top: 12px; transform: rotate(-45deg); background-color: var(--ink); }

.people-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3999998;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.people-mobile-overlay.is-visible { display: block; opacity: 1; }

.people-mobile-menu {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    max-height: 80dvh;
    overflow-y: auto;
    background: #ffffff;
    z-index: 3999999;
    display: flex;
    flex-direction: column;
    clip-path: inset(0 0 100% 0);
    pointer-events: none;
    transition: clip-path 0.28s cubic-bezier(0.4,0,0.2,1), transform 0.25s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-radius: 0 0 16px 16px;
}
.people-mobile-menu.header-collapsed {
    transform: translateY(-54px);
}
.people-mobile-menu.is-open {
    clip-path: inset(0 0 0% 0);
    pointer-events: auto;
}
.people-mobile-menu.is-closing {
    clip-path: inset(0 0 100% 0);
    pointer-events: none;
}
.people-mobile-menu__nav { padding: 54px 0 12px; }
.people-mobile-menu__footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px 24px;
}
.people-mobile-menu__footer .gh-head-button,
.people-mobile-menu__footer .gh-head-link {
    font-family: "Inter", var(--utility);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}
.people-mobile-menu__footer .gh-head-button {
    padding: 8px 16px;
    background: var(--amber);
    color: var(--ink);
    border-radius: 999px;
}
.people-mobile-nav-list { list-style: none; margin: 0; padding: 0; }
.people-mobile-nav-link {
    display: block;
    padding: 10px 24px;
    font-family: "Inter", var(--utility);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
    transition: opacity 0.15s;
}
.people-mobile-nav-link:hover { opacity: 0.75; color: var(--amber); }

.people-mobile-has-sub { position: relative; }
.people-mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: "Inter", var(--utility);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-align: left;
}
.people-mobile-nav-toggle__label,
.people-mobile-nav-toggle__link {
    font-family: "Inter", var(--utility);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}
.people-mobile-chevron {
    color: var(--ink);
    opacity: 0.4;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
}
.people-mobile-nav-item.is-open > .people-mobile-nav-toggle .people-mobile-chevron {
    transform: rotate(90deg);
}
.people-mobile-submenu { list-style: none; margin: 0; padding: 0; }
.people-mobile-submenu-item { }
.people-mobile-submenu-link {
    display: block;
    padding: 8px 24px 8px 40px;
    font-family: "Inter", var(--utility);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    opacity: 0.7;
    text-decoration: none;
    transition: opacity 0.15s, color 0.15s;
}
.people-mobile-submenu-link:hover { opacity: 1; color: var(--amber); }

.people-nav-open .site-bar { z-index: 4000000; }
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
