/* Ovila — shared styles */

@font-face {
  font-family: "Office Code Pro";
  src: url("fonts/officecodepro-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Office Code Pro";
  src: url("fonts/officecodepro-medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Office Code Pro";
  src: url("fonts/officecodepro-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0d0d0d;
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.72);
  --fg-subtle: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.14);
  --font: "Office Code Pro", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

.logo { display: block; width: 65px; height: auto; }
.logo img { display: block; width: 100%; height: auto; }

/* Footer links (shared) */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 46px;
  padding: 0 var(--gutter);
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
}
.site-footer a {
  text-decoration: none;
  color: var(--fg);
  transition: opacity 0.2s ease;
}
.site-footer a:hover,
.site-footer a:focus-visible { opacity: 0.6; }
.site-footer a[aria-current="page"] { opacity: 0.5; }

a:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
}

/* ---------- Home ---------- */

.home {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.home__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Figma: logo at 146px from top on a 1117px-tall frame */
  padding: clamp(72px, 13vh, 146px) var(--gutter) 0;
  gap: clamp(28px, 3.3vh, 36px);
  text-align: center;
}

.home__title {
  margin: 0;
  max-width: 542px;
  font-weight: 400;
  font-size: clamp(22px, 2vw + 8px, 34.545px);
  line-height: 1.1;
  color: var(--fg);
}
.home__title span { display: block; }

/* Galaxy video: Figma frame is 848px square, rotated 30°, centred at ~52% height */
.home__galaxy {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 52%;
  width: min(848px, 92vw, 76vh);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(30deg);
  pointer-events: none;
  /* Browsers can render the video's dark background a touch lighter than the
     page, which shows as a faint rotated square. Feather the edges away. */
  -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
}
.home__galaxy video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home .site-footer {
  margin-top: auto;
  /* Figma: links sit ~80px above the bottom edge */
  padding-bottom: clamp(32px, 7.3vh, 82px);
}

/* 404 page */
.notfound__link {
  margin: 0;
  font-size: 16px;
  color: var(--fg-muted);
}
.notfound__link a {
  text-decoration: underline;
  text-decoration-color: var(--fg-subtle);
  text-underline-offset: 4px;
}
.notfound__link a:hover { color: var(--fg); text-decoration-color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  .home__galaxy video { animation: none; }
}

@media (max-width: 600px) {
  .home__galaxy { width: min(130vw, 70vh); top: 54%; }
  .site-footer { font-size: 14px; gap: 12px 28px; }
}

/* ---------- Legal pages ---------- */

.legal {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.legal__header {
  display: flex;
  justify-content: center;
  padding: clamp(48px, 8vh, 96px) var(--gutter) 0;
}

.legal__main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 88px) var(--gutter) clamp(64px, 10vh, 120px);
}

.legal h1 {
  margin: 0 0 16px;
  font-weight: 400;
  font-size: clamp(26px, 2vw + 12px, 34.545px);
  line-height: 1.1;
  text-align: center;
}

.legal__meta {
  margin: 0 0 clamp(48px, 7vh, 72px);
  text-align: center;
  font-size: 14px;
  color: var(--fg-subtle);
}

.legal h2 {
  margin: 56px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
}

.legal p,
.legal li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg-muted);
}
.legal p { margin: 0 0 16px; }
.legal strong { color: var(--fg); font-weight: 500; }

.legal ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}
.legal li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
}
.legal li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--fg-subtle);
}

.legal main a {
  text-decoration: underline;
  text-decoration-color: var(--fg-subtle);
  text-underline-offset: 3px;
}
.legal main a:hover { text-decoration-color: var(--fg); color: var(--fg); }

.table-wrap {
  margin: 8px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.legal table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}
.legal th,
.legal td {
  padding: 12px 16px 12px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.legal th {
  font-weight: 500;
  color: var(--fg);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.legal td { color: var(--fg-muted); }
.legal td:first-child { color: var(--fg); width: 24%; }

.legal .site-footer {
  margin-top: auto;
  padding-top: 32px;
  padding-bottom: clamp(32px, 6vh, 64px);
}

@media (max-width: 600px) {
  .legal table { min-width: 0; }
  .legal thead { display: none; }
  .legal tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .legal td { display: block; padding: 2px 0; border: 0; width: auto !important; }
  .legal td:first-child { font-weight: 500; margin-bottom: 4px; }
}
