/* ISA Hackathon - 606 : sign-in page
   Self-contained. No framework required.
   Breakpoints: >=1024 two-column | <1024 centred column (portrait art when the screen is portrait) | <640 phone tweaks */

:root {
  --hk-navy: #0d0b2e;
  --hk-indigo: #1b1850;
  --hk-cyan: #22d3ee;
  --hk-blue: #2b8cff;
  --hk-magenta: #ec4899;
  --hk-amber: #f6c344;
  --hk-amber-soft: #fde68a;
  --hk-text: #f1f5ff;
  --hk-text-2: #c7d0ee;
  --hk-text-3: #b8c2e6;
  --hk-glass: rgba(13, 11, 46, 0.62);
  --hk-glass-2: rgba(13, 11, 46, 0.5);
  --hk-line: rgba(255, 255, 255, 0.14);
  --hk-pad-x: clamp(20px, 5vw, 64px);
  --hk-font-display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hk-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body.hk-login {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--hk-font-body);
  color: var(--hk-text);
  background-color: var(--hk-navy);
  background-image: url("../img/hack606-bg-landscape.svg");
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.hk-shell { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; overflow-x: clip; } /* the panel scrim reaches 96px past the panel: no sideways scroll */

/* Header */
.hk-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 16px;
  padding: 28px var(--hk-pad-x);
}
.hk-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.hk-shield {
  width: 40px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--hk-amber); border-radius: 6px 6px 20px 20px;
  background: rgba(13, 11, 46, 0.7);
  font-family: var(--hk-font-display); font-weight: 800; font-size: 13px; color: var(--hk-cyan);
}
.hk-brand-name { font-family: var(--hk-font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.01em; }
.hk-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.35);
  font-size: 14px; font-weight: 500; color: #a5f3fc;
}
.hk-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hk-cyan); box-shadow: 0 0 10px var(--hk-cyan); }
.hk-status[data-state="closed"] { background: rgba(246, 195, 68, 0.12); border-color: rgba(246, 195, 68, 0.4); color: var(--hk-amber-soft); }
.hk-status[data-state="closed"] .hk-status-dot { background: var(--hk-amber); box-shadow: 0 0 10px var(--hk-amber); }

/* Main layout. The landscape art (16:9, background-size: cover, anchored left) converges at the dotted column,
   52.6% across the art: max(52.6vw, 93.5vh) from the left edge whatever the screen's shape. The first column ends
   just after it and the content is centred in the space that's left, so it never hugs the screen edge. */
.hk-main {
  --hk-converge: max(52.6vw, 93.5vh);
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, calc(var(--hk-converge) - var(--hk-pad-x) + 40px)) minmax(0, 1fr);
  align-items: center;
  padding: 8px var(--hk-pad-x) 32px;
}
.hk-panel {
  grid-column: 2; justify-self: center; width: min(100%, 600px);
  display: flex; flex-direction: column; gap: 24px; position: relative; isolation: isolate;
}
/* Soft scrim so copy stays readable over the binary field */
.hk-panel::before {
  content: ""; position: absolute; inset: -72px -96px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(13, 11, 46, 0.72), rgba(13, 11, 46, 0.35) 60%, rgba(13, 11, 46, 0));
}

