/* ── dmitrii bronnikov · graph-paper notebook ─────────── */
:root {
  --bg: #FAFBF9;
  --card: rgba(255, 255, 255, .72);
  --card-open: rgba(255, 255, 255, .92);
  --ink: #161813;
  --sub: #5F665F;
  --faint: #969C96;
  --line: #E4E8E2;
  --grid: rgba(20, 60, 30, .042);
  --glow: rgba(22, 163, 74, .10);
  --acc: #00A94F;
  --acc-ink: #0C7A3E;
  --blue: #1D3FE8;
  --acc-soft: rgba(0, 169, 79, .14);
  --shadow: 0 10px 30px -18px rgba(20, 40, 25, .25);
  --serif: "Roboto Mono", ui-monospace, monospace;
  --sans: "Roboto Mono", ui-monospace, monospace;
  --mono: "Roboto Mono", ui-monospace, monospace;
  --hand: "Caveat", "Bradley Hand", cursive;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1210;
    --card: rgba(255, 255, 255, .035);
    --card-open: rgba(255, 255, 255, .06);
    --ink: #E9EBE7;
    --sub: #A2A8A1;
    --faint: #6B716B;
    --line: #242923;
    --grid: rgba(140, 220, 160, .04);
    --glow: rgba(40, 180, 90, .12);
    --acc: #35E07A;
    --acc-ink: #7BE8AC;
    --blue: #5D7BFF;
    --acc-soft: rgba(53, 224, 122, .16);
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="light"] {
  --bg: #FAFBF9; --card: rgba(255,255,255,.72); --card-open: rgba(255,255,255,.92);
  --ink: #161813; --sub: #5F665F; --faint: #969C96; --line: #E4E8E2;
  --grid: rgba(20,60,30,.042); --glow: rgba(22,163,74,.10);
  --acc: #00A94F; --acc-ink: #0C7A3E; --blue: #1D3FE8; --acc-soft: rgba(0,169,79,.14);
  --shadow: 0 10px 30px -18px rgba(20,40,25,.25);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1210; --card: rgba(255,255,255,.035); --card-open: rgba(255,255,255,.06);
  --ink: #E9EBE7; --sub: #A2A8A1; --faint: #6B716B; --line: #242923;
  --grid: rgba(140,220,160,.04); --glow: rgba(40,180,90,.12);
  --acc: #35E07A; --acc-ink: #7BE8AC; --blue: #5D7BFF; --acc-soft: rgba(53,224,122,.16);
  --shadow: 0 10px 30px -18px rgba(0,0,0,.6);
  color-scheme: dark;
}

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

html { scrollbar-gutter: stable; background: var(--bg); overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; transition: background-color .3s ease; }

body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.7;
  letter-spacing: -.01em;
  color: var(--ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: color .3s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(560px 320px at 18% -40px, var(--glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

::selection { background: var(--blue); color: #fff; }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── top bar ── */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px clamp(16px, 4vw, 28px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.mark {
  width: 31px; height: 31px;
  display: grid;
  place-items: center;
  background: var(--acc);
  color: #fff;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 9px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(10, 25, 15, .3);
  rotate: -5deg;
  transition: rotate .25s ease;
}
.bar:hover .mark { rotate: 5deg; }
.bar-name { font-size: 12.5px; font-weight: 700; letter-spacing: -.03em; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tick {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--sub);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tick b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tick .up { color: var(--acc); font-style: normal; font-size: 9px; }
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acc);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--acc-soft); }
  70% { box-shadow: 0 0 0 7px transparent; }
}
.theme-btn {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--sub);
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .2s;
}
.theme-btn:hover { color: var(--acc); border-color: var(--acc); transform: rotate(14deg); }
.theme-btn svg { display: none; }
:root:not([data-theme="dark"]) .theme-btn .moon { display: block; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-btn .moon { display: none; }
  :root:not([data-theme]) .theme-btn .sun { display: block; }
}

/* ── layout ── */
.page {
  max-width: 660px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 88px) 24px 64px;
}

/* ── hero scene (desk collage) ── */
.scene { position: relative; }
@media (min-width: 761px) { .scene { min-height: 470px; } }
.strewn { position: absolute; inset: 0; pointer-events: none; }
h1 {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: clamp(34px, 7.6vw, 62px);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1.02;
  max-width: 11ch;
}
h1 em { font-style: italic; color: var(--acc); }

