/* Nexus Tutor Portal — onboarding.nexusacademyuk.com only
   Theme: Study Hall (warm earth). Cache-bust via ?v= on index.html when shipping UI. */

:root {
  /* Study Hall tokens */
  --ink: #1a1714;
  --bark: #2a2520;
  --terracotta: #af4629;
  --ember: #d4694a;
  --oat: #faf6ef;
  --chalk: #ffffff;
  --graphite: #57514a;
  --clay-line: #e3dace;
  --sand: #f2ebe0;
  --sage: #4a6b57;
  --error: #9b2226;

  /* Legacy aliases — keep existing var(--navy)/var(--gold) call sites working */
  --navy: var(--ink);
  --navy-deep: var(--bark);
  --gold: var(--terracotta);
  --gold-soft: var(--ember);
  --ivory: var(--oat);
  --slate: var(--graphite);
  --white: var(--chalk);

  --radius: 20px;
  --radius-btn: 999px;
  --shadow: 0 20px 50px rgba(26, 23, 20, 0.1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}


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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--oat);
  -webkit-font-smoothing: antialiased;
}

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

.shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.shell--wide .portal {
  max-width: 960px;
}

.shell__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(175, 70, 41, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 100%, rgba(212, 105, 74, 0.08) 0%, transparent 50%),
    linear-gradient(165deg, var(--oat) 0%, var(--sand) 100%);
  pointer-events: none;
}

/* Account bar — always available while signed in (escape hatch) */
.account-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--clay-line);
}

.account-bar[hidden] {
  display: none !important;
}

.account-bar__email {
  margin: 0;
  font-size: 13px;
  color: var(--graphite);
  max-width: min(50vw, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-bar__logout {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 14px;
  border: 1.5px solid var(--terracotta);
  border-radius: 999px;
  background: transparent;
  color: var(--terracotta);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.account-bar__logout:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--chalk);
}

.account-bar__logout:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.portal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 80px) 20px 48px;
}

/* ——— Gate (sign-in & step views) ——— */

.gate {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  opacity: 1;
}

.gate.is-active {
  display: flex;
  animation: fadeUp 0.55s var(--ease) both;
}

.gate--hidden {
  display: none !important;
}

.gate--wide {
  max-width: 100%;
}

.gate__logo {
  width: 112px;
  height: auto;
  margin: 0 auto 28px;
}

.gate__logo--sm {
  width: 88px;
  margin-bottom: 20px;
}

.gate__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.gate__title {
  margin: 0 0 12px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(32px, 6vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--ink);
}

.gate__title--sm {
  font-size: clamp(26px, 5vw, 34px);
}

.gate__lead {
  margin: 0 0 28px;
  max-width: 36ch;
  font-size: 16px;
  line-height: 1.6;
  color: var(--graphite);
}

.gate__panel {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  background: var(--white);
  color: var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
}

.gate__panel--center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.gate__panel--wide {
  max-width: 100%;
  text-align: left;
}

.gate__signin {
  display: flex;
  justify-content: center;
  min-height: 44px;
  min-width: 240px;
}

.gate__hint {
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--slate);
  text-align: center;
}

.gate__hint--left {
  text-align: left;
  margin-top: 10px;
}

.gate__status {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--slate);
}

.gate__error {
  margin: 0 0 16px;
  color: var(--error);
  font-size: 15px;
}

.gate__error--inline {
  margin: 12px 0;
  text-align: left;
  font-size: 14px;
}

.gate__locked {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid #e3dace;
  font-size: 14px;
  color: var(--slate);
  text-align: center;
  font-style: italic;
}

/* ——— Buttons ——— */

.btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--terracotta);
  color: var(--chalk);
}

.btn--primary:hover {
  background: var(--ember);
  color: var(--chalk);
  transform: translateY(-1px);
}

.btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  background: transparent;
  border: 1.5px solid var(--terracotta);
  color: var(--terracotta);
}

