/* Shared shell for the interactive labs. Palette mirrors the portfolio (styles.css). */
:root {
  --ink: #071018;
  --panel: #0e1c27;
  --panel-raised: #132634;
  --line: rgba(164, 209, 226, 0.16);
  --line-strong: rgba(164, 209, 226, 0.32);
  --text: #f2f7f8;
  --muted: #a9bbc3;
  --faint: #7d919b;
  --cyan: #64e6da;
  --blue: #7aa8ff;
  --amber: #f4c76b;
  --coral: #ff8e7d;
  --green: #77e3a1;
  --radius: 16px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

a {
  color: var(--cyan);
}

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

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--ink);
  background: var(--cyan);
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.lab-shell {
  width: min(1180px, calc(100% - 48px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin-inline: auto;
}

/* Not sticky: nothing on the page ever scrolls underneath it. */
.lab-header {
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--line);
}

.lab-header .lab-shell {
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding-block: 10px;
}

.lab-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.lab-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.lab-brand span[aria-hidden] {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(100, 230, 218, 0.45);
  border-radius: 11px;
  color: var(--cyan);
  background: rgba(100, 230, 218, 0.08);
}

.nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--text);
  background: rgba(100, 230, 218, 0.07);
}

main {
  padding-block: 48px 72px;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 12px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.1rem;
}

.status-label {
  display: inline-block;
  margin: 6px 0 16px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.disclaimer {
  max-width: 860px;
  padding: 14px 16px;
  border: 1px solid rgba(244, 199, 107, 0.4);
  border-left-width: 4px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(244, 199, 107, 0.07);
}

.section {
  margin-top: 44px;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-kicker {
  margin-bottom: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.button:hover:not(:disabled) {
  border-color: rgba(100, 230, 218, 0.55);
  background: rgba(100, 230, 218, 0.08);
}

.button-primary {
  border-color: transparent;
  color: #041518;
  background: var(--cyan);
}

.button-primary:hover:not(:disabled) {
  background: #86efe6;
}

/* Disabled is shown by shape (dashed, unfilled) as well as tone, not by opacity alone. */
.button:disabled,
.button-primary:disabled {
  border: 1px dashed var(--line-strong);
  color: var(--faint);
  background: transparent;
  cursor: not-allowed;
}

label,
.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: #081520;
  font: inherit;
}

textarea {
  min-height: 190px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
}

.hint {
  color: var(--faint);
  font-size: 0.85rem;
}

.text-output {
  min-height: 64px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #081520;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

mark {
  border-radius: 5px;
  padding: 0 3px;
  color: var(--text);
}

mark.token {
  background: rgba(100, 230, 218, 0.16);
  box-shadow: inset 0 0 0 1px rgba(100, 230, 218, 0.45);
}

mark.residual {
  background: rgba(255, 142, 125, 0.2);
  box-shadow: inset 0 0 0 1px var(--coral);
  text-decoration: underline wavy var(--coral);
}

mark.candidate {
  background: rgba(244, 199, 107, 0.18);
  box-shadow: inset 0 0 0 1px var(--amber);
  text-decoration: underline dotted var(--amber);
}

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

.lab-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lab-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}

.pill-available {
  border-color: rgba(119, 227, 161, 0.55);
  color: var(--green);
}

.lab-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.lab-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  .lab-shell {
    width: calc(100% - 30px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  }

  main {
    padding-block: 32px 56px;
  }

  .panel {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
