@font-face {
  font-family: "Chakra Petch";
  src: url("/fonts/chakra-petch-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Chakra Petch";
  src: url("/fonts/chakra-petch-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --relief-font: "Chakra Petch", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

html,
body {
  overscroll-behavior: none;
}

body,
button,
input,
select,
textarea {
  font-family: var(--relief-font) !important;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

.tiv-toolbar [class*="text-[0.6rem]"] {
  font-size: 0.66rem !important;
  letter-spacing: 0.015em !important;
}

.tiv-toolbar .font-mono {
  font-family: var(--relief-font) !important;
}

.tiv-toolbar label {
  opacity: 0.68 !important;
  line-height: 1.35;
}

.tiv-toolbar button.opacity-50 {
  opacity: 0.68;
}

.tiv-toolbar p.opacity-50 {
  opacity: 0.58;
  line-height: 1.45;
}

canvas {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

canvas:active {
  cursor: grabbing;
}

[data-focus-select="true"] canvas {
  cursor: crosshair;
}

body[data-relief-tool="pan"] canvas {
  cursor: move;
}

body[data-relief-tool="zoom"] canvas {
  cursor: ns-resize;
}

body[data-relief-tool="focal"] canvas {
  cursor: crosshair;
}

body[data-relief-tool="rotate"] canvas {
  cursor: ew-resize;
}

body.relief-tool-dragging::before,
body.relief-scrub-dragging::before {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 9998;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.72);
  color: rgba(255, 255, 255, 0.68);
  font: 700 0.65rem/1.35 var(--relief-font);
  letter-spacing: 0.015em;
  pointer-events: none;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

body.relief-tool-dragging::before {
  content: "Relative drag · release to finish · Esc releases pointer";
}

body.relief-scrub-dragging::before {
  content: "Relative value drag · release to finish · Esc releases pointer";
}

.tiv-toolbar {
  display: flex;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  overscroll-behavior: contain;
}

.tiv-toolbar > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0 !important;
}

.relief-toolbar-scroll {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.relief-panel-toggle {
  z-index: 40 !important;
  display: grid;
  width: 2rem;
  height: 2.75rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 0;
  border-radius: 0.75rem 0 0 0.75rem;
  color: rgba(244, 244, 245, 0.64);
  background: hsla(230, 13%, 9%, 0.72);
  box-shadow: -0.35rem 0 1rem rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px);
  transition:
    right 300ms cubic-bezier(0.4, 0, 0.2, 1),
    color 160ms ease,
    background-color 160ms ease;
}

.relief-panel-toggle-open {
  right: 16rem;
}

.relief-panel-toggle-closed {
  right: 0;
}

.relief-panel-toggle:hover {
  color: rgb(250, 250, 250);
  background: hsla(230, 13%, 15%, 0.94);
}

.relief-section {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 1.25rem;
}

.relief-section-heading {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  color: rgb(212 212 216);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: left;
}

.relief-section-heading:hover {
  color: rgb(244 244 245);
}

.relief-section-line {
  min-width: 0.75rem;
  flex: 1 1 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.relief-section-chevron {
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.55;
  transform: translateY(-0.1rem) rotate(45deg);
  transition: transform 160ms ease;
}

.relief-section-heading[aria-expanded="false"] .relief-section-chevron {
  transform: translateX(-0.1rem) rotate(-45deg);
}

.relief-section-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1.25rem;
}

.relief-section-content[hidden] {
  display: none;
}

.relief-global-reset {
  z-index: 13;
  width: 100%;
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(18, 18, 23, 0.9);
  backdrop-filter: blur(18px);
}

.relief-reset-all {
  display: flex;
  width: 100%;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  color: hsl(var(--muted-foreground));
  background: rgba(255, 255, 255, 0.025);
  font: 700 0.68rem/1.35 var(--relief-font);
  letter-spacing: 0.025em;
  opacity: 0.7;
  transition:
    color 150ms ease,
    opacity 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

.relief-reset-all:hover {
  border-color: rgba(255, 255, 255, 0.14);
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
  opacity: 1;
}

.relief-camera-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.relief-subsection-label {
  color: hsl(var(--muted-foreground));
  font: 700 0.62rem/1.35 var(--relief-font);
  letter-spacing: 0.055em;
  opacity: 0.58;
}

.relief-camera-settings {
  display: flex;
  flex-direction: column;
}

.relief-camera-settings > .group:has(label[for="cameraFocalDistance"]) {
  order: 1;
}

.relief-camera-settings > .group:has(label[for="bokehStrength"]) {
  order: 2;
}

.relief-camera-settings > .group:has(label[for="distanceAttenuation"]) {
  order: 3;
}

.relief-camera-settings > .group:has(label[for="chromaticAberration"]) {
  order: 4;
}

.relief-camera-settings > .group:has(label[for="exposure"]) {
  position: relative;
  order: 5;
  margin-top: 0.75rem !important;
  padding-top: 1.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.relief-camera-settings > .group:has(label[for="exposure"])::before {
  content: "output";
  position: absolute;
  top: 0.5rem;
  left: 0;
  color: hsl(var(--muted-foreground));
  font: 700 0.62rem/1.35 var(--relief-font);
  letter-spacing: 0.055em;
  opacity: 0.58;
}

.relief-camera-settings > .group:has(label[for="devicePixelRatio"]) {
  order: 6;
}

.relief-export-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.relief-export-row,
.relief-export-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.relief-export-row label,
.relief-export-field label,
.relief-export-quality label {
  color: hsl(var(--muted-foreground));
  font: 700 0.65rem/1.35 var(--relief-font);
  letter-spacing: 0.02em;
  opacity: 0.68;
}

.relief-export-row select,
.relief-export-field input {
  min-width: 0;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.5rem;
  outline: none;
  background: rgb(24 24 29);
  color: hsl(var(--muted-foreground));
  font: 400 0.72rem/1.35 var(--relief-font);
}

.relief-export-row select {
  width: 7.5rem;
  padding: 0 0.55rem;
}

.relief-export-field input {
  width: 7.5rem;
  padding: 0 0.65rem;
  text-align: right;
}

.relief-export-row select:focus,
.relief-export-field input:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

.relief-export-quality {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.relief-export-quality > div,
.relief-export-summary {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.relief-export-quality span,
.relief-export-summary,
.relief-export-status {
  color: hsl(var(--muted-foreground));
  font: 400 0.62rem/1.35 var(--relief-font);
  letter-spacing: 0.012em;
  opacity: 0.56;
}

.relief-export-quality input {
  width: 100%;
  accent-color: rgb(212 212 216);
}

.relief-export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.relief-export-actions button {
  min-height: 2.35rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.65rem;
  color: hsl(var(--muted-foreground));
  font: 700 0.65rem/1.35 var(--relief-font);
  letter-spacing: 0.02em;
  opacity: 0.7;
}

.relief-export-actions button:hover:not(:disabled) {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  opacity: 1;
}

.relief-export-actions button:disabled {
  cursor: wait;
  opacity: 0.3;
}

.relief-export-status {
  min-height: 0.9rem;
  text-align: center;
}

.relief-origin-note {
  z-index: 12;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.15rem;
  margin: 0 !important;
  padding: 0.9rem 1.25rem 1.05rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(to bottom, rgba(18, 18, 23, 0.72), rgba(18, 18, 23, 0.94) 38%);
  box-shadow: 0 -0.75rem 1.5rem rgba(5, 5, 8, 0.12);
  backdrop-filter: blur(18px);
  color: hsl(var(--muted-foreground));
  font: 400 0.62rem/1.4 var(--relief-font);
  letter-spacing: 0.025em;
  opacity: 0.44;
  text-align: center;
  transition: opacity 150ms ease;
}

.relief-origin-note span:first-child {
  color: rgb(212 212 216);
  font-weight: 600;
}

.relief-origin-note a {
  transition:
    color 150ms ease,
    text-decoration-color 150ms ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.16rem;
}

.relief-origin-note a:hover {
  color: rgb(244 244 245);
  text-decoration-color: rgba(244, 244, 245, 0.35);
}

.relief-origin-note:hover {
  opacity: 0.75;
}

.relief-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  width: 100%;
  padding: 0.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
}

.relief-tool {
  min-height: 2rem;
  border-radius: 0.5rem;
  color: hsl(var(--muted-foreground));
  font: 700 0.66rem/1.35 var(--relief-font);
  letter-spacing: 0.02em;
  opacity: 0.64;
  transition: color 150ms, background-color 150ms, opacity 150ms;
}

.relief-tool:hover {
  background: hsl(var(--accent));
  opacity: 0.8;
}

.relief-tool[aria-pressed="true"] {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  opacity: 1;
}

body.relief-drop-active::after {
  content: "Drop image to open";
  position: fixed;
  inset: 1rem;
  z-index: 9999;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  border-radius: 1rem;
  background: rgba(9, 9, 11, 0.78);
  color: rgba(255, 255, 255, 0.92);
  font: 700 0.8rem/1.4 var(--relief-font);
  letter-spacing: 0.025em;
  pointer-events: none;
  backdrop-filter: blur(12px);
}
