/* ------------------------------------------------------------------
   CTRL-ALT-Security links: public page

   The brand is a key combination, so the page is built out of keycaps.
   The wordmark is three keys, every link is a key, and tapping one
   presses it down. That is the whole idea; everything else stays quiet.
   ------------------------------------------------------------------ */

:root {
  --is-dark: 1;
  --bg:       #171a21;
  --bg-lift:  #1d222c;
  --key:      #232833;
  --key-top:  #2b3140;
  --key-edge: #0d1015;
  --line:     #363e4e;
  --text:     #e9ecf2;
  --muted:    #98a1b3;
  --accent:   #6fd3ff;
  --shadow:   rgba(0, 0, 0, .34);

  --radius: 15px;
  --font-display: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="light"] {
  --is-dark: 0;
  --bg:       #eceef3;
  --bg-lift:  #f6f7fa;
  --key:      #ffffff;
  --key-top:  #ffffff;
  --key-edge: #c6ccd9;
  --line:     #dbe0e9;
  --text:     #14171d;
  --muted:    #5c6575;
  --shadow:   rgba(20, 25, 35, .14);
}

@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    --is-dark: 0;
    --bg:       #eceef3;
    --bg-lift:  #f6f7fa;
    --key:      #ffffff;
    --key-top:  #ffffff;
    --key-edge: #c6ccd9;
    --line:     #dbe0e9;
    --text:     #14171d;
    --muted:    #5c6575;
    --shadow:   rgba(20, 25, 35, .14);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.deck {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px calc(36px + env(safe-area-inset-bottom));
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a { color: inherit; }

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

/* ---------- Masthead ---------- */

.masthead {
  text-align: center;
  padding-bottom: 26px;
}

.avatar {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 4px 0 var(--key-edge), 0 10px 22px var(--shadow);
  background: var(--key);
}

.wordmark {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: inherit;
  font-weight: 400;
}

.cap {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(14px, 4.2vw, 19px);
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 9px 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--key-top), var(--key));
  box-shadow: 0 3px 0 var(--key-edge), 0 6px 12px var(--shadow),
              inset 0 1px 0 color-mix(in srgb, #fff calc(var(--is-dark) * 7%), transparent);
  animation: keypress .55s ease var(--cap-delay, 0ms) both;
}

.cap:first-of-type {
  color: var(--accent);
}

.wordmark__plus {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 13px;
}

@keyframes keypress {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(3px); box-shadow: 0 0 0 var(--key-edge); }
  100% { transform: translateY(0); }
}

.handle {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 16px 0 0;
}

.tagline {
  margin: 10px auto 0;
  max-width: 42ch;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.socials__key {
  display: grid;
  place-items: center;
  width: 46px;
  height: 40px;
  border-radius: 10px;
  color: var(--text);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--key-top), var(--key));
  box-shadow: 0 2px 0 var(--key-edge), 0 4px 9px var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, color .12s ease;
}

.socials__key:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--key-edge);
}

@media (hover: hover) {
  .socials__key:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  }
}

/* ---------- Section labels ---------- */

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rowlabel {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 2px 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.rowlabel::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.rowlabel__sub {
  letter-spacing: .04em;
  font-weight: 400;
  text-transform: none;
  opacity: .75;
}

/* ---------- Link keys ---------- */

.card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--key-top), var(--key));
  box-shadow: 0 3px 0 var(--key-edge), 0 8px 18px var(--shadow),
              inset 0 1px 0 color-mix(in srgb, #fff calc(var(--is-dark) * 6%), transparent);
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}

.card:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--key-edge), 0 2px 6px var(--shadow);
}

@media (hover: hover) {
  .card:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
    transform: translateY(-1px);
    box-shadow: 0 4px 0 var(--key-edge), 0 12px 22px var(--shadow);
  }
  .card:hover .card__go { color: var(--accent); }
}

.card__thumb {
  width: 74px;
  height: 74px;
  flex: none;
  border-radius: 11px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--bg-lift);
  border: 1px solid var(--line);
}

.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__glyph {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 26px;
  color: color-mix(in srgb, var(--accent) 70%, var(--muted));
}

.card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card__title {
  font-weight: 800;
  font-size: 16.5px;
  line-height: 1.25;
  letter-spacing: -.005em;
  color: var(--text);
}

.card__desc {
  font-size: 13px;
  line-height: 1.42;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  min-width: 0;
}

.card__domain {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 62%, var(--muted));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 5px;
  white-space: nowrap;
  color: var(--bg);
  background: var(--accent);
}

.card__go {
  color: var(--muted);
  display: grid;
  place-items: center;
  padding-right: 4px;
  transition: color .13s ease;
}

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

.empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
}

.footrow {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footrow__note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: .04em;
  color: var(--muted);
}

.themeswap {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 11px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--key-top), var(--key));
  box-shadow: 0 2px 0 var(--key-edge);
}

.themeswap:active {
  transform: translateY(2px);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .cap { animation: none; }
  .card, .socials__key, .themeswap { transition: none; }
  .card:active, .socials__key:active, .themeswap:active { transform: none; }
}
