/*
Theme Name: Kardashev
Description: The landing page for Kardashev Online: a full-screen film of the game behind the title, then the page's own content.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: kardashev
*/

@font-face {
  font-family: 'Michroma';
  src: url('assets/fonts/michroma-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #05070b;
  --panel: #0a0f15;
  --line: #1a2530;
  --line2: #2a3b4b;
  --text: #cdd8e3;
  --bright: #f1f6fb;
  --dim: #8a9bad;
  --accent: #4fd1c5;
  --amber: #f2b35b;
  --mono: ui-monospace, 'Cascadia Mono', 'Cascadia Code', Consolas, 'SFMono-Regular', Menlo, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Michroma', 'Eurostile', 'Segoe UI', system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 88px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--bright);
}

img,
video {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: auto;
  height: auto;
  clip-path: none;
  padding: 10px 16px;
  background: var(--bright);
  color: var(--bg);
}

/* ---------- Header ---------- */

.ko-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px var(--gutter);
}

body.admin-bar .ko-header {
  top: 32px;
}

.ko-brand {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--bright);
  text-decoration: none;
  white-space: nowrap;
}

.ko-brand span {
  color: var(--dim);
}

.ko-header--plain {
  position: static;
  border-bottom: 1px solid var(--line);
}

/* ---------- Buttons ---------- */

.ko-btn,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 17px 30px 16px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: #04110f;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.24em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.ko-btn:hover,
.wp-block-button__link:hover {
  background: var(--bright);
  border-color: var(--bright);
  color: #04110f;
}

.ko-btn__arrow {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width 0.2s;
}

.ko-btn__arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.ko-btn:hover .ko-btn__arrow {
  width: 26px;
}

.ko-btn--ghost {
  padding: 12px 20px 11px;
  background: rgba(5, 7, 11, 0.35);
  border-color: rgba(205, 216, 227, 0.4);
  color: var(--bright);
  font-size: 11px;
  clip-path: none;
  backdrop-filter: blur(6px);
}

.ko-btn--ghost:hover {
  background: var(--bright);
  color: var(--bg);
}

/* ---------- Hero ---------- */

.ko-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 110px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 90% at 78% 38%, #111c2a 0%, #080c13 45%, var(--bg) 100%);
}

.ko-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
}

.ko-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.ko-hero__video.is-on {
  opacity: 1;
}

.ko-hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 7, 11, 0.9) 0%, rgba(5, 7, 11, 0.62) 34%, rgba(5, 7, 11, 0.12) 66%, rgba(5, 7, 11, 0.3) 100%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.72) 0%, rgba(5, 7, 11, 0) 20%, rgba(5, 7, 11, 0) 60%, var(--bg) 100%);
}

.ko-hero__inner {
  max-width: 760px;
}

.ko-eyebrow,
.ko-content .ko-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}

.ko-eyebrow::before {
  content: '';
  flex: none;
  width: 34px;
  height: 1px;
  background: currentColor;
}

.ko-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  color: var(--bright);
  text-transform: uppercase;
  line-height: 1;
}

.ko-title__main {
  display: block;
  font-size: clamp(34px, 7.4vw, 104px);
  letter-spacing: 0.1em;
  margin-right: -0.1em;
  text-shadow: 0 2px 40px rgba(5, 7, 11, 0.6);
}

.ko-title__sub {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(14px, 1.6vw, 24px);
  font-size: clamp(13px, 1.5vw, 20px);
  letter-spacing: 0.9em;
  color: var(--text);
}

.ko-title__sub::after {
  content: '';
  flex: 1;
  max-width: 220px;
  height: 1px;
  background: linear-gradient(90deg, var(--line2), transparent);
}

.ko-tagline {
  margin: clamp(26px, 3.4vw, 44px) 0 0;
  max-width: 560px;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--bright);
}

.ko-intro {
  margin: 14px 0 0;
  max-width: 540px;
  color: var(--text);
  opacity: 0.86;
}

.ko-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 26px;
  margin-top: clamp(30px, 3.6vw, 46px);
}

.ko-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.ko-hero__foot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.ko-scroll {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.ko-scroll::before {
  content: '';
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, transparent, var(--text));
}

.ko-scroll:hover {
  color: var(--bright);
}

.ko-film {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(205, 216, 227, 0.22);
  background: rgba(5, 7, 11, 0.4);
  color: var(--dim);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.ko-film.is-ready {
  display: inline-flex;
}

.ko-film:hover {
  color: var(--bright);
  border-color: rgba(205, 216, 227, 0.5);
}

.ko-film__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.ko-film[aria-pressed='true'] .ko-film__dot {
  background: var(--dim);
}

/* ---------- Page content (the editor's blocks) ---------- */

.ko-content {
  padding: clamp(70px, 9vw, 130px) var(--gutter) clamp(60px, 8vw, 110px);
}

/* Everything lines up on the hero's left edge. */
.ko-content > * {
  max-width: 1600px;
  margin-left: 0;
  margin-right: 0;
}

.ko-content h2 {
  margin: 0 0 clamp(36px, 5vw, 64px);
  max-width: 1180px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bright);
}

.ko-content h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bright);
}

