/* =====================================================================
   Tokens — dark by default (like the original site), optional light
   ===================================================================== */
:root {
  --bg: #1c1c22;
  --card: #2a2a32;
  --card-2: #303039;
  --card-3: #36363f;
  --ink: #ededf2;
  --ink-2: #b9b9c4;
  --ink-3: #8b8b98;
  --line: #41414c;
  --accent: #ff9800;
  --accent-2: #ffb547;
  --accent-soft: rgba(255, 152, 0, 0.13);
  --on-accent: #1c1c22;
  --ok: #4ade80;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.75);
  --shadow-sm: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
  --blob-a: rgba(255, 152, 0, 0.09);
  --blob-b: rgba(99, 102, 241, 0.1);
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --menu-h: 64px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eceef3;
  --card: #ffffff;
  --card-2: #ffffff;
  --card-3: #f6f7fa;
  --ink: #1f1f27;
  --ink-2: #4f4f5b;
  --ink-3: #82828e;
  --line: #e2e3ea;
  --accent: #f08a00;
  --accent-2: #ffad33;
  --accent-soft: rgba(240, 138, 0, 0.12);
  --on-accent: #ffffff;
  --ok: #16a34a;
  --shadow: 0 30px 60px -32px rgba(30, 30, 50, 0.35);
  --shadow-sm: 0 10px 24px -16px rgba(30, 30, 50, 0.3);
  --blob-a: rgba(255, 152, 0, 0.12);
  --blob-b: rgba(99, 102, 241, 0.1);
  color-scheme: light;
}

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.7 var(--font); -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.i { width: 1em; height: 1em; fill: currentColor; flex: none; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  background: radial-gradient(closest-side, var(--blob-a), transparent);
  animation: float 26s ease-in-out infinite alternate;
}
.bg i:nth-child(1) { left: -12vmax; top: -14vmax; }
.bg i:nth-child(2) { right: -14vmax; top: 20vh; background: radial-gradient(closest-side, var(--blob-b), transparent); animation-delay: -9s; }
.bg i:nth-child(3) { left: 30vw; bottom: -24vmax; animation-delay: -17s; }
@keyframes float { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); } }

/* =====================================================================
   Desktop layout (≥ 1120px): menu | profile card | content card
   ===================================================================== */
.page { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; padding: 36px 24px 20px; }
.vcard {
  position: relative; width: min(1280px, 100%); height: min(720px, calc(100vh - 100px)); min-height: 600px;
  display: grid; grid-template-columns: 82px 470px minmax(0, 1fr);
}

/* menu: three separate floating blocks, like the original */
.menu {
  align-self: start; margin: 26px 12px 0 0; z-index: 3;
  display: flex; flex-direction: column; gap: 10px;
}
.menu-logo, .menu nav, .theme { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.menu-logo { display: grid; place-items: center; height: 70px; font-size: 1.25rem; color: var(--ink-2); transition: color 0.2s; }
.menu-logo:hover { color: var(--accent); }
.menu nav { display: flex; flex-direction: column; }
.menu nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 78px; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); position: relative; transition: color 0.2s, background-color 0.2s;
}
.menu nav a .i { font-size: 1.05rem; }
.menu nav a:hover { color: var(--ink); }
.menu nav a.is-active { color: var(--accent); background: var(--accent-soft); }
.menu nav a.is-active::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.theme { display: grid; place-items: center; height: 56px; color: var(--ink-3); font-size: 1rem; transition: color 0.2s; }
.theme:hover { color: var(--accent); }
.theme .moon { display: none; }
:root[data-theme="light"] .theme .moon { display: block; }
:root[data-theme="light"] .theme .sun { display: none; }