.scatter {
  position: absolute;
  left: var(--x, 0);
  top: var(--y, 0);
  rotate: var(--r, 0deg);
  pointer-events: auto;
  z-index: 2;
  user-select: none;
}
.drag { cursor: grab; }
@media (hover: hover) and (pointer: fine) { .drag { touch-action: none; } }
.drag.held { cursor: grabbing; z-index: 30; }

.pol {
  background: #FFFDF6;
  padding: 6px 6px 7px;
  border-radius: 4px;
  box-shadow: 0 6px 18px -6px rgba(20, 30, 22, .35);
  margin: 0;
}
.pol img {
  display: block;
  height: 108px;
  width: auto;
  border-radius: 2px;
  pointer-events: none;
}
.pol figcaption {
  font-family: var(--hand);
  font-size: 13px;
  color: #4A4A40;
  text-align: center;
  padding-top: 4px;
  line-height: 1.1;
}
.tape {
  position: absolute;
  top: -9px;
  left: 50%;
  translate: -50% 0;
  rotate: var(--tr, -5deg);
  width: 64px;
  height: 18px;
  background: rgba(238, 228, 170, .65);
  box-shadow: 0 1px 3px rgba(20, 30, 22, .12);
  transform-origin: center;
}
:root[data-theme="dark"] .tape { background: rgba(255, 252, 220, .3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tape { background: rgba(255, 252, 220, .3); } }

.note {
  width: 116px;
  min-height: 104px;
  padding: 12px 12px 10px;
  box-shadow: 0 8px 18px -8px rgba(20, 30, 22, .4);
  display: flex;
  align-items: flex-end;
}
.note .hand { line-height: 1.15; }
.note-y { background: linear-gradient(178deg, #FFF3A8, #F7E27C); color: #5B4E14; }
.note-g { background: linear-gradient(178deg, #D3F2D9, #B2E4BE); color: #1F4A2C; }
.hand {
  font-family: var(--hand);
  font-size: 17px;
  font-weight: 600;
}

.stamp2 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .18em;
  color: #C03A2E;
  border: 3px solid #C03A2E;
  border-radius: 6px;
  padding: 8px 14px;
  opacity: .82;
  mix-blend-mode: multiply;
  background:
    radial-gradient(circle at 30% 60%, rgba(255,255,255,.28), transparent 60%),
    radial-gradient(circle at 75% 30%, rgba(255,255,255,.22), transparent 55%);
}
:root[data-theme="dark"] .stamp2 { color: #FF6A5A; border-color: #FF6A5A; mix-blend-mode: screen; opacity: .75; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stamp2 { color: #FF6A5A; border-color: #FF6A5A; mix-blend-mode: screen; opacity: .75; } }

.stick {
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c, var(--acc)) 16%, #FFFDF6);
  border: 2.5px solid #fff;
  box-shadow: 0 4px 12px rgba(10, 25, 15, .3);
}
.stick .em { font-size: 27px; line-height: 1; }

.arrow-note { display: flex; align-items: center; gap: 6px; color: var(--sub); }
.arrow-note .hand { font-size: 16px; color: var(--sub); rotate: -3deg; }
.arrow-note svg { width: 44px; height: 30px; stroke: var(--sub); fill: none; stroke-width: 2; stroke-linecap: round; }

.ring {
  position: absolute;
  right: -30px;
  bottom: -10px;
  width: 170px;
  height: 170px;
  border: 11px solid rgba(122, 82, 40, .075);
  border-radius: 50%;
  pointer-events: none;
  mask-image: radial-gradient(circle, black 60%, transparent 72%);
}
:root[data-theme="dark"] .ring { border-color: rgba(210, 170, 120, .06); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ring { border-color: rgba(210, 170, 120, .06); } }
.nowrap { white-space: nowrap; }
.wave { display: inline-block; font-size: .38em; vertical-align: .22em; transform-origin: 70% 70%; animation: wave 1.8s ease-in-out .6s 1; }
@keyframes wave {
  0%, 100% { rotate: 0deg; }
  20% { rotate: 14deg; }
  40% { rotate: -8deg; }
  60% { rotate: 12deg; }
  80% { rotate: -4deg; }
}
.type {
  position: relative;
  z-index: 3;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--sub);
  min-height: 22px;
}
.type .prompt { color: var(--acc-ink); user-select: none; }
.cursor {
  display: inline-block;
  width: 7px; height: 15px;
  margin-left: 3px;
  background: var(--acc);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── sections ── */
section { margin-top: 52px; }
.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hl {
  position: relative;
  padding: 3px 9px;
  rotate: -.8deg;
}
.hl::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--acc-soft);
  clip-path: polygon(1% 28%, 5% 4%, 55% 0%, 97% 8%, 100% 46%, 96% 90%, 42% 100%, 3% 92%);
}

/* ── cards ── */
.cards { list-style: none; display: grid; gap: 10px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(20, 40, 25, .04);
  transition: border-color .22s ease, background .22s ease, transform .22s ease, box-shadow .22s ease;
}
.cards .card:nth-child(odd) { rotate: -.4deg; }
.cards .card:nth-child(even) { rotate: .35deg; }
.card:hover { transform: translateY(-1px); rotate: 0deg; border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); box-shadow: var(--shadow); }
.card.open { rotate: 0deg; }
.card.open { background: var(--card-open); border-color: color-mix(in srgb, var(--acc) 55%, var(--line)); }
.card-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
}
.chip {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c, var(--acc)) 15%, #FFFDF6);
  border: 2px solid #fff;
  box-shadow: 0 2px 7px rgba(10, 25, 15, .25);
  rotate: -4deg;
  transition: rotate .25s ease, scale .25s ease;
}
:root[data-theme="dark"] .chip, :root[data-theme="dark"] .stick { background: color-mix(in srgb, var(--c, var(--acc)) 30%, #181C19); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip, :root:not([data-theme="light"]) .stick { background: color-mix(in srgb, var(--c, var(--acc)) 30%, #181C19); } }
.chip .em { font-size: 19px; line-height: 1; translate: 0 .5px; }
.card:hover .chip, .card.open .chip { rotate: 4deg; scale: 1.08; }
.card-title { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.03em; }
.card-title span { color: var(--faint); font-weight: 500; }
.card-sub { display: block; font-size: 12px; color: var(--sub); margin-top: 3px; letter-spacing: -.02em; }
.chev {
  color: var(--faint);
  transition: transform .3s ease, color .2s ease;
}
.card.open .chev { transform: rotate(180deg); color: var(--acc); }
.card-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .38s cubic-bezier(.3, .8, .3, 1);
}
.card.open .card-body { grid-template-rows: 1fr; }
.card-body > div { overflow: hidden; }
.card-in { padding: 2px 16px 16px 59px; display: grid; gap: 12px; }
.points { list-style: none; display: grid; gap: 8px; }
.points li {
  position: relative;
  padding-left: 20px;
  color: var(--sub);
  font-size: 12.5px;
  letter-spacing: -.02em;
  max-width: 58ch;
}
.points li::before { content: "↳"; position: absolute; left: 0; color: var(--faint); }
.points b, .card-in b { color: var(--ink); font-weight: 700; }
.nums {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--sub);
  border-left: 2px solid var(--acc);
  padding-left: 12px;
}
.more {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--acc-ink);
  text-decoration: none;
  justify-self: start;
}
.more:hover { text-decoration: underline; text-underline-offset: 3px; }
.plain-row { padding: 13px 16px; display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: center; }
.plain-row .card-sub { margin: 0; }

