/* KEYIS apps landing page. Built by Terraform from the shared brand
   (core/network-edge/brand) plus this module's assets/landing.css. Fonts are
   same-origin files, as the Content-Security-Policy requires. */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url("/fonts/inter-tight.239e3c12.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url("/fonts/roboto.b7627e3c.woff2") format("woff2");
}

/* KEYIS brand tokens (Brand Guidelines 2026), copied from the Subcontractor app
   (keyis-subcontractor-onboarding client/src/index.css, the :root and .dark
   blocks) so platform pages share one look. Values are HSL channels:
   use as hsl(var(--token)).

   Dark mode: the apps switch with a .dark class (default light). A static page
   follows the visitor's OS instead, unless the app's saved choice
   (localStorage "theme") sets data-theme on <html>. */

:root {
  --keyis-black: 0 0% 0%;
  --keyis-white: 0 0% 100%;
  --keyis-slate: 43 16% 92%;
  --keyis-red: 351 79% 59%;
  --keyis-yellow: 44 100% 64%;
  --keyis-green: 98 43% 52%;
  --keyis-blue: 197 75% 69%;

  --surface-page: 40 14% 95%;
  --surface-sunken: 40 12% 97.5%;
  --surface-card: 0 0% 100%;

  --border-hairline: 40 9% 89%;
  --border-strong: 38 7% 78%;

  --ink-primary: 30 7% 12%;
  --ink-secondary: 33 5% 36%;
  --ink-muted: 36 4% 52%;

  --accent-solid: 30 8% 13%;
  --accent-ink: 0 0% 100%;

  --cta: 98 42% 34%;
  --cta-ink: 0 0% 100%;

  --status-info: 199 68% 42%;
  --status-info-tint: 197 70% 94%;
  --status-info-ink: 201 62% 27%;

  --shadow-hue: 30 12% 12%;
  --radius: 0.625rem;
  --shadow-card: 0 1px 2px hsl(var(--shadow-hue) / 0.04), 0 1px 1px hsl(var(--shadow-hue) / 0.03);
  --font-sans: "Inter Tight", "Roboto", Arial, system-ui, -apple-system, sans-serif;

  color-scheme: light;
}

/* The dark palette, applied twice: by OS preference (unless the app's saved
   theme says light) and by an explicit saved "dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-page: 30 8% 7%;
    --surface-sunken: 30 7% 10%;
    --surface-card: 30 7% 11%;
    --border-hairline: 30 6% 19%;
    --border-strong: 30 6% 28%;
    --ink-primary: 40 12% 96%;
    --ink-secondary: 38 7% 72%;
    --ink-muted: 36 6% 56%;
    --accent-solid: 40 12% 96%;
    --accent-ink: 30 8% 10%;
    --cta: 98 45% 55%;
    --cta-ink: 30 8% 10%;
    --status-info: 197 72% 62%;
    --status-info-tint: 200 40% 17%;
    --status-info-ink: 197 70% 74%;
    --shadow-hue: 0 0% 0%;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --surface-page: 30 8% 7%;
  --surface-sunken: 30 7% 10%;
  --surface-card: 30 7% 11%;
  --border-hairline: 30 6% 19%;
  --border-strong: 30 6% 28%;
  --ink-primary: 40 12% 96%;
  --ink-secondary: 38 7% 72%;
  --ink-muted: 36 6% 56%;
  --accent-solid: 40 12% 96%;
  --accent-ink: 30 8% 10%;
  --cta: 98 45% 55%;
  --cta-ink: 30 8% 10%;
  --status-info: 197 72% 62%;
  --status-info-tint: 200 40% 17%;
  --status-info-ink: 197 70% 74%;
  --shadow-hue: 0 0% 0%;
  color-scheme: dark;
}

/* Platform page frame: mirrors the Subcontractor app's sign-in page
   (client/src/pages/Login.tsx) — card header with the KEYIS lockup, a
   max-w-md column under the gradient rule. Reads the tokens in tokens.css. */

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

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  background-color: hsl(var(--surface-page));
  color: hsl(var(--ink-primary));
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
}

