/* ==========================================================================
   Sidney Veleda: portfolio
   White and minimal. Violet and lime from the original brand,
   oscilloscope channel colours for the moving signals.
   Type: Orpheus Pro / Cormorant (display) + Adobe Garamond / EB Garamond (reading).
   The About me and Projects sections of the home page keep the original
   site's look: Syne + Averia Serif Libre, violet #5840BA and lime #79E71A.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --soft: #f6f4fb;
  --soft-2: #ece8f6;
  --ink: #15111d;
  --ink-2: #57506a;
  --ink-3: #8b849d;
  --line: rgba(21, 17, 29, 0.1);
  --violet: #5b3fc4;
  --violet-2: #7b5ef2;
  --violet-soft: #efebfd;
  --ink-violet: #2b2160;
  --lime: #9fe03a;
  --green: #4c8f0e;
  --ch-amber: #e3a300;
  --ch-green: #5aa816;
  --ch-blue: #1f8fe0;
  --ch-rose: #e5487d;

  --f-display: 'orpheus-pro', 'Cormorant', 'Cormorant Garamond', Garamond, serif;
  --f-text: 'adobe-garamond-pro', 'EB Garamond', Garamond, Georgia, serif;
  --f-wp-head: 'Syne', 'Helvetica Neue', Arial, sans-serif;
  --f-wp-text: 'Averia Serif Libre', Georgia, serif;
  --wp-ink: #242424;
  --wp-violet: #5840ba;
  --wp-card: #5f48bd;
  --wp-lime: #79e71a;

  --s--1: 1.0625rem;
  --s-0: 1.1875rem;
  --s-1: 1.375rem;
  --s-2: 1.75rem;
  --s-3: clamp(1.9rem, 1.2rem + 2.4vw, 2.75rem);
  --s-4: clamp(2.3rem, 1.2rem + 4.2vw, 4.3rem);
  --s-5: clamp(3rem, 0.6rem + 8.6vw, 8rem);

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(80px, 10vw, 144px);
  --header-h: 72px;
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow: 0 30px 60px -36px rgba(21, 17, 29, 0.35);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-text); font-size: var(--s-0); line-height: 1.6;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 500; line-height: 1.05; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-family: var(--f-display); font-size: var(--s--1); text-decoration: none; transition: top 0.2s var(--ease); }
.skip-link:focus { top: 12px; }
html.i18n-wait body { opacity: 0; }

/* ---------- page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.3s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in 0.5s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- layout ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--section); position: relative; }
.section--soft { background: var(--soft); }
.muted { color: var(--ink-2); }
.lede { font-size: var(--s-1); line-height: 1.5; max-width: 34em; color: var(--ink-2); }
.h-section { font-size: var(--s-4); font-weight: 500; letter-spacing: -0.01em; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head p { max-width: 30em; color: var(--ink-2); }

.trace-link {
  font-family: var(--f-display); font-size: var(--s--1); font-weight: 600; text-decoration: none; color: var(--violet);
  background: linear-gradient(currentColor, currentColor) left bottom / 0% 1.5px no-repeat; padding-bottom: 4px;
  transition: background-size 0.35s var(--ease);
}
.trace-link:hover, .trace-link:focus-visible { background-size: 100% 1.5px; }

/* ---------- buttons ---------- */
.btn {
  --bg: transparent; --fg: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  font-family: var(--f-display); font-size: var(--s--1); font-weight: 600; text-decoration: none;
  color: var(--fg); background: var(--bg); border: 1.5px solid var(--bd); border-radius: 10px;
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { --bg: var(--violet); --fg: #fff; --bd: var(--violet); }
.btn--primary:hover { --bg: #4c33ad; --bd: #4c33ad; }
.btn--lime { --bg: var(--lime); --fg: var(--ink); --bd: var(--lime); }
.btn--ghost { --bd: rgba(21, 17, 29, 0.18); }
.btn--ghost:hover { --bd: var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--icon { width: 48px; padding: 0; border-radius: 50%; }

/* ---------- header ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h); display: flex; align-items: center; transition: background-color 0.3s, box-shadow 0.3s; }
.site-header.is-scrolled { background: rgba(255, 255, 255, 0.86); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); box-shadow: 0 1px 0 var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.header-left { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .btn { min-height: 42px; padding: 0 16px; font-size: 16px; }
.header-actions .btn svg { width: 17px; height: 17px; }
.header-actions .btn--icon { width: 42px; padding: 0; border-radius: 50%; }
.lang-switch { display: inline-flex; align-items: center; padding: 3px; border: 1.5px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.7); }
.lang-switch button { min-width: 38px; height: 32px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; font-family: var(--f-display); font-size: 15px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-3); transition: background-color 0.2s, color 0.2s; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--ink-violet); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; font-family: var(--f-display); font-weight: 600; font-size: 18px; text-decoration: none; color: var(--ink); }
.brand svg { width: 34px; height: 20px; color: var(--violet); }
.brand svg path { stroke-dasharray: 60; }
.brand:hover svg path { animation: brand-trace 1.1s var(--ease); }
@keyframes brand-trace { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
.nav ul { display: flex; gap: 2px; list-style: none; }
.nav a { display: block; white-space: nowrap; padding: 10px 12px; border-radius: 8px; font-family: var(--f-display); font-size: 17px; font-weight: 500; letter-spacing: 0.04em; color: var(--ink-2); text-decoration: none; position: relative; transition: color 0.2s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q2.5 0 5 3 T10 3 T15 3 T20 3' fill='none' stroke='%235b3fc4' stroke-width='1.6'/%3E%3C/svg%3E") left center / 20px 6px repeat-x;
  animation: nav-wave 1.6s linear infinite;
}
@keyframes nav-wave { to { background-position: 20px center; } }
.menu-toggle { display: none; align-items: center; gap: 10px; height: 44px; padding: 0 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; font-family: var(--f-display); font-size: 16px; font-weight: 500; }
.menu-toggle span { display: block; width: 18px; height: 1.5px; background: currentColor; position: relative; }
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease); }
.menu-toggle span::before { top: -5px; }
.menu-toggle span::after { top: 5px; }
.menu-open .menu-toggle span { background: transparent; }
.menu-open .menu-toggle span::before { transform: translateY(5px) rotate(45deg); }
.menu-open .menu-toggle span::after { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 1180px) {
  .header-actions .btn--primary { width: 42px; padding: 0; border-radius: 50%; }
  .header-actions .btn--primary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav a { padding-inline: 9px; }
}
@media (max-width: 980px) {
  .menu-toggle { display: inline-flex; }
  .header-actions { display: none; }
  .header-left { gap: 0; }
  .nav { position: fixed; inset: 0; z-index: -1; padding: calc(var(--header-h) + 32px) var(--gutter) 40px; background: #fff; display: flex; flex-direction: column; justify-content: space-between; opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s; }
  .nav ul { flex-direction: column; }
  .nav a { font-size: clamp(2rem, 9vw, 3rem); font-weight: 600; letter-spacing: -0.01em; padding: 8px 0; color: var(--ink); transform: translateY(16px); opacity: 0; transition: transform 0.5s var(--ease), opacity 0.5s var(--ease); }
  .nav a[aria-current="page"] { color: var(--violet); }
  .nav a[aria-current="page"]::after { display: none; }
  .menu-open .nav { opacity: 1; visibility: visible; }
  .menu-open .nav a { transform: none; opacity: 1; }
  .menu-open .nav li:nth-child(2) a { transition-delay: 0.05s; }
  .menu-open .nav li:nth-child(3) a { transition-delay: 0.1s; }
  .menu-open .nav li:nth-child(4) a { transition-delay: 0.15s; }
  .nav__foot { display: flex; flex-direction: column; gap: 8px; font-family: var(--f-display); font-size: 17px; color: var(--ink-3); }
  .nav .nav__foot a:not(.btn) { font-size: 17px; font-weight: 500; letter-spacing: 0; padding: 0; opacity: 1; transform: none; color: var(--violet); word-break: break-all; }
  .nav .nav__foot .btn { display: inline-flex; font-size: 18px; letter-spacing: 0.02em; padding: 0 20px; opacity: 1; transform: none; color: var(--fg); }
  .nav__btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
  .nav .nav__foot .btn--icon { width: 48px; padding: 0; border-radius: 50%; }
  .nav__foot .lang-switch { align-self: flex-start; margin-bottom: 10px; }
  .nav__foot .lang-switch button { height: 40px; min-width: 48px; font-size: 17px; }
  .menu-open { overflow: hidden; }
  .menu-open .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: transparent; box-shadow: none; }
}
@media (min-width: 981px) { .nav__foot { display: none; } }

/* ---------- page hero with its moving sine ---------- */
.page-hero { position: relative; padding: calc(var(--header-h) + clamp(16px, 3vw, 40px)) 0 0; overflow: hidden; isolation: isolate; }
.page-hero h1 { font-size: var(--s-5); font-weight: 500; letter-spacing: -0.01em; line-height: 0.95; }
.page-hero .lede { margin-top: 24px; }

/* ---------- footer ---------- */
.site-footer { background: var(--soft); padding: clamp(64px, 9vw, 112px) 0 36px; }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 28px 48px; flex-wrap: wrap; }
.footer-top h2 { font-size: var(--s-4); font-weight: 500; letter-spacing: -0.01em; max-width: 14em; }
.footer-icons { display: flex; gap: 14px; list-style: none; }
.footer-icons a { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--ink-violet); transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease); }
.footer-icons a:hover { background: var(--ink-violet); border-color: var(--ink-violet); color: #fff; transform: translateY(-3px); }
.footer-icons svg { width: 24px; height: 24px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--line); font-size: var(--s--1); color: var(--ink-3); }

/* ==========================================================================
   HOME
   ========================================================================== */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding-top: var(--header-h); overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(42% 52% at 72% 44%, rgba(123, 94, 242, 0.13), transparent 70%),
    linear-gradient(rgba(21, 17, 29, 0.045) 1px, transparent 1px) 0 0 / calc(100% / 12) 72px,
    linear-gradient(90deg, rgba(21, 17, 29, 0.045) 1px, transparent 1px) 0 0 / calc(100% / 12) 72px;
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 62% 45%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 75% at 62% 45%, #000 30%, transparent 80%);
}
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr); align-items: center; gap: clamp(24px, 4vw, 64px); padding-block: clamp(16px, 3vw, 40px); }
.hero__copy { position: relative; z-index: 3; min-width: 0; }
.hero h1 { font-size: clamp(2.4rem, 0.9rem + 4.2vw, 5rem); margin-left: -0.055em; font-weight: 500; letter-spacing: -0.005em; line-height: 0.95; color: var(--ink-violet); white-space: nowrap; }
.hero__tagline { margin-top: 22px; font-family: var(--f-text); font-style: normal; font-size: clamp(1.2rem, 0.95rem + 0.8vw, 1.6rem); line-height: 1.3; color: var(--ink); animation: fade-up 0.9s 0.25s var(--ease) both; }
.hero__tagline.is-one-line { white-space: nowrap; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.24em; margin-bottom: -0.16em; }
.hero h1 .line > span { display: inline-block; animation: rise 1s var(--ease) both; }
.hero__figure { position: relative; height: clamp(320px, calc(100svh - 300px), 560px); z-index: 2; container-type: size; }
.avatar {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: min(94cqw, 94cqh); aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%;
  animation: avatar-in 1.1s 0.1s var(--ease) both;
}
.avatar__float { position: absolute; inset: 0; border-radius: 50%; animation: float 6s ease-in-out infinite; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 8px solid #fff; box-shadow: 0 40px 80px -30px rgba(43, 29, 87, 0.45), 0 0 0 1px rgba(21, 17, 29, 0.06); }

@keyframes spin { to { rotate: 360deg; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes avatar-in { from { opacity: 0; scale: 0.92; } }
@keyframes rise { from { transform: translateY(105%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }

/* full-width signal */
.signal { position: relative; z-index: 3; width: 100%; height: clamp(96px, 12vh, 130px); padding: 0; border: 0; background: transparent; cursor: pointer; display: block; animation: fade-up 0.9s 0.7s var(--ease) both; }
.signal canvas { width: 100%; height: 100%; }
.signal:focus-visible { outline-offset: -4px; }

@media (max-width: 1100px) {
  /* photo on top, name and tagline below at full width so the tagline can stay on one line */
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero__figure { order: -1; height: 44svh; min-height: 280px; max-height: 420px; margin-top: 16px; }
  .hero__copy { margin-top: 28px; }
  .hero__tagline { margin-top: 10px; }
  .avatar { width: min(86cqw, 92cqh); }
}
@media (max-width: 860px) {
  .hero h1 { font-size: clamp(2.3rem, 10vw, 3.4rem); }
  .avatar img { border-width: 5px; }
}

/* About me and Projects: same look as the original sidneyveleda.com */
.wp-about { padding-block: var(--section); color: var(--wp-ink); }
.wp-about__grid { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.4fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.wp-about__figure { display: grid; justify-items: center; gap: 24px; }
.wp-about__figure .wp-btn { width: 100%; max-width: 380px; }
.wp-about h2 { font-family: var(--f-wp-head); font-weight: 700; font-size: 45px; line-height: 56px; letter-spacing: 0; color: var(--wp-ink); margin-bottom: 24px; }
.wp-about p { font-family: var(--f-wp-text); font-weight: 300; font-size: 18px; line-height: 28px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; color: var(--wp-ink); margin-bottom: 18px; }
.wp-about p i { font-style: italic; }
.minime-stage { position: relative; width: 100%; max-width: 380px; aspect-ratio: 919 / 1000; }
.minime-stage::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 2%; height: 9%; border-radius: 50%; background: radial-gradient(closest-side, rgba(43, 29, 87, 0.28), transparent); animation: shadow 6s ease-in-out infinite; }
.minime { position: relative; width: 100%; height: 100%; object-fit: contain; -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent 99%); mask-image: linear-gradient(to bottom, #000 84%, transparent 99%); animation: float 6s ease-in-out infinite; transform-origin: 50% 90%; transition: rotate 0.6s var(--ease); }
.minime-stage:hover .minime { rotate: -3deg; }
.pcb-glow { position: absolute; left: 56%; top: 36%; width: 40%; aspect-ratio: 1; pointer-events: none; background: radial-gradient(circle, rgba(159, 224, 58, 0.55), transparent 62%); mix-blend-mode: multiply; filter: blur(4px); animation: pcb 3.2s ease-in-out infinite, float 6s ease-in-out infinite; }
@keyframes pcb { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.8; } }
@keyframes shadow { 0%, 100% { scale: 1; opacity: 1; } 50% { scale: 0.86; opacity: 0.7; } }

.wp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11.5px 24px; border-radius: 0; background: var(--wp-violet); color: #fff; font-family: var(--f-wp-text); font-weight: 400; font-size: 16px; line-height: 1.5; text-decoration: none; transition: background-color 0.25s, transform 0.25s var(--ease); }
.wp-btn svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease); }
.wp-btn:hover { background: #4a34a3; }
.wp-btn:hover svg { transform: translateX(4px); }
.wp-btn--lime { background: var(--wp-lime); padding: 15.5px 23px; }
.wp-btn--lime:hover { background: #6bd014; }

.wp-projects { background: var(--wp-violet); color: #fff; padding-block: clamp(72px, 9vw, 120px); }
.wp-projects__head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 56px); }
.wp-projects h2 { font-family: var(--f-wp-head); font-weight: 600; font-size: 48px; line-height: 1.2; letter-spacing: 0; color: #fff; }
/* the list scrolls inside its own box, one project at a time, like the original site */
.wp-list { list-style: none; display: flex; flex-direction: column; gap: 48px; max-height: 660px; overflow-y: auto; overscroll-behavior-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.wp-list::-webkit-scrollbar { display: none; }
.wp-list:focus-visible { outline: 3px solid var(--wp-lime); outline-offset: 6px; border-radius: 0; }
.wp-card { position: relative; flex: none; display: grid; grid-template-columns: minmax(0, 516fr) minmax(0, 620fr); column-gap: 64px; background: var(--wp-card); min-height: 472px; transition: background-color 0.3s; }
/* on hover the card turns white, like the original site */
.wp-card:hover { background: #fff; }
.wp-card:hover .wp-card__date, .wp-card:hover .wp-card__title { color: var(--wp-ink); }
.wp-card:hover .wp-card__text { color: #747474; }
.wp-card:hover .wp-card__more { color: var(--wp-violet); }
.wp-card__body { padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.wp-card__date { margin: 0; font-family: var(--f-wp-head); font-weight: 700; font-size: 16px; line-height: 1.4; transition: color 0.3s; }
.wp-card__title { font-family: var(--f-wp-head); font-weight: 700; font-size: 32px; line-height: 40px; letter-spacing: 0; color: #fff; transition: color 0.3s; }
.wp-card__title a { color: inherit; text-decoration: none; }
.wp-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.wp-card__title a:focus-visible { outline: none; }
.wp-card:has(a:focus-visible) { outline: 3px solid var(--wp-lime); outline-offset: 4px; }
.wp-card__text { margin: 0; font-family: var(--f-wp-text); font-weight: 300; font-size: 16px; line-height: 24px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; transition: color 0.3s; }
.wp-card__more { display: inline-flex; align-items: center; gap: 8px; color: var(--wp-lime); font-family: var(--f-wp-text); font-weight: 400; font-size: 16px; transition: color 0.3s; }
.wp-card__more svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease); }
.wp-card:hover .wp-card__more svg { transform: translateX(5px); }
.wp-card__media { position: relative; overflow: hidden; background: #4a34a3; }
.wp-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.wp-card:hover .wp-card__media img { transform: scale(1.04); }
@media (max-width: 860px) {
  .wp-about__grid { grid-template-columns: 1fr; }
  .minime-stage { max-width: 280px; }
  .wp-about__figure .wp-btn { max-width: 280px; }
  .wp-about h2 { font-size: 36px; line-height: 44px; }
  .wp-projects h2 { font-size: 38px; }
  .wp-list { max-height: min(640px, 82svh); gap: 32px; }
  .wp-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; column-gap: 0; min-height: 0; }
  .wp-card__media { aspect-ratio: 16 / 10; order: -1; }
  .wp-card__body { padding: 28px 24px 32px; }
  .wp-card__title { font-size: 26px; line-height: 32px; }
}

/* ==========================================================================
   ABOUT: introduction and timeline
   ========================================================================== */
.about-intro { padding: calc(var(--header-h) + clamp(40px, 6vw, 80px)) 0 clamp(40px, 5vw, 72px); }
.about-intro h1 { font-size: var(--s-5); font-weight: 500; letter-spacing: -0.01em; line-height: 0.95; }
.about-intro__text { margin-top: clamp(28px, 3.5vw, 48px); }
.about-intro__text p { font-size: var(--s-1); line-height: 1.6; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.about-intro__text p:first-child { font-family: var(--f-display); font-size: clamp(1.6rem, 1.2rem + 1.1vw, 2.2rem); font-weight: 500; line-height: 1.3; text-align: left; hyphens: manual; color: var(--ink); }
.about-intro__text p + p { margin-top: 1em; }

/* timeline: one line down the middle, stops alternating right and left */
.tl-section { padding-top: clamp(16px, 2vw, 32px); }
.tl { --gap: clamp(56px, 6vw, 96px); list-style: none; position: relative; margin-top: clamp(24px, 3vw, 48px); }
.tl::before, .tl::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; border-radius: 2px; }
.tl::before { background: var(--soft-2); }
.tl::after { background: var(--violet); transform-origin: 50% 0; transform: scaleY(var(--p, 1)); }
.tl__item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--gap) minmax(0, 1fr); grid-template-areas: "meta dot card"; align-items: start; padding-block: clamp(36px, 4.5vw, 64px); }
.tl__item--left { grid-template-areas: "card dot meta"; }
.tl__meta { grid-area: meta; position: sticky; top: calc(var(--header-h) + 36px); padding-top: 2px; text-align: right; }
.tl__item--left .tl__meta { text-align: left; }
.tl__when { margin: 0; font-family: var(--f-display); font-size: clamp(1.7rem, 1.2rem + 1.3vw, 2.5rem); font-weight: 500; line-height: 1.1; color: var(--ink); font-variant-numeric: lining-nums; text-wrap: balance; }
.tl__now { display: inline-block; margin: 12px 0 0; padding: 3px 12px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); font-family: var(--f-display); font-size: 15px; font-weight: 700; }
.tl__place { margin: 12px 0 0; font-family: var(--f-display); font-size: 17px; font-weight: 600; color: var(--ink-3); }
.tl__dot { grid-area: dot; justify-self: center; position: sticky; top: calc(var(--header-h) + 46px); z-index: 1; width: 17px; height: 17px; margin-top: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--violet); transition: background-color 0.35s, box-shadow 0.35s, transform 0.35s var(--ease); }
.tl__item.is-past .tl__dot { background: var(--violet); box-shadow: 0 0 0 6px var(--violet-soft); }
.tl__card { grid-area: card; }
.tl__photo { margin: 0 0 22px; }
.tl__photo a { display: block; border-radius: 14px; overflow: hidden; background: var(--soft); }
.tl__photo img { width: 100%; height: auto; transition: transform 0.7s var(--ease); }
.tl__photo a:hover img { transform: scale(1.03); }
.tl__photo figcaption { margin-top: 10px; font-size: 15.5px; color: var(--ink-2); }
.tl__card h3 { font-size: clamp(1.8rem, 1.3rem + 1.4vw, 2.5rem); font-weight: 500; line-height: 1.05; }
.tl__sub { margin: 8px 0 0; font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; color: var(--violet); line-height: 1.35; }
.tl__text { margin: 14px 0 0; line-height: 1.7; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.tl__link { display: inline-block; margin-top: 14px; }

/* the dates and dots appear as you scroll; the cards and their photos are shown as they are */
.tl--anim .tl__meta > * { opacity: 0; transform: translateY(14px); transition: opacity 0.8s var(--ease), transform 0.9s var(--ease); }
.tl--anim .tl__dot { transform: scale(0.4); }
.tl--anim .is-in .tl__meta > *, .tl--anim .is-in .tl__dot { opacity: 1; transform: none; }
.tl--anim .is-in .tl__meta > :nth-child(2) { transition-delay: 0.1s; }

@media (max-width: 900px) {
  .tl { --gap: 36px; }
  .tl::before, .tl::after { left: 18px; }
  .tl__item, .tl__item--left { grid-template-columns: var(--gap) minmax(0, 1fr); grid-template-areas: "dot meta" ". card"; padding-block: 28px; }
  .tl__meta, .tl__item--left .tl__meta { position: static; text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
  .tl__when { font-size: 1.7rem; }
  .tl__now, .tl__place { margin: 0; }
  .tl__dot { position: static; margin-top: 8px; }
  .tl__card { margin-top: 18px; }
}


/* skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 5vw, 64px) 24px; list-style: none; }
.skill { display: grid; justify-items: center; align-content: start; text-align: center; gap: 14px; padding: 12px; border-radius: var(--radius); outline: none; }
.skill img { width: clamp(84px, 9vw, 120px); height: auto; transition: transform 0.5s var(--ease); }
.skill:hover img, .skill:focus-visible img { transform: translateY(-6px) rotate(-4deg) scale(1.05); }
.skill h3 { font-size: clamp(14px, 1.2vw, 16.5px); font-weight: 600; letter-spacing: -0.01em; }
.skill p { font-size: 15.5px; line-height: 1.45; color: var(--ink-2); max-width: 20em; opacity: 0; transform: translateY(-6px); transition: opacity 0.3s, transform 0.4s var(--ease); }
.skill:hover p, .skill:focus-visible p, .skill:focus-within p { opacity: 1; transform: none; }
@media (hover: none) { .skill p { opacity: 1; transform: none; } }
@media (max-width: 640px) { .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* languages, lesson style */
.langs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.courses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; list-style: none; }
.course { background: #fff; border: 2px solid #e5e1ef; border-bottom-width: 5px; border-radius: 20px; padding: 18px; display: grid; gap: 12px; transition: transform 0.2s, border-color 0.2s; }
.course:hover { transform: translateY(-3px); border-color: #d6cff0; }
.course__top { display: flex; align-items: center; gap: 12px; }
.course__flag { width: 48px; height: 34px; border-radius: 7px; overflow: hidden; flex: none; box-shadow: 0 0 0 2px #e5e1ef; }
.course__flag svg { width: 100%; height: 100%; }
.course__name { font-family: var(--f-display); font-size: 18px; font-weight: 600; }
.course__level { margin-left: auto; font-family: var(--f-display); font-size: 16px; font-weight: 600; color: #fff; background: var(--violet); border-radius: 10px; padding: 4px 9px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.course__bar { position: relative; height: 16px; border-radius: 999px; background: #ebe8f2; overflow: hidden; }
.course__bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--lime); transition: width 1.4s var(--ease); }
.course__bar i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.45); }
.course__label { font-size: 15px; line-height: 1.35; color: var(--ink-2); }
.course__label b { font-family: var(--f-display); font-size: 15px; font-weight: 600; color: var(--ink); display: block; }

.lesson { position: relative; background: #fff; border: 2px solid #e5e1ef; border-radius: 28px; padding: 22px 22px 0; overflow: hidden; box-shadow: var(--shadow); min-height: 440px; display: flex; flex-direction: column; }
.lesson__top { display: flex; align-items: center; gap: 12px; }
.lesson__x { width: 20px; height: 20px; color: #b7b0c8; flex: none; }
.lesson__progress { flex: 1; height: 16px; border-radius: 999px; background: #ebe8f2; overflow: hidden; }
.lesson__progress i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--lime); transition: width 0.7s var(--ease); }
.lesson__streak { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-display); font-size: 17px; font-weight: 600; color: #ff9600; }
.lesson__streak svg { width: 18px; height: 18px; }
.lesson h3 { margin-top: 22px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.lesson__prompt { display: flex; align-items: flex-end; gap: 12px; margin-top: 16px; }
.lesson__prompt img { width: 86px; height: auto; flex: none; }
.lesson__say { position: relative; padding: 12px 16px; border: 2px solid #e5e1ef; border-radius: 16px; font-size: 18px; line-height: 1.35; margin-bottom: 24px; }
.lesson__say::before { content: ""; position: absolute; left: -9px; bottom: 14px; width: 14px; height: 14px; background: #fff; border-left: 2px solid #e5e1ef; border-bottom: 2px solid #e5e1ef; transform: rotate(45deg); }
.lesson__answer { min-height: 58px; margin-top: 8px; padding: 6px 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; border-bottom: 2px solid #e5e1ef; background: linear-gradient(#e5e1ef, #e5e1ef) 0 54px / 100% 2px no-repeat; }
.lesson__bank { min-height: 104px; margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-content: flex-start; }
.tile { display: inline-block; padding: 8px 14px; border: 2px solid #e5e1ef; border-bottom-width: 4px; border-radius: 13px; background: #fff; font-size: 17px; line-height: 1.2; will-change: transform; }
.tile.is-gone { visibility: hidden; }
.lesson__foot { margin: auto -22px 0; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 2px solid #e5e1ef; transition: background-color 0.3s; }
.lesson__verdict { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 20px; font-weight: 600; color: #58a700; opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.4s var(--ease); }
.lesson__verdict i { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.lesson__verdict svg { width: 20px; height: 20px; color: #58a700; }
.lesson__check { min-width: 128px; padding: 12px 18px; border: 0; border-radius: 14px; background: #e5e1ef; color: #a39cb5; font-family: var(--f-display); font-size: 17px; font-weight: 600; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12); transition: background-color 0.3s, color 0.3s; }
.lesson.is-ready .lesson__check { background: var(--lime); color: var(--ink); }
.lesson.is-correct .lesson__foot { background: #d7ffb8; }
.lesson.is-correct .lesson__verdict { opacity: 1; transform: none; }
.lesson.is-correct .lesson__check { background: #58cc02; color: #fff; }
.lesson__pause { position: absolute; right: 14px; bottom: 82px; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-2); }
.lesson__pause svg { width: 14px; height: 14px; }
@media (max-width: 960px) { .langs { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .courses { grid-template-columns: 1fr; } .lesson { padding: 18px 16px 0; } .lesson__foot { margin-inline: -16px; padding-inline: 16px; } }


/* ==========================================================================
   PROJECTS
   ========================================================================== */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 72px) clamp(24px, 4vw, 56px); list-style: none; }
.pitem a { display: block; text-decoration: none; color: inherit; }
.pitem__media { position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--soft); transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.pitem__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.pitem a:hover .pitem__media, .pitem a:focus-visible .pitem__media { box-shadow: var(--shadow); }
.pitem a:hover .pitem__media img { transform: scale(1.04); }
.pitem h3 { margin-top: 18px; font-size: clamp(1.1rem, 0.9rem + 0.7vw, 1.45rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; display: inline; background: linear-gradient(var(--violet), var(--violet)) left bottom / 0% 2px no-repeat; transition: background-size 0.4s var(--ease); }
.pitem a:hover h3 { background-size: 100% 2px; }
.pitem__title { margin-top: 18px; }
@media (max-width: 700px) { .pgrid { grid-template-columns: 1fr; } }

/* single project page: title, two boxes, then sections of justified text and visuals */
.pj-wrap { width: min(100% - 2 * var(--gutter), 1120px); margin-inline: auto; }
.pj-head { padding: calc(var(--header-h) + clamp(32px, 5vw, 64px)) 0 clamp(36px, 4vw, 56px); text-align: center; }
.pj-head .back { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-display); font-size: 16px; font-weight: 600; color: var(--ink-2); text-decoration: none; margin-bottom: clamp(28px, 4vw, 48px); }
.pj-head .back:hover { color: var(--violet); }
.pj-head .back svg { width: 16px; height: 16px; }
.pj-head h1 { margin-inline: auto; max-width: 18em; font-size: clamp(2.3rem, 1.2rem + 3.4vw, 4.2rem); font-weight: 500; line-height: 1.04; text-wrap: balance; }
.pj-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 0; margin-top: 22px; list-style: none; font-family: var(--f-display); font-size: 17px; font-weight: 500; color: var(--ink-2); }
.pj-meta li + li::before { content: ""; display: inline-block; width: 1px; height: 0.9em; margin: 0 16px; vertical-align: -0.1em; background: var(--ink-3); opacity: 0.6; }

.pj-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.pj-box { background: var(--soft); padding: clamp(28px, 3.6vw, 52px); }
.pj-box h2 { font-size: clamp(1.8rem, 1.4rem + 1vw, 2.3rem); font-weight: 500; margin-bottom: 12px; }
.pj-box p { font-size: 1.16rem; line-height: 1.7; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.pj-box--todo { grid-column: 1 / -1; text-align: center; }
.pj-box--todo p { text-align: center; font-family: var(--f-display); font-size: 1.6rem; font-weight: 500; color: var(--ink-2); }

.pj-sec { margin-top: clamp(64px, 8vw, 112px); }
.pj-sec > h2 { text-align: center; font-size: clamp(2rem, 1.3rem + 2vw, 3rem); font-weight: 500; line-height: 1.1; margin-bottom: clamp(20px, 2.4vw, 32px); text-wrap: balance; }
.pj-sec > h3 { font-size: clamp(1.45rem, 1.2rem + 0.7vw, 1.8rem); font-weight: 600; margin: clamp(48px, 5vw, 72px) 0 12px; padding-top: clamp(28px, 3vw, 40px); border-top: 1px solid var(--line); }
.pj-sec > p { font-size: 1.2rem; line-height: 1.75; text-align: justify; hyphens: auto; -webkit-hyphens: auto; margin: 0 0 1em; }
.pj-sec > p:last-child { margin-bottom: 0; }
.pj sub, .pj sup { font-size: 0.7em; line-height: 0; }

.pj-figs { display: grid; gap: 28px 32px; margin: clamp(32px, 4vw, 52px) auto; align-items: start; }
.pj-figs--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pj-figs--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pj-figs--xsmall { max-width: 400px; }
.pj-figs--small { max-width: 560px; }
.pj-figs--medium { max-width: 760px; }
.pj-figs--large { max-width: 960px; }
.pj-fig { margin: 0; display: flex; flex-direction: column; }
.pj-fig__label { order: -1; margin: 0 0 14px; text-align: center; font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.pj-fig .zoom { display: block; cursor: zoom-in; }
.pj-fig img { width: 100%; height: auto; margin-inline: auto; }
.pj-fig figcaption, .pj-figs__caption { margin-top: 12px; text-align: center; font-size: 16px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.pj-figs__caption { grid-column: 1 / -1; margin-top: 0; }
.pj-figs--3 .pj-fig img { max-width: 300px; }
.pj-video { display: block; width: 100%; height: auto; border-radius: 12px; background: #000; }
@media (max-width: 720px) { .pj-figs--2.pj-figs--vid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.pj-stats { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: clamp(32px, 4vw, 52px) 0; border-block: 1px solid var(--line); }
.pj-stats li { padding: 22px 20px; border-left: 1px solid var(--line); }
.pj-stats li:first-child { border-left: 0; padding-left: 0; }
.pj-stats li > b { display: block; font-family: var(--f-display); font-size: clamp(1.7rem, 1.3rem + 1vw, 2.3rem); font-weight: 500; line-height: 1.1; color: var(--violet); white-space: nowrap; }
.pj-stats li > span { display: block; margin-top: 6px; font-size: 16px; line-height: 1.4; color: var(--ink-2); }

.pj-sec > .pj-formula { display: block; width: fit-content; margin: 30px auto; padding: 14px 32px; border-radius: 14px; background: var(--soft); font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem); max-width: 100%; overflow-x: auto; }
.pj-formula .katex-display { margin: 0; }
.pj .katex { font-size: 1.08em; }

.pj-table { margin: clamp(32px, 4vw, 52px) 0; }
.pj-table__scroll { overflow-x: auto; }
.pj-table table { width: 100%; border-collapse: collapse; font-size: 1.08rem; }
.pj-table th, .pj-table td { padding: 13px 18px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: top; }
.pj-table thead th { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; border-bottom: 1.5px solid var(--ink); }
.pj-table tbody th { text-align: left; font-weight: 400; color: var(--ink-2); }
.pj-table .is-hl { background: var(--violet-soft); }
.pj-table thead .is-hl { color: var(--violet); }
.pj-table figcaption { margin-top: 12px; text-align: center; font-size: 16px; color: var(--ink-2); }

.pj-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(32px, 5vw, 72px); margin: clamp(32px, 4vw, 52px) 0; }
.pj-bars figure { margin: 0; }
.pj-bars figcaption { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; margin-bottom: 16px; }
.pj-bars ul { list-style: none; display: grid; gap: 14px; }
.pj-bars li { display: grid; grid-template-columns: minmax(0, 1fr) 3.4em; grid-template-areas: "label label" "bar value"; gap: 4px 12px; align-items: center; }
.pj-bars li > span { grid-area: label; font-size: 16px; color: var(--ink-2); }
.pj-bars li > i { grid-area: bar; display: block; height: 12px; border-radius: 6px; background: linear-gradient(var(--violet), var(--violet)) 0 0 / var(--w) 100% no-repeat, var(--soft-2); }
.pj-bars li.is-muted > i { background: linear-gradient(#b9acec, #b9acec) 0 0 / var(--w) 100% no-repeat, var(--soft-2); }
.pj-bars li > b { grid-area: value; font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; text-align: right; white-space: nowrap; }

.pj-photo { margin: 0; }
.pj-photo__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr); gap: 28px; align-items: center; }
.pj-photo__img { position: relative; }
.pj-photo__img .zoom { display: block; cursor: zoom-in; }
.pj-photo__img img { width: 100%; height: auto; }
.pj-spot { position: absolute; width: 26px; height: 26px; translate: -50% -50%; display: grid; place-items: center; border-radius: 50%; background: var(--violet); color: #fff; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(21, 17, 29, 0.3); font-family: var(--f-display); font-size: 14px; font-weight: 700; pointer-events: none; transition: transform 0.2s var(--ease), background-color 0.2s; }
.pj-spot.is-on { transform: scale(1.3); background: var(--ink-violet); }
.pj-photo__legend { list-style: none; display: grid; gap: 14px; }
.pj-photo__legend li { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; line-height: 1.2; cursor: default; }
.pj-photo__legend--l li { flex-direction: row-reverse; text-align: right; }
.pj-photo__legend i { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--violet); color: var(--violet); font-style: normal; font-size: 14px; font-weight: 700; transition: background-color 0.2s, color 0.2s; }
.pj-photo__legend li.is-on i { background: var(--violet); color: #fff; }
.pj-photo figcaption { margin-top: 18px; text-align: center; font-size: 16px; color: var(--ink-2); }

.pj .project-nav { margin-top: clamp(80px, 10vw, 140px); }
@media (max-width: 900px) {
  .pj-photo__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
  .pj-photo__img { grid-column: 1 / -1; grid-row: 1; }
  .pj-photo__legend--l li { flex-direction: row; text-align: left; }
}
@media (max-width: 760px) {
  .pj-boxes, .pj-bars { grid-template-columns: 1fr; }
  .pj-figs--2 { grid-template-columns: 1fr; }
  .pj-figs--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .pj-figs--3 .pj-fig__label { font-size: 0.95rem; }
  .pj-sec > p, .pj-box p { font-size: 1.1rem; line-height: 1.7; }
  .pj-sec > .pj-formula { padding: 12px 14px; }
  .pj-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-stats li { border-left: 0; padding-left: 0; }
  .pj-stats li > b { white-space: normal; font-size: 1.6rem; }
  .pj-table table { font-size: 0.98rem; }
  .pj-table th, .pj-table td { padding: 11px 10px; }
  .pj-meta { flex-direction: column; gap: 4px; }
  .pj-meta li + li::before { display: none; }
  .pj-photo__grid { grid-template-columns: 1fr; }
  .project-nav { grid-template-columns: 1fr; }
}

/* functional diagram */
.pj-chain { margin: clamp(32px, 4vw, 52px) 0; }
.pj-chain__title { margin-bottom: 14px; text-align: center; font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; }
.pj-chain svg { display: block; width: 100%; height: auto; overflow: visible; }
.pj-chain__narrow { display: none !important; max-width: 400px; margin-inline: auto; }
.ch-box { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.ch-box--violet { fill: var(--violet-soft); stroke: var(--violet); }
.ch-line { fill: none; stroke-width: 1.6; }
.ch-line--ink { stroke: var(--ink); }
.ch-line--violet { stroke: var(--violet); }
.ch-head-ink { fill: var(--ink); }
.ch-head-violet { fill: var(--violet); }
.ch-dot { fill: var(--violet); }
.ch-meter { fill: var(--bg); stroke: var(--violet); stroke-width: 2; }
.ch-lab { font-family: var(--f-display); font-size: 17px; font-weight: 600; fill: var(--ink); }
.ch-note { font-family: var(--f-text); font-size: 15px; fill: var(--ink-2); }
.ch-sig { font-family: KaTeX_Math, var(--f-text); font-size: 18px; font-style: italic; fill: var(--ink); }
.ch-sig--violet { fill: var(--violet); }
.ch-sub { font-size: 12px; }
@media (max-width: 700px) {
  .pj-chain__wide { display: none !important; }
  .pj-chain__narrow { display: block !important; }
}

/* enlarged image (project figures, timeline photos) */
.zoombox { padding: 0; border: 0; margin: auto; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; }
.zoombox::backdrop { background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.zoombox figure { margin: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 56px 20px 32px; cursor: zoom-out; }
.zoombox[open] figure { animation: fade-up 0.35s var(--ease); }
.zoombox img { max-width: min(96vw, 1800px); max-height: calc(100dvh - 150px); width: auto; height: auto; background: #fff; border-radius: 10px; box-shadow: var(--shadow); }
.zoombox figcaption { max-width: 60em; color: var(--ink-2); font-size: 16px; text-align: center; }
.zoombox__close { position: fixed; top: 14px; right: 14px; width: 46px; height: 46px; display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); }
.zoombox__close svg { width: 22px; height: 22px; }
.project-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: var(--section); }
.project-nav a { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: inherit; transition: border-color 0.2s, box-shadow 0.3s; }
.project-nav a:hover { border-color: var(--violet); box-shadow: var(--shadow); }
.project-nav img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; }
.project-nav small { display: block; font-family: var(--f-display); font-size: 15px; font-weight: 600; color: var(--violet); margin-bottom: 4px; }
.project-nav span { font-family: var(--f-display); font-size: 17.5px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.project-nav a:last-child { text-align: right; grid-template-columns: 1fr 96px; }
.project-nav a:last-child img { order: 2; }
@media (max-width: 760px) { .project-nav { grid-template-columns: 1fr; } }

/* ==========================================================================
   HOBBIES
   ========================================================================== */
.hobby-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
.hobby-head h2 { font-size: var(--s-4); font-weight: 500; letter-spacing: -0.01em; }
.hobby-head p { font-size: var(--s-1); line-height: 1.5; color: var(--ink-2); max-width: 28em; }
@media (max-width: 760px) { .hobby-head { grid-template-columns: 1fr; } }

/* vinyl coverflow */
.crate { position: relative; isolation: isolate; user-select: none; -webkit-user-select: none; }
.crate__glow { position: absolute; left: 50%; top: 46%; width: min(760px, 90vw); aspect-ratio: 1.6; translate: -50% -50%; border-radius: 50%; background: var(--glow, #5b3fc4); opacity: 0.18; filter: blur(70px); z-index: -1; transition: background-color 0.8s; }
.crate__stage { position: relative; height: clamp(320px, 42vw, 470px); perspective: 1400px; touch-action: pan-y; cursor: grab; }
.crate__stage:active { cursor: grabbing; }
.crate__rank { text-align: center; font-family: var(--f-display); font-weight: 500; font-size: clamp(3rem, 2rem + 4vw, 5.6rem); letter-spacing: -0.01em; line-height: 1; background: linear-gradient(180deg, #f7c96b, #c9852b 70%, #e8b04f); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px; min-height: 1em; }
.record { position: absolute; left: 50%; top: 50%; width: clamp(200px, 26vw, 320px); aspect-ratio: 1; margin: calc(clamp(200px, 26vw, 320px) / -2) 0 0 calc(clamp(200px, 26vw, 320px) / -2); transform-style: preserve-3d; transition: transform 0.75s var(--ease), opacity 0.6s; border: 0; padding: 0; background: none; }
.record__disc { position: absolute; inset: 3%; border-radius: 50%; transform: translateZ(-2px); background: radial-gradient(circle, var(--label, #e3a300) 0 16%, #111 16.5% 17.5%, transparent 18%), repeating-radial-gradient(circle, #141217 0 1.6px, #23202a 1.8px 3px); box-shadow: 0 0 0 1px #000; transition: transform 0.9s var(--ease); }
.record__disc::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 30deg, transparent, rgba(255, 255, 255, 0.14) 10%, transparent 22%, transparent 50%, rgba(255, 255, 255, 0.1) 60%, transparent 72%); }
.record.is-active .record__disc { transform: translateX(36%) translateZ(-2px); animation: spin-disc 4s linear infinite 0.9s; }
@keyframes spin-disc { from { transform: translateX(36%) translateZ(-2px) rotate(0); } to { transform: translateX(36%) translateZ(-2px) rotate(360deg); } }
.record__sleeve { position: absolute; inset: 0; border-radius: 4px; overflow: hidden; -webkit-box-reflect: below 6px linear-gradient(transparent 62%, rgba(255, 255, 255, 0.16)); background: var(--sleeve, #5b3fc4); box-shadow: 0 30px 50px -24px rgba(21, 17, 29, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.record__sleeve img { width: 100%; height: 100%; object-fit: cover; }
.record__sleeve .blank { position: absolute; inset: 0; padding: 8%; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink, #fff); font-family: var(--f-display); text-align: left; background: radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.2), transparent 55%), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px); }
.blank__top { display: grid; gap: 4px; }
.record__sleeve .blank b { font-size: clamp(17px, 2vw, 26px); font-weight: 600; letter-spacing: -0.005em; line-height: 1.02; text-wrap: balance; }
.record__sleeve .blank__top span { font-family: var(--f-text); font-size: clamp(13px, 1.2vw, 16px); opacity: 0.85; }
.record__sleeve .blank__year { font-size: clamp(64px, 9vw, 118px); font-weight: 600; line-height: 0.78; letter-spacing: -0.03em; opacity: 0.95; margin-left: -0.04em; }
.crate__info { text-align: center; margin-top: 18px; min-height: 64px; }
.crate__title { font-family: var(--f-display); font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.5rem); font-weight: 500; letter-spacing: -0.01em; }
.crate__artist { color: var(--ink-2); font-size: 18px; }
.crate__nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 30; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; }
.crate__nav:hover { border-color: var(--ink); }
.crate__nav svg { width: 20px; height: 20px; }
.crate__nav--prev { left: 0; }
.crate__nav--next { right: 0; }

/* photography */
.gallery { columns: 3 280px; column-gap: 16px; }
.gallery figure { break-inside: avoid; margin: 0 0 16px; position: relative; border-radius: 14px; overflow: hidden; background: var(--soft); }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.gallery img { width: 100%; height: auto; transition: transform 0.9s var(--ease); }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; color: #fff; background: linear-gradient(transparent, rgba(10, 6, 20, 0.7)); font-family: var(--f-display); font-size: 16px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.4s var(--ease); pointer-events: none; }
.gallery figcaption span { display: block; font-weight: 400; font-size: 12px; opacity: 0.85; }
.gallery figure:hover figcaption, .gallery button:focus-visible + figcaption { opacity: 1; transform: none; }
@media (hover: none) { .gallery figcaption { opacity: 1; transform: none; } }
.gallery--empty figure { aspect-ratio: var(--ar, 4 / 5); display: grid; place-items: center; border: 2px dashed var(--soft-2); background: #fff; color: var(--ink-3); font-family: var(--f-display); font-size: 16px; }
.gallery--empty figure svg { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--soft-2); }
.lightbox { width: min(100% - 24px, 1200px); max-height: calc(100svh - 24px); padding: 0; border: 0; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lightbox[open] { display: grid; gap: 14px; justify-items: center; animation: fade-up 0.4s var(--ease); }
.lightbox img { max-height: calc(100svh - 140px); width: auto; border-radius: 12px; box-shadow: var(--shadow); }
.lightbox p { font-family: var(--f-display); font-size: 17px; font-weight: 600; text-align: center; }
.lightbox p span { display: block; font-family: var(--f-text); font-weight: 400; color: var(--ink-2); }
.lightbox__bar { display: flex; gap: 10px; }

/* travel globe */
.travel { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.travel__globe { position: relative; border-radius: 28px; background: radial-gradient(ellipse at 50% 40%, #fff, var(--soft) 75%); border: 1px solid var(--line); overflow: hidden; }
.travel__globe canvas { width: 100%; height: clamp(380px, 46vw, 600px); }
.travel__tools { position: absolute; left: 16px; bottom: 16px; }
.travel__tools .btn { background: rgba(255, 255, 255, 0.85); min-height: 42px; }
.travel__hint { position: absolute; right: 20px; bottom: 22px; margin: 0; font-family: var(--f-display); font-size: 16px; color: var(--ink-3); }
.travel__card { position: sticky; top: calc(var(--header-h) + 20px); background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); animation: fade-up 0.5s var(--ease); }
.travel__media { position: relative; margin: 0; aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--violet-soft), #e8f6d6); overflow: hidden; }
.travel__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fade-in 0.6s var(--ease); }
@keyframes fade-in { from { opacity: 0; } }
.travel__ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: clamp(5rem, 9vw, 8rem); font-weight: 600; color: rgba(91, 63, 196, 0.18); }
.travel__media figcaption { position: absolute; right: 10px; bottom: 10px; z-index: 1; }
.travel__media figcaption a { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(21, 17, 29, 0.55); color: #fff; font-size: 13px; text-decoration: none; }
.travel__body { padding: 22px 26px 28px; }
.travel__card h3 { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.8rem); font-weight: 500; margin: 4px 0 6px; color: var(--ink-violet); line-height: 1; }
.travel__kicker { margin: 0; font-family: var(--f-display); font-size: 17px; font-weight: 600; color: var(--green); }
.travel__text { color: var(--ink-2); font-size: var(--s-0); line-height: 1.55; margin: 8px 0 0; }
.travel__index { margin-top: clamp(28px, 4vw, 48px); }
.travel__chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chip-btn { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-family: var(--f-display); font-size: 16.5px; font-weight: 600; color: var(--ink); transition: border-color 0.2s, background-color 0.2s, color 0.2s; }
.chip-btn:hover { border-color: var(--violet); }
.chip-btn[aria-pressed="true"] { background: var(--ink-violet); border-color: var(--ink-violet); color: #fff; }
@media (max-width: 900px) { .travel { grid-template-columns: 1fr; } .travel__globe canvas { height: 380px; } .travel__card { position: relative; top: auto; } }

/* chess */
.chess3d { position: relative; border-radius: 28px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #fff 0%, var(--soft) 70%); border: 1px solid var(--line); }
.chess3d canvas { width: 100%; height: clamp(340px, 48vw, 600px); }
.chess3d__hud { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 16px 22px 18px; background: rgba(255, 255, 255, 0.85); border-top: 1px solid var(--line); }
.chess3d__move { font-family: var(--f-display); font-size: clamp(1.4rem, 1rem + 1.4vw, 2.2rem); font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.chess3d__game { font-size: 15px; color: var(--ink-2); max-width: 30em; line-height: 1.4; }
.chess3d__game b { font-family: var(--f-display); font-size: 16px; color: var(--ink); display: block; }
.chess3d__fallback { padding: 40px; text-align: center; color: var(--ink-2); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* hairline edge on photos so white-background images don't melt into the page */
.pitem__media::after, .project-cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(21, 17, 29, 0.08); pointer-events: none; }
.project-cover { position: relative; }
