/* =========================================================
   Yves Claessens — personal site
   A monochrome portrait, one accent, and a little light.
   ========================================================= */

:root {
  --ink: #080808;
  --paper: #f1ebe0;
  --accent: #ff4a17;
  --muted: rgba(241, 235, 224, 0.58);
  --line: rgba(241, 235, 224, 0.2);
  --pad: clamp(18px, 3.2vw, 52px);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* ---------- The portrait ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0b0b0b;
  pointer-events: none;
}

.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 30%;
  filter: grayscale(1) contrast(1.04) brightness(0.9);
  transform: scale(1.06) translate3d(var(--sx, 0px), var(--sy, 0px), 0);
  will-change: transform;
}

.portrait--light {
  filter: grayscale(1) contrast(1.1) brightness(1.34);
  opacity: 0;
  -webkit-mask-image: radial-gradient(
    circle clamp(170px, 18vw, 300px) at var(--mx, 50%) var(--my, 50%),
    #000 0%,
    rgba(0, 0, 0, 0.82) 42%,
    transparent 72%
  );
  mask-image: radial-gradient(
    circle clamp(170px, 18vw, 300px) at var(--mx, 50%) var(--my, 50%),
    #000 0%,
    rgba(0, 0, 0, 0.82) 42%,
    transparent 72%
  );
  transition: opacity 0.5s ease;
}

body.is-pointer .portrait--light {
  opacity: 1;
}

.shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.72) 0%, rgba(8, 8, 8, 0) 24%),
    linear-gradient(90deg, rgba(8, 8, 8, 0.04) 0%, rgba(8, 8, 8, 0) 30%, rgba(8, 8, 8, 0.5) 64%, rgba(8, 8, 8, 0.94) 100%),
    linear-gradient(0deg, rgba(8, 8, 8, 0.97) 0%, rgba(8, 8, 8, 0.74) 20%, rgba(8, 8, 8, 0.16) 48%, rgba(8, 8, 8, 0) 66%),
    radial-gradient(140% 100% at 40% 40%, transparent 45%, rgba(8, 8, 8, 0.45) 100%);
}

.grain {
  position: absolute;
  inset: -60%;
  width: 220%;
  height: 220%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: 0.055;
  mix-blend-mode: overlay;
  animation: grain 7s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 1%); }
  40% { transform: translate(1%, -2%); }
  60% { transform: translate(-1%, 2%); }
  80% { transform: translate(2%, 1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Frame & cursor ---------- */

.frame {
  position: fixed;
  inset: clamp(8px, 1.2vw, 16px);
  z-index: 4;
  border: 1px solid rgba(241, 235, 224, 0.12);
  pointer-events: none;
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-style: solid;
  border-color: var(--accent);
}

.frame::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid rgba(241, 235, 224, 0.7);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: difference;
  transition:
    width 0.35s var(--ease),
    height 0.35s var(--ease),
    margin 0.35s var(--ease),
    background 0.35s ease,
    opacity 0.35s ease;
}

.cursor::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: var(--paper);
}

body.has-cursor .cursor {
  opacity: 1;
}

body.has-cursor,
body.has-cursor a,
body.has-cursor button {
  cursor: none;
}

.cursor.is-link {
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  background: rgba(241, 235, 224, 0.14);
}

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(var(--pad) + 6px) var(--pad) 0;
  pointer-events: none;
}

.topbar a {
  pointer-events: auto;
}

.brand {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition:
    background 0.35s var(--ease),
    border-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

.brand span {
  color: var(--accent);
  transition: color 0.35s var(--ease);
}

.brand:hover,
.brand:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.topbar__meta {
  display: flex;
  gap: clamp(24px, 4vw, 64px);
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.7;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.topbar__meta p {
  margin: 0;
}

.topbar__meta p:first-child {
  color: var(--paper);
}

/* ---------- Main composition ---------- */

.content {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  grid-template-rows: 1fr auto;
  padding: clamp(100px, 14vh, 150px) var(--pad) clamp(76px, 10vh, 110px);
  pointer-events: none;
}

.content > * {
  pointer-events: auto;
}

.aside {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  justify-self: end;
  width: 100%;
  max-width: 330px;
  margin-top: 4vh;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow__dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.6s ease-out infinite;
}

.eyebrow__line {
  width: 30px;
  height: 1px;
  background: var(--line);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 74, 23, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(255, 74, 23, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 74, 23, 0); }
}

.intro {
  max-width: 32ch;
  margin: 18px 0 0;
  color: rgba(241, 235, 224, 0.86);
  font-size: clamp(0.98rem, 1.05vw, 1.12rem);
  line-height: 1.55;
  letter-spacing: -0.01em;
}

/* ---------- LinkedIn circle ---------- */

.cta {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(128px, 10.5vw, 156px);
  aspect-ratio: 1;
  margin-top: clamp(28px, 4vh, 46px);
  border-radius: 50%;
  color: var(--paper);
  text-decoration: none;
  isolation: isolate;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(241, 235, 224, 0.34);
  border-radius: 50%;
  transition:
    background 0.45s var(--ease),
    border-color 0.45s var(--ease),
    transform 0.45s var(--ease);
}

.cta__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: spin 24s linear infinite;
}

