:root {
    --paper: #F2EBDA;
    --paper-shadow: #E8DFC9;
    --ink: #1A1612;
    --ink-soft: #3A3128;
    --ink-faded: #6B5D4D;
    --terracotta: #B8543D;
    --terracotta-soft: #D87B5F;
    --moss: #5B6B3C;
    --line: #BFB39A;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
    opacity: 0.7;
}

body::after {
    content: '';
    position: fixed;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(ellipse, var(--terracotta-soft) 0%, transparent 60%);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.container {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

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

/* === HEADER === */

header.site {
    padding: 40px 0 30px;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 60px;
    position: relative;
}

header.site::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 0;
    right: 30%;
    height: 1px;
    background: var(--ink);
    transform: scaleY(0.5);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    flex-direction: column;
}

.logo {
    font-family: 'Cabin Sketch', cursive;
    font-weight: 700;
    font-size: 64px;
    line-height: 0.9;
    letter-spacing: -2px;
    color: var(--ink);
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo .earth-symbol {
    width: 42px;
    height: 42px;
    display: inline-block;
    margin-left: 10px;
    color: var(--terracotta);
    vertical-align: -2px;
    transition: transform 0.4s ease;
}

.logo:hover .earth-symbol {
    transform: rotate(-12deg);
}

.tagline {
    font-family: 'Special Elite', monospace;
    font-size: 13px;
    color: var(--ink-faded);
    letter-spacing: 1px;
    text-transform: uppercase;
}

nav.site ul {
    list-style: none;
    display: flex;
    gap: 32px;
    align-items: center;
}

nav.site a {
    font-family: 'EB Garamond', serif;
    font-size: 18px;
    font-style: italic;
    color: var(--ink);
    text-decoration: none;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
}

nav.site a:hover {
    color: var(--terracotta);
}

nav.site a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--terracotta);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

nav.site a:hover::after {
    transform: scaleX(1);
}

/* === SCHEDULE BANNER === */

.schedule-banner {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    background: var(--ink);
    color: var(--paper);
    font-family: 'Special Elite', monospace;
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 48px;
    transform: rotate(-0.5deg);
    box-shadow: 4px 4px 0 var(--terracotta);
}

.schedule-banner .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--terracotta-soft);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* === HERO / LATEST COMIC === */

.hero {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 60px;
    margin-bottom: 100px;
    align-items: start;
}

.latest-comic {
    background: white;
    padding: 32px;
    border: 1px solid var(--line);
    box-shadow: 8px 8px 0 var(--ink), 8px 8px 0 1px var(--ink);
    position: relative;
}

.latest-comic::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 30px;
    width: 80px;
    height: 24px;
    background: rgba(184, 84, 61, 0.25);
    border: 1px solid rgba(184, 84, 61, 0.4);
    transform: rotate(-3deg);
}

.latest-comic::after {
    content: '';
    position: absolute;
    top: -10px;
    right: 40px;
    width: 60px;
    height: 22px;
    background: rgba(184, 84, 61, 0.25);
    border: 1px solid rgba(184, 84, 61, 0.4);
    transform: rotate(4deg);
}

.comic-placeholder {
    background: var(--paper-shadow);
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(26,22,18,0.06) 8px, rgba(26,22,18,0.06) 9px),
        repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(26,22,18,0.06) 8px, rgba(26,22,18,0.06) 9px);
    margin-bottom: 24px;
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.comic-placeholder picture,
.comic-placeholder img {
    width: 100%;
    height: auto;
    display: block;
}

.comic-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.comic-number {
    font-family: 'Special Elite', monospace;
    font-size: 12px;
    color: var(--ink-faded);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.comic-date {
    font-family: 'EB Garamond', serif;
    font-size: 14px;
    font-style: italic;
    color: var(--ink-faded);
}

.comic-title {
    font-family: 'Cabin Sketch', cursive;
    font-weight: 700;
    font-size: 42px;
    line-height: 1.05;
    margin-bottom: 16px;
    color: var(--ink);
}

.comic-title a {
    color: inherit;
    text-decoration: none;
}

.comic-title a:hover {
    color: var(--terracotta);
}

.comic-blurb {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    color: var(--ink-soft);
    font-size: 17px;
}

/* === SIDEBAR === */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.countdown {
    background: var(--ink);
    color: var(--paper);
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.countdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--terracotta);
}

.countdown-label {
    font-family: 'Special Elite', monospace;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--terracotta-soft);
    margin-bottom: 12px;
}

.countdown-title {
    font-family: 'Cabin Sketch', cursive;
    font-size: 28px;
    margin-bottom: 20px;
    line-height: 1;
}

.countdown-timer {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

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

.countdown-num {
    font-family: 'Cabin Sketch', cursive;
    font-weight: 700;
    font-size: 38px;
    line-height: 1;
    color: var(--paper);
}

.countdown-name {
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-faded);
    opacity: 0.7;
}

.countdown-date {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 14px;
    color: var(--paper);
    opacity: 0.7;
    border-top: 1px solid rgba(242, 235, 218, 0.2);
    padding-top: 12px;
}

/* === ROCK CAM === */

.rock-cam {
    background: white;
    padding: 16px;
    border: 1px solid var(--line);
    position: relative;
}

.rock-cam-feed {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #8B8276 0%, #6B6259 50%, #4A4339 100%);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rock-cam-feed picture,
.rock-cam-feed img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.6s ease-in-out;
}

.rock-cam-feed picture.fading,
.rock-cam-feed img.fading {
    opacity: 0;
}

.rock-cam-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 2;
}

.rock-cam-overlay .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4444;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.rock-cam-timestamp {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 3px 8px;
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    z-index: 2;
}

