:root {
    color-scheme: dark;
    --ink: #08090c;
    --wall: #15161a;
    --wall-2: #202126;
    --paper: #e8e4d8;
    --muted: #aaa9ab;
    --blue: #00c8ff;
    --purple: #a53dff;
    --yellow: #ffd21a;
    --red: #ff4d5e;
    --line: #44444b;
    --display: Impact, "Arial Black", "Microsoft JhengHei", sans-serif;
    --body: "Microsoft JhengHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
    margin: 0;
    min-width: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--body);
    line-height: 1.65;
}
body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    content: "";
    pointer-events: none;
    background:
        radial-gradient(ellipse at 18% 20%, #8b8b8b0c 0 1px, transparent 2px),
        radial-gradient(ellipse at 75% 65%, #fff1 0 1px, transparent 2px),
        repeating-linear-gradient(169deg, transparent 0 36px, #ffffff05 37px, transparent 39px 74px),
        linear-gradient(130deg, #121318, #08090c 50%, #111016);
    background-size: 17px 19px, 23px 29px, auto, auto;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}
a { color: inherit; }
img { max-width: 100%; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    padding: 10px clamp(16px, 5vw, 72px);
    background: #090a0df2;
    border-bottom: 1px solid #ffffff24;
    backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { font: 900 29px/1 var(--display); color: var(--blue); text-shadow: 3px 2px var(--purple); }
.brand-name { font: 900 12px/1.2 var(--display); letter-spacing: 0; color: var(--paper); }
.header-controls { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.primary-nav { display: flex; align-items: center; gap: clamp(10px, 1.7vw, 24px); }
.primary-nav a {
    position: relative;
    color: #d5d3d0;
    font: 800 12px/1.2 var(--display);
    text-decoration: none;
    text-transform: uppercase;
    transition: color .18s ease;
}
.primary-nav a:hover { color: var(--yellow); }
.language-select {
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--blue);
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
}

.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(250px, .75fr);
    align-items: center;
    gap: clamp(24px, 6vw, 90px);
    min-height: min(760px, calc(100svh - 76px));
    padding: clamp(55px, 8vw, 112px) clamp(20px, 9vw, 140px);
    overflow: hidden;
    background:
        linear-gradient(112deg, #08090cf5 12%, #09090cd8 48%, #100c19ad 100%),
        repeating-linear-gradient(164deg, #fff0 0 46px, #ffffff10 47px 49px, #fff0 50px 90px),
        radial-gradient(ellipse at 80% 54%, #a53dff47, transparent 42%),
        radial-gradient(ellipse at 35% 65%, #00c8ff20, transparent 50%);
    border-bottom: 1px solid #ffffff24;
}
.hero::before {
    position: absolute;
    z-index: -1;
    top: -18%;
    right: 12%;
    width: 3px;
    height: 140%;
    content: "";
    background: var(--blue);
    box-shadow: 14px 0 var(--purple), 24px 0 var(--yellow);
    opacity: .6;
    transform: rotate(27deg);
}
.hero-copy { max-width: 760px; animation: paint-in .7s ease both; }
.eyebrow, .kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--yellow);
    font: 900 12px/1.3 var(--display);
    text-transform: uppercase;
}
.eyebrow::before { width: 26px; height: 3px; content: ""; background: var(--blue); }
.hero h1 {
    margin: 22px 0 16px;
    color: var(--paper);
    font: 1000 clamp(58px, 10.2vw, 148px)/.82 var(--display);
    text-transform: uppercase;
    text-shadow: 5px 5px 0 #00c8ff6b, -2px -2px 0 #a53dff44;
    transform: skew(-4deg);
}
.hero h1 span { display: block; color: var(--blue); }
.hero-tagline { max-width: 560px; color: #d5d3d0; font-size: clamp(15px, 1.5vw, 19px); }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spray-button, .quiet-button, .danger-button {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 0;
    font: 900 12px/1.2 var(--display);
    text-transform: uppercase;
    clip-path: polygon(3% 0, 100% 7%, 96% 100%, 0 89%);
    transition: transform .18s ease, filter .18s ease;
}
.spray-button { background: var(--yellow); color: var(--ink); }
.quiet-button { border: 1px solid var(--blue); background: transparent; color: var(--paper); clip-path: none; }
.danger-button { background: var(--red); color: white; }
.spray-button:hover, .quiet-button:hover, .danger-button:hover { filter: brightness(1.12); transform: translateY(-2px) rotate(-1deg); }
.hero-logo-wrap { position: relative; justify-self: center; width: min(100%, 430px); aspect-ratio: 1; }
.hero-logo-wrap::after {
    position: absolute;
    z-index: -1;
    inset: 12%;
    content: "";
    background: var(--purple);
    filter: blur(52px);
    opacity: .25;
}
.hero-logo { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 22px #00c8ff38); animation: logo-flicker 5s ease-in-out infinite; }
.hero-logo-fallback { display: none; align-items: center; justify-content: center; width: 100%; height: 100%; border: 2px solid var(--blue); color: var(--yellow); font: 1000 80px/1 var(--display); }
.hero-logo-fallback.is-visible { display: grid; }

.content-section { position: relative; padding: clamp(54px, 7vw, 94px) clamp(18px, 8vw, 120px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-heading h2, .section-title {
    margin: 0;
    color: var(--paper);
    font: 950 clamp(30px, 5vw, 56px)/.98 var(--display);
    text-transform: uppercase;
    text-shadow: 3px 3px 0 #a53dff6b;
}
.section-heading h2::before { display: block; width: 54px; height: 5px; margin-bottom: 12px; content: ""; background: var(--blue); transform: skew(-28deg); }
.section-subtitle { margin: 8px 0 0; color: var(--muted); }
.wall-band { background: #111216; border-block: 1px solid #ffffff18; }
.mission-grid, .dashboard-grid, .admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.wall-card, .data-card, .management-panel {
    position: relative;
    padding: 23px;
    border: 1px solid #ffffff25;
    border-left: 4px solid var(--blue);
    background:
        repeating-linear-gradient(173deg, transparent 0 38px, #ffffff08 39px 40px, transparent 41px 74px),
        linear-gradient(145deg, #1a1b20, #101115);
    box-shadow: 7px 8px 0 #0008;
}
.wall-card:nth-child(3n + 2), .data-card:nth-child(3n + 2) { border-left-color: var(--purple); }
.wall-card:nth-child(3n + 3), .data-card:nth-child(3n + 3) { border-left-color: var(--yellow); }
.wall-card h3, .data-card h3, .management-panel h3 { margin: 0 0 9px; font: 900 20px/1.1 var(--display); text-transform: uppercase; }
.wall-card p, .data-card p { margin: 7px 0 0; color: #c4c1c0; overflow-wrap: anywhere; }
.stat-number { color: var(--blue); font: 950 36px/1 var(--display); }
.motto-wall {
    display: grid;
    place-items: center;
    min-height: 260px;
    padding: 38px 20px;
    border-block: 1px solid #ffffff1e;
    background: radial-gradient(ellipse at center, #a53dff2d, transparent 62%), repeating-linear-gradient(167deg, #121318, #121318 36px, #17181d 37px, #121318 41px);
    text-align: center;
}
.motto-wall strong { display: block; color: var(--yellow); font: 950 clamp(30px, 6vw, 72px)/.98 var(--display); text-shadow: 4px 4px 0 #00c8ff50; }
.motto-wall span { display: block; margin-top: 14px; color: var(--paper); font: 900 clamp(14px, 2vw, 21px)/1.4 var(--display); }

.member-grid, .record-grid, .entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.member-card { position: relative; overflow: hidden; min-width: 0; padding: 0 0 19px; border: 1px solid #ffffff2a; background: #15161a; box-shadow: 7px 8px 0 #0009; }
.member-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: linear-gradient(135deg, #00c8ff22, #a53dff22); }
.member-photo-fallback { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; color: var(--blue); font: 900 58px/1 var(--display); background: repeating-linear-gradient(145deg, #1d1e23, #1d1e23 20px, #202127 21px, #1d1e23 24px); }
.member-card-body { padding: 16px 18px 0; }
.member-card h3 { margin: 0; font: 900 24px/1.1 var(--display); }
.member-role { display: inline-block; margin-top: 8px; padding: 3px 8px; background: var(--blue); color: var(--ink) !important; font: 900 11px/1.3 var(--display); text-transform: uppercase; }
.member-status { color: var(--yellow); font-size: 12px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin: 10px 0; color: var(--yellow); font-size: 12px; font-weight: 800; }
.data-card img { width: 100%; max-height: 240px; margin-top: 14px; object-fit: cover; }
.tag { display: inline-block; padding: 4px 8px; background: var(--purple); color: white; font: 900 10px/1.2 var(--display); text-transform: uppercase; }
.pinned-tag { background: var(--yellow); color: var(--ink); }
.empty-state { grid-column: 1 / -1; padding: 22px; border: 1px dashed #ffffff45; color: var(--muted); text-align: center; }

.quick-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.quick-link { min-height: 78px; display: flex; align-items: end; padding: 14px; border: 1px solid #ffffff30; background: linear-gradient(145deg, #202127, #101115); color: var(--paper); font: 900 15px/1.1 var(--display); text-decoration: none; text-transform: uppercase; transition: border-color .2s, transform .2s; }
.quick-link:hover { border-color: var(--yellow); transform: translateY(-3px); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: #d9d5d1; font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea, .management-panel input, .management-panel select, .management-panel textarea {
    width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px;
    border: 1px solid #55545c; border-radius: 0; background: #090a0d; color: var(--paper);
}
.field textarea, .management-panel textarea { min-height: 96px; resize: vertical; }
.field input[type="file"] { padding: 7px; }
.management-panel { margin-top: 16px; }
.management-panel summary { cursor: pointer; color: var(--yellow); font: 900 17px/1.3 var(--display); }
.management-panel form { margin-top: 16px; }
.manager-list { display: grid; gap: 10px; margin-top: 18px; }
.manager-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid #ffffff22; background: #0c0d10; }
.manager-row p { margin: 3px 0; color: var(--muted); overflow-wrap: anywhere; }
.manager-row-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: end; }
.manager-row button { min-height: 38px; padding: 8px 12px; font-size: 11px; }
.security-note { padding: 15px; border-left: 4px solid var(--yellow); background: #ffd21a12; color: #e6d9ac; font-size: 13px; }
.management-area { background: #0c0d10; border-top: 4px solid var(--purple); }
.management-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.management-tabs button { min-height: 40px; }
.management-tab[aria-selected="true"] { background: var(--blue); color: var(--ink); }
.tab-panel[hidden] { display: none; }
.application-status { min-height: 38px; }
.site-footer { padding: 30px 18px; border-top: 1px solid #ffffff20; color: var(--muted); text-align: center; font-size: 12px; }

.reveal { animation: paint-in .55s ease both; }
@keyframes paint-in { from { opacity: 0; transform: translateY(14px) skew(-1deg); } to { opacity: 1; transform: translateY(0) skew(0); } }
@keyframes logo-flicker { 0%, 96%, 100% { filter: drop-shadow(0 10px 22px #00c8ff38); } 97% { filter: drop-shadow(0 10px 24px #a53dff85); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

@media (max-width: 900px) {
    .site-header { flex-wrap: wrap; }
    .header-controls { width: 100%; justify-content: space-between; }
    .primary-nav { flex-wrap: wrap; }
    .mission-grid, .dashboard-grid, .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .member-grid, .record-grid, .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    html { scroll-padding-top: 118px; }
    .site-header { gap: 10px; padding: 10px 14px; }
    .brand-mark { font-size: 25px; }
    .header-controls { align-items: flex-start; gap: 8px; }
    .primary-nav { flex: 1; gap: 8px 12px; }
    .primary-nav a { font-size: 11px; }
    .language-select { max-width: 116px; min-height: 40px; padding-inline: 5px; font-size: 12px; }
    .hero { grid-template-columns: 1fr; min-height: auto; padding: 64px 22px 44px; text-align: center; }
    .hero-copy { margin-inline: auto; }
    .hero h1 { font-size: clamp(54px, 18vw, 86px); }
    .hero-logo-wrap { width: min(78vw, 310px); }
    .eyebrow { justify-content: center; }
    .hero-actions { justify-content: center; }
    .content-section { padding: 52px 18px; }
    .section-heading { align-items: start; flex-direction: column; }
    .section-heading h2 { font-size: clamp(30px, 10vw, 46px); }
    .mission-grid, .dashboard-grid, .admin-grid, .member-grid, .record-grid, .entry-grid { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wall-card, .data-card { padding: 18px; }
    .manager-row { grid-template-columns: 1fr; }
    .manager-row-actions { justify-content: start; }
    .manager-row button { flex: 1; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .motto-wall { min-height: 220px; }
}
