/* tiles.css: per-tile visuals and hover micro-animations (one embed per tile in the original).
   Two shared visuals (quote marks -> About, colour blocks -> Work); Approach has its own visual. */

/* ---- Voice & Tone ---- */

.voice-tone-quotation-mark {
	position: absolute;
  height: auto;
  width: calc(min(6vw, 8vh) + 32px);
  fill: var(--color--identity--on-yellow);
  stroke: transparent;
  stroke-width: 4px;
  transition: fill var(--tile-transition), stroke var(--tile-transition), transform var(--tile-transition);
}

.voice-tone-quotation-mark path {
  vector-effect: non-scaling-stroke;
}

.voice-tone-quotation-mark.left {
  left: 0;
  top: 0;
}

.voice-tone-quotation-mark.right {
  right: 0;
  bottom: 0;
  transform: rotateZ(180deg);
}
@media (any-hover: hover) {
.tile.voice-tone:hover .voice-tone-quotation-mark {
	stroke: white;
	fill: var(--text--base);
}

.tile.voice-tone:hover .voice-tone-quotation-mark.left {
	transform: translateX(40%);
}

.tile.voice-tone:hover .voice-tone-quotation-mark.right {
	transform: rotateZ(180deg) translateX(40%);
}}


/* ---- Color ---- */

.tile.color .color-color-block {
  transition: background-color var(--tile-transition), border var(--tile-transition), transform var(--tile-transition);
  border: 2px solid transparent;
}

@media (any-hover: hover) {
.tile.color:hover .color-color-block {
	background-color: transparent;
  border-color: white;
}

.tile.color:hover .color-color-block.block-1 {
	transform: translate(calc(100% - 1px), 1px);
}

.tile.color:hover .color-color-block.block-2 {
	transform: translate(calc(-100% + 1px), -1px);
}}

.tile.color .color-color-circle {
	position: absolute;
	width: 100%;
	height: 100%;
  stroke-width: 2px;
  stroke: transparent;
  transition: fill var(--tile-transition), stroke var(--tile-transition);
}

.tile.color .color-color-circle path {
  vector-effect: non-scaling-stroke;
}

.tile.color .color-color-block.block-1 .color-color-circle {
	fill: var(--color--identity--on-orange);
}

.tile.color .color-color-block.block-2 .color-color-circle {
	fill: var(--color--accent--rust);
}

@media (any-hover: hover) {
.tile.color:hover .color-color-circle {
	fill: transparent !important;
  stroke: white;
}}


/* ---- Approach (balancing shapes) ----
   js/approach-tile.js inlines the Lottie export and plays it
   on hover. Its four colours become two tones of the tile's pink range; on hover the shapes
   turn into white outlines, the same language as the other tiles. */

/* Same inner padding as the other visuals (the tile's 23px), resting on the bottom-right
   corner like the About quotes */
.approach-visual {
  position: absolute;
  inset: 0;
}

/* Mirrored so the stack rests against the right edge and swings to the left, into the empty
   side of the tile (the shapes are symmetric, so the still frame looks the same) */
.approach-visual svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: scaleX(-1);
}

.approach-visual :is(path, rect, ellipse) {
  vector-effect: non-scaling-stroke;
  stroke: transparent;
  stroke-width: 2px;
  transition: fill var(--tile-transition), stroke var(--tile-transition);
}

/* Export colours -> palette, alternating dark and light so neighbours contrast
   (base, block, ball, square) */
.approach-visual [fill="#ff5a00"] { fill: var(--color--brand--on-pink); }
.approach-visual [fill="#0d70ff"] { fill: var(--color--accent--azalea); }
.approach-visual [fill="#ff9f01"] { fill: var(--color--brand--on-pink); }
.approach-visual [fill="#43ccff"] { fill: var(--color--accent--azalea); }

@media (any-hover: hover) {
.tile.approach:hover .approach-visual :is(path, rect, ellipse) {
  fill: transparent;
  stroke: white;
}}


/* ---- Lottie visuals (Resume) ----
   js/lottie-tiles.js plays Emilia's Lottie files (lottie-web) on hover. They follow the
   system of the original icon tiles (Iconography's lock): sized like an icon,
   min(100%, 15vh) (Resume is sized like the Work picture, see below), on the bottom-right
   corner of the padding; in the tile's tones at rest, 2px white lines on hover. Colours are
   set by the colour lottie writes on each path; lottie draws fill and stroke as two paths
   with the same shape. */

.resume-visual-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

.lottie-visual {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: min(100%, 15vh);
}

/* Below 992px the original fixes the lock at 84px. On tablets (768-991px), where Contact and
   Resume are tall tiles, the drawings grow up to 20vh like the Work picture */