.cta__ring text {
  fill: currentColor;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.82;
}

.cta__core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: color 0.35s ease;
}

.cta__arrow {
  font-family: var(--sans);
  font-size: 26px;
  line-height: 1;
  transition: transform 0.45s var(--ease);
}

.cta__word {
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}

.cta:hover::before,
.cta:focus-visible::before {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.02);
}

.cta:hover,
.cta:focus-visible {
  color: var(--ink);
}

.cta:hover .cta__arrow {
  transform: translate(2px, -2px);
}

.cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Name ---------- */

.name {
  grid-row: 2;
  grid-column: 1 / -1;
  align-self: end;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4.4rem, min(15vw, 21vh), 15rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.78;
}

.name__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.02em;
}

.name__line > span {
  display: block;
  transform: translateY(112%);
  transition: transform 1.15s var(--ease);
}

body.is-loaded .name__line > span {
  transform: none;
}

.name__first {
  margin-left: 0.02em;
}

.name__last {
  margin-left: 0.05em;
  color: transparent;
  font-style: italic;
  -webkit-text-stroke: clamp(1.2px, 0.16vw, 2.6px) var(--paper);
}

.name__last::after {
  content: ".";
  color: var(--accent);
  -webkit-text-stroke: 0;
}

@supports not (-webkit-text-stroke: 1px black) {
  .name__last {
    color: var(--paper);
  }
}

/* ---------- Footer & side label ---------- */

.footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 var(--pad) calc(var(--pad) + 2px);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

.footer p {
  margin: 0;
}

.footer__hint {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(241, 235, 224, 0.38);
}

.footer__line {
  width: 28px;
  height: 1px;
  background: var(--line);
}

.side-label {
  position: fixed;
  top: 50%;
  left: calc(var(--pad) - 18px);
  z-index: 6;
  margin: 0;
  color: rgba(241, 235, 224, 0.34);
  font-size: 8.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  pointer-events: none;
}

/* ---------- Loader & reveal ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--ink);
  transition:
    transform 1s var(--ease),
    opacity 0.5s ease 0.2s;
}

.loader span {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 5rem);
  letter-spacing: -0.04em;
  transition:
    transform 0.8s var(--ease),
    opacity 0.5s ease;
}

.loader i {
  color: var(--accent);
  font-style: normal;
}

body.is-loaded .loader {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-101%);
}

body.is-loaded .loader span {
  opacity: 0;
  transform: translateY(-20px);
}

html:not(.js) .loader {
  display: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease);
}

.js body.is-loaded .reveal {
  opacity: 1;
  transform: none;
}

.d1 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.42s; }

html:not(.js) .reveal {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .portrait {
    object-position: 22% 30%;
  }

  .shade {
    background:
      linear-gradient(180deg, rgba(8, 8, 8, 0.72) 0%, rgba(8, 8, 8, 0) 22%),
      linear-gradient(0deg, #080808 0%, rgba(8, 8, 8, 0.96) 30%, rgba(8, 8, 8, 0.78) 44%, rgba(8, 8, 8, 0.18) 62%, rgba(8, 8, 8, 0) 80%);
  }

  .content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100svh;
    padding: 100px var(--pad) 70px;
  }

  .aside {
    align-self: flex-start;
    justify-self: start;
    width: 100%;
    max-width: 320px;
    margin: 0 0 26px;
  }

  .intro {
    max-width: 31ch;
    font-size: 0.98rem;
  }

  .name {
    align-self: stretch;
    width: 100%;
    font-size: clamp(3.6rem, 21vw, 7rem);
    line-height: 0.8;
  }

  .name__last {
    -webkit-text-stroke-width: 1px;
  }

  /* compact LinkedIn pill */
  .cta {
    display: inline-flex;
    width: auto;
    height: auto;
    aspect-ratio: auto;
    margin-top: 24px;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .cta::before,
  .cta__ring {
    display: none;
  }

  .cta__core {
    flex-direction: row;
    gap: 10px;
  }

  .cta__arrow {
    font-size: 18px;
  }

  .cta__word {
    font-size: 9px;
  }

  .cta:hover::before,
  .cta:focus-visible::before {
    background: transparent;
  }

  .cta:hover,
  .cta:focus-visible {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
  }

  .side-label,
  .footer__credit,
  .footer__hint {
    display: none;
  }

  .footer {
    padding-bottom: 18px;
    font-size: 8.5px;
  }

  .topbar__meta {
    gap: 26px;
  }

  .topbar__meta p:last-child {
    display: none;
  }
}

@media (max-width: 380px) {
  .name {
    font-size: clamp(3.2rem, 20vw, 5rem);
  }

  .intro {
    font-size: 0.92rem;
  }
}

@media (max-height: 700px) and (min-width: 901px) {
  .name {
    font-size: clamp(4rem, min(13vw, 23vh), 10rem);
  }

  .aside {
    margin-top: 0;
  }

  .intro {
    font-size: 0.95rem;
  }
}

/* ---------- Reduced motion ---------- */

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition-delay: 0s !important;
  }

  .name__line > span {
    transform: none;
  }

  .loader {
    display: none;
  }

  .portrait--light {
    display: none;
  }
}
