@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../assets/fonts/rubik-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../assets/fonts/rubik-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --night: #1a1033;
  --night-2: #241544;
  --night-3: #321d5a;
  --cord: #f6c9e0;
  --cube: #fff4fb;
  --ink: #2a1640;
  --pink: #ff8fc7;
  --lilac: #b89cff;
  --sky: #7cc4ff;
  --text: #f7ecff;
  --text-soft: #cdb8ec;
  --u: 28px;            /* the bead unit: every spacing is a multiple of it */
  --cube-size: 24px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--night);
  scrollbar-color: var(--night-3) var(--night);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--night);
  color: var(--text);
  font: 400 16px/1.55 "Onest", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--pink); color: var(--night); }

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; border-radius: 10px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- page frame ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.portrait {
  position: relative;
  margin: 0;
  height: 56svh;
  min-height: 340px;
  max-height: 560px;
  overflow: hidden;
}
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 64%;
  transform: scale(1.32);
  transform-origin: 50% 74%;
  display: block;
}
.portrait::before,
.portrait::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.portrait::before { background: var(--night); mix-blend-mode: lighten; opacity: 1; }  /* lifts the photo's black to night aubergine */
.portrait::after  { background: linear-gradient(to bottom, transparent 50%, var(--night) 97%); }

.column {
  position: relative;
  z-index: 2;              /* above the portrait's fade layers */
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  padding: 0 calc(var(--u) * .75) calc(var(--u) * 2);
}

/* ---------- the name bracelet ---------- */

.name {
  position: relative;
  margin: calc(var(--u) * -2.6) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.name h1 { margin: 0; }

.namecord {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 0 calc(var(--u) * .5);
}
.namecord::before {               /* the cord the name is threaded on */
  content: "";
  position: absolute;
  left: -6px; right: -6px; top: 50%;
  height: 2px;
  background: var(--cord);
  border-radius: 2px;
  transform: translateY(-50%);
  opacity: .9;
}
.namecord .cube {
  --cube-size: clamp(30px, 8.6vw, 40px);
  font-size: calc(var(--cube-size) * .56);
}

.charm {
  width: 56px;
  height: 64px;
  margin-top: -6px;
  transform-origin: 50% 0;
  filter: drop-shadow(0 6px 8px rgba(8, 3, 20, .55));
}

.tagline {
  margin: calc(var(--u) * .5) 0 0;
  text-align: center;
  color: var(--text-soft);
  font-size: 15px;
  max-width: 34ch;
  text-wrap: balance;
}
.award {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: calc(var(--u) * .5);
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(255, 143, 199, .12);
  border: 1px solid rgba(255, 143, 199, .35);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .3s var(--ease);
}
.award:hover { background: rgba(255, 143, 199, .22); }
.award svg { width: 18px; height: 18px; flex: none; }

/* ---------- beads ---------- */

.cube {
  --t: 0deg;
  --y: 0px;
  width: var(--cube-size);
  height: var(--cube-size);
  flex: none;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  border-radius: calc(var(--cube-size) * .22);
  background: linear-gradient(160deg, #ffffff 0%, var(--cube) 55%, #f1def0 100%);
  box-shadow:
    inset 0 -2px 0 rgba(42, 22, 64, .10),
    inset 0 1px 0 #fff,
    0 2px 5px rgba(8, 3, 20, .45);
  color: var(--ink);
  font: 700 calc(var(--cube-size) * .58)/1 "Rubik", "Onest", sans-serif;
  transform: rotate(var(--t)) translateY(var(--y));
  transition: transform .45s var(--ease);
}
/* relaxed strands: every bead sits a little crooked */
.cube:nth-child(3n+1) { --t: -6deg; --y: 1px; }
.cube:nth-child(3n+2) { --t: 4deg;  --y: -1px; }
.cube:nth-child(4n+3) { --t: -2deg; --y: 2px; }
.cube:nth-child(5n)   { --t: 7deg;  --y: 0px; }

.seed {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--h) 45%, color-mix(in oklab, var(--h) 70%, #1a1033) 100%);
  box-shadow: 0 1px 3px rgba(8, 3, 20, .5);
}
.seed.s { width: 7px; height: 7px; }

.knot {
  width: 12px; height: 12px; flex: none;
  border-radius: 50%;
  background: var(--cord);
  box-shadow: 0 1px 2px rgba(8, 3, 20, .5);
  position: relative; z-index: 1;
}

/* ---------- strands (the links) ---------- */

.strands {
  list-style: none;
  margin: calc(var(--u) * 1.25) 0 0;
  padding: 0;
  position: relative;
}
.strands::before {               /* the one cord every strand hangs from */
  content: "";
  position: absolute;
  left: 21px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--cord);
  border-radius: 2px;
  opacity: .55;
  transform-origin: 50% 0;
}

.strand {
  --h: var(--lilac);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: calc(var(--u) * .4);
  align-items: center;
  padding: calc(var(--u) * .32) 0;
  text-decoration: none;
  border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
}
.strand[data-h="pink"] { --h: var(--pink); }
.strand[data-h="sky"]  { --h: var(--sky); }

.icon {
  grid-row: span 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at 34% 28%, #fff 0 8%, var(--h) 42%, color-mix(in oklab, var(--h) 82%, #1a1033) 100%);
  box-shadow: 0 3px 8px rgba(8, 3, 20, .55), inset 0 -3px 6px rgba(26, 16, 51, .25);
  color: var(--night);
  transition: transform .45s var(--ease);
}
.icon svg { width: 20px; height: 20px; fill: currentColor; }

.thread {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  transition: gap .45s var(--ease), transform .45s var(--ease);
}
.thread::before {                 /* this strand's own cord */
  content: "";
  position: absolute;
  left: -14px; right: 0; top: 50%;
  height: 2px;
  background: var(--cord);
  opacity: .75;
  border-radius: 2px;
  transform: translateY(-50%);
}
.thread .fill {                   /* trailing beads up to the end knot */
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-end;
  padding-left: 6px;
  overflow: hidden;
  transition: gap .45s var(--ease);
}

.handle {
  grid-column: 2;
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--text-soft);
  transition: color .3s var(--ease);
}
.handle b { color: var(--text); font-weight: 600; }

