/* Blueprint theme of the workshop deck "AI & 3D-printen". Accent colours that are too
   light for small text on white get a darker text variant (WCAG AA, 4.5:1). */
:root {
  --navy: #0f1b2d;
  --navy-2: #172742;
  --slate: #4a5a73;
  --muted-dark: #a9b6cc;
  --bg: #f4f6fa;
  --line: #d3dbe6;
  --white: #fff;
  --orange: #ff7a1a;
  --orange-text: #b54708;
  --cyan: #00b4d8;
  --cyan-text: #00708a;
  --purple: #7c5cff;
  --green: #2bc48a;
  --green-text: #13805a;
  --red: #c62828;
  --focus: #ff7a1a;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(15, 27, 45, 0.08);
  --font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Courier New", Courier, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--navy);
  background-color: var(--bg);
  background-image: radial-gradient(var(--line) 1px, transparent 1.4px);
  background-size: 24px 24px;
  min-height: 100vh;
}

body.dark,
.band {
  color: var(--white);
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(64, 99, 150, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 99, 150, 0.35) 1px, transparent 1px),
    linear-gradient(rgba(64, 99, 150, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 99, 150, 0.14) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}

h1, h2, h3 { line-height: 1.15; margin: 0; }

a { color: var(--cyan-text); text-underline-offset: 0.15em; }
.dark a, .band a, .card-dark a { color: var(--cyan); }

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

main:focus { outline: none; }

.skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--white);
  color: var(--navy);
  border-radius: var(--radius);
  font-weight: 700;
}
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
}
.wrap.narrow { max-width: 640px; padding-top: 3rem; }

.mono { font-family: var(--mono); font-weight: 700; }

.label {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0;
}
.label-orange { color: var(--orange-text); }
.dark .label-orange, .band .label-orange, .card-dark .label-orange { color: var(--orange); }
.dark .label, .band .label { color: var(--muted-dark); }
.dark .label-orange, .band .label-orange { color: var(--orange); }

/* Content-slide header */

.slide-header { padding: 1.25rem 0 1rem; }
.slide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.slide-head h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); margin-top: 0.2rem; overflow-wrap: anywhere; }
.slide-sub { margin: 0.25rem 0 0; color: var(--slate); font-size: 1.15rem; }

.tag {
  flex: none;
  margin: 0.25rem 0 0;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
}
.tag-orange { background: var(--orange); }
.tag-cyan { background: var(--cyan); }

/* Cards */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}
.card > h2.label { margin-bottom: 0.75rem; }
.card > h1 { margin-bottom: 0.75rem; }

.card-dark {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.grid-wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }

.stack > * + * { margin-top: 1rem; }

/* Forms */

label { font-weight: 700; display: block; }
.field + .field { margin-top: 0.75rem; }
.hint { margin: 0.1rem 0 0.35rem; color: var(--slate); font-size: 0.95rem; }
.dark .hint { color: var(--muted-dark); }

input[type="text"], input:not([type]), input[type="password"], textarea {
  width: 100%;
  font: inherit;
  color: var(--navy);
  background: var(--white);
  border: 2px solid #8794a8;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin-top: 0.25rem;
}
input:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--navy); }
input[readonly], textarea[readonly] { background: var(--bg); }

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
legend { font-weight: 700; padding: 0; margin-bottom: 0.5rem; }

button, .button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.6rem 1.2rem;
  min-height: 44px;
  border-radius: 8px;
  border: 2px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--navy-2); }
