:root {
  --ink: #16211f;
  --muted: #60706b;
  --line: #dce5e0;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --teal: #0f766e;
  --teal-strong: #0b5d57;
  --coral: #f26b5e;
  --mist: #e7f2ef;
  --shadow: 0 22px 60px rgba(22, 33, 31, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(251, 250, 247, 0.98), rgba(251, 250, 247, 0.62) 48%, rgba(251, 250, 247, 0.2)),
    var(--paper);
  overflow: hidden;
}

.hero__content {
  max-width: 620px;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.25rem, 10vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.lead {
  color: #344540;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.7;
}

.hero__actions,
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.button--primary:hover {
  background: var(--teal-strong);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.72);
}

.hero__stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero__stats strong {
  color: var(--ink);
  font-size: 1.5rem;
}

.hero__media {
  align-self: stretch;
  display: flex;
  align-items: center;
  min-height: 540px;
  margin-right: min(-72px, -5vw);
}

.hero__media img {
  width: 100%;
  height: min(78vh, 760px);
  object-fit: cover;
  object-position: left center;
  border-radius: 8px 0 0 8px;
  box-shadow: var(--shadow);
}

.workspace,
.salon {
  padding: clamp(54px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.tryon-grid,
.salon-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(300px, 520px);
  justify-content: center;
  gap: clamp(20px, 4vw, 42px);
  align-items: center;
}

.phone-stage {
  width: min(100%, 390px);
  margin: auto;
}

.phone-shell {
  aspect-ratio: 9 / 18;
  width: 100%;
  padding: 12px;
  border-radius: 38px;
  background: #111817;
  box-shadow: var(--shadow);
}

.camera-status {
  min-height: 44px;
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
}

.camera-view {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(#d9e8e2 0%, #f6e4d4 58%, #15211f 58%);
}

.camera-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-view.is-mirrored #cameraVideo {
  transform: scaleX(-1);
}

.camera-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 30px;
  background: linear-gradient(160deg, #d9e8e2, #f6e4d4 64%, #d6e8e2);
  text-align: center;
}

.camera-empty[hidden] {
  display: none;
}

.camera-empty p {
  margin-bottom: 8px;
  color: #4d625c;
  font-size: 0.86rem;
}

.camera-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  color: var(--teal);
  font-size: 2.5rem;
}

.button--camera {
  border-color: var(--teal);
  background: rgba(255, 255, 255, 0.82);
  color: var(--teal-strong);
  font-weight: 800;
}

.topbar,
.capture-bar {
  position: absolute;
  left: 18px;
  right: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  top: 18px;
}

.camera-settings {
  position: absolute;
  top: 68px;
  right: 18px;
  z-index: 5;
  width: 210px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(17, 24, 23, 0.9);
  box-shadow: 0 10px 24px rgba(17, 24, 23, 0.24);
}

.camera-settings[hidden] {
  display: none;
}

.camera-settings button {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: white;
  text-align: left;
  cursor: pointer;
}

.camera-settings button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.camera-settings label {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  color: white;
  font-size: 12px;
}

.camera-settings input[type="range"] {
  width: 100%;
  accent-color: #5eead4;
}

.capture-bar {
  bottom: 20px;
}

.lens-style-switcher {
  position: absolute;
  left: 50%;
  bottom: 154px;
  z-index: 4;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  width: min(82%, 300px);
  padding: 8px;
  border-radius: 8px;
  background: rgba(15, 27, 25, 0.72);
  color: white;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.lens-adjustments {
  position: absolute;
  left: 50%;
  bottom: 94px;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(86%, 320px);
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(15, 27, 25, 0.72);
  color: white;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.lens-adjustments label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 700;
}

.lens-adjustments input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: #5eead4;
}

.lens-style-switcher button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.lens-style-switcher span {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lens-style-switcher small {
  grid-column: 1 / -1;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
}

.ai-progress {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(10, 18, 17, 0.7);
  color: white;
  font-weight: 700;
  backdrop-filter: blur(5px);
}

.ai-progress[hidden] { display: none; }

.ai-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(15, 118, 110, 0.2);
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}

.ai-progress .ai-spinner { border-color: rgba(255, 255, 255, 0.28); border-top-color: white; }

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