/* the signature: a touched strand pulls taut */
.strand:hover .cube,
.strand:focus-visible .cube,
.strand:active .cube { --t: 0deg; --y: 0px; }
.strand:hover .thread,
.strand:focus-visible .thread,
.strand:active .thread { gap: 1px; transform: translateX(4px); }
.strand:hover .fill,
.strand:focus-visible .fill { gap: 3px; }
.strand:hover .icon,
.strand:focus-visible .icon { transform: scale(1.08); }
.strand:hover .handle,
.strand:focus-visible .handle { color: var(--text); }
.strand:focus-visible { outline: 2px solid var(--h); outline-offset: 2px; }

/* ---------- hang tags (secondary guides) ---------- */

.more {
  margin-top: calc(var(--u) * 1.5);
}
.more h2 {
  margin: 0 0 calc(var(--u) * .5);
  font: 700 22px/1.2 "Rubik", sans-serif;
  color: var(--text);
}
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: calc(var(--u) * .5);
  position: relative;
  padding-top: calc(var(--u) * .75);
}
.tags::before {                   /* the cord the tags hang from */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--cord);
  opacity: .75;
}
.tags li { position: relative; }
.tags li::before {                /* each tag's string, down to its punched hole */
  content: "";
  position: absolute;
  left: 20px; top: calc(var(--u) * -.75);
  width: 2px;
  height: calc(var(--u) * .75 + 16px);
  background: var(--cord);
  border-radius: 2px;
  z-index: 2;
}
.tag {
  position: relative;
  display: block;
  height: 100%;
  padding: calc(var(--u) * .9) 14px 14px 16px;
  background: var(--cube);
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px 14px 14px 14px;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
  transform: rotate(var(--r, -1.2deg));
  transform-origin: 22px 14px;
  transition: transform .5s var(--ease);
}
.tags li { filter: drop-shadow(0 6px 10px rgba(8, 3, 20, .45)); }
.tags li:nth-child(2) .tag { --r: 1.4deg; }
.tag {
  -webkit-mask: radial-gradient(circle at 21px 15px, transparent 4.5px, #000 5.5px);
          mask: radial-gradient(circle at 21px 15px, transparent 4.5px, #000 5.5px);
}
.tag strong {
  display: block;
  font: 700 15px/1.25 "Rubik", sans-serif;
}
.tag span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  color: #5b4378;
}
.tag:hover, .tag:focus-visible { transform: rotate(0deg) translateY(-2px); }

/* ---------- footer ---------- */

.foot {
  margin-top: calc(var(--u) * 2);
  padding-top: calc(var(--u) * .75);
  border-top: 1px solid rgba(205, 184, 236, .18);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--text-soft);
}
.foot a { text-underline-offset: 3px; text-decoration-color: rgba(205, 184, 236, .45); }
.foot a:hover { color: var(--text); text-decoration-color: var(--pink); }

