:root {
  --paper: #f3f0e6;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --ink: #18201c;
  --muted: #68736d;
  --line: rgb(24 32 28 / 13%);
  --green: #0f9f73;
  --green-dark: #0b4133;
  --green-soft: #dff3ea;
  --orange: #ef9744;
  --orange-soft: #fff0dc;
  --blue: #3978f2;
  --blue-soft: #e8efff;
  --shape-color: #0f9f73;
  --shape-width: 300px;
  --shadow: 0 26px 72px rgb(40 54 47 / 13%);
  color-scheme: light;
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgb(15 159 115 / 17%), transparent 30rem),
    radial-gradient(circle at 90% 8%, rgb(239 151 68 / 18%), transparent 32rem),
    linear-gradient(135deg, #eef4ee 0%, var(--paper) 50%, #eee7d9 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

h1,
h2,
h3,
p,
pre,
fieldset {
  margin: 0;
}

.page {
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 44px;
}

.page > *,
.workspace > *,
.comparison-grid > *,
.shape-stage,
.code-panel {
  min-width: 0;
  max-width: 100%;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.eyebrow::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 2px 2px 0 var(--orange);
  content: "";
}

h1 {
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.06;
  overflow-wrap: anywhere;
}

h1 code {
  font-size: 0.88em;
  letter-spacing: -0.06em;
}

.lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(16px, 1.65vw, 19px);
  font-weight: 800;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.support-chip,
.width-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgb(15 159 115 / 22%);
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 900;
}

.support-chip.is-unsupported {
  border-color: rgb(239 151 68 / 35%);
  color: #8b4d15;
  background: var(--orange-soft);
}

.workspace {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.control-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgb(255 253 247 / 82%);
  box-shadow: var(--shadow);
}

.control-panel {
  display: grid;
  gap: 22px;
  padding: 22px;
}

.control-head,
.preview-head,
.comparison-title,
.code-head,
.color-control {
  display: flex;
  align-items: center;
}

.control-head,
.preview-head,
.comparison-title,
.code-head {
  justify-content: space-between;
  gap: 14px;
}

.control-head {
  justify-content: flex-start;
}

.control-head > div,
.preview-head > div {
  min-width: 0;
}

.control-head p,
.preview-head p,
.code-head > span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.control-head h2,
.preview-head h2 {
  margin-top: 3px;
  font-size: 22px;
  letter-spacing: -0.045em;
}

.control-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: white;
  background: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}

.control-group {
  padding: 0;
  border: 0;
}

.control-group legend,
.color-field > span:first-child,
.range-field > span:first-child {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.preset-buttons {
  display: flex;
  gap: 7px;
}

.preset-buttons button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: white;
  font-size: 12px;
  font-weight: 900;
}

.preset-buttons button[aria-pressed="true"] {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
}

.range-field,
.color-field {
  display: grid;
}

.range-field > span:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.range-field output {
  color: var(--green-dark);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.color-field {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}

.color-field > span:first-child {
  margin: 0;
}

.color-control {
  gap: 9px;
  min-height: 44px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

input[type="color"] {
  width: 34px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.color-control output {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.point-card {
  padding: 15px;
  border: 1px solid rgb(15 159 115 / 20%);
  border-radius: 16px;
  background: var(--green-soft);
}

.point-card > span {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.point-card p {
  color: #345d50;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.preview-panel {
  padding: 22px;
}

.preview-head {
  margin-bottom: 18px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.comparison-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgb(255 255 255 / 68%);
}

.comparison-card--shape {
  border-color: rgb(15 159 115 / 30%);
  background: linear-gradient(145deg, rgb(223 243 234 / 72%), rgb(255 255 255 / 70%) 58%);
}

.comparison-title {
  margin-bottom: 13px;
}

.comparison-title > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.comparison-title h3 {
  font-size: 19px;
  letter-spacing: -0.04em;
}

.comparison-title > code {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.comparison-label {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.comparison-label--fixed {
  color: #905019;
  background: var(--orange-soft);
}

.comparison-label--fluid {
  color: var(--green-dark);
  background: var(--green-soft);
}

.shape-stage {
  display: grid;
  place-items: center;
  min-height: 264px;
  padding: 20px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background-color: #f8f7f0;
  background-image:
    linear-gradient(45deg, rgb(24 32 28 / 5%) 25%, transparent 25%),
    linear-gradient(-45deg, rgb(24 32 28 / 5%) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgb(24 32 28 / 5%) 75%),
    linear-gradient(-45deg, transparent 75%, rgb(24 32 28 / 5%) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  overflow: hidden;
}

.shape-box {
  position: relative;
  width: min(var(--shape-width), 100%);
  height: 220px;
  border: 2px dashed rgb(24 32 28 / 24%);
  border-radius: 3px;
  transition: width 80ms linear;
}

.shape-box::before,
.shape-box::after {
  position: absolute;
  z-index: 2;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
}

.shape-box::before {
  top: -17px;
  left: 0;
  content: "0";
}

.shape-box::after {
  top: -17px;
  right: 0;
  content: attr(data-width);
}

.shape-fill {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  background:
    radial-gradient(circle at 24% 20%, rgb(255 255 255 / 24%), transparent 32%),
    var(--shape-color);
  transition: clip-path 220ms ease, background 180ms ease;
}

.shape-fill span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgb(11 65 51 / 62%);
  font-size: 11px;
  font-weight: 900;
}

.comparison-note {
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.fallback-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgb(239 151 68 / 32%);
  border-radius: 12px;
  color: #7b481c;
  background: var(--orange-soft);
  font-size: 13px;
  font-weight: 800;
}

.code-panel {
  margin-top: 14px;
  border-radius: 18px;
  color: #e9fff6;
  background: var(--green-dark);
  overflow: hidden;
}

.code-head {
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.code-head > span {
  color: #8fe0bf;
}

.code-head button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 10px;
  color: white;
  background: rgb(255 255 255 / 10%);
  font-size: 11px;
  font-weight: 900;
}

.code-panel pre {
  padding: 16px;
  overflow-x: auto;
}

.code-panel code {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.65;
}

.copy-status {
  min-height: 0;
  padding: 0 16px;
  color: #8fe0bf;
  font-size: 11px;
  font-weight: 800;
}

.copy-status:not(:empty) {
  min-height: 34px;
  padding-bottom: 12px;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .shape-stage {
    min-height: 250px;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 620px);
    padding: 22px 0 30px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  h1 {
    font-size: clamp(32px, 11vw, 46px);
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .control-panel,
  .preview-panel {
    width: 100%;
    border-radius: 20px;
  }

  .control-panel {
    padding: 18px;
  }

  .preview-panel {
    padding: 14px;
  }

  .preview-head {
    align-items: flex-start;
  }

  .shape-stage {
    min-height: 226px;
    padding-inline: 6px;
  }

  .shape-box {
    height: 186px;
  }
}

@media (max-width: 390px) {
  .preset-buttons {
    flex-wrap: wrap;
  }

  .preset-buttons button {
    flex-basis: calc(50% - 4px);
  }

  .comparison-title {
    align-items: flex-start;
  }

  .comparison-title > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