@media screen and (max-width: 991px) {
  .lottie-visual {
    height: min(100%, 84px);
  }
}

@media screen and (min-width: 768px) and (max-width: 991px) {
  .lottie-visual {
    height: min(100%, 20vh);
  }
}

/* Each viewBox frames the main drawing at rest; the rest (the plane's trail, the sheet
   leaving the folder) may go past it */
.lottie-visual svg {
  display: block;
  overflow: visible;
}

/* Only the drawing: the paths inside <defs> are mattes and keep their own shape */
.lottie-visual svg > g path {
  vector-effect: non-scaling-stroke;
  stroke-width: 2px;
  transition: fill var(--tile-transition), stroke var(--tile-transition);
}

/* Layers named in data-rest-hidden: shown at once, faded out when the tile rests */
.lottie-visual.is-resting .lottie-rest-hidden {
  opacity: 0;
  transition: opacity var(--tile-transition);
}

/* Resume (Profile 3.json) matches the Work visual instead, so the two drawings are the same size
   on the bottom line of the menu: min(100%, 20vh), capped like the Work square by the width
   of the Work column (half the screen minus half the central block, two gaps, the padding) */
.lottie-visual.resume-visual {
  height: min(100%, 20vh, 50vw - var(--button-width) / 2 - var(--nav-tile-gap) * 2 - 46px);
}

@media screen and (max-width: 479px) {
  .lottie-visual.resume-visual {
    height: min(100%, 20vh, 50vw - var(--button-width) / 2 - var(--nav-tile-gap) * 2 - 16px);
  }
}

@media screen and ((max-height: 399px) or ((max-width: 991px) and (max-height: 480px)) or (max-width: 249px)) {
  .resume-visual-container {
    display: none;
  }
}

/* Resume (Profile 3.json, the portrait), three tones of the purple
   range, the tile purple, a picture in on-purple and the head and the body in a mid violet.
   The file is an endless zoom (each circle grows into the next) with no background.
   data-viewbox frames the head and the body at rest in a square, with some room above the
   head; the picture and its hover frame are drawn here, behind and over the svg, as that square
   on the bottom-right corner, where "xMaxYMax meet" puts the drawing. The file clips the zoom
   to its own square, lower than this one, so that clip is dropped and the svg is clipped to the
   picture instead. On hover only lines: the picture empties into a 2px white frame (like
   Imagery's picture border) and the circles into 2px white outlines. */
.resume-visual {
  container-type: size;
  isolation: isolate;
}

.resume-visual::before,
.resume-visual::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(100cqw, 100cqh);
  aspect-ratio: 1;
  pointer-events: none;
}

.resume-visual svg {
  clip-path: inset(0 0 0 calc(100cqw - min(100cqw, 100cqh)));
}

.resume-visual svg > g > g { clip-path: none; }

.resume-visual::before {
  z-index: -1;
  background-color: var(--color--brand--on-purple);
  transition: background-color var(--tile-transition);
}

.resume-visual::after {
  border: 2px solid white;
  opacity: 0;
  transition: opacity var(--tile-transition);
}

.resume-visual svg > g path { stroke: transparent; }
.resume-visual svg > g path:is([fill="rgb(42,45,65)"], [fill="rgb(255,158,27)"]) { fill: var(--color--violet); }

@media (any-hover: hover) {
.tile.resume:hover .resume-visual::before { background-color: transparent; }
.tile.resume:hover .resume-visual::after { opacity: 1; }
.tile.resume:hover .resume-visual svg > g path { fill: transparent; }
.tile.resume:hover .resume-visual svg > g path:is([fill="rgb(42,45,65)"], [fill="rgb(255,158,27)"]) { stroke: white; }
}

/* Contact: a greeting, "Hi!", drawn as type (same markup, sizes and
   SMIL morph). At rest a regular weight filled in on-green, right-aligned; on hover the
   letters morph to a bold weight that fills the width (0.35s) and turn into 2px white outlines.
   The outline is a 4px stroke clipped by the letters themselves, so only its inner half shows. */
.tile.contact .contact-visual-type {
  height: 500px;
  max-height: 100%;
  max-width: 100%;
  fill: var(--color--brand--on-green);
  stroke: transparent;
  stroke-width: 2px;
  transition: fill var(--tile-transition), stroke var(--tile-transition);
}

.tile.contact .contact-visual-type path {
  vector-effect: non-scaling-stroke;
}

@media (any-hover: hover) {
.tile.contact:hover .contact-visual-type {
  fill: transparent;
  stroke: white;
}}