/* ---------- sub pages ---------- */

.sub .column { padding-top: calc(var(--u) * 1.25); }
.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sub-head .namecord { padding: 0; gap: 2px; }
.sub-head .namecord .cube { --cube-size: 20px; font-size: 11px; }
.sub-head .namecord::before { left: -4px; right: -4px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-soft);
  text-decoration: none;
  white-space: nowrap;
}
.back:hover { color: var(--text); }
.sub h1 {
  margin: calc(var(--u) * 1.5) 0 calc(var(--u) * .4);
  font: 700 clamp(28px, 7.5vw, 38px)/1.1 "Rubik", sans-serif;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.sub p { margin: 0 0 calc(var(--u) * .5); max-width: 62ch; color: var(--text-soft); }
.sub p b { color: var(--text); font-weight: 600; }
.sub h2 {
  margin: calc(var(--u) * 1.4) 0 calc(var(--u) * .3);
  font: 600 18px/1.3 "Rubik", sans-serif;
}
.arr { width: 16px; height: 16px; }
.sub h2.sec {
  margin-top: calc(var(--u) * 2.2);
  font: 700 clamp(24px, 6vw, 30px)/1.15 "Rubik", sans-serif;
}
.sub h3 {
  margin: calc(var(--u) * 1) 0 calc(var(--u) * .25);
  font: 600 17px/1.3 "Rubik", sans-serif;
}
.sub address { font-style: normal; color: var(--text); margin-bottom: calc(var(--u) * .5); line-height: 1.6; }
.num { font: 700 17px/1 "Rubik", sans-serif; color: var(--night); }

/* ---------- desktop: the portrait becomes a standing panel ---------- */

@media (min-width: 900px) {
  :root { --u: 32px; --cube-size: 26px; }
  .page { grid-template-columns: minmax(0, 1fr) minmax(500px, 620px); min-height: 100svh; }
  .portrait {
    position: sticky; top: 0;
    height: 100svh; max-height: none;
  }
  .portrait img { object-position: 50% 60%; }
  .portrait::after { background: linear-gradient(to right, transparent 55%, var(--night) 98%); }
  .portrait img { transform: scale(1.12); transform-origin: 50% 80%; }
  .column { max-width: 560px; padding: calc(var(--u) * 2.2) calc(var(--u) * 1.2) calc(var(--u) * 1.5); margin: 0 auto; }
  .name { margin-top: 0; }
  .namecord .cube { --cube-size: 48px; }
  .charm { width: 68px; height: 78px; }
  .sub .page { grid-template-columns: 1fr; }
  .sub .column { margin: 0 auto; }
}

/* ---------- the one entrance: the cord is pulled through ---------- */

@media (prefers-reduced-motion: no-preference) {
  .strands::before { animation: cord 1s var(--ease) both; }
  .strand .thread { animation: thread .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 120ms); }
  .strand .icon { animation: bead .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 60ms); }
  .namecord .cube { animation: drop .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
  .charm { animation: swing 2.4s var(--ease) .35s both; }
  @keyframes cord   { from { transform: scaleY(0); } }
  @keyframes thread { from { transform: translateX(-18px); } }
  @keyframes bead   { from { transform: translateY(-10px) scale(.85); } }
  @keyframes drop   { from { transform: translateY(-14px) rotate(var(--t)); } }
  @keyframes swing  {
    0%   { transform: rotate(14deg); }
    35%  { transform: rotate(-8deg); }
    65%  { transform: rotate(4deg); }
    100% { transform: rotate(0deg); }
  }
}