.icon-button,
.mini-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
}

.live-dot {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.92);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
}

.face {
  --face-top: 13%;
  --face-width: 92%;
  position: absolute;
  left: 50%;
  top: var(--face-top);
  width: var(--face-width);
  height: 48%;
  transform: translateX(-50%);
  pointer-events: none;
}

.camera-view.has-media .head {
  display: none;
}

.camera-view {
  touch-action: pan-y;
}

.head {
  position: absolute;
  left: 50%;
  top: 26%;
  width: 72%;
  height: 62%;
  transform: translateX(-50%);
  border-radius: 46% 46% 42% 42%;
  background: #e7b894;
  box-shadow: inset 0 -22px 26px rgba(121, 75, 53, 0.12);
}

.hair-preview {
  --hair-filter: none;
  position: absolute;
  left: 50%;
  top: -4%;
  width: 108%;
  height: auto;
  transform: translateX(-50%);
  z-index: 2;
  object-fit: contain;
  filter: var(--hair-filter) drop-shadow(0 5px 4px rgba(20, 15, 12, 0.24));
  transform-origin: 50% 20%;
  transition: width 180ms ease, top 180ms ease, filter 180ms ease;
}

.hair-preview[data-style="crop"] {
  top: 1%;
  width: 103%;
}

.hair-preview[data-style="bob"] {
  top: -5%;
  width: 122%;
}

.hair-preview[data-style="wolf"] {
  top: -5%;
  width: 128%;
}

.hair-preview[data-style="pixie"] {
  top: -2%;
  width: 104%;
}

.hair-preview[data-style="slick"] {
  top: -5%;
  width: 105%;
}

.hair-preview[data-style="long"] {
  top: -7%;
  width: 132%;
}

.hair-preview[data-style="curly"] {
  top: -4%;
  width: 126%;
}

.hair-preview[data-style="side-part"],
.hair-preview[data-style="pompadour"] {
  top: -5%;
  width: 108%;
}

.hair-preview[data-style="buzz"] {
  top: 3%;
  width: 100%;
}

.hair-preview[data-style="mullet"] {
  top: -5%;
  width: 122%;
}

.hair-preview[data-style="lob"],
.hair-preview[data-style="braid"] {
  top: -6%;
  width: 124%;
}

.hair-preview[data-style="waves"] {
  top: -8%;
  width: 132%;
}

.hair-preview[data-style="ponytail"] {
  top: -10%;
  width: 118%;
}

.eye,
.nose,
.mouth {
  position: absolute;
  display: block;
}

.eye {
  top: 43%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27302d;
}

.eye--left {
  left: 31%;
}

.eye--right {
  right: 31%;
}

.nose {
  left: 50%;
  top: 52%;
  width: 10px;
  height: 26px;
  border-radius: 999px;
  border-right: 2px solid rgba(99, 59, 42, 0.36);
}

.mouth {
  left: 39%;
  top: 68%;
  width: 22%;
  height: 10px;
  border-bottom: 3px solid #a85d57;
  border-radius: 50%;
}

