/* PolyUnwrap design pass
   Skill: redesign-existing-projects (https://github.com/Leonxlnx/taste-skill)
   Read: dark seam workbench for people comparing unwrap algorithms.
   Keep every control and the rose seam / cyan island legend.
   Replace the cyan-glow dashboard chrome with an instrument surface:
   Outfit + IBM Plex Mono, one desaturated mint accent, labeled metrics. */

@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/outfit-400.woff2") format("woff2");
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/outfit-500.woff2") format("woff2");
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/outfit-600.woff2") format("woff2");
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/outfit-700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/plex-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/plex-500.woff2") format("woff2");
}

:root {
  --font-sans: Outfit, "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ink: #121614;
  --ink-2: #1a211f;
  --paper: #f3f6f4;
  --body: #c5d0ca;
  --muted: #9aa69f;
  --line: rgba(214, 226, 220, 0.14);
  --line-strong: rgba(214, 226, 220, 0.28);
  --accent: #d7f3ec;
  --accent-deep: #1c3330;
  --seam: #e7a8a4;
}

html {
  background: var(--ink);
}

body {
  color: var(--body);
  background:
    radial-gradient(900px 420px at 18% -8%, rgba(168, 196, 186, 0.09), transparent 55%),
    var(--ink);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection {
  background: rgba(183, 228, 218, 0.28);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 80;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--accent);
  color: #10211e;
  padding: 8px 12px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

h1,
h2 {
  color: var(--paper);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  font-size: 1.35rem;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.7rem, 2.1vw, 2.05rem);
  line-height: 1.12;
}

main p {
  text-wrap: pretty;
  color: var(--body);
  line-height: 1.65;
}

.uppercase {
  text-transform: none;
  letter-spacing: 0.01em;
}

header {
  background: rgba(18, 22, 20, 0.88);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px);
}

header .bg-gradient-to-br {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background-image: none;
  background-color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

header .bg-gradient-to-br svg {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}

header p {
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 11px;
}

header h1 span {
  color: var(--accent);
}

nav[aria-label="Algorithms"] {
  gap: 2px;
  border: 0;
  background: transparent;
  padding: 2px;
}

nav[aria-label="Algorithms"] button {
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 500;
}

nav[aria-label="Algorithms"] button.ring-cyan-500\/50 {
  background: var(--accent-deep);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(215, 243, 236, 0.35);
}

.border-slate-800 {
  border-color: var(--line);
}

.bg-slate-900\/50,
.bg-slate-900\/60 {
  background-color: rgba(26, 33, 31, 0.72);
}

.bg-slate-950,
.bg-slate-950\/80,
.bg-slate-950\/85 {
  background-color: #101412;
}

.text-slate-400 {
  color: var(--body);
}

.text-slate-500 {
  color: var(--muted);
}

.text-slate-300 {
  color: #d5ddd8;
}

.text-cyan-300,
.text-cyan-400,
.text-cyan-500 {
  color: var(--accent);
}

.text-orange-300 {
  color: var(--paper);
}

.text-rose-300 {
  color: var(--seam);
}

.rounded-xl {
  border-radius: 16px;
}

.rounded-lg {
  border-radius: 12px;
}

section.lg\:col-span-8 > :first-child {
  border-color: transparent;
  background: transparent;
  padding-inline: 2px;
  padding-top: 2px;
  box-shadow: none;
}

main dl {
  gap: 8px;
  flex-wrap: wrap;
}

main dl > div {
  min-width: 9.75rem;
  padding: 10px 12px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(26, 33, 31, 0.9);
}

main dl .sr-only {
  position: static;
  width: auto;
  height: auto;
  margin: 0 0 4px;
  padding: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  border: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

main dl dd {
  margin: 0;
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

section .min-h-\[420px\] {
  border-color: var(--line-strong);
  background: #101412;
  box-shadow: 0 28px 50px -36px rgba(0, 0, 0, 0.85);
}

section .min-h-\[420px\] > .border-b {
  gap: 12px;
  border-bottom-color: var(--line);
  background: #171d1b;
  padding: 12px 14px;
}

button {
  font-family: inherit;
}

button.uppercase:not(.bg-cyan-600) {
  font-weight: 500;
}

button.bg-slate-800:not(.flex-1) {
  border-radius: 8px;
  background: transparent;
  color: var(--body);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

button.bg-slate-800:not(.flex-1):hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
}

button.ring-cyan-500\/40 {
  border-radius: 8px;
  background: var(--accent-deep);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(215, 243, 236, 0.4);
}

button.bg-cyan-600 {
  border-radius: 8px;
  background: var(--accent);
  color: #10211e;
  font-weight: 600;
}

button.bg-cyan-600:hover {
  background: #edfaf6;
  color: #10211e;
}

button.bg-cyan-600:disabled,
button[aria-busy="true"] {
  background: #2a3331;
  color: var(--accent);
  cursor: progress;
}

button[aria-busy="true"] {
  animation: busy 1s ease-in-out infinite;
}

.stage {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(183, 212, 200, 0.08), transparent 58%),
    #121614;
}

.stage .shadow-lg {
  border-color: var(--line);
  background: rgba(16, 20, 18, 0.78);
  box-shadow: none;
}

.stage > p {
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 36px 14px 12px;
  background: linear-gradient(to top, rgba(12, 16, 14, 0.94), rgba(12, 16, 14, 0));
  color: #d7e0db;
  font-size: 12.5px;
  line-height: 1.45;
}

aside > div:first-child {
  justify-content: flex-start;
  gap: 1.5rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0 16px;
}

aside > div:first-child button {
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  padding: 8px 0 10px;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  box-shadow: inset 0 -2px 0 transparent;
}

aside > div:first-child button.bg-slate-800 {
  background: transparent;
  color: var(--paper);
  box-shadow: inset 0 -2px 0 var(--accent);
}

aside pre {
  font-size: 12.5px;
  line-height: 1.65;
  color: #d5ddd8;
  padding: 18px 16px 20px;
}

aside .grid {
  background: rgba(26, 33, 31, 0.55);
}

aside .grid > div + div {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

input[type="range"] {
  accent-color: #9ed9cf;
  cursor: pointer;
}

input[type="text"],
select {
  border-color: var(--line-strong);
  background: #101412;
  border-radius: 10px;
  color: var(--paper);
  font-family: inherit;
}

p[role="alert"] {
  margin: 0;
  border: 1px solid rgba(231, 168, 164, 0.35);
  border-radius: 8px;
  background: rgba(72, 36, 34, 0.55);
  padding: 8px 10px;
  color: #f6d4d0;
}

button.rounded-full {
  border-radius: 8px;
  border-color: var(--line-strong);
  background: transparent;
}

button.rounded-full:hover {
  border-color: rgba(215, 243, 236, 0.45);
  color: var(--accent);
}

@media (max-width: 1023px) {
  section.lg\:col-span-8 > :first-child {
    order: 2;
    padding-top: 4px;
  }

  section.lg\:col-span-8 > :last-child {
    order: 1;
  }
}

@media (max-width: 639px) {
  section .min-h-\[420px\] {
    min-height: 0;
  }

  .stage {
    min-height: 248px;
  }

  .stage .min-h-\[280px\] {
    min-height: 188px;
  }

  label.sm\:hidden {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  label.sm\:hidden .sr-only {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
  }

  button,
  select {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  main > section,
  main > aside {
    animation: rise 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  main > aside {
    animation-delay: 70ms;
  }

  button {
    transition:
      background-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
      color 180ms cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1),
      transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  button:active:not(:disabled) {
    transform: scale(0.98);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes busy {
  50% {
    opacity: 0.62;
  }
}
