@font-face {
  font-family: "Caveat";
  /* Contains the current motto's characters. Regenerate when the motto changes. */
  src: url("assets/fonts/Caveat-Motto.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --cool: #e9f0f6;
  --warm: #f8eedf;
  --neutral: #eef0f1;
  --ink: #242a30;
  --secondary: #505b65;
  --card: #ffffffb3;
  --line: #26333e20;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body { margin: 0; color: var(--ink); font-family: var(--font); background: linear-gradient(90deg, var(--cool) 50%, var(--warm) 50%); -webkit-font-smoothing: antialiased; position: relative; isolation: isolate; }
h1, h2, p { margin: 0; }
a { color: inherit; text-underline-offset: 5px; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; border-radius: 2px; }
::selection { color: #172938; background: #c5d9e6; }
.wrap { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
.columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 96px; }
.artwork { border-bottom: 1px solid var(--line); }
.artwork img { display: block; width: 100%; height: auto; }
.profile-bar { position: sticky; top: 0; z-index: 10; background: linear-gradient(90deg,var(--cool) 50%,var(--warm) 50%); }
.profile-inner { min-height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.profile-inner > a { font-size: 15px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; width: fit-content; }
.profile-inner > a:hover { text-decoration: underline; }
.profile-inner > a:last-child { justify-self: end; }
.profile-inner h1 { font-size: 24px; font-weight: 500; letter-spacing: -.035em; line-height: 1.2; }
.variant-illustrated { --neutral: #fafafa; --cool: #e9f0f6; --warm: #f8eedf; --ink: #293035; --secondary: #475159; --card: #ffffffcc; background: var(--neutral); }
.variant-illustrated .profile-bar { background: var(--neutral); }
.variant-illustrated .links-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 44px; padding-block: 0; }
.variant-illustrated .links-inner h1 { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.035em; }
.variant-illustrated .profile-inner { display: block; min-height: 0; padding-block: 0 16px; }
.variant-illustrated .profile-inner h1 { font-size: 20px; font-weight: 600; }
.variant-illustrated .header-role { margin: 0; font: inherit; color: inherit; letter-spacing: inherit; }
.variant-illustrated .header-links { justify-self: end; align-self: start; flex-direction: row; align-items: center; gap: 24px; }
.variant-illustrated .header-portrait { align-self: center; }
.variant-illustrated .header-portrait .portrait { width: 60px; height: 60px; border: 0; }
.variant-illustrated .header-links a { font-size: 15px; line-height: 24px; min-height: 44px; }
.variant-illustrated .header-details { min-width: 0; text-align: left; margin-top: 0; }
.variant-illustrated .header-summary, .variant-illustrated .header-skills { font-weight: 500; line-height: 1.4; }
.variant-illustrated .header-summary { font-size: 16px; }
.variant-illustrated .header-skills { margin-top: 2px; font-size: 14px; line-height: 1.5; }
html:has(body.variant-illustrated) { scroll-padding-top: 68px; }
.variant-illustrated .page-content, .variant-minimal .page-content { background: linear-gradient(var(--neutral),transparent 190px),linear-gradient(90deg,var(--cool) 50%,var(--warm) 50%); display: flow-root; }
.variant-illustrated .page-content { background: linear-gradient(90deg,var(--cool) 50%,var(--warm) 50%); }
.variant-illustrated .motto { margin-top: 0; padding-top: 20px; align-items: baseline; }
.variant-illustrated .motto span:last-child { font-family: "Caveat", "Bradley Hand", cursive; font-size: 1.26em; font-weight: 600; font-style: normal; letter-spacing: -.035em; line-height: 1.1; }
.motto { width: min(1320px,calc(100% - 64px)); margin: 12px auto 0; display: grid; grid-template-columns: 1fr 1fr; font-size: clamp(32px,3.55vw,53px); line-height: 1.14; font-weight: 600; letter-spacing: -.05em; }
.motto span { white-space: nowrap; }
.motto span:first-child { text-align: right; padding-right: .12em; }
.motto span:last-child { text-align: left; padding-left: .12em; }
.about { padding-block: 36px 32px; column-gap: 28px; }
.about-card { padding: 30px 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.about p { font-size: 18px; line-height: 1.6; letter-spacing: -.012em; max-width: 48ch; }
ul { padding-left: 18px; margin: 18px 0 0; color: var(--secondary); font-size: 16px; line-height: 1.65; }
li { margin-top: 5px; padding-left: 2px; }
.projects { display: grid; gap: 28px; padding-bottom: 56px; }
.project { overflow: hidden; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.project-image { display: grid; place-items: center; height: 226px; background: #dce2e5; color: #59636a; font-size: 16px; }
.project:nth-child(2) .project-image { background: #e6e2da; }
.project-copy { padding: 25px 36px 30px; }
.project-intro { text-align: center; }
.project h2 { font-size: 29px; font-weight: 500; letter-spacing: -.035em; }
.project-intro p { margin-top: 8px; font-size: 17px; line-height: 1.5; color: var(--secondary); }
.contributions { margin-top: 20px; column-gap: 72px; }
.contributions ul { margin: 0; }
.portrait { width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center; object-fit: cover; background: #f5f5f2; border: 1px solid #26333e26; color: #697680; position: relative; font-size: 33px; font-weight: 400; letter-spacing: -.06em; }
.about-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.about-profile .portrait { width: 60px; height: 60px; flex: 0 0 60px; }
.product-profile { justify-content: flex-end; }
.about-profile h2 { font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.text-hero { text-align: center; }
.text-hero .motto { margin-top: 16px; }
.variant-portrait .profile-inner { min-height: 100px; }
.variant-portrait .profile-inner h1 { font-size: 34px; letter-spacing: -.04em; }
.hero-points { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; width: min(640px,calc(100% - 96px)); margin: 18px auto 28px; padding: 0; }
.hero-points li { padding: 0; margin: 0; }
.hero-points li:nth-child(odd) { text-align: right; }
.hero-points li:nth-child(even) { text-align: left; }
.variant-portrait .about { padding-top: 16px; }
.variant-minimal { --card: #ffffffed; background: var(--neutral); }
.variant-minimal .profile-bar { background: var(--neutral); }
.variant-minimal .page-content { position: relative; isolation: isolate; }
.variant-minimal .page-content::before, .variant-minimal .page-content::after { content: ""; position: absolute; z-index: -1; top: 50px; bottom: 0; width: 50%; pointer-events: none; background-size: 360px 380px; opacity: .15; mask-image: linear-gradient(transparent,#000 150px); }
.variant-minimal .page-content::before { left: 0; background-image: url("assets/pattern-tech.svg"); }
.variant-minimal .page-content::after { right: 0; background-image: url("assets/pattern-business.svg"); }
.variant-minimal .profile-inner {
  width: min(1280px,calc(100% - 96px));
  grid-template-columns: 40px minmax(0,1fr) auto;
  grid-template-areas: "photo identity links" ". summary summary" ". skills skills";
  padding-block: 16px 14px;
  gap: 6px 14px;
  align-items: center;
}
.header-portrait { grid-area: photo; align-self: center; }
.header-portrait .portrait { width: 48px; height: 48px; }
.header-identity { grid-area: identity; min-width: 0; }
.header-role { margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--secondary); }
.variant-minimal .header-portrait .portrait { width: 40px; height: 40px; }
.variant-minimal .profile-inner h1 { font-size: 20px; font-weight: 500; line-height: 1.3; }
.header-summary, .header-skills { font-size: 13px; color: var(--secondary); line-height: 1.6; min-width: 0; }
.header-summary { grid-area: summary; }
.header-skills { grid-area: skills; }
.header-links { grid-area: links; display: flex; align-items: center; gap: 24px; white-space: nowrap; }
.header-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; text-decoration: none; }
.header-links a:hover { text-decoration: underline; }
.variant-minimal .header-links a { font-size: 14px; }
html:has(body.variant-minimal) { scroll-padding-top: 170px; }
.variant-minimal .motto { margin-top: 0; padding-top: 32px; }
.variant-minimal .about { padding-top: 38px; }
@media (max-width:1100px) {
  .columns { column-gap: 64px; }
  .about { column-gap: 28px; }
  .project-copy { padding-inline: 28px; }
  .about p { font-size: 17px; }
}


/* Document order follows the mobile story: product, then engineering. */
.mobile-label { display: none; }
.technical-card { order: -1; }
@media (max-width: 767px) {
  .variant-illustrated .wrap { width: calc(100% - 32px); }
  .variant-illustrated .page-content { background: #fff; }
  .variant-illustrated .links-inner { gap: 12px; min-height: 52px; }
  .variant-illustrated .links-inner h1 { font-size: 18px; }
  .variant-illustrated .header-links { gap: 12px; }
  .variant-illustrated .header-links a { font-size: 13px; min-height: 44px; }
  .variant-illustrated .profile-inner { padding-bottom: 16px; }
  .variant-illustrated .header-summary { font-size: 16px; }
  .variant-illustrated .header-skills { font-size: 14px; line-height: 1.55; margin-top: 4px; max-width: 46ch; }
  .variant-illustrated .artwork { overflow: hidden; }
  .variant-illustrated .artwork img { width: 100%; height: auto; }
  .variant-illustrated .motto { width: calc(100% - 32px); display: flex; flex-direction: column; align-items: center; padding-top: 24px; font-size: clamp(28px, 7vw, 40px); gap: 1px; }
  .variant-illustrated .motto span { padding: 0; text-align: center; }
  .variant-illustrated .columns { display: flex; flex-direction: column; gap: 16px; }
  .variant-illustrated .technical-card { order: initial; }
  .variant-illustrated .about { padding-block: 24px; }
  .variant-illustrated .about-card { padding: 24px; border: 1px solid var(--line); }
  .variant-illustrated .product-card { background: var(--warm); }
  .variant-illustrated .technical-card { background: var(--cool); }
  .variant-illustrated .mobile-label { display: block; margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
  .variant-illustrated .about p { font-size: 16px; line-height: 1.6; }
  .variant-illustrated ul { font-size: 15px; line-height: 1.65; margin-top: 14px; }
  .variant-illustrated .projects { gap: 24px; padding-bottom: 32px; }
  .variant-illustrated .project-image { height: auto; aspect-ratio: 16 / 9; }
  .variant-illustrated .project-copy { padding: 0; }
  .variant-illustrated .project-intro { padding: 24px; text-align: left; }
  .variant-illustrated .project h2 { font-size: 26px; }
  .variant-illustrated .project-intro p { font-size: 16px; }
  .variant-illustrated .contributions { gap: 0; margin: 0; }
  .variant-illustrated .contribution { padding: 24px; }
  .variant-illustrated .contributions ul { margin: 0; }
}

/* Real case-study copy: shared problem, followed by two contributions. */
.project-problem { margin-top: 24px; }
.project-problem p { font-size: 16px; line-height: 1.65; color: var(--secondary); }
.project-problem h3, .contribution h3 { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.contributions { margin-top: 28px; }
.about li, .contribution li { margin-top: 12px; }
.about strong { font-weight: 600; color: var(--ink); }
@media (max-width:767px) {
 .variant-illustrated .project-problem { margin: 0; padding: 0 24px 24px; }
 .variant-illustrated .contributions { margin-top: 0; }
}

/* Explicit desktop placement; mobile keeps product-first document order. */
.about-title { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
@media (min-width:768px) {
 .about > .technical-card { grid-column: 1; grid-row: 1; }
 .about > .product-card { grid-column: 2; grid-row: 1; }
}
.about-card p, .about-card li, .project-copy p, .project-copy li {
 text-align: justify;
 text-align-last: left;
 hyphens: none;
 -webkit-hyphens: none;
}

/* About shares the project card structure and contribution columns. */
.about-description { margin-top: 20px; }
.about .about-description p { max-width: none; font-size: 16px; line-height: 1.65; }
.about-description p + p { margin-top: 16px; }
@media (max-width:767px) {
 .variant-illustrated .about-description { margin: 0; padding: 0 24px 24px; }
}

.about-unified .project-intro .about-credentials {
 font-size: 17px; font-weight: 400; line-height: 1.5;
 text-align: center; text-align-last: center;
}
@media (max-width:767px) {
 .about-unified .project-intro .about-credentials { font-size: 16px; }
}

/* Consistent card inset and full-width credentials. */
.variant-illustrated .project-copy { padding: 40px; }
.about-unified .project-intro .about-credentials { max-width: none; width: 100%; }
@media (max-width:767px) {
 .variant-illustrated .project-copy { padding: 0; }
 .variant-illustrated .project-intro, .variant-illustrated .contribution { padding: 28px; }
 .variant-illustrated .about-description, .variant-illustrated .project-problem { padding: 0 28px 28px; }
 .about-unified .project-intro .about-credentials { text-align: left; text-align-last: left; }
 .variant-illustrated .links-inner { flex-wrap: wrap; gap: 0; padding-top: 10px; }
 .variant-illustrated .links-inner h1 { width: 100%; }
 .variant-illustrated .links-inner nav { width: 100%; }
 .variant-illustrated .header-links { gap: 24px; }
 html:has(body.variant-illustrated) { scroll-padding-top: 90px; }
}

/* Compact single-line mobile identity and profile links. */
@media (max-width:767px) {
 .variant-illustrated .links-inner { flex-wrap: nowrap; gap: 10px; padding-top: 0; min-height: 48px; }
 .variant-illustrated .links-inner h1 { width: auto; flex-shrink: 0; font-size: 16px; }
 .variant-illustrated .links-inner nav { width: auto; }
 .variant-illustrated .header-links { gap: 10px; }
 .variant-illustrated .header-links a { font-size: 12px; }
 html:has(body.variant-illustrated) { scroll-padding-top: 64px; }
}
@media (max-width:359px) {
 .variant-illustrated .links-inner { gap: 8px; }
 .variant-illustrated .links-inner h1 { font-size: 14px; }
 .variant-illustrated .header-links { gap: 8px; }
}

/* Hero follows exactly the same responsive width as content cards. */
.variant-illustrated .artwork { margin-inline: auto; border-bottom: 0; }
.variant-illustrated .artwork img { max-width: 100%; }

/* Start the split at the rear edge of the desk: source image y643 / 724. */
.variant-illustrated .hero-art { position: relative; isolation: isolate; }
.variant-illustrated .hero-art::before { content: ""; position: absolute; z-index: -1; inset: 88.8121547% 0 0; background: linear-gradient(90deg,var(--cool) 50%,var(--warm) 50%); }
@media (max-width:767px) { .variant-illustrated .hero-art::before { background: #fff; } }

/* Soft transition around the rear desk edge, over the existing two colours. */
.variant-illustrated .hero-art::before { top: 89%; background: linear-gradient(to bottom,var(--neutral) 0%,transparent 92%),linear-gradient(90deg,var(--cool) 50%,var(--warm) 50%); }
@media (max-width:767px) { .variant-illustrated .hero-art::before { background: linear-gradient(to bottom,var(--neutral),#fff); } }

/* On-demand project videos: local poster first, player only after activation. */
.project-video { margin: 28px 0 32px; aspect-ratio:16/9; min-height:200px; border-radius:12px; overflow:hidden; background:#202529; position:relative; }
.video-poster { display:block; width:100%; height:100%; padding:0; border:0; cursor:pointer; background:none; position:relative; }
.video-poster img { display:block; width:100%; height:100%; object-fit:contain; }
.video-play { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); display:grid; place-items:center; padding-left:4px; width:72px; height:52px; border-radius:14px; background:rgba(20,24,28,.88); color:white; font:25px system-ui; box-shadow:0 2px 12px #0003; }
.video-poster:hover .video-play { background:#cf2424; }
.video-poster:focus-visible { outline:3px solid #3876bd; outline-offset:-4px; }
.project-video iframe { display:block; width:100%; height:100%; border:0; }
@media(max-width:767px) { .project-video { margin:22px 0 26px; border-radius:8px; } }

/* Shared card introduction style, including Sergey Belikov. */
.variant-illustrated .project .project-intro { text-align:center; }
.variant-illustrated .project .project-intro h2 { font-size:34px; }
.variant-illustrated .project .project-intro p { font-size:19px; font-weight:400; line-height:1.5; text-align:center; text-align-last:center; color:var(--ink); width:auto; max-width:820px; margin:12px auto 0; padding-inline:32px; }
/* Crop only the baked-in letterbox of the Grammarly poster; keep player intact. */
.project-video:has(.video-poster[data-video="WSaOCIkpwP4"]) { aspect-ratio:873/435; min-height:0; }
.video-poster[data-video="WSaOCIkpwP4"] img { position:absolute; width:100%; height:auto; top:50%; transform:translateY(-50%); }
@media(max-width:767px) {
 .variant-illustrated .project .project-intro h2 { font-size:30px; }
 .variant-illustrated .project .project-intro p { font-size:18px; padding-inline:8px; }
}

/* Full-bleed project media above the card introduction. */
.project > .project-video { margin:0; border-radius:0; }
.variant-illustrated .projects .project-intro { margin-bottom:28px; }
@media(max-width:767px) {
 .variant-illustrated .project .project-intro h2 { font-size:25px; }
 .variant-illustrated .project .project-intro p { font-size:16px; line-height:1.5; margin-top:10px; }
 .variant-illustrated .projects .project-intro { margin-bottom:0; }
}

.project > .project-video { width:100%; min-width:0; }

/* Inset video between the project name and summary at every breakpoint. */
.project-intro > .project-video { width:100%; min-width:0; margin:24px 0; border-radius:12px; }
@media(max-width:767px) {
 .project-intro > .project-video { margin:20px 0; border-radius:8px; }
}

/* Video follows the subtitle, within the padded introduction on all screens. */
.project-intro > .project-video { margin:24px 0 0; }
@media(max-width:767px) {
 .project-intro > .project-video { margin:20px 0 0; }
}

.video-poster[data-video="oF8w3RcJeMM"] { background:#fff; }

.portfolio-assistant { margin-bottom: 28px; padding: clamp(20px, 4vw, 40px); }
.portfolio-assistant h2 { margin-bottom: 8px; }
.portfolio-assistant h2, .portfolio-assistant h2 + p { text-align: center; }
.portfolio-assistant p { line-height: 1.5; color: var(--secondary); }
.portfolio-assistant .chat-notice { margin-top: 8px; font-size: 14px; }
.chat-questions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 14px 12px; }
.chat-questions button { max-width: 100%; min-height: 34px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--cool); font: inherit; font-size: 14px; line-height: 1.35; cursor: pointer; }
.chat-questions .product-question { background: var(--warm); }
@media (pointer: coarse) { .chat-questions button { min-height: 44px; } }
#portfolio-chat { display: block; width: 100%; max-width: 100%; }

.contact-footer { border-top: 1px solid var(--line); background: var(--neutral); }
.contact-footer address { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 28px; padding-block: 16px; font-style: normal; }
.contact-footer a { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding-block: 12px; line-height: 20px; font-size: 15px; overflow-wrap: anywhere; text-underline-offset: 3px; }
.contact-footer svg { flex: none; }