.shutter {
  width: 64px;
  height: 64px;
  border: 4px solid white;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.shutter:hover {
  background: rgba(255, 255, 255, 0.5);
}

.camera-flash {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: white;
  opacity: 0;
  pointer-events: none;
}

.camera-view.is-flashing .camera-flash {
  animation: camera-flash 260ms ease-out;
}

@keyframes camera-flash {
  0% { opacity: 0; }
  35% { opacity: 0.88; }
  100% { opacity: 0; }
}

.mini-button--accent {
  background: var(--coral);
  color: white;
}

.gender-toggle {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 62px;
  padding: 0 8px;
  color: var(--teal-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.gender-toggle img {
  width: 19px;
  height: 19px;
}

.lens-color-button {
  --selected-color: #2d2019;
  border: 4px solid rgba(255, 255, 255, 0.9);
  background: var(--selected-color);
  box-shadow: 0 0 0 1px rgba(15, 27, 25, 0.22);
}

.lens-color-palette {
  position: absolute;
  right: 18px;
  bottom: 76px;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(5, 34px);
  gap: 7px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(15, 27, 25, 0.78);
  backdrop-filter: blur(8px);
}

.lens-color-palette[hidden] {
  display: none;
}

.lens-color-palette button {
  width: 34px;
  height: 34px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--color);
  cursor: pointer;
}

.control-panel,
.design-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(22, 33, 31, 0.08);
}

.tryon-grid {
  display: block;
}

.phone-stage {
  max-width: 470px;
  margin-inline: auto;
}

.camera-view > .control-panel {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 10;
  display: block;
  width: min(88%, 350px);
  overflow-y: auto;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: rgba(250, 252, 251, 0.98);
  box-shadow: -16px 0 34px rgba(8, 18, 16, 0.22);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.camera-view > .control-panel.is-open {
  transform: translateX(0);
}

.camera-view > .control-panel[hidden] {
  display: none !important;
}

.menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.menu-heading strong {
  font-size: 1.05rem;
}

.camera-view > .control-panel .camera-settings {
  position: static;
  width: auto;
  margin-bottom: 14px;
  background: #172522;
  box-shadow: none;
}

.camera-view.menu-open::after {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: rgba(8, 18, 16, 0.35);
  content: "";
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.tab.is-active {
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 800;
}

.style-reference {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
}

.style-reference__image,
.style-thumb {
  object-fit: contain;
  background: #eee4d7;
}

.style-reference__image {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background-position: 0 0;
}

.style-reference span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.style-reference strong {
  display: block;
  line-height: 1.25;
}

.hairstyle-slider {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.gender-switch {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #e8efec;
}

.gender-option {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.gender-option.is-active {
  background: white;
  color: var(--teal);
  box-shadow: 0 2px 8px rgba(22, 33, 31, 0.1);
}

.style-card[hidden] { display: none; }

.hairstyles {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.hairstyles::-webkit-scrollbar { display: none; }

.slider-arrow {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--teal);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.style-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  flex: 0 0 min(72%, 180px);
  min-height: 156px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  scroll-snap-align: center;
  opacity: 0.64;
  transform: scale(0.94);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.style-card.is-selected {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
  opacity: 1;
  transform: scale(1);
}

.style-thumb {
  width: min(100%, 92px);
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.tab-panel[hidden] {
  display: none;
}

.swatch {
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--color);
  cursor: pointer;
}

.swatch.is-selected {
  border-color: var(--teal);
  outline: 2px solid white;
  box-shadow: 0 0 0 3px var(--teal);
}

.analysis-panel {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.analysis-panel div,
.design-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.label,
dt,
.feature-index {
  color: var(--muted);
  font-size: 0.88rem;
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.salon {
  background: var(--mist);
}

.salon-grid {
  align-items: stretch;
}

.design-card {
  display: grid;
  gap: 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.card-header strong {
  color: var(--teal);
}

.card-preview {
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center 28%;
}

.design-card dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.feature-list {
  display: grid;
  gap: 14px;
}

.feature-list > div {
  padding: 22px 0;
  border-bottom: 1px solid rgba(22, 33, 31, 0.18);
}

.feature-list p {
  color: var(--muted);
  line-height: 1.7;
}

.qr-dialog {
  width: min(calc(100% - 32px), 470px);
  padding: 24px;
  border: 0;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.qr-dialog::backdrop {
  background: rgba(10, 20, 18, 0.64);
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.65rem;
}

.qr-code {
  display: grid;
  place-items: center;
  min-height: 222px;
  margin: 22px 0 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-code img,
.qr-code canvas {
  max-width: 100%;
}

.qr-dialog > p {
  color: var(--muted);
  text-align: center;
}

.dialog-actions .button {
  flex: 1;
}

.button--full {
  width: 100%;
}

.realistic {
  position: relative;
  padding: clamp(54px, 8vw, 96px) clamp(18px, 5vw, 72px);
  background: #f7fbfa;
}

.result-back {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

body.result-mode > main > section:not(#realistic),
body.result-mode > main > header {
  display: none;
}

body.result-mode #realistic {
  display: block;
  min-height: 100vh;
}

.realistic-result {
  max-width: 720px;
  margin: 0 auto;
}

.realistic-preview {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 30px rgba(22, 33, 31, 0.08);
}

.realistic-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: linear-gradient(160deg, #dcebe7, #f3e0d1);
  object-fit: cover;
}

.realistic-preview img[hidden] {
  display: none;
}

.realistic-placeholder {
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.realistic-placeholder[hidden] { display: none; }

.realistic-placeholder p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.result-actions .button {
  min-width: 0;
  padding-inline: 12px;
}

.share-result-button {
  gap: 6px;
}

.share-result-button img {
  width: 17px;
  height: 17px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 8px;
  background: #16211f;
  color: white;
  box-shadow: 0 10px 30px rgba(22, 33, 31, 0.28);
  transform: translateX(-50%);
  text-align: center;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 860px) {
  .hero,
  .tryon-grid,
  .salon-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-bottom: 24px;
  }

  .hero__media {
    min-height: 280px;
    margin: 0 -24px;
  }

  .hero__media img {
    height: 360px;
    border-radius: 0;
  }

  .section-heading {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .hero {
    padding: 24px 18px;
  }

  .workspace,
  .salon,
  .realistic {
    padding-left: 14px;
    padding-right: 14px;
  }

  .analysis-panel div,
  .design-card dl div {
    display: grid;
    gap: 4px;
  }

  dd {
    text-align: left;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* HairLens runs as a single-screen camera app. */
body.app-mode {
  height: 100dvh;
  overflow: hidden;
  background: #111817;
}

body.app-mode main {
  height: 100dvh;
  overflow: hidden;
}

body.app-mode main > .hero,
body.app-mode main > .salon,
body.app-mode main > .realistic,
body.app-mode #tryon > .section-heading,
body.app-mode .camera-status {
  display: none;
}

body.app-mode #tryon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #111817;
}

body.app-mode .tryon-grid,
body.app-mode .phone-stage,
body.app-mode .phone-shell {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
}

body.app-mode .tryon-grid {
  display: block;
}

body.app-mode .phone-stage {
  width: min(100%, 480px);
  margin-inline: auto;
}

body.app-mode .phone-shell {
  aspect-ratio: auto;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

body.app-mode .camera-view {
  border-radius: 0;
}

body.app-mode.result-mode #tryon {
  display: none;
}

body.app-mode.result-mode main > #realistic {
  display: grid;
  align-content: center;
  height: 100dvh;
  min-height: 0;
  padding: 64px 18px 18px;
  overflow: hidden;
}

body.app-mode.result-mode #realistic .section-heading {
  margin-bottom: 16px;
}

body.app-mode.result-mode #realistic .section-heading p:not(.eyebrow) {
  display: none;
}

body.app-mode.result-mode #realistic h2 {
  font-size: 1.6rem;
}

body.app-mode.result-mode .realistic-preview {
  padding: 10px;
}

body.app-mode.result-mode .realistic-preview img {
  width: auto;
  max-width: 100%;
  height: min(66dvh, 680px);
  margin: auto;
  aspect-ratio: 2 / 3;
}

body.app-mode.result-mode .realistic-placeholder {
  min-height: min(62dvh, 560px);
}

body.app-mode .camera-view > .realistic {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  align-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 58px 14px 18px;
  overflow: hidden;
  background: rgba(8, 18, 16, 0.5);
  backdrop-filter: blur(4px);
}

body.app-mode .camera-view.showing-result > .realistic {
  display: grid;
}

body.app-mode .camera-view > .realistic .section-heading {
  display: none;
}

body.app-mode .camera-view > .realistic .section-heading p:not(.eyebrow) {
  display: none;
}

body.app-mode .camera-view > .realistic h2 {
  font-size: 1.45rem;
}

body.app-mode .camera-view > .realistic .realistic-result {
  width: min(100%, 390px);
  max-height: calc(100dvh - 82px);
  margin: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(8, 18, 16, 0.34);
}

body.app-mode .camera-view > .realistic .realistic-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: min(64dvh, 560px);
  padding: 8px;
  overflow: hidden;
}

body.app-mode .camera-view > .realistic .realistic-preview img {
  width: 100%;
  height: 100%;
  margin: auto;
  object-fit: cover;
}

body.app-mode .camera-view > .realistic .realistic-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 8px;
  background: #f7fbfa;
}

body.app-mode .camera-view > .realistic .result-back {
  position: absolute;
  top: 12px;
  left: 12px;
  min-height: 38px;
  padding: 0 11px;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
}
