:root {
  --background: #f4efe6;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffaf2;
  --text: #1b2430;
  --muted: #54606e;
  --accent: #b24c2b;
  --accent-soft: #eab69d;
  --border: rgba(27, 36, 48, 0.12);
  --shadow: 0 18px 50px rgba(50, 35, 21, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(234, 182, 157, 0.45), transparent 32%),
    linear-gradient(180deg, #fbf7f0 0%, var(--background) 100%);
}

a {
  color: inherit;
}

.container {
  width: min(1100px, calc(100% - 3rem));
  margin: 0 auto;
}

.site-header {
  position: relative;
  min-height: 9.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #111821;
}

.site-header-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-header-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 16, 23, 0.2), rgba(11, 16, 23, 0.78)),
    linear-gradient(90deg, rgba(11, 16, 23, 0.72), rgba(11, 16, 23, 0.24));
}

.site-header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1rem 0 1.5rem;
}

.site-header-logo img {
  display: block;
  width: min(220px, 46vw);
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.28));
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.site-nav a {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: #f8f1e8;
  background: rgba(17, 24, 33, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}

.site-nav a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

.hero,
.page-content {
  padding: 5rem 0 3rem;
}

.hero h1,
.page-content h1 {
  margin: 0 0 1rem;
  max-width: 14ch;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1;
}

.hero p,
.page-content p {
  max-width: 62ch;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--accent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  padding-bottom: 4rem;
}

.card {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.card-link {
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card-link:hover {
  transform: translateY(-4px);
  border-color: rgba(178, 76, 43, 0.28);
  box-shadow: 0 24px 60px rgba(50, 35, 21, 0.18);
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card h2 {
  margin: 1.2rem 1.5rem 1.4rem;
  margin-top: 0;
  font-size: 1.4rem;
  line-height: 1.2;
}

.home-main .hero {
  max-width: 82rem;
}

.home-main .hero p {
  max-width: 74ch;
}

.home-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.interactive-page {
  padding-bottom: 5rem;
}

.page-intro {
  margin-bottom: 2rem;
}

.page-intro h1 {
  max-width: 18ch;
}

.section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.section-links a,
button,
.file-input span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

button:hover,
.section-links a:hover,
.file-input span:hover {
  border-color: var(--accent-soft);
}

button {
  transition: background-color 160ms ease, border-color 160ms ease;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.interactive-section {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.section-copy h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.section-copy p:last-child {
  margin-bottom: 0;
}

.interactive-shell {
  padding: 1.5rem;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.interactive-layout {
  display: grid;
  gap: 1rem;
}

.split-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.triple-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 1rem;
  border-radius: 1.1rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.panel h3 {
  margin-top: 0;
}

.panel-dark {
  background:
    radial-gradient(circle at top, rgba(234, 182, 157, 0.18), transparent 28%),
    #111821;
  color: #f5f1ea;
}

.panel-controls {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.toolbar-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.toolbar-stack label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.slider-label output,
.control-group output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.control-group {
  display: grid;
  gap: 0.45rem;
}

.display-canvas,
.grid-canvas,
.wide-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 0.9rem;
  background: rgba(12, 17, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-canvas {
  background:
    linear-gradient(180deg, rgba(23, 31, 44, 0.98), rgba(13, 17, 24, 0.98));
}

.grid-canvas {
  max-width: 320px;
}

.info-box,
.status-text {
  color: var(--muted);
}

.info-box {
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(27, 36, 48, 0.06);
  line-height: 1.6;
}

.editor-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
}

.editor-header h3 {
  margin-bottom: 0.35rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.spectrum-panel {
  margin-top: 1rem;
}

.test-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.bottom-banner {
  margin-top: 2.5rem;
  overflow: hidden;
  border-radius: 1.4rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.bottom-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.file-input {
  position: relative;
  overflow: hidden;
}

.file-input input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

input[type="range"],
select {
  width: 100%;
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 1.5rem, 1100px);
  }

  .hero,
  .page-content {
    padding-top: 3rem;
  }

  .site-header .container {
    align-items: flex-start;
  }

  .site-header {
    min-height: 8rem;
  }
}

@media (max-width: 980px) {
  .home-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout,
  .triple-layout,
  .test-grid {
    grid-template-columns: 1fr;
  }

  .interactive-shell {
    padding: 1rem;
  }
}

@media (max-width: 680px) {
  .home-card-grid {
    grid-template-columns: 1fr;
  }
}