/* profile card */
.profile {
  position: relative; z-index: 2; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 22px; background: var(--card); box-shadow: var(--shadow);
}
.cover { position: relative; flex: 0 0 46%; min-height: 230px; overflow: hidden; background: #232a3d; }
.cover svg, .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .cv-caret { animation: blink 1.1s steps(1) infinite; }
/* light theme: same drawing, light palette */
:root[data-theme="light"] .cover { background: #f1ede8; }
:root[data-theme="light"] .cover .cv-s1 { stop-color: #f6f1eb; }
:root[data-theme="light"] .cover .cv-s2 { stop-color: #e9e8f2; }
:root[data-theme="light"] .cover .cv-g { stop-color: #6d6ff0; stop-opacity: 0.14; }
:root[data-theme="light"] .cover .cv-dot { fill: #2a2a3a; opacity: 0.08; }
:root[data-theme="light"] .cover .cv-win { opacity: 0.7; }
:root[data-theme="light"] .cover .cv-w-bg { fill: #ffffff; stroke: #dcdbe6; }
:root[data-theme="light"] .cover .cv-w-bar { fill: #f3f2f8; }
:root[data-theme="light"] .cover .cv-w-line { stroke: #dcdbe6; }
:root[data-theme="light"] .cover .cv-ln { fill: #d3d2de; }
:root[data-theme="light"] .cover .cv-m1 { fill: #d6d5e1; }
:root[data-theme="light"] .cover .cv-m2 { fill: #bdbccb; }
.cover::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -70px; height: 140px;
  background: var(--card); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.profile-body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 32px 20px; }
.avatar {
  position: relative; z-index: 1; width: 172px; height: 172px; margin-top: -108px; border-radius: 50%;
  padding: 6px; background: var(--card); box-shadow: 0 0 0 3px var(--accent), var(--shadow-sm);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 30%; background: var(--card-3); }
.name { margin-top: 20px; font-size: 2rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.role { min-height: 1.8em; margin-top: 6px; color: var(--accent); font-size: 1.05rem; font-weight: 500; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -0.15em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.socials a {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: var(--ink-2); font-size: 1rem; transition: color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}
.socials a:hover { color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.profile-actions { display: grid; grid-template-columns: 1fr; flex: none; border-top: 1px solid var(--line); }
.profile-actions a {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 72px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2);
  transition: color 0.2s, background-color 0.2s;
}
.profile-actions a + a { border-left: 1px solid var(--line); }
.profile-actions a .i { color: var(--accent); font-size: 0.95rem; transition: transform 0.25s var(--ease); }
.profile-actions a:hover { color: var(--ink); background: var(--accent-soft); }
.profile-actions a:hover .i { transform: translateY(-2px); }

/* content card */
.content {
  position: relative; margin: 26px 0; min-width: 0;
  background: var(--card-2); border-radius: 0 22px 22px 0; box-shadow: var(--shadow);
}
.tab { padding: 40px 44px 44px; }
.tab:focus { outline: none; }
.js .tab { display: none; }
.js .tab.is-active { display: block; }
.js .tab.is-active.anim { animation: tab-in 0.45s var(--ease); }
@keyframes tab-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@media (min-width: 1120px) {
  .js .tab { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
}
html:not(.js) .tab + .tab { border-top: 1px solid var(--line); }

.title { position: relative; display: inline-block; margin: 0 0 26px; font-size: 1.55rem; font-weight: 600; letter-spacing: -0.01em; }
.title::before {
  content: ""; position: absolute; left: -11px; top: 50%; width: 34px; height: 34px; margin-top: -17px;
  border-radius: 50%; background: var(--accent); opacity: 0.28; z-index: -1;
}
.title { isolation: isolate; }
.title span { color: var(--accent); }

/* about */
.about-text { display: grid; gap: 14px; color: var(--ink-2); max-width: 70ch; }
.info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.info li {
  display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px;
  border-radius: 14px; background: var(--card-3); border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.info li:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.info-ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 1rem; }
.info-txt { display: grid; min-width: 0; line-height: 1.4; }
.info-txt small { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.info-txt strong { font-size: 0.98rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.info .ok { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); }
.info .ok i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ok); animation: pulse-ok 2s infinite; }
@keyframes pulse-ok {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* resume */
.jump {
  /* opaque, edge-to-edge bar: content scrolling underneath must not show through */
  position: sticky; top: -40px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px;
  margin: -6px -44px 8px; padding: 12px 44px;
  background: var(--card-2); border-bottom: 1px solid var(--line);
}
.jump a {
  font-size: 0.78rem; font-weight: 500; padding: 6px 14px; border-radius: 99px;
  background: var(--card-3); border: 1px solid var(--line); color: var(--ink-2);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.jump a:hover, .jump a.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.r-block { padding-top: 26px; scroll-margin-top: 60px; }
.r-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 0.86rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.r-head .i { color: var(--accent); font-size: 1.1rem; }
.r-list { position: relative; display: grid; gap: 14px; padding-left: 26px; }
.r-list::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--line); }
.r-item {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px;
  padding: 18px 20px; border-radius: 16px; background: var(--card-3); border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.r-item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.r-item::before {
  content: ""; position: absolute; left: -26px; top: 22px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--card-2); border: 3px solid var(--accent);
}
.date { display: inline-block; font-size: 0.72rem; font-weight: 500; line-height: 1.6; padding: 1px 9px; border-radius: 6px; border: 1px solid var(--accent); color: var(--accent); }
.date.is-now { background: var(--accent); color: var(--on-accent); }
.r-title { margin-top: 10px; font-size: 1rem; font-weight: 600; }
.r-org { font-size: 0.82rem; color: var(--ink-3); }
.r-org a { color: var(--accent); font-weight: 500; }
.r-title a { transition: color 0.2s; }
.r-title a:hover { color: var(--accent); }
.r-org a:hover { text-decoration: underline; text-underline-offset: 3px; }
.r-org .sep { margin: 0 6px; }
.r-text { margin-top: 10px; font-size: 0.9rem; color: var(--ink-2); }
.r-text > p + p { margin-top: 8px; }
.r-text h5 { margin: 14px 0 6px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.r-logo { width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; overflow: hidden; }
.r-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.js .r-item.is-clamped:not(.is-open) .r-text {
  max-height: 12.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.js .chips:not(.is-expanded) .extra { display: none; }
.chips li.chip-more { padding: 0; border: 0; background: none; }
html:not(.js) .chip-more { display: none; }
.chip-more button {
  font-size: 0.74rem; font-weight: 600; line-height: 1; padding: 6px 10px; border-radius: 7px;
  color: var(--accent); background: var(--accent-soft); border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  transition: background-color 0.2s, color 0.2s;
}
.chip-more button:hover { background: var(--accent); color: var(--on-accent); }
.more { display: none; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.js .more { display: inline-flex; }
.more .i { font-size: 0.7em; transition: transform 0.25s var(--ease); }
.r-item.is-open .more .i { transform: rotate(180deg); }

.bullets li { position: relative; margin: 5px 0; padding-left: 16px; line-height: 1.6; }
.bullets li::before { content: ""; position: absolute; left: 1px; top: 0.66em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 0.74rem; line-height: 1; padding: 6px 10px; border-radius: 7px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2); }
.links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
.links a { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 500; color: var(--accent); }
.links a .i { font-size: 0.7em; }
.links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* skills */
.bars { display: grid; gap: 16px; margin-bottom: 30px; }
.bar-top { display: flex; justify-content: space-between; gap: 16px; font-size: 0.86rem; font-weight: 500; margin-bottom: 7px; }
.bar-top em { font-style: normal; color: var(--ink-3); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; }
.js .bars:not(.is-visible) .bar i { transform: scaleX(0); }
.js .bar i { transition: transform 1.1s var(--ease); }
.skill-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
.rings li { position: relative; display: grid; justify-items: center; gap: 6px; }
.rings svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.rings circle { fill: none; stroke-width: 6; }
.rings .track { stroke: var(--line); }
.rings .value {
  stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 213.63;
  stroke-dashoffset: calc(213.63 - 213.63 * var(--p) / 100); transition: stroke-dashoffset 1.2s var(--ease);
}
.js .rings:not(.is-visible) .value { stroke-dashoffset: 213.63; }
.rings strong { position: absolute; top: 48px; left: 50%; transform: translate(-50%, -50%); font-size: 0.95rem; font-weight: 600; }
.rings span { font-size: 0.85rem; color: var(--ink-2); }
.dots { display: grid; gap: 18px; }
.dots li > span:first-child { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 8px; }
.dot-row { display: flex; gap: 8px; }
.dot-row i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); transition: background-color 0.3s; }
.dot-row i.on { background: var(--accent); }

/* links tab */
.link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.link-card {
  display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px;
  background: var(--card-3); border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.link-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.link-ico { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.35rem; }
.link-text { display: grid; min-width: 0; }
.link-text strong { font-weight: 600; }
.link-text small { font-size: 0.8rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-go { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); transition: color 0.2s; }
.link-go .i { font-size: 0.85em; }
.link-card:hover .link-go { color: var(--accent); }
.link-sep { display: flex; align-items: center; gap: 16px; margin: 34px 0 20px; color: var(--ink-3); }
.title + .link-sep { margin-top: 0; }
.link-sep::before, .link-sep::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.link-sep span { display: inline-flex; align-items: center; gap: 10px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.link-sep .i { color: var(--accent); font-size: 1rem; }

/* contact */
.contact-info { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.contact-info li { flex: 1 1 auto; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--card-3); border: 1px solid var(--line); min-width: 0; }
.contact-info small { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.contact-info li > span:last-child { min-width: 0; overflow-wrap: break-word; font-weight: 500; }
.contact-info a:hover { color: var(--accent); }
.ci-ico { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.form { display: grid; gap: 14px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 0.8rem; font-weight: 500; color: var(--ink-2); }
.form input, .form textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-3); color: var(--ink); font: inherit; font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form textarea { resize: vertical; min-height: 150px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form .is-invalid input, .form .is-invalid textarea { border-color: #f05252; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 24px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 0.9rem;
  transition: background-color 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.form-status { font-size: 0.88rem; font-weight: 500; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: #f05252; }
/* locked after sending: only the confirmation card is shown, the fields and button go away */
.form.is-locked > :not(.form-lock) { display: none; }
/* sent: a confirmation card on top of the (locked) form, with a live countdown */
.form-lock {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px;
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 60%), var(--card-3);
  animation: lock-in 0.5s var(--ease);
}
.form-lock[hidden] { display: none; }
@keyframes lock-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.fl-ico {
  position: relative; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--on-accent);
  box-shadow: 0 10px 24px -10px var(--accent);
}
.fl-ico .i { font-size: 1.2rem; animation: fly 2.8s var(--ease) infinite; }
@keyframes fly { 0%, 60%, 100% { transform: none; } 30% { transform: translate(3px, -3px); } }
.fl-body strong { display: block; font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.fl-body p { margin: 4px 0 0; font-size: 0.85rem; color: var(--ink-2); line-height: 1.55; }
.fl-time { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fl-time span {
  display: grid; justify-items: center; padding: 9px 6px 8px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.fl-time b { font-size: 1.3rem; font-weight: 600; line-height: 1.15; color: var(--accent); font-variant-numeric: tabular-nums; }
.fl-time i { font-style: normal; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.form .lbl { display: flex; justify-content: space-between; gap: 10px; }
.form .lbl small { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.form .lbl small.is-full { color: var(--accent); }
/* "message sent" toast: drops in, draws its check, and a bar runs down until it closes */
.toast {
  position: fixed; left: 50%; top: 24px; z-index: 100; width: min(420px, calc(100% - 32px)); overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 16px 12px 18px 16px; border-radius: 18px; color: var(--ink);
  background: var(--card-2); border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line));
  box-shadow: 0 28px 60px -24px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -24px) scale(0.96); opacity: 0;
  transition: opacity 0.35s var(--ease), transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.toast[hidden] { display: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast-ico {
  position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ok) 16%, transparent);
}
.toast-ico::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; }
.toast.is-on .toast-ico::after { animation: ring-out 0.9s 0.25s ease-out; }
@keyframes ring-out { from { opacity: 0.6; transform: scale(0.85); } to { opacity: 0; transform: scale(1.5); } }
.toast-ico svg { width: 26px; height: 26px; fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.toast-ico path { stroke-dasharray: 18; stroke-dashoffset: 18; }
.toast.is-on .toast-ico path { animation: tick 0.45s 0.2s var(--ease) forwards; }
@keyframes tick { to { stroke-dashoffset: 0; } }
.toast-txt { display: grid; gap: 2px; min-width: 0; }
.toast-txt strong { font-size: 0.98rem; font-weight: 600; line-height: 1.3; }
.toast-txt small { font-size: 0.82rem; color: var(--ink-2); line-height: 1.45; overflow-wrap: break-word; }
.toast-x { width: 32px; height: 32px; align-self: start; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); transition: color 0.2s, background-color 0.2s; }
.toast-x:hover { color: var(--ink); background: var(--card-3); }
.toast-x .i { font-size: 0.85rem; }
.toast-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; transform-origin: left;
  background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 50%, var(--accent)));
}
.toast.is-on .toast-bar { animation: toast-time 5s linear forwards; }
.toast:hover .toast-bar { animation-play-state: paused; }
@keyframes toast-time { to { transform: scaleX(0); } }

.foot { font-size: 0.8rem; color: var(--ink-3); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .toast-ico path { stroke-dashoffset: 0; }
  .js .bars:not(.is-visible) .bar i { transform: none; }
  .js .rings:not(.is-visible) .value { stroke-dashoffset: calc(213.63 - 213.63 * var(--p) / 100); }
}

/* =====================================================================
   Compact header (tablets & phones only)
   ===================================================================== */
.mhead { display: none; }

/* =====================================================================
   Below 1120px — like the original site: fixed header + tab bar,
   profile card on top and all sections stacked as one scrolling page
   ===================================================================== */
@media (max-width: 1119px) {
  :root { --mhead-h: 64px; --tabs-h: 62px; }
  body { padding-top: calc(var(--mhead-h) + var(--tabs-h)); }
  .js body:not(.tabs-open) { padding-top: var(--mhead-h); }

  .mhead {
    position: fixed; top: 0; left: 0; right: 0; z-index: 41; height: var(--mhead-h);
    display: flex; align-items: center; gap: 6px; padding: 0 10px 0 16px;
    background: var(--card-2); border-bottom: 1px solid var(--line);
  }
  .mhead-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
  .mhead-who img { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; object-position: 50% 30%; box-shadow: 0 0 0 2px var(--accent); }
  .mhead-who span { display: grid; min-width: 0; line-height: 1.35; }
  .mhead-who strong { font-size: 0.95rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mhead-who em { font-style: normal; font-size: 0.75rem; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.35em; }
  .mhead-btn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); font-size: 1.15rem; transition: color 0.2s, background-color 0.2s; }
  .mhead-btn:hover { color: var(--accent); background: var(--accent-soft); }
  .mhead .theme { height: 42px; font-size: 1rem; background: none; box-shadow: none; }

  /* normal (not centred) alignment: newer browsers also apply place-items to block layout */
  .page { display: block; place-items: normal; align-content: normal; min-height: 0; padding: 0 0 28px; }
  .vcard { display: block; width: min(600px, 100%); height: auto; min-height: 0; margin: 0 auto; padding-top: 16px; }

  /* tab bar */
  .menu {
    position: fixed; top: var(--mhead-h); left: 0; right: 0; z-index: 40; height: var(--tabs-h);
    margin: 0; gap: 0; flex-direction: row; justify-content: center;
    background: var(--card-2); border-bottom: 1px solid var(--line);
    transition: transform 0.25s var(--ease), visibility 0.25s;
  }
  .js body:not(.tabs-open) .menu { transform: translateY(-100%); visibility: hidden; }
  .menu-logo, .menu-theme { display: none; }
  .menu nav { flex: 1; max-width: 760px; flex-direction: row; background: none; box-shadow: none; border-radius: 0; }
  .menu nav a { flex: 1; height: var(--tabs-h); gap: 5px; font-size: 0.68rem; border-right: 1px solid var(--line); }
  .menu nav a:last-child { border-right: 0; }
  .menu nav a.is-active { background: none; }
  .menu nav a.is-active::before { left: 22%; right: 22%; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }

  /* profile card: big, nearly a full screen, like the original */
  .profile { position: relative; border-radius: 10px; min-height: min(660px, calc(100svh - var(--mhead-h) - var(--tabs-h) - 32px)); }
  .cover { flex: 0 0 44%; min-height: 230px; }

  /* every section is visible, one after another */
  .content { margin: 0; background: none; box-shadow: none; border-radius: 0; }
  .js .tab, .tab {
    display: block; position: static; overflow: visible; animation: none;
    margin-top: 15px; padding: 32px 30px 34px; border-radius: 10px;
    background: var(--card-2); box-shadow: var(--shadow);
    scroll-margin-top: calc(var(--mhead-h) + var(--tabs-h) + 10px);
  }
  html:not(.js) .tab + .tab { border-top: 0; }
  .jump { top: calc(var(--mhead-h) + var(--tabs-h)); margin: -6px -30px 8px; padding: 10px 30px; }
  .js body:not(.tabs-open) .jump { top: var(--mhead-h); }
  /* pinned under the header: stretch the bar to the screen edges like the header above it */
  /* shadows (not pseudo-elements) so nothing widens the page; the second one draws the bottom line */
  .jump.is-pinned { box-shadow: 0 0 0 100vmax var(--card-2), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax -1px); }
  .r-block { scroll-margin-top: calc(var(--mhead-h) + var(--tabs-h) + 64px); }
  .js body:not(.tabs-open) .tab { scroll-margin-top: calc(var(--mhead-h) + 10px); }
  .js body:not(.tabs-open) .r-block { scroll-margin-top: calc(var(--mhead-h) + 64px); }
  .foot { margin-top: 22px; }
  .toast { top: calc(var(--mhead-h) + var(--tabs-h) + 12px); }
  .js body:not(.tabs-open) .toast { top: calc(var(--mhead-h) + 12px); }
}

/* phones: edge-to-edge cards, as on the original */
@media (max-width: 640px) {
  :root { --mhead-h: 60px; --tabs-h: 58px; }
  body { font-size: 14.5px; }
  .vcard { width: 100%; padding-top: 0; }
  .profile, .js .tab, .tab { border-radius: 0; }
  .menu nav a { font-size: 0.62rem; letter-spacing: 0.06em; gap: 4px; }
  .menu nav a .i { font-size: 1rem; }
  .cover { flex-basis: 42%; min-height: 200px; }
  .avatar { width: 156px; height: 156px; margin-top: -100px; }
  .name { font-size: 1.95rem; margin-top: 16px; padding: 0 8px; }
  .role { font-size: 1rem; }
  .socials { gap: 2px; flex-wrap: nowrap; }
  .socials a { width: 34px; height: 34px; font-size: 0.95rem; }
  .profile-actions a { height: 64px; font-size: 0.74rem; gap: 8px; }
  .js .tab, .tab { padding: 28px 20px 30px; }
  .title { font-size: 1.35rem; margin-bottom: 20px; }
  .info { grid-template-columns: 1fr; gap: 10px; }
  .info li { padding: 12px 14px; }
  .r-list { padding-left: 20px; }
  .r-list::before { left: 3px; }
  .r-item { grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 0; padding: 16px; }
  .r-item::before { left: -22px; width: 12px; height: 12px; }
  .r-main { display: contents; }
  .r-main > * { grid-column: 1 / -1; }
  .r-main > .r-top { grid-column: 2; grid-row: 1; align-self: center; }
  .r-top .r-title { margin-top: 6px; }
  .r-logo { grid-column: 1; grid-row: 1; align-self: center; width: 56px; height: 56px; border-radius: 13px; }
  .skill-pair, .link-grid, .form .row { grid-template-columns: 1fr; }
  .rings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn { width: 100%; justify-content: center; }
  .jump { gap: 5px; margin: -6px -20px 8px; padding: 10px 20px; }
  .jump a { padding: 5px 11px; font-size: 0.74rem; }
  .page { padding-bottom: 0; }
  .foot {
    position: relative; z-index: 1; /* above the last card's shadow, so the two read as one surface */
    margin-top: 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
    background: var(--card-2); border-top: 1px solid var(--line);
  }
}

/* =====================================================================
   Desktop scale-up: the card fills most of the screen
   ===================================================================== */
@media (min-width: 1120px) {
  body { font-size: 15.75px; }
  .page { padding: 28px 24px 16px; gap: 12px; }
  .vcard {
    width: min(1440px, 100%);
    height: min(770px, calc(100vh - 100px)); min-height: 610px;
    grid-template-columns: 88px clamp(430px, 36vw, 540px) minmax(0, 1fr);
  }
  .menu { margin: 28px 12px 0 0; gap: 10px; }
  .menu nav a { height: 84px; gap: 7px; font-size: 0.7rem; }
  .menu nav a .i { font-size: 1.18rem; }
  .theme { height: 58px; font-size: 1.05rem; }

  .avatar { width: 188px; height: 188px; margin-top: -118px; padding: 6px; }
  .name { margin-top: 22px; font-size: 2.2rem; }
  .role { font-size: 1.12rem; margin-top: 6px; }
  .socials { gap: 6px; margin-top: 20px; }
  .socials a { width: 42px; height: 42px; border-radius: 12px; font-size: 1.08rem; }
  .profile-actions a { height: 78px; font-size: 0.82rem; gap: 11px; }
  .profile-actions a .i { font-size: 1rem; }

  .content { margin: 12px 0; }
  /* short tabs (About, Links, Contact) sit in the middle of the card; long ones start at the top */
  .js .tab.is-active { display: flex; flex-direction: column; justify-content: safe center; }
  .js .tab.is-active > .title { align-self: flex-start; }
  .js .tab, .tab { padding: 46px 52px 50px; }
  .title { font-size: 1.8rem; margin-bottom: 28px; }
  .title::before { width: 38px; height: 38px; margin-top: -19px; left: -12px; }
  .about-text { font-size: 1.02rem; gap: 16px; max-width: 74ch; }
  .info { gap: 14px; margin-top: 34px; }
  .info li { padding: 16px 18px; }
  .info-txt strong { font-size: 1.02rem; }

  .jump { top: -46px; margin: -6px -52px 10px; padding: 14px 52px; }
  .jump a { font-size: 0.8rem; padding: 6px 15px; }
  .content { overflow: hidden; }
  .r-block { scroll-margin-top: 72px; }
  .r-head { font-size: 0.9rem; }
  .r-head .i { font-size: 1.15rem; }
  .r-item { padding: 20px 22px; gap: 20px; }
  .r-title { font-size: 1.06rem; }
  .r-org { font-size: 0.86rem; }
  .r-text { font-size: 0.93rem; }
  .r-logo { width: 78px; height: 78px; border-radius: 17px; }
  .chips li { font-size: 0.77rem; }
  .bar-top { font-size: 0.9rem; }
  .rings svg { width: 104px; height: 104px; }
  .rings strong { top: 52px; font-size: 1rem; }

  .link-card { padding: 20px; gap: 16px; }
  .link-ico { width: 56px; height: 56px; font-size: 1.45rem; }
  .link-text strong { font-size: 1.03rem; }
  .contact-info li { padding: 18px; }
  .form input, .form textarea { padding: 13px 15px; }
  .btn { height: 50px; padding: 0 26px; font-size: 0.94rem; }
}
