/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: monospace;
  background: #f8f8f8;
  color: #222;
}

/* ---- Nav ---- */
nav {
  font-family: monospace;
  font-size: 0.85em;
  padding: 12px 20px;
  border-bottom: 1px solid #e0e0e0;
}
nav a { color: inherit; text-decoration: none; }
nav a:hover { text-decoration: underline; }

/* ---- Layout ---- */
main {
  max-width: 860px;
  margin: auto;
  padding: 40px 24px 80px;
}

h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1rem; margin: 0 0 6px; }
p  { margin: 0 0 12px; font-size: 0.85rem; color: #aaa; line-height: 1.5; }
.intro { margin: 8px 0 32px; }

.section {
  margin-top: 56px;
  padding: 28px 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

/* ---- Clip-path grid ---- */
.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.clip-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.clip-shape {
  width: 160px;
  height: 160px;
  cursor: pointer;
  transition: clip-path 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.4s ease,
              transform 0.2s ease;
}
.clip-shape:hover { transform: scale(1.05); }

/* ---- 1. circle → square ---- */
.circle-to-square {
  background: linear-gradient(135deg, #222 0%, #555 100%);
  clip-path: circle(50% at 50% 50%);
}
.circle-to-square:hover {
  clip-path: inset(0% 0% 0% 0% round 4px);
}

/* ---- 2. triangle → diamond ---- */
.triangle-to-diamond {
  background: linear-gradient(160deg, #222 0%, #888 100%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.triangle-to-diamond:hover {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

/* ---- 3. hexagon → circle ---- */
.hexagon-to-circle {
  background: linear-gradient(135deg, #333 0%, #777 100%);
  clip-path: polygon(
    25% 0%, 75% 0%,
    100% 50%,
    75% 100%, 25% 100%,
    0% 50%
  );
}
.hexagon-to-circle:hover {
  clip-path: circle(50% at 50% 50%);
}

/* ---- 4. arrow → chevron ---- */
.star-to-circle {
  background: linear-gradient(135deg, #222 0%, #999 100%);
  clip-path: polygon(
    0% 30%, 60% 30%, 60% 0%, 100% 50%,
    60% 100%, 60% 70%, 0% 70%
  );
}
.star-to-circle:hover {
  clip-path: polygon(
    0% 20%, 55% 20%, 40% 0%, 100% 50%,
    40% 100%, 55% 80%, 0% 80%
  );
}

/* ---- 5. ellipse → rect ---- */
.ellipse-to-rect {
  background: linear-gradient(180deg, #222 0%, #666 100%);
  clip-path: ellipse(38% 50% at 50% 50%);
}
.ellipse-to-rect:hover {
  clip-path: inset(0% 10% 0% 10% round 2px);
}

/* ---- 6. notched → full ---- */
.notch-to-full {
  background: linear-gradient(135deg, #444 0%, #aaa 100%);
  clip-path: polygon(
    0% 0%, 80% 0%,
    100% 20%,
    100% 100%,
    20% 100%,
    0% 80%
  );
}
.notch-to-full:hover {
  clip-path: polygon(
    0% 0%, 100% 0%,
    100% 0%,
    100% 100%,
    0% 100%,
    0% 0%
  );
}

/* ---- clip info ---- */
.clip-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.clip-name {
  font-size: 0.82rem;
  color: #222;
}
.clip-info code {
  font-size: 0.68rem;
  color: #aaa;
}

/* ---- Reveal on hover ---- */
.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.reveal-card {
  position: relative;
  height: 160px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}

.reveal-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e84393 0%, #00c8ff 100%);
}

.reveal-overlay {
  position: absolute;
  inset: 0;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: #aaa;
  transition: clip-path 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Default: overlay covers everything */
.reveal-card .reveal-overlay {
  clip-path: inset(0%);
}

/* v1: expand from center */
.reveal-card:hover .reveal-overlay {
  clip-path: inset(50% 50% 50% 50%);
}

/* v2: wipe from left */
.reveal-card.v2 .reveal-overlay {
  clip-path: inset(0% 0% 0% 0%);
}
.reveal-card.v2:hover .reveal-overlay {
  clip-path: inset(0% 100% 0% 0%);
}

/* v3: iris open (circle) */
.reveal-card.v3 .reveal-overlay {
  clip-path: circle(100% at 50% 50%);
}
.reveal-card.v3:hover .reveal-overlay {
  clip-path: circle(0% at 50% 50%);
}

/* ---- Text clip ---- */
.text-clip-wrap {
  margin-top: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.text-clip-a,
.text-clip-b {
  font-size: calc(2rem + 1.5vw);
  font-weight: bold;
  letter-spacing: -0.02em;
  padding: 10px 20px;
  transition: clip-path 0.4s ease;
}

.text-clip-a {
  background: linear-gradient(135deg, #222 0%, #888 100%);
  color: #fff;
  clip-path: polygon(0 0, 90% 0, 100% 100%, 0 100%);
}
.text-clip-a:hover {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.text-clip-b {
  background: linear-gradient(135deg, #aaa 0%, #222 100%);
  color: #fff;
  clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
}
.text-clip-b:hover {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
