/* Isolated layout for the profile-based Modelling lesson. */
.modeling-profile-workspace .controls,
.modeling-profile-workspace .object-toolbar {
  display: none;
}

.modeling-profile-workspace .lesson-svg {
  pointer-events: none;
}

.modeling-profile-canvas .three-canvas-layer,
.modeling-profile-canvas .lesson-svg {
  transform: translateY(-40px);
}

.modeling-profile-workspace {
  --profile-visual-height: min(480px, 23.48vw);
  --profile-graph-height: calc(var(--profile-visual-height) / 0.9);
  --profile-standard-copy-width: min(395px, 28vw);
  --profile-copy-width: min(430px, 31vw);
  --profile-copy-right: clamp(76px, 8vw, 136px);
  --profile-slider-width: 184px;
  --profile-surface-top: calc(52.15% - var(--profile-visual-height) / 2);
  --profile-surface-right: calc(50% + var(--profile-visual-height) / 2);
  --profile-column-left: calc(100% - var(--profile-copy-right) - var(--profile-standard-copy-width));
  --profile-axis-left: calc(var(--profile-column-left) + 5px);
}

.modeling-profile-toolbar {
  position: absolute;
  top: 29px;
  left: 50%;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 5px;
  transform: translateX(-50%);
}

.modeling-profile-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
}

.modeling-profile-button svg {
  width: 16px;
  height: 23px;
  display: block;
  transform: translateX(1.5px);
}

.modeling-profile-copy {
  position: absolute;
  top: calc(clamp(54px, 8vh, 92px) - 10px);
  left: var(--profile-column-left);
  z-index: 24;
  width: var(--profile-copy-width);
  color: rgba(24, 24, 24, 0.82);
  font-family: var(--plain);
  pointer-events: auto;
  user-select: text;
}

.modeling-profile-copy h2 {
  max-width: 360px;
  margin: 0 0 8px;
}

.modeling-profile-copy > p {
  max-width: 360px;
  margin: 10px 0 0;
  font-size: clamp(13px, 1.03vw, 17px);
  font-weight: 300;
  line-height: 1.28;
}

.modeling-material-control {
  width: var(--profile-slider-width);
  margin-top: 0;
  color: rgba(52, 57, 69, 0.66);
  font-family: var(--plain);
  font-size: 11px;
  font-weight: 400;
  pointer-events: auto;
}

.modeling-material-controls-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 26px;
}

.modeling-cast-shadow-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 0;
  margin-top: 10px;
  margin-bottom: 0;
  color: rgba(52, 57, 69, 0.66);
  font-family: var(--plain);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
}

.modeling-cast-shadow-control span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
}

.modeling-cast-shadow-control input {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid rgba(34, 39, 56, 0.5);
  border-radius: 50%;
  outline: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.modeling-cast-shadow-control input:hover {
  border-color: #53b7f9;
  background-color: #53b7f9;
}

.modeling-cast-shadow-control input:checked {
  border-color: #53b7f9;
  background-color: #53b7f9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1.5 5 4.6 8 10.5 1.8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 11px 9px;
}

.modeling-cast-shadow-control input:is(:focus, :focus-visible) {
  outline: 0;
  box-shadow: none;
}

.modeling-material-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.modeling-material-labels > :first-child {
  transform: translateX(5px);
}

.modeling-material-labels > :last-child {
  transform: translateX(-5px);
}

.modeling-material-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  outline: 0;
  background: linear-gradient(
    to right,
    #343945 0 var(--material-progress),
    #d8d3ca var(--material-progress) 100%
  );
  box-shadow: none;
  cursor: pointer;
}

.modeling-material-slider:focus,
.modeling-material-slider:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.modeling-material-slider::-webkit-slider-runnable-track {
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
}

.modeling-material-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 38px;
  height: 18px;
  margin-top: -5px;
  border: 0;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(52, 57, 69, 0.2);
  transition: background-color 150ms ease;
}

.modeling-material-slider::-moz-range-track {
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
}

