/* tairqaldy.xyz — playful light editorial, v4 (more life) */

:root {
  --paper: #fbf6ec;
  --ink: #221c13;
  --ink-soft: #71675a;
  --line: rgba(34, 28, 19, 0.12);
  --teal: #00afca;
  --sun: #ffc93c;
  --sun-deep: #e8a200;
  --coral: #ff6b57;
  --violet: #9b6bff;
  --leaf: #3ecf8e;
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --hand: "Caveat", cursive;
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --gap: clamp(1.1rem, 3svh, 2.6rem);
}

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

body {
  font-family: var(--serif);
  font-optical-sizing: auto;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* atmosphere */
.bg {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 18% 22%, rgba(255, 201, 60, 0.17), transparent 70%),
    radial-gradient(34% 30% at 85% 12%, rgba(0, 175, 202, 0.11), transparent 70%),
    radial-gradient(26% 24% at 12% 80%, rgba(155, 107, 255, 0.08), transparent 70%),
    radial-gradient(30% 28% at 80% 85%, rgba(255, 107, 87, 0.10), transparent 70%);
  filter: blur(40px);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to   { transform: translate3d(1.5%, 1.5%, 0) scale(1.04); }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* floating confetti bits behind content */
#bits { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

.bit {
  position: absolute;
  will-change: transform;
}

.bit > svg {
  display: block;
  animation: bitfloat var(--bd, 9s) ease-in-out var(--bdel, 0s) infinite alternate;
  opacity: 0.55;
}

@keyframes bitfloat {
  from { transform: translateY(-9px) rotate(-8deg); }
  to   { transform: translateY(9px) rotate(10deg); }
}

.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.handwritten {
  font-family: var(--hand);
  font-size: 1.35rem;
  line-height: 1.1;
  display: inline-block;
  color: var(--teal);
}

/* corner site tag */
.site-tag {
  position: fixed;
  top: 0.9rem;
  left: 1.2rem;
  z-index: 35;
  font-family: var(--hand);
  font-size: 1.3rem;
  color: var(--coral);
  text-decoration: none;
  transform: rotate(-3deg);
  transition: transform 0.25s var(--pop), color 0.2s;
}

.site-tag:hover { transform: rotate(2deg) scale(1.12); color: var(--violet); }

/* ---------- layout ---------- */

main {
  position: relative;
  z-index: 2;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: clamp(1.2rem, 3svh, 2.2rem) 1.5rem calc(clamp(0.8rem, 2svh, 1.6rem) + 2rem);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--gap);
}

/* ---------- hero ---------- */

.hero-row { display: flex; align-items: center; gap: 1.5rem; }

.avatar-col { position: relative; flex: none; }

.avatar-wrap {
  position: relative;
  width: clamp(70px, 11svh, 100px);
  height: clamp(70px, 11svh, 100px);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 6px 22px rgba(34, 28, 19, 0.18);
  cursor: pointer;
  transition: transform 0.3s var(--pop), box-shadow 0.3s;
  background: var(--sun);
}

.avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 175, 202, 0.55);
  animation: spin 24s linear infinite;
  transition: border-color 0.3s;
}

@keyframes spin { to { transform: rotate(360deg); } }

.avatar-wrap:hover { transform: scale(1.08) rotate(-5deg); box-shadow: 0 10px 30px rgba(255, 107, 87, 0.35); }
.avatar-wrap:hover::before { border-color: var(--coral); }
.avatar-wrap:active { transform: scale(0.92); }

.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.avatar-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}

.avatar-wrap.no-photo img { display: none; }
.avatar-wrap.no-photo .avatar-fallback { display: flex; }

.avatar-note {
  position: absolute;
  left: 50%;
  bottom: -1.5rem;
  translate: -50% 0;
  white-space: nowrap;
  font-size: 1.1rem;
  color: var(--coral);
  rotate: -5deg;
  opacity: 0.85;
}

.eyebrow { font-size: 1.12rem; font-style: italic; color: var(--ink-soft); }

/* name: static first name with wavy letters + rolling surname */
h1 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 0.32em;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0.04em 0 0.05em;
  cursor: default;
}

.first .ltr {
  display: inline-block;
  transition: transform 0.3s var(--pop), color 0.3s;
}

.first .ltr.up { transform: translateY(-0.14em) rotate(-4deg); }
.first .ltr.up:nth-child(odd) { color: var(--teal); }
.first .ltr.up:nth-child(even) { color: var(--coral); }

.roll { display: inline-grid; overflow: hidden; }

.roll > span {
  grid-area: 1 / 1;
  white-space: nowrap;
  padding-bottom: 0.07em;
  transform: translateY(115%);
  transition: transform 0.6s var(--pop);
}

.roll .b { transform: translateY(-115%); color: var(--teal); }

body.loaded .roll .a { transform: none; transition-delay: 0.15s; }

body.loaded h1:hover .roll .a { transform: translateY(115%); transition-delay: 0s; }
body.loaded h1:hover .roll .b { transform: none; }

