:root {
  color-scheme: dark;
  --night: #041018;
  --surface: #071821;
  --raised: #0b222d;
  --line: #244452;
  --ink: #f7fbff;
  --muted: #a9bbc4;
  --cyan: #20e8ef;
  --pink: #ff69ba;
  --gold: #ffd020;
  --green: #17e86d;
  --red: #ffa9b8;
  --radius: 14px;
  --heading: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font: 16px/1.55 Inter, system-ui, -apple-system, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; min-height: 100dvh; margin: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--night); }
button, input, textarea, select { font: inherit; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--cyan); text-underline-offset: .22em; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
p, dl, li { overflow-wrap: anywhere; }
img { max-width: 100%; object-fit: cover; }

.shell { width: min(100% - 2.25rem, 1180px); margin-inline: auto; }
.skip-link { position: absolute; top: 1rem; left: 1rem; z-index: 5; padding: .7rem 1rem; background: var(--night); transform: translateY(-220%); }
.skip-link:focus { transform: none; }
.site-header { position: relative; z-index: 2; border-bottom: 1px solid var(--line); background: #06151e; }
.site-nav, .footer-content { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 42px; width: auto; max-width: min(37vw, 120px); object-fit: contain; }
.brand-division { border-left: 1px solid var(--line); padding-left: .85rem; font-size: .83rem; font-weight: 700; line-height: 1.15; letter-spacing: .04em; }
.brand-division strong { color: var(--cyan); }
.site-actions, .button-row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.site-actions { justify-content: flex-end; }
.mobile-menu { display: none !important; }
.site-footer { background: #06151e; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-content { min-height: 64px; }
.workspace { flex: 1; padding-block: clamp(1.7rem, 5vw, 4.5rem); }
.workspace:focus { outline: none; }
.loading { margin-top: 3rem; color: var(--muted); }
.connection { padding: .55rem 1rem; color: var(--gold); background: #342810; text-align: center; font-size: .85rem; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: .55rem; border: 1px solid var(--line); padding: .56rem .9rem; border-radius: 8px; background: transparent; color: var(--ink); text-align: center; text-decoration: none; font-weight: 750; font-size: .9rem; line-height: 1.25; cursor: pointer; }
.button:not(:disabled):hover { background: var(--raised); border-color: var(--cyan); text-decoration: none; }
.button-primary { background: var(--cyan); border-color: var(--cyan); color: #001b21; }
.button-primary:not(:disabled):hover { background: #8effff; border-color: #8effff; }
.button-quiet { border-color: transparent; color: var(--muted); }
.button-quiet[aria-current="page"] { color: var(--cyan); background: var(--surface); border-color: var(--line); }
.button-danger { color: var(--red); }
.button-gold { color: #211700; background: var(--gold); border-color: var(--gold); }
.button-gold:not(:disabled):hover { background: #ffe586; border-color: #ffe586; }
.button-small { min-height: 36px; padding: .4rem .65rem; font-size: .8rem; }

.eyebrow { width: fit-content; display: flex; align-items: center; gap: .6rem; color: var(--cyan); font: 700 .76rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .13em; }
.eyebrow::before { display: block; width: 18px; height: 2px; content: ''; background: currentColor; }
.landing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 5vw, 4rem); min-height: min(550px, 60vh); padding-block: clamp(.5rem, 4vw, 3rem); }
.hero-heading, .page-heading, .hero-word { font-family: var(--heading); font-weight: 800; line-height: .98; letter-spacing: .02em; text-transform: uppercase; }
.hero-heading { margin-block: .85rem 1.25rem; font-size: clamp(3.7rem, 8vw, 7.4rem); }
.hero-heading span { display: block; color: var(--cyan); }
.landing-copy > p:not(.eyebrow), .intro-copy { max-width: 54ch; color: var(--muted); font-size: clamp(1rem, 2vw, 1.12rem); }
.landing-copy > .button-row { margin-top: 1.7rem; }
.landing-copy .button { min-height: 48px; padding-inline: 1.15rem; }

.hero-art { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; min-height: 380px; aspect-ratio: 1.15; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(circle at 50% 47%, #135664 0, #0a2a36 39%, #071821 72%); }
.hero-art::before { position: absolute; inset: 0; z-index: -1; content: ''; background: radial-gradient(#50bec360 1px, transparent 1px); background-size: 20px 20px; mask-image: radial-gradient(ellipse at center, transparent 10%, #000 70%); }
.hero-art::after { position: absolute; inset: 20px; z-index: -1; content: ''; background: linear-gradient(var(--cyan), var(--cyan)) left top / 20px 1px no-repeat, linear-gradient(var(--cyan), var(--cyan)) left top / 1px 20px no-repeat, linear-gradient(var(--cyan), var(--cyan)) right bottom / 20px 1px no-repeat, linear-gradient(var(--cyan), var(--cyan)) right bottom / 1px 20px no-repeat; opacity: .73; }
.hero-scope { display: grid; place-items: center; position: relative; width: min(75%, 350px); aspect-ratio: 1; border-radius: 50%; border: 1px solid #477882; }
.hero-scope::before { position: absolute; inset: 6%; content: ''; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #20e8efb8 0deg 1deg, transparent 1deg 6deg); mask-image: radial-gradient(circle at center, transparent 65%, #000 66% 69%, transparent 70%); }
.hero-scope::after { position: absolute; inset: 14%; content: ''; border-radius: 50%; border: 1px solid #20e8ef4d; box-shadow: 0 0 48px #20e8ef29, inset 0 0 36px #20e8ef1a; }
.scope-content { text-align: center; z-index: 1; }
.scope-content strong { display: block; color: var(--cyan); font: 900 clamp(2.4rem, 6vw, 4.7rem)/1 var(--mono); font-variant-numeric: tabular-nums; text-shadow: 0 0 32px #20e8ef6a; letter-spacing: -.08em; }
.scope-content span { display: block; margin-top: .45rem; color: var(--ink); font: 700 .76rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .14em; }
.role-primer { margin-top: clamp(1rem, 3vw, 2.2rem); }
.role-primer .card { display: grid; gap: .35rem; }
.role-primer .card strong { color: var(--ink); }
.role-primer .card p { color: var(--muted); }

.page-heading { font-size: clamp(2.35rem, 5vw, 4.55rem); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .9rem 1.5rem; margin-bottom: 1.4rem; }
.page-head .eyebrow { margin-bottom: .6rem; }
.page-head p:not(.eyebrow) { margin-top: .48rem; color: var(--muted); }
.section { margin-top: 1.35rem; }
.section-heading { margin-bottom: .7rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem; justify-content: space-between; }
.section-heading h2, .card h2 { font-size: clamp(1.2rem, 2.5vw, 1.48rem); line-height: 1.17; }
.stack { display: grid; align-content: start; gap: .9rem; }
.grid { display: grid; gap: .9rem; }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: clamp(1rem, 2.6vw, 1.45rem); min-width: 0; }
.card-highlight { border-color: #36b6bb; background: linear-gradient(135deg, #0c2834, var(--surface) 66%); }
.card-muted { background: transparent; }
.card p + p { margin-top: .5rem; }
.card .section-heading h2 { margin-bottom: 0; }
.card label:not(.check-label) { display: grid; gap: .3rem; }
.card h3 { font-size: 1.1rem; line-height: 1.2; }
.empty-state { display: grid; gap: .45rem; align-items: start; justify-items: start; }
.empty-state p, .muted, .field-hint, .help-text { color: var(--muted); }
.empty-state .button-row { margin-top: .4rem; }
.tag { width: fit-content; padding: .27rem .55rem; border: 1px solid var(--line); border-radius: 999px; font: 700 .72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #09202b; white-space: nowrap; }
.tag-cyan { color: var(--cyan); border-color: #36737b; }
.tag-gold { color: var(--gold); border-color: #776421; }
.phase-title, .tag-group { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.event-list { display: grid; gap: .75rem; }
.event-list .card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.event-list h2, .event-list h3 { margin-bottom: .25rem; }
.event-meta { color: var(--muted); font-size: .92rem; }
.back-button { margin-bottom: .65rem; margin-left: -.9rem; }

.event-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .46fr); gap: 1rem; align-items: start; }
.primary-area, .side-area { min-width: 0; }
.side-area .card { display: grid; gap: .55rem; }
.challenge-copy { color: var(--muted); white-space: pre-wrap; }
.challenge h2 { margin-block: .4rem .55rem; font-size: clamp(1.45rem, 3vw, 2rem); }
.competition-clock { border-color: #2d737d; background: radial-gradient(ellipse at 8% 0%, #0c3443, var(--surface) 76%); }
.competition-clock p:not(.eyebrow) { color: var(--muted); }
.clock-digits { display: block; color: var(--cyan); font: 800 clamp(3rem, 7vw, 4.7rem)/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.07em; }
.schedule { padding: 0; display: grid; gap: .42rem; margin: 0; list-style: none; }
.schedule li { display: grid; grid-template-columns: 1fr auto; gap: .25rem; padding: .2rem 0; color: var(--muted); font-size: .85rem; }
.schedule li[aria-current="step"] { color: var(--cyan); font-weight: 800; }
.schedule strong { font-weight: inherit; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .8rem; }
.team-card { display: grid; align-content: start; gap: .8rem; }
.team-identity { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.team-identity > div { min-width: 0; }
.team-logo, .avatar { width: 48px; height: 48px; border: 1px solid #426b76; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center; color: var(--cyan); background: #103746; font: 700 .95rem/1 var(--mono); overflow: hidden; object-fit: cover; }
.avatar { width: 66px; height: 66px; border-radius: 50%; }
.team-line, .role-label { margin-top: .08rem; color: var(--muted); font-size: .83rem; }
.plain-list { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: .45rem; flex-wrap: wrap; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.person-row:last-child { border-bottom: 0; }
.profile-card { max-width: 720px; }
.profile-card .avatar { margin-bottom: .15rem; }
.investment-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(105px, 145px); align-items: center; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.investment-row .team-identity { gap: .55rem; }
.investment-row .team-logo { width: 38px; height: 38px; }
.investment-row .team-identity p { font-size: .79rem; }
.currency-input { min-width: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: .15rem 0 .7rem; }
.metric { margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; }
.metric dt { font-size: .78rem; color: var(--muted); }
.metric dd { margin: 0; color: var(--cyan); font-family: var(--mono); font-size: clamp(1rem, 3vw, 1.35rem); font-weight: 800; }
.metric [data-negative="true"] { color: var(--red); }
.winner-banner { display: grid; gap: .85rem; border-color: #a38722; background: radial-gradient(ellipse at 0% 0%, #4c3923, var(--surface) 70%); }
.winner-banner .eyebrow, .winner-banner h2 { color: var(--gold); }
.winner-banner h2 { margin-block: .3rem; font-family: var(--heading); text-transform: uppercase; font-size: clamp(2.35rem, 5vw, 4rem); line-height: .98; }
.winner-banner .card { background: #091924aa; }
.winner-banner h3 { margin-top: .25rem; }

.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.data-table caption { text-align: left; padding-bottom: .5rem; }
.data-table th, .data-table td { text-align: left; border-bottom: 1px solid var(--line); padding: .62rem .52rem; }
.data-table th { color: var(--muted); font-size: .8rem; font-weight: 700; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:first-child td:first-child { color: var(--gold); }

dialog { position: fixed; margin: auto; border: 1px solid #3b6573; border-radius: var(--radius); color: var(--ink); background: var(--surface); padding: 0; width: min(calc(100% - 1.75rem), 550px); max-height: calc(100dvh - 2rem); overscroll-behavior: contain; box-shadow: 0 18px 100px #000c; }
dialog::backdrop { background: #02090cbe; backdrop-filter: blur(4px); }
.overlay-inner { padding: clamp(1rem, 4vw, 1.75rem); position: relative; }
.overlay-inner > h2 { margin-bottom: .8rem; padding-right: 2.4rem; font-size: 1.55rem; line-height: 1.15; }
.dialog-close { position: absolute; top: .4rem; right: .45rem; width: 42px; padding: 0; font-size: 1.4rem; }
.form { display: grid; gap: .8rem; }
.form label:not(.check-label) { display: grid; gap: .28rem; }
.form label > span:first-child, .label-text { color: var(--ink); font-size: .92rem; font-weight: 700; }
.form fieldset { padding: 0; border: 0; min-inline-size: 0; margin: 0; display: grid; gap: .5rem; }
.form legend { font-weight: 750; margin-bottom: .4rem; }
.form input, .form textarea, .form select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #3b5e6b; border-radius: 8px; color: var(--ink); background: #04131d; padding: .52rem .62rem; }
.form input[type="file"] { padding: .45rem; }
.form textarea { resize: vertical; min-height: 105px; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--cyan); }
.form input::placeholder, .form textarea::placeholder { color: #8199a5; }
.form .button-row { margin-top: .12rem; }
.field-hint, .help-text { font-size: .84rem; }
.feedback { margin-top: .6rem; padding: .55rem .75rem; border: 1px solid #79414c; border-radius: 8px; color: var(--red); background: #301820; }
.notice { color: var(--gold); font-size: .9rem; }
.notification { position: fixed; z-index: 4; bottom: 1.25rem; inset-inline-end: 1.25rem; max-width: min(410px, calc(100% - 2.5rem)); border-radius: 8px; border: 1px solid #3b6573; background: var(--raised); color: var(--ink); box-shadow: 0 8px 26px #000a; padding: .75rem 1rem; }
.notification.error { border-color: #79414c; color: var(--red); }
.invite-code { display: block; max-width: 100%; width: fit-content; user-select: all; overflow-wrap: anywhere; font: 700 1rem/1.4 var(--mono); background: #04131d; border: 1px solid var(--line); border-radius: 8px; padding: .7rem; color: var(--cyan); }

@media (max-width: 850px) {
  .event-layout { grid-template-columns: minmax(0, 1fr); }
  .event-layout > .side-area { display: contents; }
  .event-layout .competition-clock { grid-row: 1; display: grid; gap: .5rem; }
  .event-layout .schedule-card { display: grid; gap: .55rem; }
  .hero-art { min-height: 315px; }
}

@media (max-width: 700px) {
  .mobile-menu { display: inline-flex !important; }
  .site-actions { display: none; position: absolute; inset: 100% 0 auto; z-index: 1; justify-content: flex-start; padding: .55rem 1rem; background: #06151e; border-block: 1px solid var(--line); }
  .site-actions.is-open { display: flex; }
  .landing { grid-template-columns: 1fr; }
  .hero-art { max-width: 540px; width: 100%; min-height: 0; aspect-ratio: 1.55; }
  .hero-scope { width: min(52%, 290px); }
  .scope-content strong { font-size: clamp(2.1rem, 7.8vw, 3.65rem); }
  .scope-content span { font-size: .65rem; }
  .grid-three { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 475px) {
  .shell { width: min(100% - 1.4rem, 1180px); }
  .site-nav { gap: .55rem; min-height: 62px; }
  .brand { gap: .45rem; }
  .brand-division { padding-left: .45rem; font-size: .74rem; }
  .brand-logo { height: 35px; }
  .hero-heading { font-size: clamp(3.2rem, 15vw, 4.6rem); }
  .grid-two { grid-template-columns: minmax(0, 1fr); }
  .schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .7rem; }
  .schedule li { font-size: .75rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .winner-banner { animation: winner-enter .55s ease-out both; }
  @keyframes winner-enter { from { opacity: 0; transform: translateY(12px); } }
}
