/* SPDX-License-Identifier: MIT */
/* One small stylesheet for the whole site: system fonts, no frameworks. */

:root {
  color-scheme: light dark;
  --bg: #fff;
  --surface: #f6f2fc;
  --text: #1d0b3f;
  --muted: #4d3d68;
  --link: #6420c0;
  --accent: #1d0b3f;
  --on-accent: #fff;
  --border: #ddd0f0;
  --radius: 0.75rem;
  --wrap: 72rem;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12062a;
    --surface: #1d0b3f;
    --text: #f3eefc;
    --muted: #c9bce0;
    --link: #d8b4fe;
    --accent: #daabec;
    --on-accent: #12062a;
    --border: #3a2363;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

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

h1,
h2,
h3 {
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem);
  margin-block: 1.5rem 1rem;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  z-index: 1;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */

.site-header {
  background: #1d0b3f;
  color: #fff;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-block: 0.75rem;
}

.site-header a {
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.4rem;
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.site-search {
  display: flex;
  gap: 0.25rem;
  margin-inline-start: auto;
}

.site-header :focus-visible {
  outline-color: #daabec;
}

input[type="search"] {
  font: inherit;
  min-width: 0;
  width: 14rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg);
  color: var(--text);
}

button,
.button {
  font: inherit;
  font-weight: 600;
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 0.4rem;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  cursor: pointer;
}

.site-header button {
  border-color: #daabec;
  background: #daabec;
  color: #1d0b3f;
}

/* Text content */

.prose {
  max-width: 44rem;
}

.prose h2 {
  margin-top: 2rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-inline-start: 4px solid var(--link);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

/* Logos sit on a white tile so dark logos stay visible in dark mode. */
.logo {
  flex: none;
  width: 100px;
  height: 100px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
  padding: 6px;
  border: 1px solid var(--border);
}

.logo-placeholder {
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1d0b3f;
}

.app-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-block: 1.5rem 1rem;
}

.app-head h1 {
  margin: 0;
}

.meta {
  color: var(--muted);
}

/* Home: grid of big tech platforms */

.platforms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 3rem;
  padding: 0;
  list-style: none;
}

.platforms a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

.platforms a:hover {
  background: var(--surface);
}

/* Alternative cards and search results */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
  margin: 1rem 0 3rem;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-head .logo {
  width: 64px;
  height: 64px;
  padding: 4px;
}

.card h2,
.card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.card p {
  margin: 0;
}

.card .visit {
  margin-top: auto;
  padding-top: 0.5rem;
  overflow-wrap: anywhere;
}

.search-page form {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.search-page input[type="search"] {
  width: 100%;
  max-width: 24rem;
}

[hidden] {
  display: none !important;
}

/* Footer */

.site-footer {
  margin-top: 3rem;
  padding-block: 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

@media (max-width: 40rem) {
  .site-search {
    margin-inline-start: 0;
    width: 100%;
  }

  .site-search input[type="search"] {
    flex: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
