/*
 * Design tokens. Every reused or themeable value lives here; components and
 * page styles only reference these variables. Names follow Basecoat/shadcn
 * so the vendored components work unchanged.
 */
:root {
  /* Colors: see the per-theme blocks below. */
  --card-foreground: var(--foreground);

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.625rem;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;

  /* Shape */
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-full: 9999px;
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);

  /* Layout */
  --content-width: 72rem;
  --narrow-width: 40rem;
  --header-height: 3.5rem;
  --control-height: 2.25rem;
  --control-height-sm: 2rem;

  /* Brand: the red of the HTML5 logo and the gold of the drawn brackets, the same in both themes. */
  --brand: #dd4b25;
  --brand-accent: #f1ac4b;

  /* Motion */
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --theme-transition: 400ms ease;
}

/*
 * Theme colors. Dark is the default; <html data-theme="light"> switches.
 * (Plain values per theme rather than light-dark(), so a theme change
 * transitions smoothly.)
 */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --link: oklch(0.75 0.12 260);
  --input-background: color-mix(in oklab, var(--input) 30%, transparent);
  --switch-track: color-mix(in oklab, var(--input) 80%, transparent);
  --switch-thumb: var(--foreground);
  --switch-thumb-checked: var(--primary-foreground);
  --theme-thumb: oklch(0.3 0.03 265);
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --link: oklch(0.45 0.18 260);
  --input-background: transparent;
  --switch-track: var(--input);
  --switch-thumb: var(--background);
  --switch-thumb-checked: var(--background);
  --theme-thumb: oklch(1 0 0);
}

/* Reset and element defaults. */

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

html {
  -webkit-text-size-adjust: 100%;
  /* Reserve the scrollbar so pages of different heights don't shift sideways. */
  scrollbar-gutter: stable;
}

