/* ============================================================
   The Knight Within, styles
   Black & white, minimalist, modern. One landing page.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --bg-dark: #000000;
  --fg-dark: #ffffff;

  --muted: #6b6b6b;        /* secondary text on light */
  --muted-dark: #9a9a9a;   /* secondary text on dark  */
  --line-dark: rgba(255, 255, 255, 0.14);

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 0px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.2s var(--ease);
  --t-med: 0.45s var(--ease);

  --nav-h: 4.5rem;
}

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-dark);
  /* Allow the browser's native pull-to-refresh at the top of the page on mobile. */
  overscroll-behavior-y: auto;
}

body {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  /* Let a single long word wrap to the next line instead of overflowing (and
     being clipped by an ancestor's overflow:hidden). Greek runs long — e.g. the
     hero's "κληρονομήσετε" is wider than a phone screen — and English never
     needs this, so it only ever fires when a word genuinely can't fit. */
  overflow-wrap: break-word;
}

::selection { background: var(--fg); color: var(--bg); }

/* ---------- Helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link:not(:focus) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  z-index: 200;
  top: 0.75rem; left: 0.75rem;
  background: var(--fg-dark);
  color: var(--bg-dark);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
}

:where(a, button, input):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Programmatic focus target (the skip link lands on <main tabindex="-1">):
   keep the focus, drop the browser's outline ring around the whole page. */
[tabindex="-1"]:focus { outline: none; }

.kicker {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.section--dark .kicker { color: var(--muted-dark); }

/* ---------- Section theming ---------- */
.section--dark { background: var(--bg-dark); color: var(--fg-dark); }
.section--light { background: var(--bg); color: var(--fg); }

.section {
  min-height: 100vh;  /* fallback for Safari < 15.4 (no svh) */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-block: clamp(3.5rem, 6vw, 5.5rem);
  scroll-margin-top: var(--nav-h);
}
/* Center content when it's short, but top-align it when it's taller than the
   screen so nothing slides under the fixed nav. */
.section > .container { margin-block: auto; }

[id] { scroll-margin-top: var(--nav-h); }

.section__head { max-width: 56rem; }

.section__title {
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.75rem);
  margin-top: 1.1rem;
  margin-left: -0.08em; /* optical: align cap ink flush with the kicker / body */
}

.section__lede {
  margin-top: 1.5rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
}