.site-header {
  background-color: hsl(var(--surface-card));
  border-bottom: 1px solid hsl(var(--border-hairline) / 0.5);
}

.container {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header .container {
  display: flex;
  align-items: center;
  height: 3.5rem;
}

.logo {
  display: block;
  height: 1.5rem;
  width: auto;
}

/* Approved artwork only: switch files per background, never recolour. */
.logo-for-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-for-light {
    display: none;
  }
  :root:not([data-theme="light"]) .logo-for-dark {
    display: block;
  }
}

:root[data-theme="dark"] .logo-for-light {
  display: none;
}

:root[data-theme="dark"] .logo-for-dark {
  display: block;
}

main {
  display: flex;
  justify-content: center;
  padding: 4rem 1rem;
}

.column {
  width: 100%;
  max-width: 28rem;
}

.keyis-rule {
  width: 6rem;
  height: 3px;
  margin-bottom: 2rem;
  border-radius: 999px;
  background-image: linear-gradient(
    90deg,
    hsl(var(--keyis-red)) 0%,
    hsl(var(--keyis-yellow)) 38%,
    hsl(var(--keyis-green)) 68%,
    hsl(var(--keyis-blue)) 100%
  );
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.stack {
  margin-top: 1.5rem;
}

.stack > * + * {
  margin-top: 0.75rem;
}

p {
  margin: 0;
}

.lead {
  color: hsl(var(--ink-primary));
}

/* The fonts carry 300–500 only and synthesis is off, so "bold" is 500, as in
   the app (<strong> on the sign-in page). */
strong {
  font-weight: 500;
}

/* State icon above the heading, like MailCheck on the sign-in page. */
.state-icon {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  color: hsl(var(--ink-primary));
}

/* The app's ContactAdmin line: small and muted, with the email and phone as
   medium-weight, full-colour links. */
.contact {
  font-size: 0.875rem;
  color: hsl(var(--ink-muted));
}

.contact a {
  font-weight: 500;
  color: hsl(var(--ink-primary));
  white-space: nowrap;
}

.muted {
  color: hsl(var(--ink-muted));
}

.notice {
  margin-top: 1.5rem;
  padding: 0.75rem;
  border: 1px solid hsl(var(--status-info) / 0.3);
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--status-info-tint));
  color: hsl(var(--status-info-ink));
  font-size: 0.875rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0;
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: hsl(var(--ink-muted));
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: hsl(var(--border-hairline));
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}

a:hover {
  color: hsl(var(--ink-primary));
}

:where(a, button):focus-visible {
  outline: 2px solid hsl(var(--accent-solid) / 0.55);
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 4px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.25rem;
  margin-top: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--cta));
  color: hsl(var(--cta-ink));
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  background-color: hsl(var(--cta) / 0.9);
  color: hsl(var(--cta-ink));
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Tiles for the KEYIS apps landing page. Uses the brand tokens only, so light
   and dark follow the visitor's OS like the rest of the frame. */

.column-wide {
  max-width: 40rem;
}

.intro {
  margin-top: 0.75rem;
}

.tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  padding: 1rem 2.75rem 1rem 1rem;
  border: 1px solid hsl(var(--border-hairline));
  border-radius: var(--radius);
  background-color: hsl(var(--surface-card));
  box-shadow: var(--shadow-card);
  color: hsl(var(--ink-primary));
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover {
  border-color: hsl(var(--border-strong));
  color: hsl(var(--ink-primary));
}

.tile:focus-visible {
  border-radius: var(--radius);
}

.tile-name {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  overflow-wrap: anywhere;
}

.tile-description {
  font-size: 0.875rem;
  color: hsl(var(--ink-muted));
}

.tile-arrow {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 1.25rem;
  height: 1.25rem;
  color: hsl(var(--ink-muted));
  transform: translateY(-50%);
  transition: transform 0.15s ease, color 0.15s ease;
}

.tile:hover .tile-arrow {
  color: hsl(var(--ink-primary));
  transform: translate(2px, -50%);
}

