/* mcp.szewcz.uk: tokens and components from the szewcz.uk design system (Mono theme). */

:root {
  color-scheme: dark;

  --background: oklch(0 0 0);
  --foreground: oklch(1 0 0);
  --card: oklch(0.2 0 0);
  --card-foreground: oklch(1 0 0);
  --primary: oklch(1 0 0);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.26 0 0);
  --secondary-foreground: oklch(1 0 0);
  --muted: oklch(0.26 0 0);
  --muted-foreground: oklch(0.66 0 0);
  --destructive: oklch(1 0 0);
  --border: oklch(0.3 0 0);
  --input: oklch(0.3 0 0);
  --ring: oklch(1 0 0);

  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "DM Sans", ui-sans-serif, system-ui, sans-serif;

  --space-1: 0.25rem;
  --space-1\.5: 0.375rem;
  --space-2: 0.5rem;
  --space-2\.5: 0.625rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-md: 0.4rem;
  --radius-lg: 0.5rem;
  --radius-full: 9999px;

  --shadow-row-hover: 0 10px 15px -3px oklch(1 0 0 / 0.05), 0 4px 6px -4px oklch(1 0 0 / 0.05);
  --shadow-card-hover: 0 20px 25px -5px oklch(1 0 0 / 0.1), 0 8px 10px -6px oklch(1 0 0 / 0.1);
  --shadow-cta-hover: 0 10px 15px -3px oklch(1 0 0 / 0.2), 0 4px 6px -4px oklch(1 0 0 / 0.2);

  --duration-default: 150ms;
  --duration-fast: 200ms;
  --duration-base: 300ms;
  --duration-enter: 500ms;
  --stagger-paragraph: 120ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);

  --container-mobile: 36rem;
  --measure-text: 28rem;

  --ring-halo: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

/* --- Base ------------------------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--border); }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font: 400 16px/1.625 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--foreground); color: var(--background); }

:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--ring) 50%, transparent);
  outline-offset: 2px;
}

h1, h2, h3, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { color: var(--muted-foreground); text-wrap: pretty; }
strong { font-weight: 500; color: var(--foreground); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; padding: 0; cursor: pointer; }
svg { flex-shrink: 0; }

.i4 { width: 1rem; height: 1rem; }

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

/* Inline text links: white with a grey underline that turns white on hover. */
.text-link {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--muted-foreground);
  text-underline-offset: 4px;
  transition: text-decoration-color var(--duration-default) var(--ease-default);
}
.text-link:hover { text-decoration-color: var(--foreground); }

/* --- Layout ---------------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-mobile);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.topbar { border-bottom: 1px solid var(--border); }
.topbar .container {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: 3.5rem;
}

.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-weight: 500; line-height: 24px; color: var(--foreground);
}
.brand .logo { width: 1.5rem; height: 1.5rem; color: var(--primary); }

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav-link {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-mono); font-size: 12px; line-height: 16px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted-foreground);
  transition: color var(--duration-default) var(--ease-default);
}
.nav-link:hover { color: var(--foreground); }
.nav-link[aria-current="page"] { color: var(--primary); }
.nav-link[aria-current="page"]::before {
  content: ""; width: var(--space-6); height: 1px; background: var(--primary);
}
.nav form { display: contents; }

main.container { padding-top: var(--space-12); padding-bottom: var(--space-20); }

.page-head { margin-bottom: var(--space-12); }
.page-head .lead { margin-top: var(--space-4); max-width: var(--measure-text); }
.page-head .cta { margin-top: var(--space-8); }

.section { scroll-margin-top: var(--space-8); }
.section + .section { margin-top: var(--space-16); }

.stack > * + * { margin-top: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }

/* --- Type ------------------------------------------------------------------------------------ */

.page-title {
  font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -0.025em;
  color: var(--foreground); text-wrap: balance;
}
@media (min-width: 640px) {
  .page-title.lg { font-size: 48px; line-height: 1; }
}

.lead { font-size: 16px; line-height: 1.625; color: var(--muted-foreground); }

.title { font-size: 16px; line-height: 24px; font-weight: 500; color: var(--foreground); }

.small { font-size: 14px; line-height: 1.625; }
.muted { color: var(--muted-foreground); }

/* SectionHeading: a short white rule before an uppercase label. */
.section-heading {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-6);
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground);
}
.section-heading::before { content: ""; width: var(--space-6); height: 1px; background: var(--primary); }

