:root {
  --bg: #14151c;
  --card: #1d1f2a;
  --card2: #282b3b;
  --line: #2f3345;
  --text: #ecedf3;
  --muted: #a3a6b8;
  --gold: #f0b94d;
  --soft: rgba(240, 185, 77, 0.13);
  --ink: #1a1405;
}
:root[data-theme="light"] {
  --bg: #f1eee6;
  --card: #fff;
  --card2: #efeadc;
  --line: #e3dccb;
  --text: #22232d;
  --muted: #5f6172;
  --gold: #a9710a;
  --soft: rgba(169, 113, 10, 0.12);
  --ink: #fff;
}
* {
  box-sizing: border-box;
  margin: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  background: var(--bg);
  color: var(--text);
  font:
    400 1rem/1.7 "Instrument Sans",
    system-ui,
    sans-serif;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(700px 500px at 8% 0, var(--soft), transparent 70%),
    radial-gradient(600px 500px at 100% 100%, var(--soft), transparent 70%);
}
h1,
h2,
h3 {
  font-family: Fraunces, Georgia, serif;
  line-height: 1.2;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
#bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 20;
}
.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 190px;
  gap: 24px;
  align-items: start;
}
.side {
  position: sticky;
  top: 28px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
}
.side .panel {
  margin: 0;
}
h2 {
  font-size: 1.7rem;
  color: var(--gold);
  margin-bottom: 18px;
}
.muted,
.lead {
  color: var(--muted);
}
/* profile */
.prof {
  text-align: center;
}
.ph {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 6px auto 22px;
}
.ph::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: conic-gradient(
    var(--gold),
    transparent 35%,
    var(--gold) 70%,
    transparent
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 3px),
    #000 calc(100% - 2px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 3px),
    #000 calc(100% - 2px)
  );
  animation: spin 9s linear infinite;
}
.ph img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 70% 30%;
  position: relative;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.prof h1 {
  font-size: 1.65rem;
  margin-bottom: 10px;
}
.prof .role {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}
.prof .job {
  display: inline-block;
  background: var(--soft);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 6px 0 8px;
}
.prof .job span {
  font-weight: 500;
  opacity: 0.85;
}
.prof .job small {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-left: 2px;
}
.prof .where {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 10px 0 20px;
}
.pills {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}
.pills a {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 7px 20px;
  text-decoration: none;
  color: var(--muted);
}
.pills a.on,
.pills a:hover {
  background: var(--soft);
  color: var(--gold);
  border-color: transparent;
}
.btn {
  display: block;
  text-align: center;
  padding: 13px;
  border-radius: 14px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 10px;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px var(--soft);
}
.btn.alt {
  background: none;
  border: 1.5px solid var(--gold);
  color: var(--gold);
}
.icons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}
.icons a,
.icons button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.25s;
}
.icons a:hover,
.icons button:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-3px);
}
.icons svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.icons svg.st {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* toc */
.toc h2 {
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  margin-bottom: 12px;
}
.toc ol {
  list-style: none;
  padding: 0;
  display: grid;
}
.toc a {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-left: 2px solid var(--line);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: 0.25s;
}
.toc a span {
  font-size: 0.72rem;
  opacity: 0.6;
  align-self: center;
}
.toc a.on {
  color: var(--text);
  border-color: var(--gold);
  padding-left: 16px;
}
/* content */
.about p {
  color: var(--muted);
  margin-bottom: 14px;
  max-width: 70ch;
  font-size: 1.05rem;
}
.about p strong {
  color: var(--text);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}
.chips li {
  background: var(--card2);
  border-radius: 20px;
  padding: 3px 13px;
  font-size: 0.85rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.stat {
  background: var(--card2);
  border-radius: 16px;
  padding: 22px 16px;
  text-align: center;
}
.stat b {
  display: block;
  font:
    700 2.2rem Fraunces,
    serif;
  color: var(--gold);
}
.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.skills h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.proj {
  background: var(--card2);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s,
    box-shadow 0.3s;
  transform-style: preserve-3d;
}
.proj:hover {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.proj.big {
  grid-column: 1/-1;
  flex-direction: row;
}
.shot {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--card), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 10px;
  overflow: hidden;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s;
}
.proj:hover .shot img {
  transform: scale(1.06);
}
.big .shot {
  flex: 1.1;
  aspect-ratio: auto;
  min-height: 250px;
}
.pb {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pb h3 {
  font-size: 1.2rem;
}
.pb p {
  color: var(--muted);
  font-size: 0.94rem;
}
.links {
  margin-top: auto;
  display: flex;
  gap: 16px;
  font-weight: 600;
  font-size: 0.9rem;
}
.links a {
  color: var(--gold);
}
.tl {
  position: relative;
  border-left: 0;
  padding-left: 30px;
  display: grid;
  gap: 28px;
}
.tl::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--gold);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.6s ease;
}
.tl.in::before,
html:not(.js) .tl::before {
  transform: none;
}
.tl article {
  position: relative;
}
.tl article::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px var(--soft);
}
.tl time {
  display: inline-block;
  background: var(--card2);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.tl h3 {
  font-size: 1.15rem;
}
.tl .org {
  color: var(--gold);
  margin-bottom: 4px;
}
.tl .xp-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.tl .xp-link:hover {
  opacity: 0.8;
}
.tl p {
  color: var(--muted);
  max-width: 66ch;
}
.certs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.cert {
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  padding: 0;
  background: var(--card2);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s;
}
.cert:hover {
  transform: translateY(-5px);
}
.cert .shot {
  aspect-ratio: 4/3;
}
.cert .shot img {
  object-fit: contain;
  background: #fff;
}
.cert .b {
  padding: 14px 16px;
}
.cert h3 {
  font-size: 0.98rem;
}
.cert span {
  color: var(--muted);
  font-size: 0.84rem;
}
.cert .lk {
  display: inline-block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 600;
}
.more {
  margin-top: 24px;
}
.more .btn {
  display: inline-block;
  padding: 11px 26px;
}
.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.tabs button {
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 16px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}
.tabs button[aria-pressed="true"] {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  font-weight: 600;
}
.gal {
  columns: 3 230px;
  column-gap: 16px;
}
.gi {
  display: block;
  width: 100%;
  position: relative;
  break-inside: avoid;
  margin-bottom: 16px;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--card2);
  color: var(--text);
  font: inherit;
  text-align: left;
}
.gi img {
  width: 100%;
  display: block;
  transition: transform 0.7s;
}
.gi:hover img {
  transform: scale(1.07);
}
.gi .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #fff;
  font-size: 0.88rem;
  transform: translateY(60%);
  opacity: 0;
  transition: 0.4s;
}
.gi:hover .cap,
.gi:focus-visible .cap {
  transform: none;
  opacity: 1;
}
.gi .cap b {
  display: block;
  color: var(--gold);
}
.gi.txt {
  padding: 20px;
  cursor: default;
}
.gi.txt b {
  display: block;
  font:
    700 1.5rem Fraunces,
    serif;
  color: var(--gold);
  margin-bottom: 4px;
}
.contact .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.contact .row a {
  background: var(--card2);
  padding: 12px 22px;
  border-radius: 12px;
  text-decoration: none;
  transition: 0.25s;
}
.contact .row a:hover {
  color: var(--gold);
  transform: translateY(-3px);
}
dialog {
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  padding: 16px;
  max-width: min(92vw, 900px);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
}
dialog img {
  max-width: 100%;
  max-height: 78vh;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}