/* ── wins pills ── */
.pills { display: flex; flex-wrap: wrap; gap: 9px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--sub);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  text-decoration: none;
  transition: border-color .2s, transform .2s, color .2s;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--acc)); font-style: normal; }
.pill .pem { font-size: 13.5px; line-height: 1; }
.pill b { color: var(--ink); font-weight: 700; }
.pill:hover { transform: translateY(-1px); border-color: var(--acc); color: var(--acc); }
.pill-link { color: var(--acc); border-style: dashed; }

/* ── polaroids ── */
.shots {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 12px 4px 18px;
  scrollbar-width: none;
}
.shots::-webkit-scrollbar { display: none; }
.shots figure {
  position: relative;
  flex: 0 0 auto;
  background: #FFFDF6;
  padding: 7px 7px 9px;
  border-radius: 4px;
  box-shadow: 0 8px 22px -8px rgba(20, 30, 22, .35);
  rotate: var(--r, -2deg);
  transition: rotate .25s ease, transform .25s ease;
  margin-top: 8px;
}
.shots figure:hover { rotate: 0deg; transform: translateY(-4px) scale(1.03); }
.shots img {
  display: block;
  height: 148px;
  width: auto;
  border-radius: 3px;
  user-select: none;
  -webkit-user-drag: none;
}
.shots figcaption {
  font-family: var(--hand);
  font-size: 13.5px;
  color: #4A4A40;
  padding-top: 5px;
  text-align: center;
}

