:root {
  --bg: #ffffff;
  --surface: #f2f2f2;
  --border: #cccccc;
  --accent: #555555;
  --accent2: #888888;
  --accent3: #333333;
  --text: #111111;
  --muted: #999999;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  min-height: 100vh;
  padding: 60px 40px;
  overflow-x: hidden;
}

/* ── PAGE HEADER ── */
.page-header {
  text-align: center;
  margin-bottom: 80px;
}
.page-header h1 {
  font-family: Arial, sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-header h1 em {
  font-style: normal;
  color: var(--text);
}
.page-header p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── SECTION ── */
.section {
  max-width: 1100px;
  margin: 0 auto 100px;
}
.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.section-label span {
  color: var(--accent);
}
.section-title {
  font-family: Arial, sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* ═══════════════════════════════════════
   01 — ROLLOVER CARDS
═══════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  width: 100%;
}

.rollover-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.25s ease,
              box-shadow 0.35s ease;
}

.rollover-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.05);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.rollover-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.rollover-card:hover::before { opacity: 0.06; }

.rollover-card .card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rollover-card:hover .card-icon { transform: scale(1.3) rotate(-5deg); }

.rollover-card h3 {
  font-family: Arial, sans-serif;
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.rollover-card p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   02 — IMAGE HOVER EFFECTS
═══════════════════════════════════════ */
.img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.img-box {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

/* — box A: zoom + desaturate → color — */
.img-box-a .img-fill {
  width: 100%;
  height: 100%;
  background: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: saturate(0) brightness(0.6);
}
.img-box-a:hover .img-fill {
  transform: scale(1.08);
  filter: saturate(1) brightness(1);
}

/* — box B: slide-in overlay — */
.img-box-b .img-fill {
  width: 100%;
  height: 100%;
  background: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.img-box-b .img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #fff;
  font-weight: 500;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}
.img-box-b:hover .img-overlay { transform: translateY(0); }

/* — box C: blur + scale reveal — */
.img-box-c .img-fill {
  width: 100%;
  height: 100%;
  background: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  transition: filter 0.4s ease, transform 0.4s ease;
}
.img-box-c .img-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.img-box-c:hover .img-fill { filter: blur(3px); transform: scale(1.05); }
.img-box-c:hover .img-caption { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════
   03 — TEXT EFFECTS
═══════════════════════════════════════ */
.text-effects-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.text-effect-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.te-label {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  min-width: 90px;
}

/* — gradient sweep — */
.text-sweep {
  font-family: Arial, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  background: linear-gradient(90deg, #111 0%, #bbb 50%, #111 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: sweepGradient 3s linear infinite;
}
@keyframes sweepGradient {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}

/* — char-by-char reveal on hover — */
.text-chars {
  font-family: Arial, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  cursor: default;
  display: flex;
  gap: 1px;
}
.text-chars .ch {
  display: inline-block;
  transition: color 0.15s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.text-chars:hover .ch:nth-child(1)  { color: var(--accent);  transform: translateY(-6px); transition-delay: 0.00s; }
.text-chars:hover .ch:nth-child(2)  { color: var(--accent);  transform: translateY(-6px); transition-delay: 0.04s; }
.text-chars:hover .ch:nth-child(3)  { color: var(--accent);  transform: translateY(-6px); transition-delay: 0.08s; }
.text-chars:hover .ch:nth-child(4)  { color: var(--accent);  transform: translateY(-6px); transition-delay: 0.12s; }
.text-chars:hover .ch:nth-child(5)  { color: var(--accent);  transform: translateY(-6px); transition-delay: 0.16s; }
.text-chars:hover .ch:nth-child(6)  { color: var(--accent2); transform: translateY(-6px); transition-delay: 0.20s; }
.text-chars:hover .ch:nth-child(7)  { color: var(--accent2); transform: translateY(-6px); transition-delay: 0.24s; }
.text-chars:hover .ch:nth-child(8)  { color: var(--accent2); transform: translateY(-6px); transition-delay: 0.28s; }
.text-chars:hover .ch:nth-child(9)  { color: var(--accent2); transform: translateY(-6px); transition-delay: 0.32s; }
.text-chars:hover .ch:nth-child(10) { color: var(--accent3); transform: translateY(-6px); transition-delay: 0.36s; }
.text-chars:hover .ch:nth-child(11) { color: var(--accent3); transform: translateY(-6px); transition-delay: 0.40s; }
.text-chars:hover .ch:nth-child(12) { color: var(--accent3); transform: translateY(-6px); transition-delay: 0.44s; }

/* — underline draw — */
.text-underline {
  font-family: Arial, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.text-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent2);
  transition: width 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}
.text-effect-row:hover .text-underline::after { width: 100%; }

/* ═══════════════════════════════════════
   04 — PURE CSS ANIMATIONS
═══════════════════════════════════════ */
.anim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  width: 100%;
}
.anim-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.anim-cell-label {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
}

/* — pulse ring — */
.pulse-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulseRing 1.8s ease-out infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.8);  opacity: 0; }
}

