/* ==========================================================================
   Matthew Bernier : personal site
   Recreation of the original matthewb.work layout, animations and feel,
   rebuilt as a dependency-light static single page app.
   ========================================================================== */

:root {
  --accent: #1851f1;
  --accent-2: #2c00ff;
  --ink: #323232;
  --text: #605561;
  --muted: rgba(28, 38, 43, .35);
  --line: #ededed;
  --dark: #0a0a0a;
  --font: 'Jost', sans-serif;
  --font-display: 'Anton', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.66;
  color: var(--text);
  -webkit-text-size-adjust: none;
  background: #000;
}

img { max-width: 100%; height: auto; border: 0; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-family: var(--font); }
h1 { font-size: calc(20px + 2.6vw); margin: .8em 0 .4em; line-height: 1.2; font-weight: 500; }
h2 { font-size: calc(16px + 1.44vw); margin: 1em 0 .6em; line-height: 1.3; font-weight: 400; }
h3 { font-size: calc(15px + .3vw); margin: 1em 0 .6em; font-weight: 500; }
h4 { font-size: 15px; margin: 1em 0 .5em; font-weight: 500; }
p { margin: 0 0 1em; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   One page layout shell
   -------------------------------------------------------------------------- */
html.one-page-layout { overflow: hidden; }
.one-page-layout body { overflow: hidden; width: 100%; height: 100vh; height: 100dvh; }

/* initial black loader (white pulse) before the intro plays */
html:not(.home-loaded)::before {
  content: ""; position: fixed; z-index: 2000; top: 50%; left: 50%;
  width: 48px; height: 48px; background: #fff; border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

.home-wrap {
  display: flex; width: 100%; height: 100vh; height: 100dvh;
  position: relative; z-index: 100; align-items: center; overflow: hidden;
}

.home-bg {
  position: absolute; top: 0; left: 0; width: 125%; height: 100%;
  background-size: cover; background-position: center top; opacity: 0;
  will-change: transform, opacity;
}
.home-bg::after {
  content: ""; position: absolute; inset: 0; background: #000; opacity: .1;
}

/* --- menu --- */
.home-menu { position: absolute; z-index: 10; user-select: none; font-family: var(--font-display); }
.home-menu a {
  line-height: 1; position: relative; outline: none; display: flex;
  flex-direction: column; align-items: flex-start; margin: 1.8vh 0; overflow: hidden;
}
.home-menu .item-name {
  position: relative; display: inline-block; font-size: calc(.8rem + 4vmin);
  font-weight: 400; overflow: hidden; padding: 0 5px 0 32px; text-transform: uppercase;
  color: #fff; transform: translateY(100%);
  transition: transform 1.2s cubic-bezier(.23, 1, .32, 1);
  text-shadow: 0 0 20px rgba(0, 0, 0, .27);
}
.home-loaded .home-menu .item-name { transform: translateY(0%); }
.home-loaded .home-menu a:nth-child(1) .item-name { transition-delay: 1s; }
.home-loaded .home-menu a:nth-child(2) .item-name { transition-delay: 1.3s; }
.home-loaded .home-menu a:nth-child(3) .item-name { transition-delay: 1.6s; }
.home-loaded .home-menu a:nth-child(4) .item-name { transition-delay: 1.9s; }
.home-loaded .home-menu a:nth-child(5) .item-name { transition-delay: 2.2s; }
.home-skip-intro .home-menu .item-name { transition-delay: 0s !important; transition-duration: .01s; }
.home-menu .item-name::before,
.home-menu .item-name::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; background: var(--accent);
  transform: translate3d(-100%, 0, 0) translate3d(-1px, 0, 0);
  transition: transform .7s cubic-bezier(.7, 0, .3, 1);
}
.home-menu .item-name::after { top: calc(50% - 2px); height: .14em; }
.home-menu a:hover .item-name::before,
.home-menu a:focus-visible .item-name::before { transform: translate3d(100%, 0, 0) translate3d(1px, 0, 0); }
.home-menu a:hover .item-name::after,
.home-menu a:focus-visible .item-name::after { transform: translate3d(0, 0, 0); }

/* --- heading / logo --- */
.home-heading {
  z-index: 3; text-align: center; margin: 0 auto; width: 100%;
  color: #111; user-select: none; transform: translateY(-100vh);
}
.home-logo {
  display: inline-block; background-color: #fff; white-space: nowrap; font-size: 0;
  margin: 0 auto; font-weight: 500; box-shadow: 0 0 16px rgba(0, 0, 0, .2); position: relative;
  text-align: left;
}
.home-logo i {
  font-style: normal; font-size: 4.4vmin; display: inline-block; vertical-align: middle;
  font-family: var(--font); font-weight: 500;
}
.home-logo i span { display: inline-block; }
.home-logo-left { padding-left: 40px; overflow: hidden; }
.home-logo-right { padding-right: 40px; overflow: hidden; }
.home-logo-center {
  font-size: 0; line-height: 0; padding: calc(2px + 1.2vw); position: relative; background-color: #fff;
}
.home-icon { position: relative; display: block; width: 3.6vmax; }
.home-icon img { display: block; width: 100%; user-select: none; max-height: 100%; }
.home-text-container {
  position: absolute; left: 100%; top: 0; display: inline-block; vertical-align: middle;
  background-color: var(--dark); height: 100%; overflow: hidden;
  transform: scaleX(0); transform-origin: left;
}
.home-text-container-placeholder {
  opacity: 0; visibility: hidden; position: relative; margin: 0; display: block;
}
.home-text {
  position: absolute; top: 0; left: 100%; margin: 0; color: #fff;
  transform: translateX(100%); opacity: 0;
}
.home-text, .home-text-container-placeholder {
  font-size: calc(6px + 2.6vw); padding: 1.86vmax 4vmin; line-height: 1; white-space: nowrap;
  font-style: normal;
}
.home-marquee {
  margin: 0 auto; overflow: hidden; white-space: nowrap; box-sizing: border-box;
  height: 25px; width: 360px;
  font-size: calc(12px + .14vw); font-weight: 400; position: absolute; top: 106%; left: 0;
  color: #fff; text-shadow: 0 0 8px rgba(0, 0, 0, .44); opacity: 0;
}
/* transform-based scroll: runs on the compositor, so it never stutters while the intro animates */
.home-marquee > span {
  display: inline-block; padding-left: 100%; will-change: transform;
  animation: marquee 34s linear infinite; backface-visibility: hidden;
}
.home-job-title {
  margin: 0; white-space: normal; font-size: calc(10px + .14vw); font-weight: 700;
  position: absolute; bottom: 106%; left: 0; color: #fff; text-align: right; text-transform: uppercase;
  letter-spacing: 2px; text-shadow: 0 0 8px rgba(0, 0, 0, .44); opacity: 0; line-height: 1.5;
}

/* --- social, footer --- */
.home-social {
  position: fixed; bottom: 0; left: 0; margin: 0; display: flex; overflow: hidden; z-index: 20;
  transform: translateY(100%); transition: transform 2.2s cubic-bezier(.23, 1, .32, 1);
}
.home-loaded .home-social { transform: translateY(0%); transition-delay: 2s; }
.home-skip-intro .home-social { transition-delay: 0s; }
.home-social a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: calc(10px + 2vmin); line-height: 1; background: #000; color: #fff; transition: background .5s;
}
.home-social a:hover { background: var(--accent); }
.home-social svg { width: 15px; height: 15px; fill: currentColor; display: block; }

