@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Silkscreen&display=swap');

:root {
    --bg-primary: #0c080b;
    --bg-secondary: #160b10;
    --bg-card: #1c0e14;
    --gold: #d5a0ad;
    --gold-light: #f1d1d9;
    --orange: #a54860;
    --text: #f8f0f2;
    --text-muted: #bdaeb4;
    --border: #c78c9e26;
    --pixel-accent: #d5a0ad;
    --font-pixel: 'Silkscreen', 'Audiowide', monospace;
    --font-mono: 'IBM Plex Mono', monospace;
}
html { background: #0c080b !important; scroll-padding-top: 130px; }
body { background: radial-gradient(ellipse at 12% 12%, #7130441a, transparent 38%), radial-gradient(ellipse at 92% 45%, #712a4316, transparent 45%), #0c080b; isolation: isolate; }
::selection { color: #160c19; background: #e6b1cf; }
:focus-visible { outline: 2px solid #edc3dc; outline-offset: 5px; }
.ambient-scene { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.ambient-glow { position: absolute; width: min(68vw, 900px); height: min(68vw, 900px); border-radius: 50%; filter: blur(80px); opacity: .34; animation: atmosphere-drift 23s ease-in-out infinite alternate; }
.ambient-glow:nth-child(1) { top: -380px; left: -160px; background: radial-gradient(circle, #6e2339, transparent 68%); }
.ambient-glow:nth-child(2) { top: 12%; right: -360px; background: radial-gradient(circle, #662137, transparent 68%); animation-delay: -9s; }
.ambient-glow:nth-child(3) { bottom: -450px; left: 20%; background: radial-gradient(circle, #8d2c4522, transparent 68%); animation-delay: -16s; }
@keyframes atmosphere-drift { to { transform: translate3d(70px, 90px, 0) scale(1.14); } }

/* A viewport-fixed burgundy notch: wide at rest, compact while scrolling down. */
.header { padding: 22px 0; pointer-events: none; transition: padding 500ms cubic-bezier(.2,.8,.2,1); }
.header.scrolled { padding: 12px 0; }
.header > .container { width: min(calc(100% - 48px), 1120px); max-width: none; padding: 0; pointer-events: auto; transition: width 600ms cubic-bezier(.22,1,.36,1); }
.header-inner, .header.scrolled .header-inner {
    overflow: hidden; min-height: 70px; gap: 16px; padding: 13px 23px;
    border: 0; border-radius: 26px; background: linear-gradient(135deg, #3a0d18eb, #230c14e6);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 12px 40px #0002, inset 0 1px 0 #f2c9e12b, inset 0 -1px 0 #b790c10d;
}
.header.scrolled .header-inner { background: linear-gradient(135deg, #3a0d18f5, #230c14f0); box-shadow: 0 16px 50px #0004, inset 0 1px 0 #d38a9b30; }
.header-inner::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(220px circle at var(--nav-x, 50%) var(--nav-y, 0%), #b647641f, transparent 70%); }
.header-brand { flex-shrink: 0; gap: 9px; }
.header-logo { width: 40px; height: 40px; filter: drop-shadow(0 0 10px #edb4d31a); }
.header-title { font: 16px var(--font-pixel); color: #f0c7dd; background: none; -webkit-text-fill-color: currentColor; }
.header-link { font: 11px/1.6 var(--font-mono); padding: 10px 13px; border-radius: 12px; color: #bcaebf; }
.header-link:hover, .header-link.active { color: #f6daeb; background: #bd88b318; }
.header-cta { padding: 10px 17px; border: 0; border-radius: 12px; color: #f0ccd5; background: #a6476333; box-shadow: inset 0 1px 0 #d592a528; font: 11px var(--font-mono); }
.header-cta:hover { background: #a647634a; transform: translateY(-2px); }
.header-current { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 10px var(--font-mono); color: #dfbdc7; }
.header.is-compact:not(.is-expanded) { padding-top: 10px; }
.header.is-compact:not(.is-expanded) > .container { width: min(calc(100% - 32px), 340px); }
.header.is-compact:not(.is-expanded) .header-inner { min-height: 56px; padding: 8px 14px; border-radius: 22px; gap: 12px; }
.header.is-compact:not(.is-expanded) .header-nav,
.header.is-compact:not(.is-expanded) .header-cta,
.header.is-compact:not(.is-expanded) .nav-voxels { display: none; }
.header.is-compact:not(.is-expanded) .header-current { display: block; margin-left: auto; }
.header.is-compact:not(.is-expanded) .header-logo { width: 30px; height: 30px; }
.header.is-compact:not(.is-expanded) .header-title { font-size: 13px; }
.header.is-compact .header-menu-btn { display: flex; flex-shrink: 0; }
.header.is-compact.menu-is-open:not(.is-expanded) > .container { width: min(calc(100% - 32px), 420px); }
.header-menu-btn { border-radius: 12px; background: #d7b4d30c; color: #ead4e6; min-width: 40px; min-height: 40px; }
.nav-voxels { position: absolute; top: -8px; right: 80px; width: 50px; height: 20px; pointer-events: none; }
.nav-voxels i { position: absolute; width: 7px; height: 7px; background: #d6a4c9; box-shadow: 2px 2px 0 #624360; border-radius: 1px; opacity: .3; transition: transform 500ms, opacity 500ms; }
.nav-voxels i:nth-child(2) { left: 13px; top: 5px; width: 5px; height: 5px; }
.nav-voxels i:nth-child(3) { left: 28px; top: 2px; width: 9px; height: 9px; }
.header-inner:hover .nav-voxels i { opacity: .9; transform: translateY(-8px) rotate(-8deg); }
.header-inner:hover .nav-voxels i:nth-child(2) { transform: translateY(-14px) rotate(12deg); }
.mobile-menu { top: 107px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: min(calc(100% - 32px), 420px); max-height: calc(100dvh - 120px); overflow-y: auto; align-items: stretch; gap: 4px; padding: 14px; border-radius: 20px; background: #2a0d17f5; border: 0; box-shadow: 0 25px 65px #0007, inset 0 1px 0 #d592a533; backdrop-filter: blur(24px); pointer-events: none; }
.header.is-compact:not(.is-expanded) ~ .mobile-menu { top: 80px; }
.mobile-menu.open { pointer-events: auto; }
.mobile-menu a { font: 12px var(--font-mono); border-radius: 10px; padding: 14px 16px; }
.mobile-menu a:hover { background: #d2a1c51a; }

/* Sections share the atmosphere instead of dividing into horizontal panels. */
main { position: relative; }
.hero, .roster-section, .cta-section { border: 0; background: transparent; }
.section { padding: 85px 0; }
.hero { min-height: 740px; padding: 190px 24px 130px; overflow: hidden; }
.hero-bg { overflow: visible; background: radial-gradient(ellipse at 50% 40%, #96527a12, transparent 65%); }
.hero-content { max-width: 940px; }
.hero-title { font: 400 clamp(44px, 6.7vw, 84px)/1.2 var(--font-pixel); letter-spacing: -.065em; margin-bottom: 25px; }
.hero-title .highlight { background: linear-gradient(135deg, #f0bdc9 20%, #b86f86); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; }
.hero-subtitle { font-size: 15px; line-height: 1.9; max-width: 560px; margin: 0 auto 35px; color: #bfb0c1; }
.hero-coordinates { margin-top: 40px; font: 9px/1.8 var(--font-mono); color: #b297b0; letter-spacing: .1em; }
.section-header { margin-bottom: 42px; }
.section-label { color: #c995b5; font: 10px/1.7 var(--font-mono); letter-spacing: .18em; margin-bottom: 14px; }
.section-label::before { content: '\25AA  '; }
.section-title, .page-title, .cta-title { font-family: var(--font-pixel); font-weight: 400; letter-spacing: -.055em; line-height: 1.4; }
.section-title { font-size: clamp(23px, 3vw, 34px); }
.page-title { font-size: clamp(28px, 4.5vw, 50px); }
.page-hero, .gallery-hero { padding: 180px 0 45px; }
.page-hero::before { width: min(600px, 100%); background: radial-gradient(ellipse, #9a3c5830, transparent 65%); filter: blur(40px); opacity: .4; }
.roster-section { padding-top: 20px; padding-bottom: 35px; overflow-x: clip; }
.roster-section .section-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; text-align: left; }
.achievement-grid, .rankings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.achievement-card { position: relative; min-width: 0; padding: 38px; overflow: visible; border: 0; border-radius: 25px; background: radial-gradient(ellipse at 100% 0%, #96334a20, transparent 70%), linear-gradient(135deg, #301019, #180b10); box-shadow: inset 0 1px 0 #c7798c24, 0 18px 55px #0002; transition: transform 450ms, box-shadow 450ms; }
.achievement-card:hover { transform: translateY(-7px); border: 0; box-shadow: 0 24px 65px #0003, inset 0 1px 0 #c7798c45; }
.achievement-card::after { display: none; }
.achievement-stage { font: 9px/1.8 var(--font-mono); color: #c6a7af; letter-spacing: .13em; text-transform: uppercase; }
.achievement-card { --placement-color: #d0a3af; }
.achievement-card[data-placement="1"] { --placement-color: #e4bf70; }
.achievement-card[data-placement="2"] { --placement-color: #c6ceda; }
.achievement-card[data-placement="3"] { --placement-color: #c88d62; }
.achievement-place { color: var(--placement-color); margin: 28px 0 14px; font: 42px/1.2 var(--font-pixel); letter-spacing: -.05em; }
.achievement-card h3 { font: 500 21px/1.5 'Inter', sans-serif; color: #f2e3e7; }
.achievement-caption { margin-top: 8px; padding: 0; color: #bca2aa; font: 11px/1.8 var(--font-mono); }
.achievement-pixels { position: absolute; right: 30px; top: 33px; width: 35px; height: 35px; }
.achievement-pixels i { position: absolute; width: 9px; height: 9px; border-radius: 1px; background: #b35b70; box-shadow: 3px 3px 0 #3a111b; transition: transform 500ms; }
.achievement-pixels i:nth-child(2) { left: 14px; top: 12px; width: 13px; height: 13px; }
.achievement-pixels i:nth-child(3) { left: -3px; top: 27px; width: 6px; height: 6px; }
.achievement-card:hover .achievement-pixels i { transform: translateY(-12px) rotate(9deg); }
.achievement-card:hover .achievement-pixels i:nth-child(2) { transform: translateY(-20px) rotate(-7deg); }
.is-archive .achievement-place { font-size: 29px; margin-top: 18px; }
.is-archive { padding: 30px 38px; }
.ranking-link { display: inline-flex; gap: 10px; margin-top: 25px; color: #d4a0ae; font: 11px var(--font-mono); }
.rankings-toolbar h3, .rankings-count { font-family: var(--font-mono); font-size: 12px; }
.rankings-toolbar { margin-bottom: 30px; }
.btn { border-radius: 13px; font: 11px/1.7 var(--font-mono); min-height: 48px; justify-content: center; transition: transform 250ms, box-shadow 250ms, background 250ms; }
.btn-primary { color: #211021; border: 0; background: linear-gradient(135deg, #e4abb9, #b95b74); box-shadow: 0 5px 22px #bf85b21a, inset 0 1px 0 #fff5; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 32px #bf85b230; }
.btn-secondary { color: #e8cfe2; border: 0; background: #cba3c112; box-shadow: inset 0 1px 0 #e5b1d722; }
.btn-secondary:hover { background: #d6a5c524; }
.cta-section { padding: 105px 20px; position: relative; overflow: hidden; }
.cta-section::before { background: radial-gradient(ellipse, #8f4f8130, transparent 65%); height: 100%; top: 0; border: 0; }
.cta-section > .container { position: relative; z-index: 1; }
.cta-title { font-size: clamp(22px, 3vw, 32px); max-width: 750px; margin-inline: auto; margin-bottom: 20px; }
.pixel-field { position: absolute; inset: 0; opacity: .11; pointer-events: none; background: radial-gradient(#b981a7 2px, transparent 2px); background-size: 24px 24px; mask-image: radial-gradient(ellipse at 50% 70%, black, transparent 65%); }
footer { border: 0 !important; background: transparent !important; margin-top: 35px !important; }
footer p, .footer-bottom { border: 0 !important; }
footer .container > div > div > span { color: #d0a6c3 !important; }
footer a[target='_blank'] { color: #d6b0cc !important; background: #b581a011 !important; border: 0 !important; border-radius: 12px !important; }
.back-to-top { border-radius: 13px; color: #e7bdd9; background: #342338; border: 0; box-shadow: 0 8px 25px #0005; }
.writeup-card, .resource-card, .gallery-card-centered { border-radius: 20px; border-color: transparent; background: linear-gradient(135deg, #31192380, #1c1015aa); box-shadow: inset 0 1px 0 #e5b1d71f; }
.writeup-card { background: linear-gradient(145deg, #25151c, #170f14); box-shadow: inset 0 1px 0 #c49aa814; }
.writeup-card::before { border-radius: 20px; background: linear-gradient(135deg, #b7819426, #b7819408, #b781941a); padding: 1px; }
.writeup-card:hover, .writeup-card:focus-visible { transform: translateY(-6px); box-shadow: inset 0 1px 0 #c49aa824, 0 18px 40px #0003; }
.writeup-card-glow { background: radial-gradient(circle at 70% 30%, #85425912, transparent 45%); }
.writeup-card:hover .writeup-card-title { background: none; color: #ead4dc; -webkit-text-fill-color: currentColor; }
.writeup-card-ctf, .writeup-card-link { color: #c4a0ad; }
.writeup-card-date { color: #a2919a; }
.writeup-card-title, .resource-content, .resource-content h4, .gallery-title { overflow-wrap: anywhere; }
.resource-content { min-width: 0; }
.category-pill { border: 0; background: #cba3c10b; }
.category-pill.active { background: #a8466427; color: #f0c5df; }
.search-input, .filter-select { border: 0; border-radius: 12px; background: #cba3c10c; }
.writeup-badge.hard { color: #d3a3b3; background: #c4879b18; border-color: #c4879b26; }
.writeup-badge.medium { color: #c6b2a1; background: #b49b7b14; border-color: #b49b7b26; }
.writeup-badge.easy { color: #beb2b7; background: #b6a5ad12; border-color: #b6a5ad24; }
.writeup-badge.category { color: #bcadb6; background: #b6a5ad0d; border-color: #b6a5ad1a; }
.writeup-card-footer, .gallery-meta { border: 0; }
.gallery-image-overlay { pointer-events: none; }
.gallery-image-wrapper { display: block; padding: 0; border: 0; }
.gallery-title { font-family: 'Inter', sans-serif; font-weight: 500; }
.gallery-meta-item svg { color: #d5a0ad; }
.gallery-badge { color: #e6bdd6; background: #362136bd; border: 0; }
.gallery-grid-layout { padding-bottom: 30px; }
.about-section { margin-bottom: 38px; padding: 30px; border-radius: 20px; background: linear-gradient(135deg, #31192355, transparent); }
.about-section h2 { color: #dbb0ce; font-family: var(--font-mono); font-size: 18px; }
.writeup-hero { padding-top: 180px; }
.writeup-content { overflow-wrap: anywhere; }
.writeup-content pre { max-width: 100%; overflow-x: auto; }
.writeup-header { padding-top: 160px; }
.writeup-title { overflow-wrap: anywhere; }
.code-block-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 25px; font: 11px var(--font-mono); color: #c9a9c1; }
.code-block-copy { padding: 8px 12px; border: 0; border-radius: 8px; background: #bd86ad22; color: #edc3dc; cursor: pointer; }
.writeup-content a, .back-btn:hover, .not-found h1 { color: #e2b3d0; }

@media (max-width: 1100px) { .header-link { padding-inline: 10px; font-size: 10px; } }
@media (max-width: 640px) {
    .header { padding-top: 14px; }
    .header > .container { width: calc(100% - 32px); padding: 0; }
    .header-inner, .header.scrolled .header-inner { min-height: 66px; padding: 10px 14px; gap: 10px; border-radius: 19px; }
    .header-title { font-size: 14px; }
    .header-cta { padding: 10px 12px; font-size: 10px; }
    .nav-voxels { right: 125px; }
    .mobile-menu { top: 94px; left: 50%; right: auto; }
    .hero { min-height: 690px; padding: 170px 22px 100px; }
    .hero-title { font-size: clamp(35px, 8vw, 50px); }
    .hero-subtitle { font-size: 14px; }
    .hero-coordinates { font-size: 8px; letter-spacing: .02em; }
    .section { padding: 55px 0; }
    .roster-section { padding-top: 0; padding-bottom: 10px; }
    .roster-section .section-header { display: block; }
    .achievement-grid, .rankings-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .achievement-card { padding: 29px; }
    .achievement-card h3 { font-size: 19px; }
    .achievement-stage { max-width: calc(100% - 34px); display: block; font-size: 8px; }
    .achievement-pixels { right: 22px; top: 26px; }
    .page-hero, .gallery-hero { padding: 150px 0 30px; }
    .page-title { font-size: clamp(25px, 7.5vw, 34px); }
    .section-title { font-size: clamp(22px, 6vw, 28px); }
    .cta-section { padding: 85px 16px; }
    .gallery-info { padding: 25px 22px; }
    .gallery-image-overlay { padding: 14px; }
    .gallery-badge { font: 9px var(--font-mono); padding: 8px 10px; }
    .gallery-meta { gap: 14px; }
    .about-section { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