.btn--secondary:hover {
  background: var(--terracotta);
  color: var(--chalk);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--navy);
  color: var(--navy);
}

.btn--outline:hover {
  background: var(--ink);
  color: var(--oat);
}

/* ——— Upload ——— */

.upload {
  display: block;
  margin-bottom: 8px;
  text-align: left;
}

.upload__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.upload input[type='file'] {
  width: 100%;
  font-size: 14px;
}

/* ——— Loader ——— */

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 120px;
}

.loader__ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(26, 23, 20, 0.12);
  border-top-color: var(--gold);
  animation: spin 0.85s linear infinite;
}

.loader__message {
  min-height: 1.45em;
  max-width: 280px;
  text-align: center;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.loader__message.is-swapping {
  opacity: 0;
  transform: translateY(4px);
}

.loader__hint {
  margin: -4px 0 0;
  max-width: 260px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--slate);
  text-align: center;
  opacity: 0.85;
  transition: opacity 0.35s var(--ease);
}

.loader__hint.is-visible {
  opacity: 1;
}

/* ——— Meet link gate (blocks hub) ——— */

.gate--meet {
  max-width: 100%;
  align-items: stretch;
  text-align: left;
}

.meet-gate {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.meet-gate__dialog {
  position: relative;
  padding: clamp(28px, 5vw, 36px);
  border-radius: 16px;
  background: var(--white);
  border: 1px solid rgba(175, 70, 41, 0.35);
  box-shadow:
    0 24px 48px rgba(26, 23, 20, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  text-align: center;
}

.meet-gate__dialog::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--gold);
}

.meet-gate__logo {
  display: block;
  width: 96px;
  height: auto;
  margin: 0 auto 20px;
}

.meet-gate__eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.meet-gate__title {
  margin: 0 0 12px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--navy);
}

.meet-gate__lead {
  margin: 0 auto 24px;
  max-width: 40ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--slate);
}

.meet-gate__form {
  text-align: left;
}

.meet-gate__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.meet-gate__required {
  font-weight: 500;
  color: var(--slate);
}

.meet-gate__input {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 13px 14px;
  border: 1.5px solid #e3dace;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: var(--navy);
  background: #faf6ef;
}

.meet-gate__input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(175, 70, 41, 0.22);
}

.meet-gate__error {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--error);
}

.meet-gate__submit {
  width: 100%;
  margin-top: 4px;
}

.meet-gate__resource {
  border-radius: 14px;
  background: rgba(250, 246, 239, 0.92);
  border: 1px solid rgba(26, 23, 20, 0.08);
  text-align: left;
  overflow: hidden;
}

.meet-gate__help-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--navy);
  transition: background 0.2s var(--ease);
}

.meet-gate__help-toggle:hover {
  background: rgba(175, 70, 41, 0.08);
}

.meet-gate__help-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.meet-gate__help-toggle-text {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.meet-gate__help-toggle-hint {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
}

.meet-gate__help-chevron {
  display: inline-flex;
  color: var(--gold);
  transition: transform 0.25s var(--ease);
  margin-left: auto;
}

.meet-gate__help-toggle[aria-expanded='true'] .meet-gate__help-chevron {
  transform: rotate(180deg);
}

.meet-gate__help-panel {
  padding: 0 18px 20px;
  border-top: 1px solid rgba(26, 23, 20, 0.06);
}

.meet-gate__help-panel[hidden] {
  display: none !important;
}

.meet-gate__resource-title {
  margin: 16px 0 8px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.meet-gate__resource-copy {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--slate);
}

.meet-gate__video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ink);
}

.meet-gate__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ——— Hub ——— */

.gate--hub {
  max-width: 100%;
  align-items: stretch;
  text-align: left;
}

.gate--hub .hub-hero {
  text-align: center;
  margin-bottom: 28px;
}

.gate--hub .hub-hero .gate__logo {
  margin-left: auto;
  margin-right: auto;
}

.hub-hero__lead {
  margin-left: auto;
  margin-right: auto;
}