.rock-cam-caption {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--ink-faded);
    text-align: center;
    line-height: 1.4;
}

/* === SECTION HEADS === */

.section-head {
    margin-bottom: 40px;
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.section-head h2 {
    font-family: 'Cabin Sketch', cursive;
    font-weight: 700;
    font-size: 48px;
    color: var(--ink);
    line-height: 1;
}

.section-head .num {
    font-family: 'Special Elite', monospace;
    font-size: 14px;
    color: var(--terracotta);
    letter-spacing: 2px;
}

.section-head .line {
    flex: 1;
    height: 1px;
    background: var(--ink);
    opacity: 0.3;
}

/* === ARCHIVE GRID === */

.archive {
    margin-bottom: 100px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 32px;
}

.comic-card {
    background: white;
    border: 1px solid var(--line);
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
}

.comic-card:nth-child(odd) {
    transform: rotate(-0.6deg);
}

.comic-card:nth-child(even) {
    transform: rotate(0.4deg);
}

.comic-card:hover {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 6px 6px 0 var(--ink);
}

.comic-card-image {
    background: var(--paper-shadow);
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(26,22,18,0.07) 6px, rgba(26,22,18,0.07) 7px);
    margin-bottom: 14px;
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.comic-card-image picture,
.comic-card-image img {
    width: 100%;
    height: auto;
    display: block;
}

.comic-card-num {
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    color: var(--ink-faded);
    letter-spacing: 2px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.comic-card-title {
    font-family: 'Cabin Sketch', cursive;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.comic-card-date {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--ink-faded);
}

/* === ABOUT === */

.about {
    background: white;
    padding: 60px;
    border: 1px solid var(--line);
    position: relative;
    margin-bottom: 80px;
    box-shadow: 6px 6px 0 var(--ink);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about h3 {
    font-family: 'Cabin Sketch', cursive;
    font-size: 36px;
    margin-bottom: 20px;
    line-height: 1;
}

.about p {
    font-family: 'EB Garamond', serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
    margin-bottom: 16px;
}

.about p:last-child {
    margin-bottom: 0;
}

.about .signature {
    font-family: 'Cabin Sketch', cursive;
    font-style: italic;
    font-size: 24px;
    color: var(--terracotta);
    margin-top: 24px;
}

.about-illustration {
    border: 1px solid var(--line);
    overflow: hidden;
    position: relative;
}

.about-illustration img {
    width: 100%;
    height: auto;
    display: block;
}

/* === COMIC DETAIL === */

.comic-detail {
    margin-bottom: 60px;
}

.comic-detail-card {
    background: white;
    padding: 40px;
    border: 1px solid var(--line);
    box-shadow: 10px 10px 0 var(--ink);
    margin-bottom: 48px;
    position: relative;
}

.comic-detail-image {
    border: 1px solid var(--line);
    margin-bottom: 32px;
    overflow: hidden;
}

.comic-detail-image picture,
.comic-detail-image img {
    width: 100%;
    height: auto;
    display: block;
}

.comic-detail-card .comic-title {
    font-size: 52px;
    margin-bottom: 20px;
}

.comic-detail-card .comic-blurb {
    font-size: 19px;
    margin-bottom: 24px;
}

.comic-detail-description {
    font-family: 'EB Garamond', serif;
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink-soft);
}

.comic-detail-description p {
    margin-bottom: 14px;
}

.comic-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 80px;
}

.comic-nav a,
.comic-nav span {
    flex: 1;
    padding: 18px 22px;
    border: 1px solid var(--line);
    background: white;
    text-decoration: none;
    color: var(--ink);
    font-family: 'EB Garamond', serif;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comic-nav a:hover {
    box-shadow: 4px 4px 0 var(--ink);
    transform: translateY(-2px);
}

.comic-nav > span {
    opacity: 0.3;
    cursor: not-allowed;
}

.comic-nav .label {
    font-family: 'Special Elite', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--terracotta);
}

.comic-nav .title {
    font-family: 'Cabin Sketch', cursive;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.1;
}

.comic-nav .next {
    text-align: right;
}

/* === FOOTER === */

footer.site {
    border-top: 2px solid var(--ink);
    padding: 40px 0 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

footer.site p {
    font-family: 'Special Elite', monospace;
    font-size: 12px;
    color: var(--ink-faded);
    letter-spacing: 1px;
}

.social {
    display: flex;
    gap: 20px;
}

.social a {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 15px;
    color: var(--ink);
    text-decoration: none;
    transition: color 0.3s;
}

.social a:hover {
    color: var(--terracotta);
}

/* === ENTRANCE ANIMATIONS === */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

header.site { animation: fadeUp 0.6s ease-out both; }
.schedule-banner { animation: fadeUp 0.6s ease-out 0.1s both; }
.latest-comic, .comic-detail-card { animation: fadeUp 0.6s ease-out 0.2s both; }
.sidebar { animation: fadeUp 0.6s ease-out 0.3s both; }
.archive { animation: fadeUp 0.6s ease-out 0.4s both; }
.about { animation: fadeUp 0.6s ease-out 0.5s both; }
.comic-nav { animation: fadeUp 0.6s ease-out 0.4s both; }

/* === RESPONSIVE === */

@media (max-width: 900px) {
    .hero, .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .logo { font-size: 48px; }
    .container { padding: 0 24px; }
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    nav.site ul {
        gap: 20px;
        flex-wrap: wrap;
    }
    .about { padding: 40px 28px; }
    .section-head h2 { font-size: 36px; }
    .comic-detail-card .comic-title { font-size: 36px; }
    .comic-nav { flex-direction: column; }
    .comic-nav .next { text-align: left; }
}

@media (max-width: 500px) {
    .archive-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .comic-card-title { font-size: 18px; }
}
