:root {
  color-scheme: light;
  --background: oklch(0.985 0.005 85);
  --foreground: oklch(0.22 0.008 75);
  --card: oklch(0.995 0.004 85);
  --muted: oklch(0.95 0.006 85);
  --muted-foreground: oklch(0.55 0.008 75);
  --accent: oklch(0.7 0.13 62);
  --border: oklch(0.9 0.006 85);
  --ring: oklch(0.7 0.13 62);
  --danger: oklch(0.577 0.245 27.325);
}

.dark {
  color-scheme: dark;
  --background: oklch(0.17 0.005 70);
  --foreground: oklch(0.94 0.005 85);
  --card: oklch(0.2 0.006 70);
  --muted: oklch(0.25 0.006 70);
  --muted-foreground: oklch(0.65 0.008 78);
  --accent: oklch(0.76 0.13 65);
  --border: oklch(1 0 0 / 9%);
  --ring: oklch(0.76 0.13 65);
  --danger: oklch(0.704 0.191 22.216);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.hidden {
  display: none !important;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(100%, 390px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  padding: 24px;
  box-shadow: 0 18px 40px -28px rgb(0 0 0 / 45%);
}

.gate-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.gate h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.15;
}

.gate p {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
}

.gate-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.gate-form label {
  display: grid;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.gate-form input {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  color: var(--foreground);
  padding: 0 14px;
  outline: 0;
}

.gate-form input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}

.gate-form button {
  height: 42px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: var(--background);
  font-weight: 650;
}

.gate-error {
  min-height: 20px;
  margin: -4px 0 0 !important;
  color: var(--danger) !important;
}

.workshop {
  width: min(1080px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 64px 24px;
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.masthead h1 {
  margin: 0;
  color: var(--foreground);
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
}

.masthead p {
  max-width: 440px;
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.65;
}

.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  transition: border-color 220ms ease, color 220ms ease;
}

.theme-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  color: var(--foreground);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 300ms ease;
}

.theme-toggle:hover svg {
  transform: rotate(-12deg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.tool {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  padding: 24px;
  transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.tool:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 1px 0 0 var(--border), 0 18px 40px -24px rgb(0 0 0 / 45%);
  transform: translateY(-2px);
}

.tool-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.tool-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.icon-shell {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  color: var(--foreground);
  transition: border-color 300ms ease, color 300ms ease;
}

.tool:hover .icon-shell {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
}

.glyph {
  width: 20px;
  height: 20px;
}

.tool h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.2;
}

.badges {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.tag,
.lock {
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.tag {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 560;
}

.lock {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
}

.lock svg {
  width: 12px;
  height: 12px;
}

.subtitle,
.host,
.footer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.subtitle {
  color: color-mix(in srgb, var(--muted-foreground) 80%, transparent);
  font-size: 12px;
}

.description {
  flex: 1;
  margin: 12px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.65;
}

.tool-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  padding-top: 16px;
}

.host {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--muted-foreground) 80%, transparent);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 300ms ease;
}

.arrow {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted-foreground);
  transition: transform 300ms ease, color 300ms ease;
}

.tool:hover .host,
.tool:hover .arrow {
  color: var(--accent);
}

.tool:hover .arrow {
  transform: translate(2px, -2px);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  padding-top: 24px;
  color: color-mix(in srgb, var(--muted-foreground) 70%, transparent);
  font-size: 12px;
}

.footer button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.footer button:hover {
  color: var(--accent);
}

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

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .workshop {
    padding: 42px 20px;
  }

  .masthead {
    align-items: center;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .tool {
    padding: 20px;
  }

  .footer {
    margin-top: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
