:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 320ms;
}

body {
  background: linear-gradient(160deg, #1b1033, #0b0b0d 60%);
  color: #f2f1ee;
}

.site {
  display: flex; align-items: center; gap: 40px;
  padding: 20px clamp(16px, 5vw, 56px);
}
.logo { font: 700 24px system-ui; color: inherit; text-decoration: none; }
.logo span { color: #ff4d2e; }

.morph-nav { position: relative; }
.morph-triggers { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.morph-triggers button, .morph-triggers a {
  display: block; padding: 10px 14px;
  background: none; border: 0; border-radius: 8px;
  color: rgb(242 241 238 / 0.8); font: inherit; font-size: 15px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.morph-triggers button:hover, .morph-triggers a:hover,
.morph-triggers button[aria-expanded="true"] { color: #fff; background: rgb(255 255 255 / 0.08); }

/* ---- The morphing dropdown ---- */

.morph-dropdown {
  position: absolute; top: calc(100% + 12px); left: 0;
  perspective: 2000px;
  pointer-events: none;
}
.morph-dropdown.is-open { pointer-events: auto; }

/* The white card: its size and position animate to whichever panel is active.
   --x, --w, --h are set from JS by measuring the target panel. */
.morph-bg {
  position: relative;
  width: var(--w, 0); height: var(--h, 0);
  translate: var(--x, 0) 0;
  background: #fff; color: #121216;
  border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.5);
  overflow: hidden;
  opacity: 0;
  transform: rotateX(-12deg) scale(0.96);
  transform-origin: 50% -50px;
  transition:
    width var(--speed) var(--ease),
    height var(--speed) var(--ease),
    translate var(--speed) var(--ease),
    opacity 200ms ease,
    transform var(--speed) var(--ease);
}
.is-open .morph-bg { opacity: 1; transform: none; }
/* First open shouldn't morph from 0×0 — it should just appear in place. */
.morph-dropdown.no-morph .morph-bg { transition-property: opacity, transform; }

.morph-arrow {
  position: absolute; top: -6px; left: 0; z-index: 1;
  width: 14px; height: 14px;
  background: #fff; border-radius: 3px 0 0 0;
  rotate: 45deg;
  translate: var(--arrow-x, 0) 0;
  opacity: 0;
  transition: translate var(--speed) var(--ease), opacity 200ms;
}
.is-open .morph-arrow { opacity: 1; }
.no-morph .morph-arrow { transition-property: opacity; }

.morph-panel {
  position: absolute; top: 0; left: 0;
  width: max-content;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity 200ms ease, translate var(--speed) var(--ease), visibility 0s 200ms;
}
.morph-panel.is-active { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 60ms, 0s, 0s; }
.morph-panel.from-left { translate: -40px 0; }
.morph-panel.from-right { translate: 40px 0; }

/* ---- Panel content ---- */

.morph-panel a { color: inherit; text-decoration: none; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 230px); gap: 8px; }
.feature { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; padding: 10px; border-radius: 10px; }
.feature:hover { background: #f4f1ea; }
.feature .swatch { grid-row: span 2; width: 36px; height: 36px; border-radius: 9px; background: var(--c); }
.feature small { color: #77757f; }

.cols { display: grid; grid-template-columns: repeat(3, 150px); gap: 16px; }
.cols h3 { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #77757f; }
.cols a { display: block; padding: 5px 0; }
.cols a:hover { color: #ff4d2e; }

.simple { list-style: none; margin: 0; padding: 0; width: 160px; }
.simple a { display: block; padding: 8px 10px; border-radius: 8px; }
.simple a:hover { background: #f4f1ea; }

.page { padding: 20vh clamp(16px, 5vw, 56px); }
.page h1 { font-size: clamp(40px, 7vw, 84px); letter-spacing: -0.03em; margin: 0 0 12px; }
.page p { color: #a5a3ad; font-size: 18px; margin: 0; }

@media (max-width: 640px) {
  .site { flex-wrap: wrap; gap: 12px; }
  .grid-2, .cols { grid-template-columns: 1fr; }
}