.hub {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.hub-block {
  background: var(--white);
  color: var(--navy);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 32px);
  box-shadow: var(--shadow);
  border: 1px solid var(--clay-line);
}

.hub-block--forms {
  background: linear-gradient(165deg, #ffffff 0%, #faf6ef 100%);
  border: 1px solid rgba(175, 70, 41, 0.28);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hub-block--tools {
  border-top: 3px solid var(--gold);
}

.hub-block__head {
  margin-bottom: 20px;
}

.hub-block__title {
  margin: 0 0 6px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(22px, 3vw, 26px);
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.hub-block__copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--slate);
  max-width: 48ch;
}

/* Doc / slides link */
.hub-doc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid #e3dace;
  background: #f2ebe0;
  text-decoration: none;
  color: var(--navy);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  cursor: pointer;
}

.hub-doc:hover {
  transform: translateY(-2px);
  border-color: rgba(175, 70, 41, 0.55);
  box-shadow: 0 10px 28px rgba(26, 23, 20, 0.1);
}

.hub-doc:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.hub-doc__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(175, 70, 41, 0.12);
  color: var(--gold);
}

.hub-doc__icon svg {
  width: 22px;
  height: 22px;
}

.hub-doc__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.hub-doc__title {
  font-size: 15px;
  font-weight: 600;
}

.hub-doc__meta {
  font-size: 13px;
  color: var(--slate);
}

.hub-doc__action {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* Videos */
.hub-videos {
  display: grid;
  gap: 16px;
}

.hub-video {
  border-radius: 12px;
  border: 1px solid #e3dace;
  overflow: hidden;
  background: #fff;
}

.hub-video__meta {
  padding: 14px 16px 10px;
}

.hub-video__label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.hub-video__title {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
}

.hub-video__frame {
  background: var(--ink);
}

.hub-video__frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  max-height: 360px;
}

/* Form tiles — premium interactive cards */
.hub-forms {
  display: grid;
  gap: 14px;
}

.form-tile {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 20px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid rgba(26, 23, 20, 0.08);
  text-decoration: none;
  color: var(--navy);
  box-shadow: 0 4px 16px rgba(26, 23, 20, 0.06);
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.form-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.form-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(175, 70, 41, 0.45);
  box-shadow: 0 16px 40px rgba(26, 23, 20, 0.14);
}

.form-tile:hover::before {
  transform: scaleX(1);
}

.form-tile:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.form-tile__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--sand);
  color: var(--terracotta);
  flex-shrink: 0;
}

.form-tile__icon svg {
  width: 24px;
  height: 24px;
}

.form-tile__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-tile__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.form-tile__title {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.form-tile__desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate);
}

.form-tile__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.form-tile__cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}

.form-tile:hover .form-tile__cta svg {
  transform: translateX(4px);
}

/* Permanent Meet link card */
.meet-card {
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(26, 23, 20, 0.1);
  background: #f2ebe0;
}

.meet-card__top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.meet-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--sand);
  color: var(--terracotta);
}

.meet-card__icon svg {
  width: 22px;
  height: 22px;
}

.meet-card__intro {
  min-width: 0;
}

.meet-card__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.meet-card__title {
  margin: 0 0 4px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.meet-card__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate);
}

.meet-card__empty {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--slate);
  font-style: italic;
}

.meet-card__url {
  display: block;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid #e3dace;
  color: var(--navy);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  word-break: break-all;
  transition: border-color 0.2s var(--ease);
}

.meet-card__url:hover {
  border-color: rgba(175, 70, 41, 0.55);
}

.meet-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meet-card__actions .btn,
.meet-card__join {
  width: auto;
  min-width: 120px;
  padding: 11px 18px;
  font-size: 14px;
}

.meet-card__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.meet-card__input {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1.5px solid #e3dace;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: var(--navy);
  background: var(--white);
}

.meet-card__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(175, 70, 41, 0.2);
}

