/* Shared identity for the public site and the subject notebook. */
:root {
  --lab-ink: #101f46;
  --lab-blue: #2358ef;
  --lab-muted: #52627e;
  --lab-paper: #f6f8fc;
  --lab-surface: #fff;
  --lab-line: #dce4f2;
  --lab-wash: #e9f0ff;
  --lab-coral: #ff6f66;
}
@media (prefers-color-scheme: dark) {
  :root {
    --lab-ink: #f1f5ff;
    --lab-blue: #92afff;
    --lab-muted: #b0c0dc;
    --lab-paper: #0d1527;
    --lab-surface: #151f35;
    --lab-line: #344462;
    --lab-wash: #263653;
    --lab-coral: #ff958b;
  }
}

#workspace {
  --tiplo-paper: #fff9ec;
  --tiplo-ink: #101e43;
  --tiplo-grid: #e8dfc9;
  --tiplo-yellow: #ffda45;
}
@media (prefers-color-scheme: dark) {
  #workspace {
    --tiplo-paper: #17233b;
    --tiplo-ink: #f4f5ff;
    --tiplo-grid: #25344f;
  }
}
#workspace #home .dashboard-head,
#workspace #nb-view[data-tool="overview"] .nb-subject-head {
  position: relative;
  isolation: isolate;
  background-color: var(--tiplo-paper);
  background-image: linear-gradient(90deg, var(--tiplo-paper) 42%, transparent 82%),
    linear-gradient(var(--tiplo-grid) 1px, transparent 1px), linear-gradient(90deg,var(--tiplo-grid) 1px, transparent 1px);
  background-size: auto, 22px 22px, 22px 22px;
  color: var(--tiplo-ink);
  border: 1px solid var(--tiplo-grid);
  border-radius: 16px;
}
#workspace #home .dashboard-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: clamp(10px,3vw,40px);
  margin-bottom: 24px;
  padding: clamp(12px,2vw,24px) clamp(16px,3.2vw,48px);
}
#home .dashboard-head h1 {max-width: 15ch; font-size: clamp(2.1rem,4.2vw,4.25rem); line-height: .99; color: inherit}
#home .dashboard-head .greeting {color: var(--lab-muted); text-transform: none; letter-spacing: 0; font-size: 1rem}
#home .dashboard-head .learner-context {margin-top: 14px; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--lab-muted)}
.study-home-portrait {position: relative; margin: 0; text-align: center}
.study-home-portrait img {display: block; width: clamp(126px,17vw,222px); height: auto; max-height: 230px; object-fit: contain}
.study-home-portrait figcaption {
  position: relative; display: inline-block; margin-top: -7px; padding: 2px 14px;
  background: var(--tiplo-yellow); color: #101e43; transform: rotate(-4deg); font: 780 1rem/1.25 var(--sans);
}
#home #nb-library {margin: 0 0 26px}
#home #nb-library h2, #home #nb-home-intake h2 {font: 730 clamp(1.25rem,2.1vw,1.6rem)/1.2 var(--sans); letter-spacing: -.035em}
#home #nb-library h2 {margin: 0}
#home .nb-tile {border-top-color: var(--lab-blue)}
#home .nb-tile strong {font: 700 1.17rem/1.25 var(--sans)}
#home #nb-study {background: var(--tiplo-yellow); color: #101e43; border: 1px solid #d4ae26; box-shadow: none}
#workspace #home .next-step {background: #162c59; color: #fff}
#workspace #home .next-step::before {background: #28477e}
#workspace #home .next-step :is(.studio-eyebrow,.next-step-art,#next-step-reason) {color: #d9e8ff}
#workspace #sidebar .side-top .brand {font-size: 1.45rem; letter-spacing: -.045em}
#workspace #home .nb-tile .nb-subject {color: var(--lab-blue)}
@media (max-width: 600px) {
  #workspace #home .dashboard-head {gap: 4px; padding: 14px 10px 15px 16px}
  #home .dashboard-head h1 {font-size: clamp(1.65rem,6vw,2.5rem); line-height: 1.04}
  #home .dashboard-head .greeting {font-size: .85rem; margin-bottom: 7px}
  #home .dashboard-head .learner-context {margin-top: 8px}
  .study-home-portrait img {width: clamp(94px,26vw,140px)}
  .study-home-portrait figcaption {font-size: .8rem}
}

:is(#welcome .brand, #sidebar .side-top .brand, #workspace .topbar .brand) .mark,
.lab-notebook-mark {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border-radius: 23%;
  background: linear-gradient(145deg, #326dff 0%, #2854ff 76%, #477cff 100%);
  color: #fff;
  font-size: 0;
}
:is(#welcome .brand, #sidebar .side-top .brand, #workspace .topbar .brand) .mark::before,
.lab-notebook-mark::before {
  content: "";
  width: 48%;
  height: 65%;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(to right, transparent 14%, currentColor 14% 23%, transparent 23%);
}

.nb-folder, .lab-subject-icon {
  --subject-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='4' y='2.5' width='16' height='19' rx='2'/%3E%3Cpath d='M8 3v18M11 8h6'/%3E%3C/svg%3E");
}
:is(.nb-folder, .lab-subject-icon)[data-subject="biology"] {
  --subject-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2h8m-7 0v7l-6 10q-1 2 1.5 2h15q2.5 0 1.5-2L15 9V2'/%3E%3Cpath d='M5 16q3-2 7 0t7 0l2 4H3z' fill='black'/%3E%3C/svg%3E");
}
:is(.nb-folder, .lab-subject-icon)[data-subject="maths"] {
  --subject-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2'/%3E%3Cpath d='M8 7h8M8.5 12h2M14 12h1.5M8.5 17h2M14 17h1.5'/%3E%3C/svg%3E");
}
:is(.nb-folder, .lab-subject-icon)[data-subject="history"] {
  --subject-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 8 10-5 10 5zM3 21h18M4 18h16M6 11v7M10 11v7M14 11v7M18 11v7'/%3E%3C/svg%3E");
}
.lab-subject-icon {
  display: inline-block;
  flex: none;
  width: 1.35em;
  height: 1.35em;
  background: currentColor;
  mask: var(--subject-glyph) center / contain no-repeat;
}

#workspace:has(#nb-view[data-tool="overview"]:not([hidden])) #main {
  background: var(--lab-paper);
}