/* ── socials ── */
.socrow { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; color: var(--sub); font-size: 13px; letter-spacing: -.02em; }
.socrow a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.socrow a:hover { color: var(--acc); border-color: var(--acc); }
.socrow svg { display: block; }
.sep { color: var(--line); user-select: none; }

/* ── footer ── */
footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.memo-link { font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; }
.memo-link a { color: var(--acc-ink); text-decoration: none; }
.memo-link a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── detail pages ── */
.back {
  display: inline-flex;
  margin-bottom: 36px;
  color: var(--sub);
  font-size: 14.5px;
  text-decoration: none;
  transition: color .18s, transform .18s;
}
.back:hover { color: var(--acc); transform: translateX(-3px); }
.meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--faint);
  margin-top: 8px;
}
.body { margin-top: 26px; display: grid; gap: 18px; }
.body p { color: var(--sub); max-width: 60ch; font-size: 13.5px; letter-spacing: -.02em; }
.body .points li { font-size: 13.5px; }
.body .nums { font-size: 12.5px; }
figure { margin-top: 10px; }
.body figure img, .grid2 img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
}
figcaption { color: var(--faint); font-size: 12.5px; font-family: var(--mono); margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* ── results list (wins page) ── */
.results { list-style: none; display: grid; }
.results li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: -.02em;
}
.results li:first-child { border-top: 1px solid var(--line); }
.results .r { color: var(--ink); font-weight: 700; white-space: nowrap; }
.results .c { color: var(--sub); }

.sig {
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  rotate: -2deg;
  display: inline-block;
}

/* ── corner mail tab ── */
.mailtab {
  position: fixed;
  right: 0;
  bottom: 18px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px 11px 13px;
  background: var(--blue);
  color: #fff;
  font-family: var(--mono);
  font-size: clamp(10.5px, 2.6vw, 12.5px);
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  border-radius: 10px 0 0 10px;
  box-shadow: 0 8px 22px -8px rgba(10, 20, 60, .5);
  transition: transform .2s ease, box-shadow .2s ease;
}
.mailtab:hover { transform: translateX(-4px); box-shadow: 0 12px 26px -8px rgba(10, 20, 60, .6); }
.mailtab svg { width: 16px; height: 16px; flex: none; }

/* ── hero collage responsiveness ── */
@media (max-width: 760px) {
  .strewn {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 18px;
    margin-top: 26px;
    pointer-events: auto;
  }
  .scatter { position: static; }
  .arrow-note, .ring { display: none; }
  .pol img { height: 92px; }
  .note { width: 104px; min-height: 92px; }
}

.mt-short { display: none; }

@media (max-width: 760px) {
  section { margin-top: 40px; }
  .page { padding-bottom: 110px; }
  .mailtab {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    padding: 10px 14px;
  }
  .mailtab .mt-long { display: none; }
  .mailtab .mt-short { display: inline; }
  .shots img { height: 132px; }
  .type { min-height: 44px; }
}

@media (hover: none) { .arrow-note { display: none; } }

/* phones: mail tab becomes a round FAB — 4x less occlusion, 46px target */
@media (max-width: 560px) {
  .mailtab {
    width: 46px; height: 46px;
    padding: 0;
    border-radius: 50%;
    right: 14px;
    display: grid;
    place-items: center;
  }
  .mailtab .mt-short { display: none; }
  .mailtab svg { width: 19px; height: 19px; }
}

/* coarse pointers: grow small tap targets */
@media (pointer: coarse) {
  .theme-btn { width: 42px; height: 42px; }
  .more, .socrow a, .memo-link a, .back { padding: 10px 6px; margin: -10px -6px; }
  .pill { padding: 10px 15px; }
}

/* short landscape viewports: cap the hero scene */
@media (min-width: 761px) and (max-height: 540px) {
  .scene { min-height: 360px; }
  .ring { display: none; }
}

@media (max-width: 480px) {
  .bar-name { display: none; }
  .card-in { padding-left: 16px; }
}

/* ── market canvas layer ── */
#mkt {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ── film grain ── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .045;
  mix-blend-mode: overlay;
}
:root[data-theme="dark"] body::after { opacity: .07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { opacity: .07; } }

