/* Tokens follow auth.caioricciuti.com and caioricciuti.com: Geist, #0a0a0a, #f97316. */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --fg: #0a0a0a;
  --muted: #52525b;
  --border: #e4e4e7;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --on-accent: #0a0a0a;
  --ring: rgba(249, 115, 22, 0.28);
  --danger: #b91c1c;
  --ok: #15803d;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-2: #1c1c1f;
    --fg: #fafafa;
    --muted: #a1a1aa;
    --border: #27272a;
    --accent-hover: #fb923c;
    --ring: rgba(249, 115, 22, 0.35);
    --danger: #f87171;
    --ok: #4ade80;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.top {
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 42rem;
  margin: 0 auto;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
}
.brand img {
  border-radius: 6px;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}
.card.narrow {
  max-width: 26rem;
  width: 100%;
  margin: 3rem auto 0;
}

h1,
h2 {
  margin: 0 0 0.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1 {
  font-size: 1.5rem;
}
h2 {
  font-size: 1.1rem;
}
p {
  margin: 0 0 1rem;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
  margin: 0.75rem 0 0;
}

.profile {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.25rem;
  align-items: center;
}
.profile > .actions,
.profile > .small {
  grid-column: 1 / -1;
}
.profile > .actions {
  margin-top: 1.25rem;
}
.avatar {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  object-fit: cover;
}
.who {
  min-width: 0;
}
.who h1 {
  overflow-wrap: anywhere;
}
dl {
  margin: 0;
  display: grid;
  gap: 0.15rem;
}
dl div {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.6rem;
}
dt {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 5.5rem;
  padding-top: 0.15rem;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.actions form {
  margin: 0;
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn[aria-busy="true"] {
  opacity: 0.7;
  pointer-events: none;
}
.btn:focus-visible,
.app:focus-visible,
.brand:focus-visible,
#avatar-file:focus-visible + .btn {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.apps {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.6rem;
}
.app {
  display: grid;
  gap: 0.1rem;
  height: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
}
.app:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}
.app-name {
  font-weight: 600;
  font-size: 1rem;
}

.notice {
  margin: 0;
  padding: 0.7rem 1rem;
  border: 1px solid var(--danger);
  border-radius: 6px;
  color: var(--danger);
  background: var(--surface);
}
.notice.ok {
  border-color: var(--ok);
  color: var(--ok);
}
.card .notice {
  margin-bottom: 1rem;
}
[hidden] {
  display: none !important;
}

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

@media (max-width: 26rem) {
  .profile {
    grid-template-columns: 1fr;
    row-gap: 1rem;
  }
  .card {
    padding: 1.1rem;
  }
}