.section--dark .section__lede { color: var(--muted-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast),
    border-color var(--t-fast), transform var(--t-fast);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* solid = black on light backgrounds */
.btn--solid { background: var(--fg); color: var(--bg); }
.btn--solid:hover { background: #2a2a2a; }

/* solid-inverse = white, for dark backgrounds */
.btn--solid-inverse { background: var(--fg-dark); color: var(--bg-dark); }
.btn--solid-inverse:hover { background: #dcdcdc; }

/* ---------- Wordmark ---------- */
.brand {
  display: inline-flex;
  align-items: center;
}
.brand__logo {
  display: block;
  height: 1.6rem;   /* sized to sit in the same space as the old wordmark */
  width: auto;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  color: var(--fg-dark);
  transition: background var(--t-med), border-color var(--t-med), backdrop-filter var(--t-med);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.nav.is-scrolled {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav__right {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2.5vw, 1.75rem);
}
.lang {
  display: inline-flex;
  align-items: center;
  flex: none;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.lang__btn {
  padding: 0.4rem 0.7rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-dark);
  opacity: 0.7;
  transition: background var(--t-fast), color var(--t-fast), opacity var(--t-fast);
}
.lang__btn:hover { opacity: 1; }
.lang__btn[aria-pressed="true"] {
  background: var(--fg-dark);
  color: var(--bg-dark);
  opacity: 1;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9375rem;
}
.nav__links > a:not(.btn) {
  position: relative;
  opacity: 0.85;
  transition: opacity var(--t-fast);
}
.nav__links > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast);
}
.nav__links > a:not(.btn):hover { opacity: 1; }
.nav__links > a:not(.btn):hover::after { transform: scaleX(1); }

.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -0.5rem;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.nav__toggle span {
  width: 22px; height: 2px;
  background: currentColor;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav.is-open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Social icons in the header */
.nav__social {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.4rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line-dark);
}
.nav__social a {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  color: var(--fg-dark);
  opacity: 0.72;
  border-radius: var(--radius);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.nav__social a:hover { opacity: 1; transform: translateY(-2px); }
.nav__social svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;  /* fallback for Safari < 15.4 (no svh) */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: calc(var(--nav-h) + 2rem) 6rem;
  overflow: hidden;
  /* Flat pure black (same as every other dark section and the careers page) so
     the desktop overscroll area at the top blends seamlessly with the hero. */
  background: var(--bg-dark);
}
.hero__inner { position: relative; }
.hero__title {
  font-size: clamp(2.85rem, 1.2rem + 8vw, 7.5rem);
  letter-spacing: -0.035em;
  margin-top: 1.4rem;
  max-width: 16ch;
  margin-left: -0.09em; /* optical: align large cap ink with the kicker above */
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2.5rem;
}


/* ---------- In development ---------- */
.game__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
/* Allow the columns to shrink below their content's intrinsic width, so a long
   Greek label plus the fixed-width blur bar can't push the card past the
   viewport on the smallest phones (pairs with min-width:0 on .specs dd). */
.game__inner > * { min-width: 0; }
.game__intro .btn { margin-top: 2.25rem; }

/* Right column: the "In development" tag sits above the information card. */
.game__aside {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.game__aside .badge { align-self: flex-start; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dark);
  border: 1px solid var(--line-dark);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
}
.badge__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ff7a18;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.game__card {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}
.game__card-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.game__card-value {
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-dark);
}
.specs {
  margin-top: 1.75rem;
  border-top: 1px solid var(--line-dark);
}
.specs > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line-dark);
}
.specs dt {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
/* Purely decorative frosted blur blocks — no value, no text (hidden from
   assistive tech via aria-hidden on the list). The widths are a designed look;
   min-width:0 lets a bar shrink on a tiny screen instead of forcing the whole
   card wider than the viewport. */
.specs dd {
  width: 7rem;
  min-width: 0;
  height: 0.95rem;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
  filter: blur(3.5px);
}
.specs > div:nth-child(1) dd { width: 5.5rem; }
.specs > div:nth-child(2) dd { width: 8.5rem; }
.specs > div:nth-child(3) dd { width: 7rem; }

/* ---------- Studio: each block is a full-screen page, centred in the viewport ----------
   Both blocks stay on the same white #studio section; the user scrolls from one
   centred title block to the next. scroll-margin-top:0 plus the symmetric nav-height
   padding makes an anchor jump (clicking "Studio") land the first block centred. */
#studio {
  padding-block: 0;
  scroll-margin-top: 0;
}
#studio > .container { margin-block: 0; }
#studio .section__head,
#studio .ethos {
  min-height: 100vh;  /* fallback for Safari < 15.4 (no svh) */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: calc(var(--nav-h) + 1.5rem);
}
.ethos__logos {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 3vw, 1.75rem);
  margin-top: clamp(2rem, 4vw, 2.75rem);
}
.ethos__logo {
  display: inline-flex;
  transition: transform var(--t-fast);
}
.ethos__logo:hover { transform: translateY(-2px); }
.ethos__logo img {
  width: clamp(40px, 7vw, 52px);
  height: auto;
}

/* ---------- Careers ---------- */
.openings__inner { max-width: 52rem; }
.careers__cta { margin-top: 2.25rem; }

/* ---------- Footer ---------- */
.footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line-dark);
}
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  height: fit-content;
}
.footer__nav a { color: var(--muted-dark); transition: color var(--t-fast); }
.footer__nav a:hover { color: var(--fg-dark); }
.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.75rem;
  font-size: 0.8125rem;
  color: var(--muted-dark);
}

/* ---------- Typewriter reveal (section titles + their kickers only) ----------
   The text types in character by character behind a blinking caret. Targets are
   hidden until JS types them in; if JS is off, they simply show. */
.js [data-tw] { visibility: hidden; }
[data-tw].tw--seen { visibility: visible; }

.tw__caret {
  display: inline-block;
  width: 0.08em;
  min-width: 2px;
  height: 0.92em;
  margin-left: 0.1em;
  vertical-align: -0.12em;
  background: currentColor;
  border-radius: 1px;
  opacity: 0;
}
.tw--typing .tw__caret { animation: tw-blink 0.85s steps(1, end) infinite; }
@keyframes tw-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .game__inner { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav__toggle { display: flex; }
  /* Lock the page behind the open menu so it can't scroll under it. */
  html.nav-open { overflow: hidden; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    /* Never run past the bottom of the screen — on a short (landscape) phone the
       menu would otherwise push Careers and the social icons off-screen with no
       way to reach them. Cap to the space below the nav and scroll inside. */
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-dark);
    padding: 0.5rem var(--gutter) 1.5rem;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  }
  .nav.is-open .nav__links {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .nav__links > a:not(.btn) {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line-dark);
    font-size: 1.1rem;
  }
  .nav__links > a:not(.btn)::after { display: none; }

  .nav__social {
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0;
    padding: 0;
    border-left: none;
  }
  .nav__social a { width: 44px; height: 44px; border: 1px solid var(--line-dark); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-tw] { visibility: visible !important; }
  .tw__caret { display: none; }
  .badge__dot { animation: none; }
  .btn:hover,
  .ethos__logo:hover,
  .nav__social a:hover { transform: none; }
}