.home-footer {
  position: fixed; bottom: 0; right: 0; color: rgba(255, 255, 255, .25); margin: 0;
  padding: 8px 18px; font-size: calc(10px + .2vw); opacity: 0; z-index: 20;
}

/* --- fullscreen toggle --- */
.full-screen-wrap {
  width: 30px; height: 30px; cursor: pointer; position: fixed; top: 24px; right: 24px; z-index: 50;
  transform: scale(.5); transition: all .3s; opacity: .4; background: none; border: 0; padding: 0;
}
.full-screen-wrap:hover { opacity: .7; }
.full-screen-wrap.active { opacity: 1; transform: scale(.66); }
.full-screen-wrap span { width: 2px; height: 11px; background: #fff; position: absolute; }
.full-screen-wrap .h { width: 11px; height: 2px; }
.full-screen-wrap .tl { top: 0; left: 0; }
.full-screen-wrap .tr { top: 0; right: 0; }
.full-screen-wrap .bl { bottom: 0; left: 0; }
.full-screen-wrap .br { bottom: 0; right: 0; }

/* --------------------------------------------------------------------------
   Music player (persistent on every page)
   -------------------------------------------------------------------------- */
.play-music {
  display: flex; align-items: center; position: fixed; z-index: 1200;
  bottom: calc(30px + 7vh); left: 34px; opacity: 0; transition: opacity 1.5s, background .4s, padding .4s, box-shadow .4s;
  cursor: pointer; background: transparent; border: 0; padding: 6px 0; color: #fff;
  font-family: var(--font); border-radius: 30px; -webkit-tap-highlight-color: transparent;
}
.home-loaded .play-music { opacity: 1; }
@media (min-width: 992px) { .play-music { top: 34px; bottom: auto; } }
/* readable pill when a white page is on top */
html.is-ajax-page-visible .play-music,
html.p-overlay-on .play-music {
  background: #111; padding: 9px 16px 9px 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
@media (min-width: 992px) {
  html.is-ajax-page-visible .play-music,
  html.p-overlay-on .play-music { top: 12px; left: 16px; }
}
@media (max-width: 991px) {
  html.is-ajax-page-visible .play-music,
  html.p-overlay-on .play-music { bottom: 14px; left: 14px; }
}
.music-animation {
  display: flex; margin-right: 10px; align-items: center; height: 16px; position: relative;
}
.music-bar {
  width: 2px; background-color: #fff; height: 3px; display: block; margin: 0 1px; border-radius: 1px;
  transition: height .3s;
}
/* muted: gentle low wave + dimmed, inviting a tap */
.music-animation.muted .music-bar { opacity: .55; animation: bar-soft 1.6s ease-in-out infinite; }
.music-animation.on .music-bar { opacity: 1; animation: bar 1.2s ease-in-out infinite; }
.music-animation .bar2 { animation-delay: .1s !important; }
.music-animation .bar3 { animation-delay: .2s !important; }
.music-animation .bar4 { animation-delay: .3s !important; }
.music-animation .bar5 { animation-delay: .4s !important; }
.music-animation.paused .music-bar { animation: none; height: 2px; opacity: .5; }
.music-animation .mute-slash {
  position: absolute; left: -2px; right: -2px; top: 50%; height: 1.5px; background: #fff;
  transform: rotate(-35deg); opacity: 0; transition: opacity .3s;
}
.music-animation.muted .mute-slash { opacity: .9; }
.music-toggle { position: relative; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #fff; text-shadow: 0 0 8px rgba(0, 0, 0, .59); line-height: 1.4; white-space: nowrap; }
.music-toggle::after {
  content: ""; display: block; height: 1px; width: 0; background-color: #fff; position: absolute; transition: .2s;
}
.play-music:hover .music-toggle::after,
.play-music:focus-visible .music-toggle::after { width: 100%; }
@keyframes bar { 0% { height: 4px; } 50% { height: 15px; } 100% { height: 4px; } }
@keyframes bar-soft { 0% { height: 3px; } 50% { height: 7px; } 100% { height: 3px; } }

/* --------------------------------------------------------------------------
   Page transition overlays + content page
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed; z-index: 500; inset: 0; transition: transform .4s; transform: translateY(-100%);
}
.overlay-1 { background: #000; }
.overlay-2 { background: var(--accent); }
.overlay-2::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 48px; height: 48px;
  background: #fff; border-radius: 50%; animation: pulse 1s ease-in-out infinite; visibility: hidden;
}
.is-ajax-page-active .overlay-2::before { visibility: visible; }
.is-ajax-page-loaded .overlay-2::before { visibility: hidden; }

.one-page-content {
  position: fixed; z-index: 1; top: 0; width: 100%; height: 100vh; height: 100dvh;
  background: #fff; opacity: 0; overflow-x: hidden; overflow-y: scroll; -webkit-overflow-scrolling: touch;
  visibility: hidden;
}
.one-page-content.is-visible { z-index: 400; opacity: 1; visibility: visible; }
.one-page-content > .content-wrap { width: 90%; max-width: 1180px; margin: 0 auto; padding: 3em 0 6em; }
.one-page-content .entry-header { padding-top: 4em; text-align: center; }
.entry-title { margin: 0; text-align: center; }
.one-page-content h1 {
  display: inline-block; position: relative; line-height: 1; padding: 0 10px 20px; transition: color .5s; z-index: 0;
}
.one-page-content h1::before {
  content: ''; position: absolute; height: 0; width: 30%; padding-bottom: 30%; top: 50%; margin-top: -18%; left: 35%;
  z-index: -1; background: #f3f3f3; transform: rotate3d(0, 0, 1, 45deg) scale3d(0, 1, 1); transition: transform .7s;
}
.is-ajax-page-visible .one-page-content h1::before { transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 1, 1); }
.entry-content { margin-top: 2.4em; }

.close-page {
  position: fixed; z-index: 550; top: 0; left: 50%; margin-left: -31px; display: block;
  width: 61px; height: 61px; cursor: pointer; background: #1b1b1b; border: 0;
  transform: translateY(-100%); transition: transform .4s; transition-delay: .4s;
}
.is-ajax-page-visible .close-page { transform: translateY(0); }
.close-page::before, .close-page::after {
  content: ""; height: 1px; width: 50%; position: absolute; left: 25%; top: 30px;
  background-color: #aaa; transform: rotate(45deg); transition: all .3s ease-in;
}
.close-page::after { transform: rotate(-45deg); }
@media (hover) {
  .close-page:hover::before { transform: rotate(-45deg); background-color: #fff; }
  .close-page:hover::after { transform: rotate(45deg); background-color: #fff; }
}

/* click ripple */
i.ripple {
  position: fixed; height: 60px; width: 60px; background: #fff; margin: -30px; border-radius: 100%;
  opacity: 1; transform: scale(0); z-index: 9999; user-select: none; pointer-events: none;
}
i.ripple.active { transition: transform .4s ease, opacity .4s ease; opacity: 0; transform: scale(1); }

/* back to top (inside content pages) */
.back-to-top {
  position: fixed; bottom: 0; right: -6px; z-index: 560; width: 86px; line-height: 46px; text-align: center;
  background: #001428; color: #fff; cursor: pointer; border: 0; border-radius: 2px; font-size: 16px;
  transition: all .2s ease-out; opacity: 0; visibility: hidden; user-select: none;
}
.back-to-top:hover { background: #01101f; }
.back-to-top.show { opacity: 1; visibility: visible; }

/* --------------------------------------------------------------------------
   Content building blocks
   -------------------------------------------------------------------------- */
.row { display: grid; gap: 30px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 991px) {
  .cols-4, .cols-5 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .cols-5 { grid-template-columns: repeat(2, 1fr); }
  .row { gap: 20px; }
}
.section { margin: 5em 0 0; }
.section:first-child { margin-top: 0; }

.section-title { text-align: center; margin: 0 0 3em; }
.section-title h2 {
  margin: 0; font-size: 16px; text-transform: uppercase; position: relative; display: inline-block;
  font-weight: 500; letter-spacing: 3px; line-height: 1.1;
}
.section-title h2 i { display: inline-block; position: relative; padding: 0; font-style: normal; }
.section-title h2 i::before, .section-title h2 i::after {
  content: ''; display: inline-block; width: 34px; margin: 3px 14px 3px 12px; border-bottom: 2px solid #555; vertical-align: middle;
}
@media (max-width: 480px) { .section-title h2 i::before, .section-title h2 i::after { width: 18px; margin: 3px 8px; } }

.intro { align-items: center; }
.intro img { display: block; width: 100%; max-width: 540px; margin: 0 auto; }
.intro h2 { font-weight: 300; font-size: calc(18px + 1.1vw); line-height: 1.45; margin: 0; color: #222; }
.intro h2 b { font-weight: 600; color: var(--accent); }
.intro .lede { margin-top: 1.4em; font-size: 16px; }

.service { padding: 36px 24px; text-align: center; border: 1px solid var(--line); height: 100%; transition: border-color .3s, transform .3s; }
.service:hover { border-color: #d9d9d9; transform: translateY(-3px); }
.service img { display: block; height: 42px; width: auto; margin: 0 auto 22px; }
.service h4 { margin: 0 0 .3em; text-transform: uppercase; letter-spacing: 1px; font-size: 14px; font-weight: 600; }
.service p { margin: .2em 0 0; opacity: .8; font-size: 15px; }

.quote-block { text-align: center; max-width: 760px; margin: 5em auto 0; }
.quote-block blockquote { margin: 0; font-size: calc(18px + .8vw); font-style: italic; font-weight: 300; color: #222; line-height: 1.4; }
.quote-meta { display: inline-flex; align-items: center; gap: 14px; margin-top: 1.4em; text-align: left; }
.avatar {
  width: 60px; height: 60px; border-radius: 50%; background: #111; color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: 20px; flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.quote-meta strong { display: block; color: #222; font-weight: 600; }
.quote-meta span { font-size: 13px; color: var(--muted); }

.client { padding: 1em; min-height: 100px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.client img { max-width: 80%; max-height: 46px; width: auto; filter: grayscale(1); opacity: .8; transition: all .3s; }
.client:hover img { filter: none; opacity: 1; }

.fun-fact { text-align: center; }
.fun-fact img { width: 54px; height: 54px; margin: 0 auto 18px; display: block; }
.fun-fact h4 { font-size: 12px; max-width: 160px; margin: 0 auto; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.stat-num { display: block; font-size: calc(26px + 1.2vw); font-weight: 600; color: var(--ink); line-height: 1; margin-bottom: 10px; }

/* --- resume timeline --- */
.event { position: relative; padding: 0 1em 2em 3.2em; }
.event::before { content: ""; position: absolute; top: 10px; bottom: -10px; left: 12px; width: 4px; background: #f7f7f7; }
.event::after {
  content: ""; position: absolute; z-index: 2; top: 10px; left: 7px; width: 14px; height: 14px; border-radius: 50%; background: #f1f1f1;
  transition: background .4s, box-shadow .4s, transform .4s cubic-bezier(.34, 1.56, .64, 1);
}
.event.passed::after { background: var(--accent); box-shadow: 0 0 0 5px rgba(24, 81, 241, .14); transform: scale(1.1); }
.event.is-head::after { display: none; }
.event h2 { font-size: 1em; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 2.4em; }
.event .event-icon {
  display: flex; align-items: center; justify-content: center; position: absolute; top: -18px; left: -10px;
  width: 52px; height: 52px; margin: 0; z-index: 3; border-radius: 50%; background: #f5f5f5;
  transition: background .5s, box-shadow .5s;
}
.event .event-icon svg { width: 22px; height: 22px; stroke: #111; fill: none; stroke-width: 1.6; transition: stroke .5s; }
.event.is-head.passed .event-icon { background: var(--accent); box-shadow: 0 10px 24px rgba(24, 81, 241, .25); }
.event.is-head.passed .event-icon svg { stroke: #fff; }
.event.is-head + .event.is-head, .event + .event.is-head { margin-top: 1.2em; }
.event h3 {
  display: inline-block; position: relative; padding: 7px 12px; font-size: 10px; line-height: 1;
  letter-spacing: .03em; margin: 0 0 1.5em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent);
}
.event h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; margin: .1em 0 .2em; padding: 0; color: var(--ink); }
.event h5 { margin: 0; padding: 0 0 .3em; font-size: 14px; font-weight: 500; color: rgba(28, 38, 43, .4); }
.event p { margin: .6em 0 .2em; font-size: .95em; letter-spacing: .3px; }
.event .event-tags { margin-top: .8em; display: flex; flex-wrap: wrap; gap: 6px; }
.timeline > .event:last-child::before { bottom: 0; }
@media (min-width: 768px) {
  .event { padding: 0 1em 3em 4em; }
  .event h3 { margin-left: -2.6em; }
  .event .event-icon { width: 72px; height: 72px; left: -20px; top: -26px; }
  .event .event-icon svg { width: 28px; height: 28px; }
}
.tag {
  display: inline-block; font-size: 11px; letter-spacing: .5px; padding: 3px 9px; border-radius: 20px;
  background: #f3f5fb; color: #3b4466; line-height: 1.5;
}

.skill-unit { padding-bottom: 1.1em; }
.skill-unit h4 { margin: 0 0 4px 4px; font-size: 12px; position: relative; z-index: 1; display: inline-block; text-transform: uppercase; font-weight: 600; }
.skill-unit .bar { position: relative; width: 100%; height: 4px; background: #eee; }
.skill-unit .bar .progress {
  position: absolute; top: 0; left: 0; width: 0; height: 100%; background: var(--accent); border-radius: 16px;
  transition: width 1.2s cubic-bezier(.23, 1, .32, 1);
}
.skill-unit .bar .progress span {
  position: absolute; top: -12px; left: max(28px, 100%); margin-left: -28px; font-size: 12px; font-weight: 700; color: #111;
  text-align: center; min-width: 28px; line-height: 26px; border: 1px solid #345; background: #fff; opacity: 0; transition: opacity .4s .8s;
}
.skill-unit.filled .bar .progress span { opacity: 1; transition-delay: .25s; }
.skills-grid { column-gap: 60px; row-gap: 6px; }

.testo { position: relative; padding: 1.4em 1.8em; margin: 4.4em 0 0; border: 2px solid #f3f3f3; text-align: center; }
.testo .avatar { width: 94px; height: 94px; margin: -78px auto 16px; border: 8px solid #fff; box-sizing: content-box; display: flex; }
.testo h3 { margin: 0; }
.testo h5 { margin: 0; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.testo p { margin: 1em 0 .2em; font-size: 15px; }

/* --- buttons, forms --- */
.button, button.button, input[type=submit] {
  color: var(--accent); border: 2px solid var(--accent); font-family: var(--font); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; line-height: 1; text-decoration: none; background: none; cursor: pointer;
  padding: 18px 32px; margin: 10px 20px 0 0; display: inline-flex; align-items: center; gap: 8px; outline: none; position: relative;
  transition: all .3s; overflow: hidden; z-index: 0;
}
.button::after {
  width: 0%; height: 100%; top: 0; left: 0; background: var(--accent); content: ''; position: absolute; z-index: -1; transition: all .3s;
}
.button:hover, .button:focus-visible { color: #fff !important; }
.button:hover::after, .button:focus-visible::after { width: 100%; }
.button:active { transition: all .1s; transform: scale(.94); }
.button:last-child { margin-right: 0; }
.button.solid { background: var(--accent); color: #fff; }
.button.solid::after { background: #0b2a8a; }
.button svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.center { text-align: center; }

.info-strip { text-align: center; }
.info-item { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.info-item svg { width: 46px; height: 46px; }
.info-item h5 { margin: 0; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; color: var(--ink); }
.info-item a { color: inherit; }
.info-item > a { display: block; line-height: 0; }
.info-item a:hover { color: var(--accent); }

.lead-title { text-align: center; font-weight: 300; margin: 0 0 1.2em; }
.lead-title b { font-weight: 600; color: var(--accent); }
.contact-form { max-width: 680px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
.contact-form .full { grid-column: 1 / -1; }
.contact-form p { margin: 0 0 1.8em; }
@media (max-width: 640px) { .contact-form { grid-template-columns: 1fr; } }
.contact-form label { display: block; font-size: 11px; letter-spacing: 1px; font-weight: 600; text-transform: uppercase; color: #666; }
.contact-form input, .contact-form textarea {
  padding: .6em 0 .3em; width: 100%; font-size: 15px; border: 0; border-bottom: 2px solid rgba(0, 0, 0, .07);
  border-radius: 0; background: transparent; -webkit-appearance: none; font-family: var(--font); color: #222; outline: 0;
  transition: border-color .3s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.contact-form textarea { min-height: 7em; line-height: 1.6; resize: vertical; }
.contact-form .hp { position: absolute; left: -9999px; }
.form-status { grid-column: 1 / -1; font-size: 14px; min-height: 1.5em; margin: 0; }
.form-status.ok { color: #138a4f; }
.form-status.err { color: #c0392b; }

.cta-card { display: grid; grid-template-columns: 1fr 1fr; background: #f6f7fb; overflow: hidden; align-items: stretch; }
.cta-card .cta-img { background-size: cover; background-position: center; min-height: 320px; }
.cta-card .cta-body { padding: 3em; display: flex; flex-direction: column; justify-content: center; }
.cta-card h2 { margin-top: 0; }
@media (max-width: 767px) { .cta-card { grid-template-columns: 1fr; } .cta-card .cta-body { padding: 2em; } }

/* --------------------------------------------------------------------------
   Portfolio grid
   -------------------------------------------------------------------------- */
.filters { list-style: none; padding: 0; margin: 0 0 3em; text-align: center; font-size: 13px; font-weight: 500; letter-spacing: 1px; }
.filters li { display: inline-block; margin: .6em .6em; text-transform: uppercase; }
.filters button {
  background: none; border: 0; padding: 0 0 2px; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: inherit;
}
.cool-link {
  background-image: linear-gradient(transparent 88%, var(--accent-2) 12%); background-repeat: no-repeat;
  background-size: 0% 100%; transition: all 1s;
}
.cool-link:hover, .filters .current .cool-link { background-size: 100% 100%; }
.filters .current button { color: var(--accent); }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1100px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .media-grid { grid-template-columns: 1fr; } }
.media-cell { text-align: center; transition: opacity .4s, transform .4s; }
.media-cell.is-hidden { display: none; }
.media-cell.fade-in { animation: fadeUp .5s both; }
.media-box {
  position: relative; overflow: hidden; background: #f1f1f1; transition: all .8s; transform: scale(1);
  aspect-ratio: 16 / 9; cursor: pointer;
}
.media-box:hover { transform: scale(.95); }
.media-box img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transform: scale(1); transition: all .8s; }
.media-box:hover img { transform: scale(1.15); }
.media-box .mask {
  opacity: 0; position: absolute; inset: 0; background: rgba(3, 36, 74, .33); transition: all .3s ease-out;
  display: flex; align-items: center; justify-content: center;
}
.media-box .mask svg { width: 30px; height: 30px; stroke: #fff; fill: none; stroke-width: 1.6; }
.media-box:hover .mask { opacity: 1; }
.media-box a { position: absolute; inset: 0; z-index: 2; }
.media-badge {
  position: absolute; top: 12px; left: 12px; z-index: 1; background: rgba(10, 10, 10, .82); color: #fff; font-size: 10px;
  letter-spacing: 1.5px; text-transform: uppercase; padding: 5px 9px; font-weight: 600;
}
.media-cell-desc { position: relative; padding: 1.2em 1.5em 1.6em; background: #fff; }
.media-cell-desc h3 { padding: 0; margin: 4px 0 0; line-height: 1.3; cursor: pointer; }
.media-cell-desc h3 a { color: inherit; }
.media-cell-desc p { font-size: 14px; margin: .3em 0 0; opacity: .6; }

/* --------------------------------------------------------------------------
   Portfolio detail overlay
   -------------------------------------------------------------------------- */
.p-overlay {
  position: fixed; z-index: 1000; display: none; width: 100%; background: #fff; inset: 0; min-height: 100%;
  overflow: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; animation-duration: .5s; animation-fill-mode: both;
}
.p-overlay.active { display: block; }
.animate-in { animation-name: zoomShow; animation-duration: .4s; animation-timing-function: cubic-bezier(.165, .84, .44, 1); }
.animate-out { animation-name: zoomHide; animation-duration: .3s; animation-timing-function: cubic-bezier(.165, .84, .44, 1); }
html.p-overlay-on .one-page-content { overflow: hidden; }

.portfolio-nav { display: flex; position: fixed; top: 0; left: 0; z-index: 100; width: 100%; user-select: none; }
.portfolio-nav > * { flex: 1 1 0; }
.portfolio-nav button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: calc(16px + .6vw) calc(8px + 1.2vw);
  font-size: 13px; letter-spacing: 1px; text-transform: uppercase; line-height: 1; color: #1c262b; cursor: pointer;
  border: 0; border-left: 1px solid #ddd; border-bottom: 1px solid #ddd; background: #fff; font-family: var(--font); transition: all .3s ease-out;
}
.portfolio-nav > :first-child button { border-left: 0; }
.portfolio-nav button:hover { color: #fff; border-color: transparent; background-color: #222; }
.portfolio-nav .back button:hover { background: #1c2529; }
.portfolio-nav svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
@media (max-width: 560px) { .portfolio-nav .label { display: none; } }

.portfolio-single { width: 88%; max-width: 1100px; margin: 0 auto; text-align: center; padding: calc(5em + 4vw) 0 6em; }
.portfolio-single .entry-title { font-size: calc(24px + 2.4vw); font-weight: 500; }
.portfolio-single .p-tagline { font-size: calc(15px + .4vw); margin: .6em auto 0; max-width: 760px; color: #555; }
.p-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin: 1.8em 0 0; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.p-meta span b { color: var(--ink); font-weight: 600; }
.p-hero { margin: 2.6em auto 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .12); display: block; width: 100%; background: #f1f1f1; }
.p-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; text-align: left; margin-top: 3.4em; }
@media (max-width: 860px) { .p-body { grid-template-columns: 1fr; gap: 30px; } }
.p-body h3 { margin-top: 0; text-transform: uppercase; letter-spacing: 2px; font-size: 13px; font-weight: 600; }
.p-body p { font-size: 16px; }
.benefits { list-style: none; padding: 0; margin: 0; }
.benefits li { position: relative; padding: 0 0 1em 30px; font-size: 15px; }
.benefits li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 9px; border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.benefits li b { color: var(--ink); font-weight: 600; }
.p-side { background: #f7f8fb; padding: 2em; }
.p-side .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.6em; }
.p-actions { margin-top: 2.6em; }

/* --------------------------------------------------------------------------
   Responsive home tweaks (mirrors the original theme)
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .home-heading { align-self: flex-start; margin-top: 7vh; text-align: left; padding-left: calc(20px + 17vw); }
}
@media (max-width: 991px) and (max-height: 500px) {
  .home-heading { text-align: center; padding-left: 0; }
}
@media (max-width: 600px) {
  /* frame the photo on the face/body and keep the name block below the face */
  .home-bg { background-position: 25% top; }
  .home-heading { padding-left: 24px; margin-top: 30vh; }
  /* job title on two clean lines: "AI Strategist" / "Business Consultant · Builder" */
  .home-job-title > span { display: block; }
  .home-job-title .jt-sep { display: none; }
  .home-logo i { font-size: 6vmin; }
  .home-icon { width: 9vmin; }
  .home-text, .home-text-container-placeholder { font-size: 7vmin; padding: 3.4vmin 4vmin; }
  .home-logo-center { padding: 2.4vmin; }
  .home-menu .item-name { font-size: calc(1rem + 5vmin); padding-left: 24px; }
  .home-menu { margin-top: 9vh; }
  .home-job-title { font-size: 10px; letter-spacing: 1.5px; }
}

@media (max-width: 600px) and (max-height: 720px) {
  .home-heading { margin-top: 26vh; }
  .home-menu { margin-top: 12vh; }
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes marquee { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }
@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
@keyframes zoomShow { 0% { opacity: 0; transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
@keyframes zoomHide { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.2); } }
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(18px); } 100% { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .home-marquee > span { animation: none; padding-left: 0; }
  .music-animation .music-bar { animation: none !important; height: 8px; }
  .media-box, .media-box img { transition: none; }
}

/* programmatic focus target for screen readers, no visible ring */
h1[tabindex="-1"]:focus { outline: none; }
.quote-block .avatar { color: #fff; font-weight: 500; font-size: 22px; }

/* --- resume layout (timeline left, skills + testimonials right) --- */
.resume-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 70px; align-items: start; }
.resume-side .section-title { margin-bottom: 2.2em; }
.resume-side .section-title ~ .section-title { margin-top: 3.4em; }
.resume-side .skill-unit { padding-bottom: 1.25em; }
.resume-side .testo { margin-top: 5em; }
.resume-side .section-title + .testo { margin-top: 4em; }
.resume-cta { margin: 1em 0 0 3.2em; }
@media (min-width: 768px) { .resume-cta { margin-left: 4em; } }
@media (max-width: 991px) { .resume-layout { grid-template-columns: 1fr; gap: 3em; } }

/* blue line that draws down the timeline as you scroll */
.timeline[data-timeline] { position: relative; }
.timeline-fill {
  position: absolute; z-index: 1; top: 10px; left: 12px; width: 4px; height: 0; border-radius: 4px;
  background: linear-gradient(to bottom, rgba(24, 81, 241, .25), var(--accent)); pointer-events: none;
}
.timeline-fill::after {
  content: ""; position: absolute; bottom: -3px; left: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 6px rgba(24, 81, 241, .15);
}

/* scroll reveal */
.js-reveal { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.timeline .event.js-reveal:not(.is-head) { transform: translate3d(28px, 0, 0); }
.timeline .event.js-reveal.is-head { transform: translate3d(-14px, 0, 0); }
.js-reveal.in, .timeline .event.js-reveal.in { opacity: 1; transform: none; }
.testo.js-reveal .avatar { transform: scale(.4); opacity: 0; transition: transform .6s .25s cubic-bezier(.34, 1.56, .64, 1), opacity .4s .25s; }
.testo.js-reveal.in .avatar { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal, .js-reveal .avatar { opacity: 1 !important; transform: none !important; transition: none !important; }
  .timeline-fill { display: none; }
}