/* Hero */
.hk-hero { display: flex; flex-direction: column; gap: 6px; }
.hk-title { margin: 0; display: flex; flex-direction: column; }
.hk-title-eyebrow { font-family: var(--hk-font-display); font-weight: 500; font-size: 22px; color: #dbe4ff; letter-spacing: 0.02em; }
.hk-title-606 {
  font-family: var(--hk-font-display); font-weight: 800;
  font-size: clamp(84px, 7.6vw, 140px); line-height: 0.92; letter-spacing: -0.03em;
  background: linear-gradient(180deg, #5eead4 0%, var(--hk-cyan) 40%, var(--hk-blue) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hk-tagline { margin: 0; font-family: var(--hk-font-display); font-weight: 700; font-size: 18px; color: var(--hk-amber); }

.hk-intro { display: flex; flex-direction: column; gap: 10px; }
.hk-headline { margin: 0; text-wrap: balance; font-family: var(--hk-font-display); font-weight: 700; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; color: #fff; }
.hk-lede { margin: 0; font-size: 17px; line-height: 1.6; color: var(--hk-text-2); max-width: 44ch; }

/* Glass surfaces */
.hk-card, .hk-tile {
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hk-line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hk-card, .hk-tile, .hk-countdown { background: rgba(13, 11, 46, 0.88) !important; }
}
.hk-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 18px; background: var(--hk-glass); }

.hk-ms-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; width: 100%; padding: 0 20px;
  border: 0; border-radius: 12px;
  background: #fff; color: var(--hk-indigo);
  font-family: var(--hk-font-body); font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.hk-ms-btn:hover { background: #eef2ff; }
.hk-ms-btn:active { transform: translateY(1px); }
.hk-ms-btn:focus-visible { outline: 3px solid var(--hk-amber); outline-offset: 3px; }
.hk-ms-btn svg { flex: none; }
.hk-help { margin: 0; font-size: 14px; line-height: 1.5; color: var(--hk-text-3); text-align: center; }

.hk-alert {
  margin: 0; padding: 12px 14px; border-radius: 10px;
  background: rgba(236, 72, 153, 0.14); border: 1px solid rgba(236, 72, 153, 0.45);
  color: #fbcfe8; font-size: 14px; line-height: 1.5;
}

/* Countdown: the most visible thing after the "606" */
.hk-countdown {
  --hk-cd: var(--hk-cyan);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 22px 18px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(43, 140, 255, 0.08) 45%, rgba(13, 11, 46, 0.66));
  border: 1px solid rgba(34, 211, 238, 0.38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 18px 50px -20px rgba(34, 211, 238, 0.45);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.hk-countdown::before { /* a thin lit edge along the top */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--hk-cd), transparent);
}
.hk-countdown[data-state="final"] {
  --hk-cd: var(--hk-magenta);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(246, 195, 68, 0.1) 50%, rgba(13, 11, 46, 0.66));
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 18px 50px -18px rgba(236, 72, 153, 0.6);
}
.hk-countdown[data-state="closed"], .hk-countdown[data-state="pending"] {
  --hk-cd: var(--hk-amber);
  background: linear-gradient(135deg, rgba(246, 195, 68, 0.12), rgba(13, 11, 46, 0.7) 55%);
  border-color: rgba(246, 195, 68, 0.4); box-shadow: none;
}
.hk-countdown-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.hk-countdown-title {
  margin: 0; font-family: var(--hk-font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--hk-cd);
}
.hk-countdown-date { font-size: 14px; font-weight: 500; color: var(--hk-text-2); }
.hk-countdown[data-state="pending"] .hk-countdown-date { font-family: var(--hk-font-display); font-size: 22px; font-weight: 700; color: #fff; }

.hk-segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hk-seg {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px 10px; border-radius: 12px;
  background: rgba(8, 7, 30, 0.55); border: 1px solid rgba(255, 255, 255, 0.08);
}
.hk-seg + .hk-seg::before { /* the ":" between blocks */
  content: ":"; position: absolute; left: -9px; top: 10px;
  font-family: var(--hk-font-display); font-weight: 700; font-size: clamp(26px, 2.6vw, 38px); color: rgba(255, 255, 255, 0.28);
}
.hk-seg-num {
  font-family: var(--hk-font-display); font-weight: 800; line-height: 1;
  font-size: clamp(30px, 3.1vw, 46px); letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  color: #fff; text-shadow: 0 0 22px color-mix(in srgb, var(--hk-cd) 55%, transparent);
}
.hk-countdown[data-state="closed"] .hk-seg-num { color: rgba(255, 255, 255, 0.45); text-shadow: none; }
.hk-seg:last-child .hk-seg-num { color: var(--hk-cd); }
.hk-countdown[data-state="closed"] .hk-seg:last-child .hk-seg-num { color: rgba(255, 255, 255, 0.45); }
.hk-seg-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hk-text-3); }
.hk-countdown-note { margin: 0; font-size: 14px; color: var(--hk-text-2); }
.hk-countdown[data-state="final"] .hk-countdown-note { color: #fbcfe8; font-weight: 600; }
.hk-countdown[data-state="closed"] .hk-countdown-note { color: var(--hk-amber-soft); }
.hk-tick { animation: hk-tick .35s ease-out; }
@keyframes hk-tick { from { transform: translateY(-3px); opacity: .55; } to { transform: none; opacity: 1; } }

/* In the running: one slim line under the sign-in card */
.hk-stats {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 0;
  font-size: 14px; color: var(--hk-text-2);
}
.hk-stats li { display: inline-flex; align-items: baseline; gap: 6px; }
.hk-stats li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--hk-amber); margin: 0 14px; align-self: center; }
.hk-stats strong { font-family: var(--hk-font-display); font-size: 18px; font-weight: 700; color: #fff; }

/* Footer */
.hk-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 20px var(--hk-pad-x) 28px; font-size: 13px; color: var(--hk-text-2);
}
.hk-footer a { color: var(--hk-amber); }
.hk-footer a:hover { color: var(--hk-amber-soft); }
.hk-footer a:focus-visible { outline: 2px solid var(--hk-amber); outline-offset: 2px; border-radius: 2px; }

