@import url("https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Jua&display=swap");

:root {
  color-scheme: light;
  --cream: #fff7ea;
  --sky: #eef4ff;
  --mint: #d6f5e8;
  --ink: #2b2438;
  --accent: #f0747a;
  --navy: #2b2a55;
  --shadow: 0 14px 32px rgba(43, 36, 56, 0.12);
  --grid-line: #111111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Gowun Dodum", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--cream) 0%, var(--sky) 50%, #f7fff9 100%);
  min-height: 100vh;
}

h1,
h2,
h3,
.logo {
  font-family: "Jua", "Gowun Dodum", sans-serif;
  letter-spacing: 0.2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 10vw;
  background: #ffffff;
  border-bottom: 2px dashed rgba(43, 42, 85, 0.2);
}

.logo {
  font-size: 1.4rem;
  color: var(--navy);
}

.primary-button {
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.secondary-button {
  border: none;
  cursor: pointer;
  background: #ffffff;
  color: var(--navy);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  border: 2px solid rgba(43, 42, 85, 0.2);
}

main {
  padding: 40px 10vw 80px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--navy);
  font-weight: 600;
}

.lead {
  font-size: 1.05rem;
  margin-top: 12px;
}

.hero-panel {
  background: #ffffff;
  padding: 22px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 2px solid rgba(43, 42, 85, 0.1);
  display: grid;
  gap: 18px;
}

.panel-label {
  font-weight: 700;
  color: var(--navy);
}

.cube-illustration {
  background: #f8f9ff;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.viewer {
  width: 100%;
  max-width: 300px;
  height: 200px;
  border-radius: 14px;
  border: 2px solid rgba(43, 42, 85, 0.2);
  background: #ffffff;
  overflow: hidden;
}

.viewer-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-weight: 700;
  color: #4a4a6a;
}

.direction-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 100%;
  font-weight: 700;
  color: #4a4a6a;
  text-align: center;
  font-size: 0.9rem;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid #111111;
  display: inline-block;
}

.swatch.red {
  background: #ff4444;
}

.swatch.yellow {
  background: #ffd700;
}

.swatch.blue {
  background: #4169e1;
}

.swatch.green {
  background: #32cd32;
}

.activity {
  background: rgba(255, 255, 255, 0.88);
  padding: 26px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 2px solid rgba(43, 42, 85, 0.08);
}

.activity-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.helper {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: #4e4b6d;
}

.tool-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.palette-btn {
  border: 2px solid rgba(43, 42, 85, 0.2);
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.palette-btn.is-active {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.grid-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 2px solid var(--grid-line);
  background: #ffffff;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.cell {
  border: 1px solid var(--grid-line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #111111;
}

.cell.inactive {
  background: #f4f4f6;
  cursor: not-allowed;
}

.cell.active {
  border-width: 2px;
}

.cell.red {
  background: #ff4444;
  color: #ffffff;
}

.cell.yellow {
  background: #ffd700;
}

.cell.blue {
  background: #4169e1;
  color: #ffffff;
}

.cell.green {
  background: #32cd32;
  color: #ffffff;
}

.result {
  margin-top: 18px;
  font-weight: 700;
  color: var(--navy);
}

.site-footer {
  padding: 24px 10vw 40px;
  color: #5b5b70;
  font-weight: 600;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  main {
    padding: 32px 6vw 70px;
  }
}