.dark button, .dark .button { background: var(--orange); border-color: var(--orange); color: var(--navy); }
.dark button:hover, .dark .button:hover { background: #ff9447; }
.dark a.button { color: var(--navy); }

button.secondary { background: var(--white); color: var(--navy); }
button.secondary:hover { background: var(--bg); }
button.danger { background: var(--white); color: var(--red); border-color: var(--red); }
button.danger:hover { background: #fdecec; }
button.small { padding: 0.35rem 0.8rem; min-height: 36px; font-size: 0.95rem; }
button.link {
  background: none;
  border: 0;
  padding: 0.25rem 0;
  min-height: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-weight: 400;
}
button.link:hover { background: none; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.icon { width: 1.2em; height: 1.2em; flex: none; }

.alert {
  border: 2px solid var(--red);
  background: #fdecec;
  color: #8e1b1b;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin: 0 0 1rem;
  font-weight: 700;
}
.info {
  border: 2px solid var(--cyan);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin: 0 0 1rem;
}
.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  color: var(--navy);
}
.notice p { margin: 0.25rem 0; }
.notice-lock { display: flex; gap: 0.6rem; align-items: center; font-weight: 700; }
.empty { color: var(--slate); font-style: italic; }
.card-dark .empty { color: var(--muted-dark); }

/* Hero: the title slide */

.hero {
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}
.hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 400; margin: 0.6rem 0 1rem; }
.hero-sub { color: var(--cyan); font-size: clamp(1.2rem, 2vw, 1.6rem); margin: 0 0 2rem; max-width: 34em; }
.hero .notice { max-width: 34em; }

/* Corner brackets around the form, as around the cube on the title slide */
.frame {
  position: relative;
  padding: 2.25rem;
}
.frame::before, .frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 3px solid var(--cyan);
  -webkit-mask: linear-gradient(#000 0 0) top left / 40px 40px no-repeat, linear-gradient(#000 0 0) top right / 40px 40px no-repeat;
  mask: linear-gradient(#000 0 0) top left / 40px 40px no-repeat, linear-gradient(#000 0 0) top right / 40px 40px no-repeat;
}
.frame::after {
  -webkit-mask: linear-gradient(#000 0 0) bottom left / 40px 40px no-repeat, linear-gradient(#000 0 0) bottom right / 40px 40px no-repeat;
  mask: linear-gradient(#000 0 0) bottom left / 40px 40px no-repeat, linear-gradient(#000 0 0) bottom right / 40px 40px no-repeat;
}
.pin-form {
  background: var(--navy-2);
  border: 1px solid #2a3d5c;
  border-radius: var(--radius);
  padding: 1.5rem;
}
.pin-form label { font-size: 1.15rem; }
.pin-form .alert { color: #8e1b1b; }
.pin-input {
  font-family: var(--mono) !important;
  font-weight: 700;
  font-size: 2rem !important;
  letter-spacing: 0.3em;
  text-align: center;
  margin: 0.25rem 0 1rem !important;
}
.pin-form button { width: 100%; justify-content: center; margin-top: 0.5rem; }
.dimension {
  margin: 1.5rem 0 0;
  border-top: 2px solid var(--cyan);
  position: relative;
  text-align: center;
}
.dimension::before, .dimension::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 2px;
  height: 16px;
  background: var(--cyan);
}
.dimension::before { left: 0; }
.dimension::after { right: 0; }
.dimension span {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  color: var(--cyan);
  font-size: 0.95rem;
}

/* Join: choose a group */

.choice { position: relative; }
.choice + .choice { margin-top: 0.5rem; }
.choice input { position: absolute; left: 1rem; top: 1.05rem; width: 1.25rem; height: 1.25rem; accent-color: var(--navy); }
.choice label {
  font-weight: 400;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.8rem 0.6rem 3rem;
  cursor: pointer;
}
.choice label strong, .choice label span { display: block; }
.choice label span { color: var(--slate); }
.choice input:checked + label { border-color: var(--navy); background: var(--bg); }
.choice input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Editor */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 2rem;
}
.editor-main { display: flex; flex-direction: column; }
.title-field { margin-bottom: 1rem; }
.title-field .label { display: inline-block; }
.title-input { font-size: 1.25rem !important; font-weight: 700; }
.editor-top .label { display: inline-block; }
.editor textarea {
  min-height: max(260px, calc(100vh - 430px));
  resize: vertical;
  line-height: 1.5;
  font-size: 1.1rem;
}
.editor-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.6rem;
}
.editor-bar .count { margin: 0; color: var(--slate); font-size: 0.95rem; }
.save-status { margin: 0 0 0 auto; color: var(--slate); font-size: 0.95rem; }
.save-status.is-error { color: var(--red); font-weight: 700; }
.save-status.is-saved { color: var(--green-text); }
.meta { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.meta summary { cursor: pointer; font-weight: 700; color: var(--slate); }
.meta-fields { margin-top: 0.75rem; display: grid; gap: 0.75rem; }
.meta-fields fieldset .field + .field { margin-top: 0.5rem; }

.side { display: grid; gap: 0.75rem; }
.side .card-dark { padding: 1rem 1.25rem; }

/* Checklist */

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist .item { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.2rem 0; line-height: 1.25; }
.checklist.sub { margin: 0.25rem 0 0.25rem 0.4rem; padding-left: 0.9rem; border-left: 2px solid #2a3d5c; }
.checklist .item input {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  accent-color: var(--orange);
  cursor: pointer;
}
.checklist .item label, .checklist .item-text { font-weight: 400; cursor: pointer; }
.checklist .item-text { cursor: default; }
.item-hint { display: block; font-size: 0.85rem; color: var(--muted-dark); }
.item-group { padding: 0.2rem 0; }
.group-title { font-weight: 700; }
.box {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid var(--muted-dark);
  border-radius: 4px;
  color: transparent;
}
.box .icon { width: 1rem; height: 1rem; }
.box.done { background: var(--orange); border-color: var(--orange); color: var(--navy); }
.checks:disabled { opacity: 0.75; }

/* Teacher */

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  gap: 1rem;
}
.topnav form { margin: 0; }

.band { padding-bottom: 1.5rem; }
.band-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}
.band h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 400; margin-top: 0.3rem; overflow-wrap: anywhere; }
.band-sub { color: var(--cyan); font-size: 1.3rem; margin: 0.3rem 0 0; }
.join { text-align: right; }
.join p { margin: 0; }
.join .label { display: block; }
.join-url .mono { color: var(--cyan); font-size: clamp(1.4rem, 2.6vw, 2.2rem); }
.join-pin { margin-top: 0.5rem !important; }
.pin { font-size: clamp(2.8rem, 6vw, 4.5rem); letter-spacing: 0.08em; color: var(--white); line-height: 1; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}
.toolbar p { margin: 0; display: flex; align-items: center; gap: 0.5rem; color: var(--slate); }
.toolbar form { margin: 0; }

.section-title { font-size: 1.5rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem; }
.count-chip { font-family: var(--mono); font-size: 1rem; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.6rem; }

.group-grid {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
/* Each card spans five rows of the grid (title, names, progress, status, button);
   subgrid lines these up across a row of cards, also when a title wraps. */
.group-card {
  display: grid;
  grid-row: span 5;
  grid-template-rows: subgrid;
  row-gap: 0.4rem;
  align-content: start;
  padding: 1rem 1.25rem;
}
.group-card h3 { font-size: 1.3rem; overflow-wrap: anywhere; }
.group-card h3 a { color: var(--navy); text-decoration: none; }
.group-card h3 a:hover { text-decoration: underline; }
.group-card .names { margin: 0; color: var(--slate); }
.group-card .when { margin: 0; color: var(--slate); font-size: 0.9rem; }
.group-card .card-status { display: grid; gap: 0.25rem; align-content: start; }
.group-card form { align-self: end; padding-top: 0.4rem; }
.group-card.is-open { border: 2px solid var(--cyan); }
.state-open { margin: 0; color: var(--cyan-text); font-weight: 700; font-size: 0.95rem; }

.progress-text { margin: 0; display: flex; justify-content: space-between; align-items: baseline; }
.progress-text .label { font-size: 0.75rem; }
.card-dark .progress-text .label { color: var(--muted-dark); }
progress {
  appearance: none;
  width: 100%;
  height: 0.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 999px; }
.card-dark .progress { margin-bottom: 0.75rem; }

.spec {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font);
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 0;
  max-height: 65vh;
  overflow: auto;
}
.copy-status { margin: 0 0 0.5rem; min-height: 1.4em; color: var(--green-text); font-weight: 700; }

.danger-zone { margin: 0 0 3rem; }
.detail { padding-top: 1.5rem; }
.untitled { font-style: italic; opacity: 0.8; }
.danger-zone summary { cursor: pointer; color: var(--red); font-weight: 700; }
.danger-zone p { color: var(--slate); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); }
thead th { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate); }

/* Small screens and zoom */

@media (max-width: 900px) {
  .hero, .grid-2, .grid-wide-left, .editor { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 3rem; gap: 1.5rem; }
  .join { text-align: left; }
}

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

@media (forced-colors: active) {
  .box.done { background: Highlight; color: HighlightText; }
  .frame::before, .frame::after { border-color: CanvasText; }
}