/* ── squiggle under the name ── */
.nm { position: relative; display: inline-block; }
.squig {
  position: absolute;
  left: 2%;
  bottom: -8px;
  width: 96%;
  height: 12px;
  overflow: visible;
}
.squig path {
  fill: none;
  stroke: var(--acc);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: .85;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: squig-draw .9s cubic-bezier(.4, 0, .3, 1) 1s forwards;
}
@keyframes squig-draw { to { stroke-dashoffset: 0; } }

/* ── sticker social tiles ── */
.stile {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(10, 25, 15, .25);
  rotate: -4deg;
  transition: rotate .22s ease, scale .22s ease;
}
.stile svg { width: 14px; height: 14px; display: block; }
.socrow a:hover .stile { rotate: 4deg; scale: 1.08; }
.stile-ig { background: radial-gradient(circle at 28% 110%, #FDCB52 8%, #FD3A5C 52%, #833AB4 100%); }
.stile-in { background: #0A66C2; }
.stile-mail { background: var(--acc); }

@media (prefers-reduced-motion: reduce) {
  .wave, .dot, .cursor { animation: none; }
  .card, .chip, .pill, .shots figure, .theme-btn, .back, .mark, .stile { transition: none; }
  .card-body { transition: none; }
  .squig path { animation: none; stroke-dashoffset: 0; }
  #mkt { display: none; }
}

/* ── entrance & scroll animations (pudgy-style springs) ── */
h1 .nm, h1 .nowrap { display: inline-block; animation: rise .55s cubic-bezier(.2, 1.4, .35, 1) backwards; }
h1 .nowrap { animation-delay: .1s; }
.type { animation: rise .5s cubic-bezier(.2, 1.4, .35, 1) .22s backwards; }
@keyframes rise { from { opacity: 0; translate: 0 26px; } }

.strewn > .scatter { animation: drop .5s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.strewn > :nth-child(1) { animation-delay: .4s; }
.strewn > :nth-child(2) { animation-delay: .48s; }
.strewn > :nth-child(3) { animation-delay: .56s; }
.strewn > :nth-child(4) { animation-delay: .64s; }
.strewn > :nth-child(5) { animation-delay: .78s; }
.strewn > :nth-child(6) { animation-delay: .72s; }
.strewn > :nth-child(7) { animation-delay: .9s; }
@keyframes drop { from { opacity: 0; translate: 0 -20px; scale: .8; } }
.strewn > .stamp2 { animation: slam .45s cubic-bezier(.3, 1.2, .4, 1) .78s backwards; }
@keyframes slam {
  0% { opacity: 0; scale: 2.3; }
  65% { scale: .9; }
  100% { opacity: .82; scale: 1; }
}

.card:hover .chip { animation: wiggle .45s ease; }
.nowrap:hover .wave { animation: wave 1.1s ease-in-out; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(9deg); }
  50% { transform: rotate(-7deg); }
  75% { transform: rotate(5deg); }
}

.mailtab { animation: tab-in .5s cubic-bezier(.2, 1.4, .4, 1) 1.15s backwards; }
@keyframes tab-in { from { transform: translateX(115%); } }

.js .pop { transition: opacity .5s ease var(--pd, 0ms), transform .6s cubic-bezier(.2, 1.4, .35, 1) var(--pd, 0ms); }
.js .pop:not(.in) { opacity: 0; transform: translateY(24px) scale(.97); }
@media print { .js .pop:not(.in) { opacity: 1; transform: none; } }

/* ── custom cursor ── */
@media (pointer: fine) {
  .cur-dot, .cur-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 99999;
    border-radius: 50%;
    translate: -50% -50%;
  }
  .cur-dot { width: 7px; height: 7px; background: var(--acc); }
  .cur-ring {
    width: 30px; height: 30px;
    border: 1.5px solid var(--acc);
    opacity: .4;
    transition: width .2s ease, height .2s ease, opacity .2s ease;
  }
  .cur-ring.on { width: 46px; height: 46px; opacity: .85; }
}

@media (prefers-reduced-motion: reduce) {
  h1 .nm, h1 .nowrap, .type, .strewn > .scatter, .strewn > .stamp2, .mailtab { animation: none; }
  .card:hover .chip, .nowrap:hover .wave { animation: none; }
  .js .pop:not(.in) { opacity: 1; transform: none; }
  .cur-dot, .cur-ring { display: none; }
}
