:root {
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", Consolas, monospace;
  --bg-0: #ebebeb;
  --bg-1: #d8e9c8;
  --bg-2: #f8c87c;
  --ink-0: #1c1d12;
  --ink-1: #33381f;
  --card: rgba(252, 252, 245, 0.84);
  --line: rgba(31, 35, 19, 0.15);
  --accent: #1c9a68;
  --accent-2: #ca5d31;
  --focus: #185adb;
  --shadow: 0 14px 28px rgba(18, 31, 12, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink-0);
  background: var(--bg-0);
  overflow-x: hidden;
}

.bg-layer {
  display: none;
}

.bg-layer-a {
  background: none;
}

.bg-layer-b {
  background: none;
  opacity: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1rem 3.5rem;
}

.hero {
  margin-bottom: 1.5rem;
  animation: slide-in 560ms ease-out both;
}

.kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.06;
}

.subtitle {
  margin: 0;
  max-width: 64ch;
  color: var(--ink-1);
}

.step-card,
.preview-card,
.results-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.step-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
}

h2,
h3 {
  margin: 0;
}

.hint {
  margin: 0.4rem 0 0.8rem;
  color: var(--ink-1);
  font-size: 0.92rem;
}

.object-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.object-panel {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.58);
}

.input-row {
  display: grid;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

label {
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(30, 35, 25, 0.28);
  border-radius: 2px;
  padding: 0.68rem 0.7rem;
  font-size: 1rem;
  font-family: var(--font-mono);
  background: #fffffb;
  color: var(--ink-0);
}

input:focus,
select:focus {
  border-color: var(--focus);
  outline: 2px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 1px;
}

.radii-fields {
  margin-top: 0.65rem;
}

.preview-canvas {
  margin-top: 0.7rem;
  width: 100%;
  height: clamp(260px, 44vw, 420px);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #eef3e7;
  overflow: hidden;
}

.preview-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.results-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.result-item {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.82);
}

.result-label {
  margin: 0;
  color: var(--ink-1);
  font-size: 0.86rem;
}

.result-value {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
}

.contact-plot-wrap {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.82);
}

.plot-label {
  margin: 0 0 0.5rem;
  color: var(--ink-1);
  font-size: 0.88rem;
  font-weight: 600;
}

.contact-plot {
  display: block;
  width: 100%;
  height: clamp(220px, 35vw, 290px);
  border: 1px solid rgba(30, 35, 25, 0.2);
  border-radius: 2px;
  background: #fbfcf8;
}

.status-text {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-1);
}

.site-footer {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
  color: var(--ink-1);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
}

.site-footer a {
  color: #0645ad;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:visited {
  color: #0b0080;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #0b0080;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: step-fade 520ms ease-out both;
}

.reveal:nth-of-type(2) {
  animation-delay: 70ms;
}

.reveal:nth-of-type(3) {
  animation-delay: 130ms;
}

.reveal:nth-of-type(4) {
  animation-delay: 190ms;
}

.reveal:nth-of-type(5) {
  animation-delay: 250ms;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes step-fade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .object-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding: 1.2rem 0.8rem 2.4rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