dialog p {
  margin: 10px 0;
  text-align: center;
}
dialog button {
  display: block;
  margin: 0 auto;
  background: var(--gold);
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  padding: 8px 24px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding-bottom: 30px;
}
.simple {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}
.simple .back {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
/* scroll animation, only when JS is on */
.js .rv {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.8s,
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0s);
}
.js .rv.in {
  opacity: 1;
  transform: none;
}
.js .rv.zoom {
  transform: scale(0.94);
}
.js .rv.zoom.in {
  transform: none;
}
.js .shot img.rvimg {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .in .shot img.rvimg,
.js .shot img.rvimg.in {
  clip-path: inset(0);
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}
@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
  }
  .panel {
    padding: 24px;
  }
  .proj.big {
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .ph::before {
    animation: none;
  }
  .js .rv,
  .js .rv.zoom {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .js .shot img.rvimg {
    clip-path: none;
  }
  .tl::before {
    transform: none;
    transition: none;
  }
}

/* ---- each section opens like a laptop lid, then a scan sweeps across ---- */
.js main > .panel.rv {
  opacity: 0;
  transform: perspective(1200px) rotateX(-62deg) translateY(30px);
  transform-origin: 50% 100%;
  transition:
    transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.6s;
}
.js main > .panel.rv.in {
  opacity: 1;
  transform: none;
}
/* hidden (not yet revealed) panels must not catch taps meant for content above them */
.js main > .panel.rv:not(.in) {
  pointer-events: none;
}
main > .panel {
  position: relative;
  overflow: hidden;
}
main > .panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s 0.6s;
  background:
    linear-gradient(var(--gold), var(--gold)) top left/18px 2px,
    linear-gradient(var(--gold), var(--gold)) top left/2px 18px,
    linear-gradient(var(--gold), var(--gold)) top right/18px 2px,
    linear-gradient(var(--gold), var(--gold)) top right/2px 18px,
    linear-gradient(var(--gold), var(--gold)) bottom left/18px 2px,
    linear-gradient(var(--gold), var(--gold)) bottom left/2px 18px,
    linear-gradient(var(--gold), var(--gold)) bottom right/18px 2px,
    linear-gradient(var(--gold), var(--gold)) bottom right/2px 18px;
  background-repeat: no-repeat;
}
main > .panel.in::before {
  opacity: 0.55;
}
main > .panel.in::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -100px;
  height: 100px;
  pointer-events: none;
  background: linear-gradient(
    transparent,
    rgba(240, 185, 77, 0.28) 70%,
    var(--gold)
  );
  opacity: 0;
  animation: scan 1.5s ease-out 0.55s 1 both;
}
@keyframes scan {
  0% {
    top: -100px;
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .boot {
    height: auto;
    padding: 40px 0;
  }
  .stage {
    position: static;
    height: auto;
  }
  .js main > .panel.rv {
    transform: none;
    opacity: 1;
    transition: none;
  }
  main > .panel.in::after {
    animation: none;
    display: none;
  }
}

/* ---- multi-page additions ---- */
.layout.two {
  grid-template-columns: 320px minmax(0, 1fr);
}
.pills {
  flex-wrap: wrap;
}
.pills a {
  padding: 6px 15px;
  font-size: 0.92rem;
}
.explore {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.ex {
  display: block;
  background: var(--card2);
  border-radius: 18px;
  padding: 24px 22px;
  text-decoration: none;
  transform-style: preserve-3d;
}
.ex b {
  display: block;
  font:
    700 1.35rem Fraunces,
    serif;
  color: var(--gold);
}
.ex span {
  color: var(--muted);
  font-size: 0.92rem;
}
.ex i {
  display: block;
  font-style: normal;
  margin-top: 14px;
  color: var(--gold);
  font-size: 1.3rem;
}
.shots {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 20px 18px;
  perspective: 900px;
}
.shots button {
  flex: none;
  height: 300px;
  border: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  transition:
    transform 0.35s,
    box-shadow 0.35s;
}
.shots button:hover {
  transform: translateY(-8px) rotateY(-8deg);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}
.shots img {
  height: 100%;
  width: auto;
  display: block;
}
.noshots {
  margin: 0 20px 20px;
  padding: 26px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.proj .pb {
  padding-bottom: 10px;
}
.js .rv.in.tilt {
  transition:
    transform 0.25s ease-out,
    box-shadow 0.3s;
  transition-delay: 0s;
}
.cert .shot {
  padding: 0;
  background: #fff;
}
.cert .b {
  min-height: 74px;
}

/* home: software explore, posters, sidebar achievements */
.ex .chips {
  margin-top: 12px;
}
.ex span {
  display: block;
}
.toc {
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc .ach-h {
  margin-top: 28px;
}
.ach {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
}
.ach li {
  background: var(--card2);
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  padding: 10px 12px;
}
.ach b {
  display: block;
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.ach span {
  color: var(--text);
}
/* wider right sidebar on the home page */
.layout:not(.two) {
  max-width: 1440px;
  grid-template-columns: 300px minmax(0, 1fr) 270px;
}
.toc h2 {
  font-size: 0.9rem;
}
.toc a {
  font-size: 1.02rem;
  padding: 8px 12px;
}
@media (max-width: 1200px) {
  .layout:not(.two) {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}
@media (max-width: 820px) {
  .layout:not(.two) {
    grid-template-columns: 1fr;
  }
}
/* compact versions of projects, certificates and gallery on the home page */
.projects.mini {
  grid-template-columns: 1fr;
  gap: 14px;
}
.mini .pb {
  padding: 16px 18px 8px;
  gap: 8px;
}
.mini .pb h3 {
  font-size: 1.08rem;
}
.mini .pb p {
  font-size: 0.9rem;
}
.mini .shots {
  padding: 4px 18px 14px;
  gap: 10px;
}
.mini .shots button {
  height: 130px;
  border-radius: 10px;
}
.mini .noshots {
  margin: 0 18px 16px;
  padding: 14px;
}
.certs.mini {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.certs.mini .b {
  padding: 10px 12px;
  min-height: 0;
}
.certs.mini h3 {
  font-size: 0.86rem;
}
.certs.mini span {
  font-size: 0.76rem;
}
.gal.mini {
  columns: 4 140px;
  column-gap: 12px;
}
.gal.mini .gi {
  margin-bottom: 12px;
}
.gal.mini .gi .cap {
  font-size: 0.78rem;
  padding: 24px 10px 8px;
}
#software .explore {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.psts {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.pst {
  flex: 1;
  max-width: 150px;
  border: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: zoom-in;
  transition: transform 0.3s;
}
.pst:hover {
  transform: translateY(-4px);
}
.pst img {
  display: block;
  width: 100%;
  height: auto;
}
.ex .go {
  display: inline-block;
  margin-top: 14px;
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}
.ex .go:hover {
  text-decoration: underline;
}
/* Early Innovations: small square grid, click to enlarge */
.inv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.it {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  background: var(--card2);
  cursor: zoom-in;
  font: inherit;
  color: var(--text);
  transition:
    box-shadow 0.35s,
    border-color 0.35s;
}
.it img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.6s;
}
.it::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s;
  pointer-events: none;
}
.it .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 8px 7px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.35s;
}
.it:hover,
.it:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 10px 26px var(--soft);
}
.js .it.rv.in {
  transition:
    transform 0.35s,
    box-shadow 0.35s,
    border-color 0.35s;
  animation: tile-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) backwards;
}
@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.85);
  }
}
.js .it.rv.in:hover,
.js .it.rv.in:focus-visible {
  transform: translateY(-5px);
}
.it:hover img,
.it:focus-visible img {
  transform: scale(1.12) rotate(1deg);
  filter: saturate(1.2);
}
.it:hover::after,
.it:focus-visible::after {
  transform: translateX(120%);
}
.it:hover .cap,
.it:focus-visible .cap {
  transform: none;
}
dialog[open] {
  animation: box-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
dialog[open]::backdrop {
  animation: fade-in 0.35s;
}
@keyframes box-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@media (hover: none) {
  .it .cap {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .it img,
  .it::after,
  .it .cap {
    transition: none;
  }
  .js .it.rv.in,
  dialog[open],
  dialog[open]::backdrop {
    animation: none;
  }
}
/* ---- responsive fixes for phones and tablets ---- */
html {
  overflow-x: hidden;
}
@supports (overflow-x: clip) {
  html,
  body {
    overflow-x: clip;
  }
}
img {
  max-width: 100%;
}
@media (max-width: 820px) {
  .layout.two {
    grid-template-columns: 1fr;
  }
  /* no 3D tilt on small screens: tall panels tilted in 3D project far past the
     screen and cover the content above them */
  .js main > .panel.rv {
    transform: translateY(30px);
  }
}
@media (max-width: 480px) {
  .layout,
  .simple {
    padding: 16px 16px 40px;
    gap: 16px;
  }
  .panel {
    padding: 20px 16px;
    border-radius: 18px;
    margin-bottom: 16px;
  }
  h2 {
    font-size: 1.45rem;
  }
  .inv {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
  }
  .psts {
    flex-wrap: wrap;
  }
}
/* Skills: each category in its own card */
.skills {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.skills > div {
  position: relative;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 20px;
  overflow: hidden;
  transition:
    transform 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
}
.skills > div::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.skills > div:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 12px 28px var(--soft);
}
.skills h3 {
  color: var(--gold);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.skills .chips li {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 4px 12px;
  transition:
    border-color 0.25s,
    color 0.25s;
}
.skills .chips li:hover {
  border-color: var(--gold);
  color: var(--gold);
}
@media (max-width: 480px) {
  .skills {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skills > div,
  .skills > div:hover {
    transition: none;
    transform: none;
  }
}
.skills > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
/* ---- Certificates: professional cards ---- */
.certs {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.cert {
  display: flex;
  flex-direction: column;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition:
    transform 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
}
.cert:hover,
.cert:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 14px 32px var(--soft);
}
.cert .shot {
  position: relative;
  aspect-ratio: 4/3;
  padding: 14px;
  background:
    radial-gradient(circle at 30% 20%, var(--soft), transparent 70%),
    var(--card);
  border-bottom: 1px solid var(--line);
}
.cert .mat {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  color: #555;
  font-size: 0.8rem;
}
.cert .mat img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  transition: transform 0.5s;
}
.cert:hover .mat img {
  transform: scale(1.04);
}
.cert .cat {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.cert .b {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 14px 16px 16px;
  min-height: 0;
}
.cert .iss {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cert .iss i {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.cert .iss span {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cert h3 {
  font-size: 1rem;
  line-height: 1.3;
}
.cert .meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}
.cert .meta time {
  color: var(--muted);
}
.cert .meta em {
  font-style: normal;
  font-weight: 600;
  color: var(--gold);
}
.cert .meta em::after {
  content: " →";
  display: inline-block;
  transition: transform 0.25s;
}
.cert:hover .meta em::after {
  transform: translateX(3px);
}
.cert .lk {
  margin-top: 0;
}
/* compact version on the home page */
.certs.mini {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.certs.mini .shot {
  padding: 10px;
}
.certs.mini .cat {
  top: 15px;
  left: 15px;
  font-size: 0.6rem;
  padding: 2px 7px;
}
.certs.mini .b {
  padding: 11px 12px 12px;
  gap: 6px;
}
.certs.mini .iss i {
  min-width: 26px;
  height: 26px;
  font-size: 0.6rem;
}
.certs.mini .iss span {
  font-size: 0.72rem;
}
.certs.mini h3 {
  font-size: 0.86rem;
}
.certs.mini .meta {
  font-size: 0.7rem;
  padding-top: 8px;
}
@media (max-width: 480px) {
  .certs,
  .certs.mini {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  .cert .meta em {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cert .mat img,
  .cert .meta em::after {
    transition: none;
  }
}
.certs.mini .cat {
  display: none;
}
@media (max-width: 480px) {
  .cert .cat {
    display: none;
  }
}
/* ---- Experience and education: two styled containers ---- */
.xp {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 18px;
}
.xp-box {
  position: relative;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 20px 22px;
  overflow: hidden;
}
.xp-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.xp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.xp-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--soft);
  border: 1px solid var(--gold);
}
.xp-ic svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.xp-head h3 {
  font-size: 1.25rem;
  color: var(--gold);
}
.xp-n {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}
.xp .tl {
  gap: 14px;
  padding-left: 26px;
}
.xp .tl article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  transition:
    border-color 0.3s,
    transform 0.3s,
    box-shadow 0.3s;
}
.xp .tl article:hover {
  border-color: var(--gold);
  transform: translateX(4px);
  box-shadow: 0 10px 24px var(--soft);
}
.xp .tl article::before {
  left: -33px;
  top: 20px;
  width: 12px;
  height: 12px;
}
.xp .tl time {
  background: var(--card2);
  border: 1px solid var(--line);
}
.xp .tl h3 {
  font-size: 1.02rem;
  margin: 4px 0 2px;
}
.xp .tl p {
  font-size: 0.92rem;
}
.xp .tl article.has-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}
.xp-txt {
  flex: 1;
  min-width: 0;
}
.xp-logo {
  order: 2;
  flex: none;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  background: #fff;
  border: 2px solid var(--gold);
  border-radius: 12px;
  overflow: hidden;
}
.xp-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.xp-logo-wide img {
  object-fit: contain;
  padding: 4px;
}
@media (max-width: 480px) {
  .xp-box {
    padding: 16px 14px 18px;
  }
  .xp-head h3 {
    font-size: 1.1rem;
  }
  .xp .tl {
    padding-left: 22px;
  }
  .xp .tl article::before {
    left: -29px;
  }
  .xp .tl article.has-logo {
    gap: 10px;
  }
  .xp-logo {
    width: 58px;
    height: 58px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .xp .tl article,
  .xp .tl article:hover {
    transition: none;
    transform: none;
  }
}

.dc-link {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
/* Skills: honest learning-stage note */
.skills-note {
  position: relative;
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.skills-note-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.skills-note-tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: skills-pulse 2s ease-in-out infinite;
}
.skills-note p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
@keyframes skills-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--soft); opacity: 1; }
  50% { box-shadow: 0 0 0 6px transparent; opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .skills-note-tag .dot { animation: none; }
}