.aka {
  font-size: 1.25rem;
  font-weight: 600;
  font-style: normal;
  color: var(--coral);
  rotate: -2deg;
  opacity: 0;
  translate: 0 6px;
  transition: opacity 0.35s var(--ease-out) 0.1s, translate 0.35s var(--pop) 0.1s;
}

h1:hover .aka { opacity: 1; translate: 0 0; }

.role { margin-top: 0.45rem; color: var(--ink-soft); text-transform: lowercase; }

.d { font-weight: 700; }
.d1 { color: var(--teal); }
.d2 { color: var(--coral); }
.d3 { color: var(--violet); }

/* ---------- story prose ---------- */

.story { display: grid; gap: clamp(0.7rem, 2svh, 1.1rem); }

.story p {
  font-size: clamp(0.98rem, 2.1svh, 1.12rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

.story strong { color: var(--ink); font-weight: 600; }

mark {
  padding: 0.02em 0.28em;
  border-radius: 3px;
  color: var(--ink);
  font-weight: 600;
}

.m-sun { background: linear-gradient(104deg, transparent 0.5%, var(--sun) 3%, var(--sun) 96%, transparent 99%); }
.m-coral { background: linear-gradient(104deg, transparent 0.5%, rgba(255, 107, 87, 0.5) 3%, rgba(255, 107, 87, 0.5) 96%, transparent 99%); }

a { color: inherit; text-decoration: none; }

/* project links in prose: each its own color, fills on hover */
.pl {
  font-weight: 600;
  color: var(--ink);
  padding: 0 0.12em;
  transition: color 0.2s, box-shadow 0.25s var(--ease-out);
}

.pl-teal { box-shadow: inset 0 -2px 0 var(--teal); }
.pl-teal:hover { box-shadow: inset 0 -1.25em 0 rgba(0, 175, 202, 0.28); }
.pl-coral { box-shadow: inset 0 -2px 0 var(--coral); }
.pl-coral:hover { box-shadow: inset 0 -1.25em 0 rgba(255, 107, 87, 0.26); }

.qai { box-shadow: inset 0 -2px 0 var(--violet); padding: 0 0.12em; }

/* ---------- shelf ---------- */

.shelfwrap { position: relative; }

.shelf-note {
  font-size: 1.4rem;
  color: var(--violet);
  rotate: -2deg;
  margin-bottom: 0.5rem;
}

.shelf {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.thing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.55rem 1rem 0.4rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  rotate: var(--tilt, -2deg);
  transition: rotate 0.28s var(--pop), transform 0.28s var(--pop), box-shadow 0.28s var(--ease-out), background 0.2s;
}

.thing:nth-child(2) { --tilt: -2.5deg; }
.thing:nth-child(3) { --tilt: 2deg; }
.thing:nth-child(4) { --tilt: -1.5deg; }
.thing:nth-child(5) { --tilt: 2.5deg; }

.t-teal   { box-shadow: 2.5px 2.5px 0 var(--teal); }
.t-violet { box-shadow: 2.5px 2.5px 0 var(--violet); }
.t-coral  { box-shadow: 2.5px 2.5px 0 var(--coral); }
.t-sun    { box-shadow: 2.5px 2.5px 0 var(--sun-deep); }

.thing:hover {
  rotate: 0deg;
  transform: translateY(-4px) scale(1.04);
  background: #fff;
}

.t-teal:hover   { box-shadow: 5px 6px 0 var(--teal); }
.t-violet:hover { box-shadow: 5px 6px 0 var(--violet); }
.t-coral:hover  { box-shadow: 5px 6px 0 var(--coral); }
.t-sun:hover    { box-shadow: 5px 6px 0 var(--sun-deep); }

.thing-name { font-size: 1.06rem; font-weight: 600; font-style: italic; }

.thing-status { font-size: 1.05rem; }
.t-teal .thing-status   { color: var(--teal); }
.t-violet .thing-status { color: var(--violet); }
.t-coral .thing-status  { color: var(--coral); }
.t-sun .thing-status    { color: var(--sun-deep); }

.next-note { align-self: center; font-size: 1.2rem; color: var(--ink-soft); rotate: 2deg; }

/* ---------- footer: where, cta, socials ---------- */

.where {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--ink-soft);
  margin-bottom: clamp(0.6rem, 1.6svh, 1rem);
}

.pin { color: var(--coral); }

#clock { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.clock-note { font-size: 1.05rem; color: var(--violet); rotate: -3deg; margin-left: 0.15rem; }

.cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.cta-line {
  font-size: clamp(1.3rem, 3.1svh, 1.7rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
}

.cta-line a {
  color: var(--coral);
  box-shadow: inset 0 -3px 0 var(--coral);
  transition: box-shadow 0.25s var(--ease-out), color 0.2s;
  white-space: nowrap;
}

.cta-line a:hover { box-shadow: inset 0 -1.15em 0 rgba(255, 107, 87, 0.2); }

.cta-note { font-size: 1.2rem; color: var(--coral); rotate: -2deg; margin-left: 0.4rem; }

/* socials: bare icons, each brand color + bounce on hover */
.links { display: flex; gap: 0.9rem; align-items: center; }

.links a {
  display: inline-flex;
  padding: 0.2rem;
  transition: transform 0.25s var(--pop);
}

.links a svg { width: 20px; height: 20px; fill: #a89d8d; transition: fill 0.2s, transform 0.25s var(--pop); }

.links a:hover { transform: translateY(-5px); }
.links a:hover svg { transform: rotate(-8deg) scale(1.15); }

.s-x:hover svg { fill: var(--ink); }
.s-in:hover svg { fill: #0a66c2; }
.s-gh:hover svg { fill: var(--violet); }
.s-tg:hover svg { fill: #229ed9; }
.s-ig:hover svg { fill: #e4405f; }
.s-mail:hover svg { fill: var(--coral); }

/* ---------- marquee ---------- */

.marquee {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding: 0.42rem 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: scroll 46s linear infinite;
  will-change: transform;
}

.marquee-track span { padding: 0 1.15rem; }
.marquee-track .sep:nth-of-type(4n + 1) { color: var(--sun); }
.marquee-track .sep:nth-of-type(4n + 2) { color: var(--teal); }
.marquee-track .sep:nth-of-type(4n + 3) { color: var(--coral); }
.marquee-track .sep:nth-of-type(4n) { color: var(--violet); }
.marquee:hover .marquee-track { animation-play-state: paused; }

@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- sticker chips ---------- */

.sticker {
  position: fixed;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 11px 13px;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 2.5px 2.5px 0 var(--ink);
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  opacity: 0;
  will-change: transform;
  transition: box-shadow 0.25s var(--ease-out);
}

.sticker img, .sticker svg.flag { display: block; pointer-events: none; }

.sticker .lbl {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.sticker.text {
  max-width: 138px;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.45;
  text-align: center;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.sticker.brand {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.05rem;
}

.sticker.on {
  animation: toss 0.6s var(--pop) forwards;
  animation-delay: var(--td, 0s);
}

@keyframes toss {
  from { opacity: 0; transform: rotate(calc(var(--rot) + 26deg)) scale(0.2); }
  to   { opacity: 1; transform: rotate(var(--rot)) scale(1); }
}

.sticker.settled { opacity: 1; animation: none; }

.sticker:hover { box-shadow: 4px 4px 0 var(--hov, var(--teal)); }
.sticker:nth-child(4n + 1) { --hov: var(--teal); }
.sticker:nth-child(4n + 2) { --hov: var(--coral); }
.sticker:nth-child(4n + 3) { --hov: var(--violet); }
.sticker:nth-child(4n) { --hov: var(--sun-deep); }

.sticker.dragging {
  cursor: grabbing;
  box-shadow: 7px 9px 0 rgba(34, 28, 19, 0.25);
  z-index: 45;
}

.sticker.wiggle { animation: wiggle 0.55s ease-in-out; }

@keyframes wiggle {
  25% { transform: rotate(calc(var(--rot) + 5deg)) scale(1.05); }
  75% { transform: rotate(calc(var(--rot) - 4deg)) scale(1.02); }
}

/* mobile sticker strip */
.sticker-strip { display: none; gap: 0.55rem; margin-top: 0.9rem; flex-wrap: wrap; }

.sticker-strip .mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.22s var(--pop), box-shadow 0.22s;
}

.sticker-strip .mini:nth-child(4n + 1):hover { box-shadow: 3px 3px 0 var(--teal); }
.sticker-strip .mini:nth-child(4n + 2):hover { box-shadow: 3px 3px 0 var(--coral); }
.sticker-strip .mini:nth-child(4n + 3):hover { box-shadow: 3px 3px 0 var(--violet); }
.sticker-strip .mini:nth-child(4n):hover { box-shadow: 3px 3px 0 var(--sun-deep); }
.sticker-strip .mini:hover { transform: rotate(-5deg) scale(1.12); }
.sticker-strip .mini img, .sticker-strip .mini svg { width: 24px; height: 24px; display: block; }

/* ---------- entrance ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
  transition-delay: var(--d, 0s);
}

body.loaded .reveal { opacity: 1; transform: none; }

/* ---------- confetti ---------- */

.confetti {
  position: fixed;
  width: 9px;
  height: 9px;
  z-index: 99;
  pointer-events: none;
  border-radius: 2px;
}

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
  .sticker { display: none; }
  .sticker-strip { display: flex; }
}

@media (max-width: 560px) {
  .hero-row { gap: 1.1rem; }
  h1 { font-size: clamp(1.7rem, 7.6vw, 2.4rem); }
  .aka { display: none; }
  .avatar-note { display: none; }
  .site-tag { font-size: 1.1rem; }
  .shelf { gap: 0.55rem; }
  .thing { padding: 0.45rem 0.75rem 0.35rem; }
  .cta-row { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .bg, .marquee-track, .avatar-wrap::before, .bit > svg { animation: none !important; }
  .roll > span, .reveal, .aka, .first .ltr { transition-duration: 0.01s; }
  .sticker.on { animation-duration: 0.01s; }
}
