:root {
  --bg: #fafaf7;
  --fg: #1d1d1b;
  --muted: #6b6b66;
  --card: #ffffff;
  --border: #e3e3dc;
  --accent: #d9480f;
  --error: #c92a2a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --fg: #ecece6;
    --muted: #9a9a92;
    --card: #1f1f1d;
    --border: #33332f;
    --accent: #ff8a4c;
    --error: #ff6b6b;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem;
}

.brand {
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

.account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

#account-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

.intro,
.card {
  max-width: 40rem;
}

.intro h1 {
  margin: 2rem 0 0.5rem;
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

.intro p {
  margin: 0 0 2.5rem;
  color: var(--muted);
}

h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.card {
  margin-bottom: 2.5rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

form {
  display: grid;
  gap: 0.5rem;
}

.hint {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

label {
  font-size: 0.9rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.link-button {
  padding: 0;
  font-weight: 400;
  color: var(--accent);
  background: none;
  text-decoration: underline;
}

#verify-form .link-button {
  justify-self: start;
}

.message {
  margin: 0.75rem 0 0;
  min-height: 1.5em;
  color: var(--muted);
}

.message.error {
  color: var(--error);
}

.ideas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  color: var(--muted);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: var(--tint);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6%;
  aspect-ratio: 4 / 3;
  font-size: clamp(48px, 11vw, 80px);
  line-height: 1;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--tint) 28%, transparent) 0%,
    color-mix(in srgb, var(--tint) 8%, transparent) 55%,
    transparent 100%
  );
  border-bottom: 1px solid var(--border);
}

.tile-inner {
  padding: 16px;
}

.tile h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--fg);
}

.tile p {
  margin: 0;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }

  .tile:hover {
    transform: none;
  }
}

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

.ideas:has(li) + .empty {
  display: none;
}