.meet-card__error {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--error);
}

/* Tools */
.hub-tools {
  display: grid;
  gap: 14px;
}

.tool-tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--navy);
  background: transparent;
  text-decoration: none;
  color: var(--navy);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  cursor: pointer;
}

.tool-tile:hover {
  transform: translateY(-2px);
  background: rgba(26, 23, 20, 0.03);
  box-shadow: 0 10px 28px rgba(26, 23, 20, 0.1);
}

.tool-tile:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tool-tile--primary {
  background: var(--chalk);
  border-color: var(--terracotta);
  border-width: 2px;
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(175, 70, 41, 0.08);
}

.tool-tile--primary:hover {
  background: var(--sand);
  border-color: var(--ember);
}

.tool-tile--button {
  width: 100%;
  text-align: left;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.tool-tile__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(26, 23, 20, 0.08);
  color: var(--navy);
}

.tool-tile--primary .tool-tile__icon {
  background: rgba(175, 70, 41, 0.12);
  color: var(--terracotta);
}

.tool-tile__icon svg {
  width: 22px;
  height: 22px;
}

.tool-tile__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.tool-tile__title {
  font-size: 16px;
  font-weight: 600;
}

.tool-tile__desc {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.75;
}

.tool-tile__cta {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Stagger reveal when hub opens */
.hub-reveal {
  opacity: 0;
  transform: translateY(16px);
}

.gate--hub.is-active.is-revealed .hub-reveal {
  animation: fadeUp 0.5s var(--ease) forwards;
}

.gate--hub.is-active.is-revealed .hub-reveal:nth-child(1) {
  animation-delay: 0.05s;
}

.gate--hub.is-active.is-revealed .hub-reveal:nth-child(2) {
  animation-delay: 0.16s;
}

.gate--hub.is-active.is-revealed .hub-reveal:nth-child(3) {
  animation-delay: 0.28s;
}

@media (min-width: 700px) {
  .hub-forms,
  .hub-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal {
    max-width: 880px;
  }

  .gate--hub.is-active {
    max-width: 880px;
    margin: 0 auto;
  }

  .meet-gate {
    max-width: 600px;
  }

  .gate--dashboard.is-active {
    max-width: 960px;
    margin: 0 auto;
  }
}

/* ——— Lesson Dashboard ——— */

.gate--dashboard {
  position: relative;
  max-width: 100%;
  align-items: stretch;
  text-align: left;
}

.dashboard-mutation {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 32px);
  background: rgba(26, 23, 20, 0.72);
  border-radius: 16px;
}

.dashboard-mutation[hidden] {
  display: none !important;
}

.dashboard-mutation__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  padding: 28px 24px;
  text-align: center;
  background: rgba(26, 23, 20, 0.96);
  border: 1px solid rgba(175, 70, 41, 0.35);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.dashboard-mutation__panel .loader__message {
  color: var(--oat);
}

.dashboard-mutation__panel .loader__hint {
  color: rgba(250, 246, 239, 0.78);
}

.dashboard-head {
  text-align: center;
  margin-bottom: 24px;
}

.dashboard-head__lead {
  margin-left: auto;
  margin-right: auto;
}

.dashboard-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 1.5px solid var(--terracotta);
  border-radius: 999px;
  background: transparent;
  color: var(--terracotta);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.dashboard-back:hover {
  background: var(--terracotta);
  color: var(--chalk);
}

.dashboard-back:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dashboard-back:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.month-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: var(--sand);
  border: 1px solid var(--clay-line);
}

.month-toggle__btn {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--graphite);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.month-toggle__btn.is-active {
  background: var(--terracotta);
  color: var(--chalk);
}

.month-toggle__btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.dashboard-log-toggle {
  width: 100%;
}

.dashboard-status {
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(74, 107, 87, 0.12);
  border: 1px solid rgba(74, 107, 87, 0.28);
  color: var(--sage);
  font-size: 14px;
  font-weight: 500;
}