/* — orbit — */
.orbit-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px dashed var(--border);
  position: relative;
  animation: spin 3s linear infinite;
}
.orbit-wrap::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--accent3);
  border-radius: 50%;
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* — morph blob — */
.morph-blob {
  width: 60px;
  height: 60px;
  background: #aaa;
  animation: morphShape 4s ease-in-out infinite;
}
@keyframes morphShape {
  0%   { border-radius: 50%; }
  25%  { border-radius: 20% 80% 70% 30% / 40% 60% 30% 70%; }
  50%  { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  75%  { border-radius: 30% 70% 80% 20% / 50% 70% 30% 50%; }
  100% { border-radius: 50%; }
}

/* — typewriter — */
.typewriter-text {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--accent);
  width: 0;
  animation: typeIn 2s steps(12, end) infinite,
             blink 0.75s step-end infinite;
}
@keyframes typeIn {
  0%   { width: 0; }
  60%  { width: 7em; }
  90%  { width: 7em; }
  100% { width: 0; }
}
@keyframes blink {
  50% { border-color: transparent; }
}

/* ═══════════════════════════════════════
   05 — INTERACTIVE BUTTONS / CTA
═══════════════════════════════════════ */
.btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

/* — fill sweep — */
.btn-fill {
  position: relative;
  padding: 14px 32px;
  border: 2px solid var(--text);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.35s ease, border-color 0.35s ease;
}
.btn-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 0;
}
.btn-fill:hover::before { transform: scaleX(1); }
.btn-fill:hover { color: #fff; border-color: var(--accent); }
.btn-fill span { position: relative; z-index: 1; }

/* — glitch button — */
.btn-glitch {
  position: relative;
  padding: 14px 32px;
  background: var(--accent);
  border: none;
  border-radius: 2px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-glitch::before,
.btn-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
}
.btn-glitch::before { background: var(--accent2); color: #fff; }
.btn-glitch::after  { background: var(--accent3); color: #fff; }
.btn-glitch:hover::before {
  opacity: 1;
  animation: glitch1 0.3s steps(2) infinite;
}
.btn-glitch:hover::after {
  opacity: 1;
  animation: glitch2 0.3s steps(2) infinite;
}
@keyframes glitch1 {
  0%  { clip-path: inset(20% 0 70% 0); transform: translate(-3px, 1px); }
  50% { clip-path: inset(60% 0 10% 0); transform: translate(3px, -1px); }
}
@keyframes glitch2 {
  0%  { clip-path: inset(50% 0 30% 0); transform: translate(3px, 2px); }
  50% { clip-path: inset(10% 0 80% 0); transform: translate(-3px, -2px); }
}

/* — neon glow — */
.btn-neon {
  padding: 14px 32px;
  background: transparent;
  border: 2px solid var(--muted);
  border-radius: 2px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: box-shadow 0.3s ease, background 0.3s ease, text-shadow 0.3s ease;
}
.btn-neon:hover {
  background: rgba(0,0,0,0.05);
  box-shadow: 0 0 12px #999, 0 0 30px rgba(100,100,100,0.3);
  text-shadow: 0 0 6px #aaa;
}

/* — stagger load animation — */
.section { animation: fadeUp 0.6s ease both; }
.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