.modeling-material-slider::-moz-range-progress {
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.modeling-material-slider::-moz-range-thumb {
  width: 38px;
  height: 18px;
  border: 0;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(52, 57, 69, 0.2);
  transition: background-color 150ms ease;
}

.modeling-material-slider:is(:hover, :focus-visible)::-webkit-slider-thumb {
  background: #53b7f9;
}

.modeling-material-slider:is(:hover, :focus-visible)::-moz-range-thumb {
  background: #53b7f9;
}

.modeling-material-info {
  max-width: 360px;
  margin-top: 30px;
  padding-top: 0;
  color: inherit;
}

.modeling-material-info-title {
  margin: 0 0 14px;
  color: #000;
  font-family: var(--heading);
  font-size: clamp(17px, 1.23vw, 22px);
  font-weight: var(--heading-weight);
  line-height: 1.05;
  letter-spacing: 0;
  text-transform: uppercase;
  -webkit-text-stroke: var(--heading-stroke-width) currentColor;
  paint-order: stroke fill;
}

.modeling-material-info-intro {
  margin: 0;
  color: inherit;
  font-size: clamp(13px, 1.03vw, 17px);
  font-weight: 300;
  line-height: 1.28;
}

.modeling-profile-editor {
  position: absolute;
  top: calc(var(--profile-surface-top) - var(--profile-visual-height) / 24 - 40px);
  left: var(--profile-axis-left);
  z-index: 24;
  width: max(124px, calc(var(--profile-graph-height) / 2));
  transform: translateX(calc(-14.1667% - 250px));
  pointer-events: auto;
}

.modeling-profile-save-controls {
  margin: 8px 0 0 14.1667%;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
}

.modeling-profile-save-actions {
  display: flex;
  align-items: center;
  gap: 0;
  transform: translateX(-10px);
}

.modeling-profile-save-button {
  width: 28px;
  height: 28px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: #343945;
  cursor: pointer;
}

.modeling-profile-save-button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modeling-profile-save-button:is(:hover, :focus-visible) {
  color: #53b7f9;
  outline: none;
}

.modeling-profile-save-button:disabled {
  color: rgba(52, 57, 69, 0.25);
  cursor: default;
}

.modeling-profile-saved-dots {
  min-height: 10px;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modeling-profile-saved-dot {
  width: 9px;
  min-width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid rgba(34, 39, 56, 0.5);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.modeling-profile-saved-dot:is(:hover, :focus-visible, .is-active) {
  border-color: #53b7f9;
  background: #53b7f9;
  outline: none;
}

.modeling-profile-graph {
  width: max(124px, calc(var(--profile-graph-height) / 2));
  height: var(--profile-graph-height);
  display: block;
  overflow: visible;
  touch-action: none;
}

.modeling-profile-grid line {
  stroke: rgba(96, 112, 128, 0.22);
  stroke-width: 1;
  stroke-dasharray: 5 7;
}

.modeling-profile-light-arrow {
  fill: none;
  stroke: #f0af00;
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.78;
  pointer-events: none;
}

.modeling-profile-light-arrowhead {
  fill: #f0af00;
  stroke: none;
}

.modeling-profile-axes path {
  fill: none;
  stroke: #aaa9a6;
  stroke-width: 0.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modeling-profile-axis-label {
  fill: #aaa9a6;
  font-family: var(--plain);
  font-size: 13px;
  font-weight: 400;
}

.modeling-profile-curve {
  fill: none;
  stroke: #222738;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modeling-profile-fixed-point,
.modeling-profile-handle {
  vector-effect: non-scaling-stroke;
}

.modeling-profile-fixed-point {
  fill: #f8f5f0;
  stroke: #343945;
  stroke-width: 1.6;
}

.modeling-profile-handle {
  fill: rgba(255, 255, 255, 0.94);
  stroke: #222738;
  stroke-width: 2;
  cursor: move;
}

.modeling-profile-handle::after {
  content: "";
}

.modeling-profile-handle:is(:hover, :focus-visible, .is-dragging) {
  fill: #000;
  stroke: #000;
  outline: none;
}

.modeling-profile-tangent-line {
  vector-effect: non-scaling-stroke;
  stroke: rgba(34, 39, 56, 0.42);
  stroke-width: 1;
}

.modeling-profile-tangent-handle {
  fill: #53b7f9;
  stroke: #218bce;
  stroke-width: 1.25;
  cursor: grab;
}

.modeling-profile-tangent-handle.is-dragging {
  cursor: grabbing;
}

.modeling-profile-tangent-handle:is(:hover, :focus-visible, .is-dragging) {
  fill: #53b7f9;
  stroke: #1577b5;
}

.modeling-profile-radius-handle {
  fill: #f8f5f0;
}

.modeling-point-navigation {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.modeling-point-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(185, 174, 158, 0.72);
  border-radius: 12px;
  background: #efeae1;
  color: #222738;
  cursor: pointer;
  font-family: var(--plain);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.modeling-point-button:is(:hover, :focus-visible) {
  border-color: #53b7f9;
  background: #53b7f9;
  color: #fff;
  transform: translateY(-1px);
  outline: none;
}

.modeling-point-button.is-active {
  border-color: #53b7f9;
  background: #53b7f9;
  color: #fff;
  transform: none;
}

@media (min-width: 1181px) {
  .modeling-profile-canvas .three-canvas-layer,
  .modeling-profile-canvas .lesson-svg {
    transform: translate(-185px, -40px);
  }
}

@media (max-width: 1050px) {
  .modeling-profile-toolbar {
    left: 50%;
  }

  .modeling-profile-copy {
    width: var(--profile-copy-width);
  }

  .modeling-profile-editor,
  .modeling-profile-graph {
    width: max(124px, calc(var(--profile-graph-height) / 2));
  }
}

@media (max-width: 760px) {
  .modeling-profile-workspace {
    --profile-visual-height: min(300px, 23.48vw);
  }

  .modeling-profile-toolbar {
    top: 32px;
    left: 50%;
  }

  .modeling-profile-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
  }

  .modeling-profile-copy {
    top: 56px;
    width: var(--profile-copy-width);
  }

  .modeling-profile-copy > p {
    display: none;
  }

  .modeling-material-control {
    width: var(--profile-slider-width);
    margin-top: 0;
  }

  .modeling-material-controls-row {
    gap: 14px;
    margin-top: 12px;
  }

  .modeling-profile-editor {
    width: max(124px, calc(var(--profile-graph-height) / 2));
    transform: translateX(calc(-14.1667% - 205px));
  }

  .modeling-profile-graph {
    width: max(124px, calc(var(--profile-graph-height) / 2));
    height: var(--profile-graph-height);
  }

  .modeling-point-navigation {
    position: fixed;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

html.is-ipad .modeling-profile-copy {
  top: 68px;
}

html.is-ipad .modeling-profile-copy > p {
  font-size: 18px;
}

@media (orientation: landscape) {
  html.is-ipad .modeling-profile-copy {
    top: 92px;
  }
}