.dashboard-panel {
  background: var(--white);
  color: var(--navy);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 28px);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
}

.dashboard-loading,
.dashboard-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  text-align: center;
}

.dashboard-loading[hidden],
.dashboard-error[hidden],
.dashboard-content[hidden],
.dashboard-status[hidden],
.log-lesson[hidden] {
  display: none !important;
}

.dashboard-month-label {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.stat-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #e3dace;
  background: #f2ebe0;
}

.stat-card__label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}

.stat-card__value {
  margin: 0;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--navy);
}

.stat-card__value--sm {
  font-size: clamp(18px, 3.5vw, 22px);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
}

.stat-card__toggle {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stat-card__toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.stat-card__list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate);
}

.lessons-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e3dace;
  border-radius: 12px;
}

.lessons-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 14px;
}

.lessons-table__caption {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--slate);
  caption-side: top;
}

.lessons-table th,
.lessons-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e3dace;
  text-align: left;
  vertical-align: top;
}

.lessons-table th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
  background: #faf6ef;
}

.lessons-table tbody tr:last-child td {
  border-bottom: 0;
}

.lessons-table td:nth-child(8) {
  max-width: 280px;
  word-break: break-word;
}

.lessons-table__demo-link {
  color: var(--gold, #af4629);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lessons-table__demo-link:hover {
  color: var(--navy, #1a1714);
}

.lessons-table__actions {
  white-space: nowrap;
}

.lesson-action {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  margin: 0 2px 0 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy);
  cursor: pointer;
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lesson-action:hover:not(:disabled) {
  color: var(--terracotta);
  background: rgba(175, 70, 41, 0.08);
}

.lesson-action:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.lesson-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: none;
}

.lesson-action--delete {
  color: #9b2226;
}

.lesson-action--delete:hover:not(:disabled) {
  color: #7a1b1e;
  background: rgba(155, 34, 38, 0.08);
}

.lessons-empty {
  margin: 0;
  padding: 20px 16px;
  font-size: 14px;
  color: var(--slate);
  text-align: center;
  font-style: italic;
}

.log-lesson {
  background: var(--white);
  color: var(--navy);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 28px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(175, 70, 41, 0.35);
}

.log-lesson__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.log-lesson__title {
  margin: 0;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.log-lesson__close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e3dace;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

.log-lesson__close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.log-lesson__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.log-lesson__error {
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(155, 34, 38, 0.08);
  border: 1px solid rgba(155, 34, 38, 0.25);
}

.log-lesson__error-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--error);
}

.log-lesson__error-text {
  margin: 0;
  font-size: 14px;
  color: var(--error);
}

.log-lesson__row {
  display: grid;
  gap: 12px;
}

.log-lesson__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-lesson__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.log-lesson__input,
.log-lesson__textarea,
.log-lesson__select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e3dace;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: var(--navy);
  background: #faf6ef;
}

.log-lesson__input:focus,
.log-lesson__textarea:focus,
.log-lesson__select:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(175, 70, 41, 0.22);
}

.log-lesson__textarea {
  resize: vertical;
  min-height: 110px;
}

.log-lesson__preview {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(175, 70, 41, 0.12);
  font-size: 14px;
  line-height: 1.5;
  color: var(--navy);
}

#log-demo-link-field[hidden] {
  display: none !important;
}

@media (min-width: 700px) {
  .dashboard-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .month-toggle {
    flex: 1;
    max-width: 320px;
  }

  .dashboard-log-toggle {
    width: auto;
    min-width: 180px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-lesson__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-reveal {
    opacity: 1;
    transform: none;
  }

  .gate--hub.is-active.is-revealed .hub-reveal {
    animation: none;
  }
}

/* ——— Welcome overlay ——— */

.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.welcome.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s var(--ease);
}