.hk-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Tablet: single centred column, landscape art stays */
/* Two columns only when the space right of the streams fits the panel (wide enough and not too tall). */
@media (max-width: 1279px), (max-aspect-ratio: 3/2) {
  .hk-main { grid-template-columns: minmax(0, 600px); justify-content: center; padding-top: 24px; }
  .hk-panel { grid-column: 1; }
  body.hk-login { background-position: 30% center; }
}

/* Laptop heights (768-940px): tighter so header, panel and footer fit on one screen */
@media (min-width: 1024px) and (max-height: 940px) and (min-height: 641px) {
  .hk-header { padding-top: 20px; padding-bottom: 12px; }
  .hk-title-606 { font-size: clamp(72px, 12vh, 120px); }
  .hk-title-eyebrow { font-size: 20px; }
  .hk-panel { gap: 16px; }
  .hk-intro { gap: 6px; }
  .hk-headline { font-size: clamp(24px, 4vh, 34px); }
  .hk-lede { font-size: 16px; line-height: 1.5; }
  .hk-countdown { padding: 16px 20px 14px; gap: 10px; }
  .hk-seg { padding: 10px 4px 8px; }
  .hk-seg-num { font-size: clamp(28px, 4.6vh, 42px); }
  .hk-card { padding: 18px 20px; gap: 10px; }
  .hk-main { padding-bottom: 12px; }
  .hk-footer { padding-top: 8px; padding-bottom: 18px; }
}

/* Portrait tablets and all phones: portrait art, streams fan down above the content */
@media (max-width: 1023px) and (orientation: portrait), (max-width: 639px) {
  body.hk-login {
    background-image: url("../img/hack606-bg-portrait.svg");
    background-position: center top;
    background-attachment: scroll;
  }
  .hk-main { padding-top: clamp(120px, 24svh, 300px); }
}

/* Phone: portrait art, streams fan above the content */
@media (max-width: 639px) {
  .hk-header { padding-top: 20px; padding-bottom: 12px; }
  .hk-brand-name { font-size: 15px; }
  .hk-status { font-size: 13px; padding: 6px 12px; }
  .hk-main { padding-top: clamp(120px, 26svh, 260px); padding-bottom: 32px; gap: 0; }
  .hk-panel { gap: 22px; }
  .hk-title-eyebrow { font-size: 18px; }
  .hk-tagline { font-size: 16px; }
  .hk-lede { font-size: 16px; }
  .hk-card { padding: 18px; }
  .hk-countdown { padding: 16px 14px 14px; gap: 12px; }
  .hk-segments { gap: 8px; }
  .hk-seg { padding: 10px 2px 8px; }
  .hk-seg-num { font-size: clamp(26px, 8.4vw, 34px); }
  .hk-seg + .hk-seg::before { font-size: 24px; left: -7px; top: 9px; }
  .hk-seg-label { font-size: 10px; letter-spacing: 0.08em; }
  .hk-footer { flex-direction: column; gap: 6px; }
}

/* Very narrow phones */
@media (max-width: 379px) {
  .hk-title-606 { font-size: 80px; }
  .hk-segments { gap: 6px; }
  .hk-seg-label { letter-spacing: 0.04em; }
}

/* Short landscape screens (phones turned sideways, small laptops) */
@media (max-height: 640px) and (min-width: 640px) {
  .hk-title-606 { font-size: clamp(64px, 8vw, 104px); }
  .hk-panel { gap: 16px; }
  .hk-seg-num { font-size: 30px; }
  .hk-main { padding-top: 8px; padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .hk-ms-btn { transition: none; }
  .hk-tick { animation: none; }
}