code {
  font-family: var(--font-mono); font-size: 0.875em;
  padding: 0.125rem var(--space-1\.5);
  border-radius: var(--radius-md);
  background: var(--secondary); color: var(--secondary-foreground);
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* --- Surfaces -------------------------------------------------------------------------------- */

.card {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.divided > * + * { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }

/* --- Actions --------------------------------------------------------------------------------- */

/* CtaLink: the one white call to action per view. */
.cta {
  display: inline-flex; align-items: center; gap: var(--space-2);
  border-radius: var(--radius-md); background: var(--primary);
  padding: var(--space-2\.5) var(--space-5);
  font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 500;
  color: var(--primary-foreground);
  transition: all var(--duration-base) var(--ease-out);
}
.cta svg { width: 1rem; height: 1rem; transition: transform var(--duration-base) var(--ease-out); }
.cta:hover { transform: translateY(-2px); opacity: 0.9; box-shadow: var(--shadow-cta-hover); }
.cta:hover svg { transform: translate(2px, -2px); }

/* Button (shadcn base-nova) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1\.5);
  height: 2rem; padding: 0 var(--space-2\.5);
  border: 1px solid transparent; border-radius: var(--radius-lg); background-clip: padding-box;
  font-family: var(--font-sans); font-size: 14px; line-height: 20px; font-weight: 500;
  white-space: nowrap; user-select: none; cursor: pointer;
  transition: all var(--duration-default) var(--ease-default);
}
.btn svg { width: 1rem; height: 1rem; pointer-events: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--ring-halo); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-default { background: var(--primary); color: var(--primary-foreground); }
.btn-default:hover { background: color-mix(in oklab, var(--primary) 80%, transparent); }
.btn-outline { border-color: var(--border); background: var(--background); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { color: var(--foreground); }
.btn-ghost:hover { background: var(--muted); }
.btn-destructive { background: color-mix(in oklab, var(--destructive) 10%, transparent); color: var(--destructive); }
.btn-destructive:hover { background: color-mix(in oklab, var(--destructive) 20%, transparent); }

.btn-sm {
  height: 1.75rem; gap: var(--space-1); padding: 0 var(--space-2\.5);
  font-size: 0.8rem; border-radius: min(var(--radius-md), 12px);
}
.btn-sm svg { width: 0.875rem; height: 0.875rem; }
.btn-lg { height: 2.25rem; padding: 0 var(--space-4); }
.btn-flush { margin-left: calc(-1 * var(--space-2\.5)); }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

/* --- Status ---------------------------------------------------------------------------------- */

.tag {
  display: inline-flex; align-items: center; gap: var(--space-1\.5);
  border-radius: var(--radius-full); background: var(--secondary);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--secondary-foreground);
  white-space: nowrap;
}
.tag svg { width: 0.875rem; height: 0.875rem; }
.tag-muted, .tag-alert {
  background: transparent; border: 1px solid;
  padding: calc(var(--space-1) - 1px) calc(var(--space-3) - 1px);
}
.tag-muted { border-color: var(--muted-foreground); color: var(--muted-foreground); }
.tag-alert { border-color: var(--foreground); color: var(--foreground); }

.flash {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4); margin-bottom: var(--space-6);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); color: var(--foreground);
  font-size: 14px; line-height: 1.625;
}
.flash svg { width: 1.25rem; height: 1.25rem; margin-top: 1px; }
.flash.error, .flash.warning { border-color: var(--muted-foreground); }
.card .flash { margin: var(--space-4) 0 0; background: var(--background); }
.card .flash:first-child { margin-top: 0; }

/* --- Panel pieces ---------------------------------------------------------------------------- */

.account { display: flex; align-items: center; gap: var(--space-4); }
.account img {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--border); filter: grayscale(1);
}
.account .small { overflow-wrap: anywhere; }

.status-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.status-row.wrap { flex-wrap: wrap; }
.status-row > div { flex: 1 1 auto; min-width: 0; }
.status-row > .tag { flex-shrink: 0; }
.status-row .small { margin-top: var(--space-1); }
.status-row form { margin-top: var(--space-3); }

.copy {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background);
}
.copy code { padding: 0; background: none; font-size: 14px; color: var(--foreground); }

.howto { margin-top: var(--space-6); }
.howto dt { font-weight: 500; line-height: 24px; color: var(--foreground); }
.howto dd { margin-top: var(--space-1); font-size: 14px; line-height: 1.75; color: var(--muted-foreground); }
.howto dd + dt { margin-top: var(--space-5); }

.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.form-row label { flex-basis: 100%; font-size: 14px; color: var(--foreground); }

.field {
  height: 2rem; padding: 0 var(--space-8) 0 var(--space-2\.5);
  border: 1px solid var(--input); border-radius: var(--radius-lg);
  background: var(--background) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23929292' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right var(--space-2) center / 1rem;
  color: var(--foreground); font: 400 14px/20px var(--font-sans);
  appearance: none; cursor: pointer;
  transition: border-color var(--duration-default) var(--ease-default), box-shadow var(--duration-default) var(--ease-default);
}
.field:hover { border-color: var(--muted-foreground); }
.field:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--ring-halo); }

.checklist li { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--foreground); }
.checklist li + li { margin-top: var(--space-3); }
.errorlist { margin-top: var(--space-4); font-size: 14px; color: var(--foreground); }
.checklist svg { width: 1.25rem; height: 1.25rem; margin-top: 2px; }

/* --- Tables ---------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.625; }
th {
  padding: 0 var(--space-3) var(--space-3) 0; text-align: left; vertical-align: bottom;
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}
td {
  padding: var(--space-3) var(--space-3) var(--space-3) 0; vertical-align: top;
  color: var(--foreground); border-bottom: 1px solid var(--border);
}
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; padding-bottom: 0; }
td.end, th.end { text-align: right; }
td .muted { display: block; overflow-wrap: break-word; }
td .id { overflow-wrap: anywhere; }
.course-id { display: block; margin-top: var(--space-1); font-size: 12px; color: var(--muted-foreground); }
td a {
  display: inline-flex; align-items: center; gap: var(--space-1\.5); font-weight: 500;
  transition: color var(--duration-default) var(--ease-default);
}
td a svg { width: 1rem; height: 1rem; transition: transform var(--duration-base) var(--ease-out); }
td a:hover svg { transform: translate(2px, -2px); }

/* --- Motion ---------------------------------------------------------------------------------- */

@keyframes enter {
  from { opacity: 0; transform: translateY(1rem); }
}
.enter {
  animation: enter var(--duration-enter) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * var(--stagger-paragraph));
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter { animation: none; }
  .cta:hover,
  .cta:hover svg, td a:hover svg, .btn:active { transform: none; }
}