.welcome.is-exiting {
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.welcome__scrim {
  position: absolute;
  inset: 0;
  background: rgba(26, 23, 20, 0.88);
}

.welcome__card {
  position: relative;
  text-align: center;
  max-width: 420px;
  animation: fadeUp 0.6s var(--ease) both;
}

.welcome.is-exiting .welcome__card {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.welcome__logo {
  width: 120px;
  height: auto;
  margin: 0 auto 24px;
}

.welcome__eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
}

.welcome__name {
  margin: 0 0 8px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--oat);
}

.welcome__tagline {
  margin: 0 0 22px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
  color: rgba(250, 246, 239, 0.88);
}

.welcome__rule {
  width: 64px;
  height: 2px;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.welcome__next {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 246, 239, 0.5);
}

/* ——— Hub entrance (after Meet link saved) ——— */

.hub-entrance {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.hub-entrance.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.hub-entrance__scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, #2a2520 0%, var(--ink) 70%);
  transition: opacity 0.55s var(--ease);
}

.hub-entrance__bloom {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(175, 70, 41, 0.45) 0%, rgba(175, 70, 41, 0) 70%);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  will-change: transform, opacity;
}

.hub-entrance__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 90vw;
}

.hub-entrance__logo {
  width: min(160px, 48vw);
  height: auto;
  opacity: 0;
  transform: scale(0.72);
  filter: drop-shadow(0 12px 40px rgba(212, 105, 74, 0.35));
  will-change: transform, opacity;
}

.hub-entrance__eyebrow {
  margin: 28px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
  opacity: 0;
  transform: translateY(10px);
}

.hub-entrance__line {
  margin: 10px 0 0;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(24px, 5.5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--oat);
  opacity: 0;
  transform: translateY(12px);
}

/* Phase 1 — logo settles centre */
.hub-entrance.is-enter .hub-entrance__logo {
  animation: hubLogoEnter 0.85s var(--ease) both;
}

.hub-entrance.is-enter .hub-entrance__bloom {
  animation: hubBloomIdle 1.1s var(--ease) both;
}

/* Phase 2 — welcome copy */
.hub-entrance.is-message .hub-entrance__logo {
  opacity: 1;
  transform: scale(1);
}

.hub-entrance.is-message .hub-entrance__bloom {
  opacity: 0.85;
  transform: scale(1.6);
}

.hub-entrance.is-message .hub-entrance__eyebrow {
  animation: hubCopyIn 0.55s var(--ease) both;
}

.hub-entrance.is-message .hub-entrance__line {
  animation: hubCopyIn 0.65s var(--ease) 0.08s both;
}

/* Phase 3 — logo expands across the screen */
.hub-entrance.is-expand .hub-entrance__logo {
  animation: hubLogoExpand 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hub-entrance.is-expand .hub-entrance__bloom {
  animation: hubBloomExpand 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hub-entrance.is-expand .hub-entrance__eyebrow,
.hub-entrance.is-expand .hub-entrance__line {
  animation: hubCopyOut 0.35s var(--ease) forwards;
}

/* Phase 4 — overlay dissolves onto hub */
.hub-entrance.is-exit {
  transition: opacity 0.5s var(--ease);
  opacity: 0;
}

.hub-entrance.is-exit .hub-entrance__scrim {
  opacity: 0;
}

@keyframes hubLogoEnter {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  65% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hubBloomIdle {
  from {
    opacity: 0;
    transform: scale(0.35);
  }
  to {
    opacity: 0.75;
    transform: scale(1.55);
  }
}

@keyframes hubCopyIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hubCopyOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes hubLogoExpand {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  55% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: scale(14);
  }
}

@keyframes hubBloomExpand {
  0% {
    opacity: 0.8;
    transform: scale(1.6);
  }
  100% {
    opacity: 0;
    transform: scale(28);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .gate.is-active,
  .welcome__card {
    opacity: 1;
    transform: none;
  }

  .hub-entrance,
  .hub-entrance__logo,
  .hub-entrance__bloom,
  .hub-entrance__eyebrow,
  .hub-entrance__line {
    animation: none !important;
    transition: none !important;
  }
}