/* Cross-document view transitions: page-to-page navigation cross-fades in place. */
@view-transition {
  navigation: auto;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
  text-wrap: balance;
}
h1 {
  font-size: var(--text-2xl);
}
h2 {
  font-size: var(--text-xl);
}
h3 {
  font-size: var(--text-base);
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

img,
svg {
  display: block;
  max-width: 100%;
}

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

[hidden] {
  display: none !important;
}

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

/* Basecoat: button (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding-inline: calc(var(--space-2) * 1.25);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background-clip: padding-box;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  outline: none;
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:focus-visible {
  border-color: var(--ring);
  box-shadow: var(--focus-ring);
}
.btn:active:not([aria-haspopup]) {
  translate: 0 1px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}
@media (hover: hover) {
  .btn:hover {
    background-color: color-mix(in oklab, var(--primary) 80%, transparent);
  }
}
.btn[data-size="sm"] {
  height: var(--control-height-sm);
  gap: var(--space-1);
  padding-inline: var(--space-3);
  border-radius: min(var(--radius-md), 10px);
  font-size: var(--text-sm);
}
.btn[data-variant="secondary"] {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.btn[data-variant="outline"] {
  border-color: var(--border);
  background-color: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}
.btn[data-variant="ghost"] {
  background-color: transparent;
  color: var(--foreground);
}
@media (hover: hover) {
  .btn[data-variant="secondary"]:hover {
    background-color: color-mix(in oklch, var(--secondary), var(--foreground) 5%);
  }
  .btn[data-variant="outline"]:hover,
  .btn[data-variant="ghost"]:hover {
    background-color: var(--muted);
  }
  .btn[data-variant="destructive"]:hover {
    background-color: color-mix(in oklab, var(--destructive) 20%, transparent);
  }
}
.btn[data-variant="destructive"] {
  background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

/* Basecoat: badge (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: 1.25rem;
  padding: 0.125rem var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--transition), color var(--transition);
}
.badge[data-variant="secondary"] {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.badge[data-variant="outline"] {
  border-color: var(--border);
  background-color: transparent;
  color: var(--foreground);
}
.badge[data-variant="destructive"] {
  background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
@media (hover: hover) {
  a.badge[data-variant="outline"]:hover {
    background-color: var(--muted);
    color: var(--muted-foreground);
  }
}

/* Basecoat: card (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-block: var(--space-6);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background-color: var(--card);
  color: var(--card-foreground);
  font-size: var(--text-sm);
}
.card > header {
  display: grid;
  grid-auto-rows: min-content;
  align-items: flex-start;
  gap: var(--space-1);
  padding-inline: var(--space-6);
}
.card > header > :is(h2, h3) {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-normal);
}
.card > header > p {
  color: var(--muted-foreground);
}
.card > section {
  padding-inline: var(--space-6);
}
.card > footer {
  display: flex;
  align-items: center;
  padding-inline: var(--space-6);
}

/* Basecoat: alert (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.alert {
  position: relative;
  display: grid;
  gap: 0.125rem;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--card);
  color: var(--card-foreground);
  font-size: var(--text-sm);
}
.alert > :is(h2, h3, strong) {
  font-weight: var(--weight-medium);
}
.alert > section {
  color: var(--muted-foreground);
  text-wrap: pretty;
}
.alert[data-variant="destructive"],
.alert[data-variant="destructive"] > section {
  color: var(--destructive);
}

/* Basecoat: input, textarea, native select (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.input,
.textarea,
.select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background-color: var(--input-background);
  font-size: var(--text-sm);
  outline: none;
  transition: color var(--transition), box-shadow var(--transition);
}
.input,
.select {
  height: var(--control-height);
  padding: var(--space-1) calc(var(--space-2) * 1.25);
}
.textarea {
  display: block;
  min-height: 4rem;
  padding: var(--space-2) calc(var(--space-2) * 1.25);
  resize: vertical;
  field-sizing: content;
}
.select {
  width: fit-content;
  padding-inline-end: var(--space-8);
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="gray" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
  background-position: right var(--space-2) center;
  background-repeat: no-repeat;
  background-size: 1rem;
}
.select option {
  background-color: var(--background);
  color: var(--foreground);
}
:is(.input, .textarea)::placeholder {
  color: var(--muted-foreground);
}
:is(.input, .textarea, .select):focus-visible {
  border-color: var(--ring);
  box-shadow: var(--focus-ring);
}
:is(.input, .textarea, .select)[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
}
:is(.input, .textarea, .select):disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Basecoat: field, label, fieldset (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.field > label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}
.field > p {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.field[data-invalid="true"] > label,
.field > p.field-error {
  color: var(--destructive);
}
.fieldset {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: 0;
}
.fieldset > legend {
  margin-bottom: var(--space-3);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

/* Basecoat: table (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.table-container {
  position: relative;
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  caption-side: bottom;
  font-size: var(--text-sm);
}
.table tr {
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition);
}
.table tbody tr:last-child {
  border-bottom: 0;
}
@media (hover: hover) {
  .table tbody tr:hover {
    background-color: color-mix(in oklab, var(--muted) 50%, transparent);
  }
}
.table th {
  height: 2.5rem;
  padding-inline: var(--space-2);
  text-align: start;
  vertical-align: middle;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  color: var(--foreground);
}
.table td {
  padding: var(--space-2);
  vertical-align: middle;
}
.table caption {
  margin-top: var(--space-4);
  color: var(--muted-foreground);
}

/* Basecoat: empty state (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-12) var(--space-6);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted-foreground);
  text-align: center;
  text-wrap: balance;
}

/* Basecoat: switch (MIT, Ronan Berder). Ported from Tailwind to plain CSS.
   Markup: <input type="checkbox" role="switch" class="switch"> */
.switch[role="switch"] {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  width: 32px;
  height: 18.4px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background-color: var(--switch-track);
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: background-color var(--transition), box-shadow var(--transition);
}
.switch[role="switch"]:checked {
  background-color: var(--primary);
}
.switch[role="switch"]:focus-visible {
  border-color: var(--ring);
  box-shadow: var(--focus-ring);
}
.switch[role="switch"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.switch[role="switch"]::before {
  content: "";
  display: block;
  width: 1rem;
  height: 1rem;
  border-radius: var(--radius-full);
  background-color: var(--switch-thumb);
  pointer-events: none;
  transition: translate var(--transition);
}
.switch[role="switch"]:checked::before {
  translate: calc(100% - 2px) 0;
  background-color: var(--switch-thumb-checked);
}

/* Site layout and page styles. */

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

.site-header {
  border-bottom: 1px solid var(--border);
  view-transition-name: site-header;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-height: var(--header-height);
  padding-block: var(--space-2);
}
.brand {
  color: var(--foreground);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
}
.nav-links > a:not(.btn),
.link-button {
  color: var(--muted-foreground);
  text-decoration: none;
}
.nav-links > a:not(.btn):hover,
.link-button:hover,
.nav-links > a[aria-current="page"] {
  color: var(--foreground);
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
/* Switching themes cross-fades colors instead of snapping. */
.theme-changing,
.theme-changing *,
.theme-changing *::before,
.theme-changing *::after {
  transition:
    background-color var(--theme-transition),
    color var(--theme-transition),
    border-color var(--theme-transition),
    box-shadow var(--theme-transition),
    translate var(--theme-transition) !important;
}
/* The thumb shows a sun in light mode and a moon in dark mode, and spins
   once while the theme changes. */
.theme-toggle .switch[role="switch"] {
  width: 40px;
  height: 22px;
  padding-inline: 1px;
}
.theme-toggle .switch[role="switch"]::before {
  content: "\2600\FE0F";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
  background-color: var(--theme-thumb);
  box-shadow: var(--shadow-xs);
  transition: translate var(--theme-transition), background-color var(--theme-transition);
}
.theme-toggle .switch[role="switch"]:checked::before {
  content: "\1F319";
  translate: 18px 0;
  background-color: var(--theme-thumb);
}
.theme-changing .theme-toggle .switch[role="switch"]::before {
  animation: theme-spin var(--theme-transition);
}
@keyframes theme-spin {
  from {
    rotate: 0deg;
  }
  to {
    rotate: 360deg;
  }
}
.nav-links > a.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}
/* Hand-drawn angle brackets; the closing one is the same stroke turned upside down and mirrored. */
.brand-bracket {
  width: auto;
  height: 1.5em;
  fill: var(--brand-accent);
}
.brand-bracket-close {
  rotate: 180deg;
}

main {
  outline: none; /* focused programmatically after in-page navigation */
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-block: var(--space-8);
}

.site-footer {
  padding-block: var(--space-6);
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.narrow {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: var(--narrow-width);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.stack > .btn {
  align-self: flex-start;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-6);
}
.muted {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.lede {
  max-width: var(--narrow-width);
  font-size: var(--text-lg);
  text-wrap: pretty;
}

/* Search bar */
.search {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.search > .input {
  flex: 1 1 16rem;
}

/* Job listing table */
#results {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.results-meta {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.jobs td {
  white-space: nowrap;
}
.jobs td.role {
  white-space: normal;
  min-width: 14rem;
}
.jobs td.role > a {
  font-weight: var(--weight-medium);
}
.jobs small {
  color: var(--muted-foreground);
}
.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.table th.num {
  text-align: end;
}
.table td.wrap {
  white-space: normal;
}
.sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: inherit;
  text-decoration: none;
}
.sort-icon {
  display: inline-block;
  width: 0.75em;
  opacity: 0.4;
}
.sort-icon::before {
  content: "↕";
}
[aria-sort] .sort-icon {
  opacity: 1;
}
[aria-sort="ascending"] .sort-icon::before {
  content: "↑";
}
[aria-sort="descending"] .sort-icon::before {
  content: "↓";
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}
@media (max-width: 40rem) {
  .hide-sm {
    display: none;
  }
}

/* Job page */
.job {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: var(--narrow-width);
}
.job-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.job-company {
  font-size: var(--text-lg);
}
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  padding: 0;
  list-style: none;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.job-meta .views {
  font-variant-numeric: tabular-nums;
}
.prose {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  line-height: var(--leading-relaxed);
  overflow-wrap: anywhere;
}
.apply > section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.apply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* About and resources */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-inline-start: var(--space-6);
}
.resource-list a {
  font-weight: var(--weight-medium);
}
.resource-list span {
  color: var(--muted-foreground);
}

/* Profile */
.profile-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-4);
  font-size: var(--text-sm);
}
.profile-facts dt {
  color: var(--muted-foreground);
}

/* Dashboard and admin */
.actions form {
  display: flex;
  justify-content: flex-end;
}
.review footer .decision {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  width: 100%;
}
.review footer .input {
  flex: 1 1 16rem;
}
.review h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.log {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}
.log small {
  margin-inline-start: var(--space-2);
  color: var(--muted-foreground);
}
details > summary {
  cursor: pointer;
}