.ko-content p {
  margin: 0 0 1em;
}

.ko-content .ko-pillars {
  counter-reset: pillar;
  gap: clamp(28px, 3.4vw, 52px);
  margin-bottom: 0;
}

.ko-content .ko-pillars > .wp-block-column {
  counter-increment: pillar;
  padding-top: 22px;
  border-top: 1px solid var(--line2);
  position: relative;
}

.ko-content .ko-pillars > .wp-block-column::before {
  content: '0' counter(pillar);
  display: block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.ko-content .ko-pillars > .wp-block-column::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 34px;
  height: 1px;
  background: var(--accent);
}

.ko-content .ko-pillars p {
  color: var(--text);
  opacity: 0.84;
  font-size: 16px;
}

.ko-content .ko-band {
  margin-top: clamp(70px, 9vw, 130px);
  padding: clamp(36px, 5vw, 64px);
  border: 1px solid var(--line2);
  background:
    linear-gradient(135deg, rgba(79, 209, 197, 0.07), rgba(79, 209, 197, 0) 45%),
    var(--panel);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
}

.ko-content .ko-band h2 {
  margin-bottom: 14px;
  font-size: clamp(20px, 2.3vw, 30px);
}

.ko-content .ko-band p {
  max-width: 620px;
  opacity: 0.86;
}

.ko-content .ko-band .wp-block-buttons {
  margin-top: 30px;
}

/* ---------- Other pages ---------- */

.ko-page {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(50px, 7vw, 90px) var(--gutter);
}

.ko-page h1 {
  margin: 0 0 30px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(24px, 3.4vw, 40px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bright);
}

.ko-page h2,
.ko-page h3 {
  color: var(--bright);
}

/* ---------- Footer ---------- */

.ko-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 30px;
  padding: 28px var(--gutter) 34px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.ko-footer a {
  color: inherit;
  text-decoration: none;
}

.ko-footer a:hover {
  color: var(--bright);
}

/* ---------- Everything on the page's centre line ---------- */

.ko-header > :only-child {
  margin: 0 auto;
}

.ko-hero {
  align-items: center;
  text-align: center;
}

.ko-hero__shade {
  background:
    radial-gradient(ellipse 62% 58% at 50% 50%, rgba(5, 7, 11, 0.74) 0%, rgba(5, 7, 11, 0.42) 55%, rgba(5, 7, 11, 0.16) 100%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.72) 0%, rgba(5, 7, 11, 0) 20%, rgba(5, 7, 11, 0) 62%, var(--bg) 100%);
}

.ko-hero__inner {
  max-width: 1200px;
}

.ko-eyebrow,
.ko-content .ko-eyebrow {
  justify-content: center;
}

.ko-eyebrow::after {
  content: '';
  flex: none;
  width: 34px;
  height: 1px;
  background: currentColor;
}

/* Letter spacing trails each letter, so the same again in front keeps a line centred. */
.ko-title__main {
  margin-right: 0;
  padding-left: 0.1em;
}

.ko-title__sub {
  justify-content: center;
  padding-left: 0.9em;
}

.ko-title__sub::before,
.ko-title__sub::after {
  content: '';
  flex: 1;
  max-width: 180px;
  height: 1px;
}

.ko-title__sub::before {
  background: linear-gradient(270deg, var(--line2), transparent);
  margin-left: -0.9em;
}

.ko-title__sub::after {
  background: linear-gradient(90deg, var(--line2), transparent);
  margin-left: -0.9em;
}

.ko-tagline,
.ko-intro {
  margin-left: auto;
  margin-right: auto;
}

.ko-actions {
  justify-content: center;
}

.ko-hero__foot {
  justify-content: center;
}

.ko-scroll {
  flex-direction: column;
  gap: 10px;
}

.ko-film {
  position: absolute;
  right: 0;
  bottom: 0;
}

.ko-content > *,
.ko-content h2,
.ko-content .ko-eyebrow {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.ko-content .ko-band {
  text-align: center;
}

.ko-content .ko-band p {
  margin-left: auto;
  margin-right: auto;
}

.ko-content .ko-band > :last-child {
  margin-bottom: 0;
}

.ko-footer {
  justify-content: center;
  text-align: center;
}

/* ---------- Small screens ---------- */

@media (max-width: 782px) {
  body.admin-bar .ko-header {
    top: 46px;
  }

  .ko-header {
    padding-top: 20px;
  }

  .ko-brand {
    font-size: 10px;
    letter-spacing: 0.22em;
  }

  .ko-btn--ghost {
    padding: 10px 14px 9px;
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  .ko-hero {
    justify-content: flex-end;
    padding-top: 110px;
    padding-bottom: 120px;
  }

  .ko-hero__shade {
    background:
      linear-gradient(180deg, rgba(5, 7, 11, 0.7) 0%, rgba(5, 7, 11, 0.15) 26%, rgba(5, 7, 11, 0.7) 58%, var(--bg) 100%);
  }

  .ko-title__sub {
    letter-spacing: 0.6em;
  }

  .ko-eyebrow {
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  .ko-scroll {
    display: none;
  }

  .ko-hero__foot {
    justify-content: flex-end;
  }
}
