/* ------------------------------
   Basic website variables
------------------------------ */

:root {
  --background: #090b10;
  --panel-background: rgba(14, 18, 27, 0.88);
  --text: #f4f5f7;
  --muted-text: #b0b6c0;
  --border: rgba(255, 255, 255, 0.18);
  --button-background: rgba(255, 255, 255, 0.08);
  --button-hover: rgba(255, 255, 255, 0.17);
  --accent: #ffffff;
}

/* Make sizing easier to control */
* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  min-height: 100svh;

  margin: 0;

  overflow-x: hidden;

  color: var(--text);
  background: var(--background);

  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

/* Prevent scrolling while the modal is open */
body.modal-open {
  overflow: hidden;
}

/* ------------------------------
   Ambient neural network
------------------------------ */

.neural-background {
  position: fixed;
  inset: 0;

  width: 100%;
  height: 100%;

  z-index: 1;

  pointer-events: none;

  opacity: 0.62;

  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 48%,
      rgba(0, 0, 0, 0.55) 55%,
      black 62%,
      black 100%
    );

  mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 48%,
      rgba(0, 0, 0, 0.55) 55%,
      black 62%,
      black 100%
    );
}

/* ------------------------------
   Top-right title
------------------------------ */

.site-header {
  position: fixed;
  top: 32px;
  right: 48px;

  z-index: 10;

  text-align: right;
}

.site-header h1 {
  position: relative;

  display: inline-block;

  margin: 0;
  padding-bottom: 10px;

  font-family:
    "Palatino Linotype",
    Palatino,
    Georgia,
    serif;

  font-size: clamp(1.85rem, 3.4vw, 3.15rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.085em;

  background:
    linear-gradient(
      125deg,
      #ffffff 0%,
      #dfe8f7 30%,
      #ffffff 52%,
      #9cabc4 78%,
      #eef4ff 100%
    );

  background-clip: text;
  -webkit-background-clip: text;

  color: transparent;
  -webkit-text-fill-color: transparent;

  filter:
    drop-shadow(0 3px 8px rgba(0, 0, 0, 0.78))
    drop-shadow(0 0 18px rgba(163, 190, 235, 0.18));
}

.site-header h1::after {
  content: "";

  position: absolute;
  right: 0;
  bottom: 0;

  width: 68%;
  height: 1px;

  background:
    linear-gradient(
      to left,
      rgba(238, 245, 255, 0.9),
      rgba(158, 181, 218, 0.38),
      transparent
    );

  box-shadow: 0 0 12px rgba(170, 201, 255, 0.28);
}

.site-header .welcome-text {
  margin: 11px 0 0;

  font-size: clamp(0.72rem, 1vw, 0.88rem);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-align: right;

  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.75);
}

/* ------------------------------
   Main welcome section
------------------------------ */

.hero {
  position: relative;

  min-height: 100vh;
  min-height: 100svh;

  display: flex;
  align-items: center;
  justify-content: flex-end;

  padding: 130px 8vw 70px;

  overflow: hidden;
}

/*
  The portrait occupies most of the left side.

  mask-image causes the actual image to become
  transparent gradually from left to right.
*/
.portrait {
  position: absolute;
  inset: 0 auto 0 0;

  width: min(76%, 82.2vh);
  width: min(76%, 82.2svh);
  height: 100%;

  z-index: 0;
}

.portrait img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: contain;
  object-position: left top;

  -webkit-mask-image:
    linear-gradient(
      to right,
      black 0%,
      black 48%,
      rgba(0, 0, 0, 0.82) 62%,
      rgba(0, 0, 0, 0.3) 82%,
      transparent 100%
    );

  mask-image:
    linear-gradient(
      to right,
      black 0%,
      black 48%,
      rgba(0, 0, 0, 0.82) 62%,
      rgba(0, 0, 0, 0.3) 82%,
      transparent 100%
    );
}

/* ------------------------------
   Contact links
------------------------------ */

.contact-links {
  position: fixed;
  bottom: 28px;
  right: 32px;

  z-index: 20;

  display: flex;
  align-items: center;
  gap: 20px;
}

.contact-trigger {
  color: var(--muted-text);

  background: transparent;
  border: 0;
  /* A generous invisible hit area makes the labels easier to hover. */
  padding: 12px 10px;
  margin: -12px -10px;

  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;

  transition:
    color 180ms ease,
    transform 180ms ease;
}

.contact-trigger:hover,
.contact-trigger[aria-expanded="true"] {
  color: var(--text);
  transform: translateY(-2px);
}

.contact-trigger:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.contact-menu {
  position: relative;
}

.contact-popover {
  position: absolute;
  bottom: calc(100% + 18px);
  left: 50%;

  width: max-content;
  padding: 12px;

  background:
    linear-gradient(
      140deg,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0.07) 52%,
      rgba(125, 165, 255, 0.12)
    );

  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 19px;

  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);

  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);

  opacity: 0;
  transform: translate(-50%, 10px) scale(0.92);
  transform-origin: 50% 100%;

  transition:
    opacity 180ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-popover[hidden] {
  display: none;
}

.contact-popover.is-open {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.contact-popover::after {
  content: "";

  position: absolute;
  top: 100%;
  left: 50%;

  width: 14px;
  height: 14px;

  background: rgba(84, 91, 108, 0.82);
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);

  transform: translate(-50%, -7px) rotate(45deg);
}

.social-popover {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 8px;
}

.compact-popover {
  right: 0;
  left: auto;

  min-width: 210px;

  transform: translate(0, 10px) scale(0.92);
  transform-origin: 100% 100%;
}

.compact-popover.is-open {
  transform: translate(0, 0) scale(1);
}

.compact-popover::after {
  right: 18px;
  left: auto;
}

.contact-action {
  display: flex;
  align-items: center;
  gap: 11px;

  padding: 10px 12px;

  color: var(--text);
  text-decoration: none;
  white-space: nowrap;

  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;

  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.contact-action:hover {
  background: rgba(255, 255, 255, 0.17);
  transform: translateY(-2px);
}

.contact-action:focus-visible,
.social-icon:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.contact-action svg {
  width: 24px;
  height: 24px;

  flex: 0 0 auto;

  fill: currentColor;
}

.social-icon {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;

  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.social-icon svg {
  width: 22px;
  height: 22px;

  fill: currentColor;
}

.instagram-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.instagram-icon .icon-dot {
  fill: currentColor;
  stroke: none;
}

.twitter-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

/*
  This dark gradient is a fallback and also improves
  the readability of the buttons on bright photographs.
*/
.portrait::after {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      to right,
      transparent 20%,
      rgba(9, 11, 16, 0.1) 52%,
      rgba(9, 11, 16, 0.72) 83%,
      var(--background) 100%
    );
}

/* ------------------------------
   Right-side buttons
------------------------------ */

.action-panel {
  position: relative;

  z-index: 2;

  width: min(380px, 42vw);
}

.welcome-text {
  margin: 0 0 24px;

  color: var(--muted-text);

  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
}

.main-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main-button-item {
  position: relative;
}

.main-button {
  position: relative;

  width: 100%;

  padding: 18px 24px;

  color: var(--text);
  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0.07) 48%,
      rgba(130, 165, 255, 0.1)
    );

  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 18px;

  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);

  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;

  cursor: pointer;

  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);

  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.main-button:hover {
  transform: translateX(-6px);

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.29),
      rgba(255, 255, 255, 0.11) 48%,
      rgba(145, 180, 255, 0.16)
    );
  border-color: rgba(255, 255, 255, 0.5);

  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.main-button:focus-visible,
.more-projects-button:focus-visible,
.close-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* macOS Dock Stack-style previews */
.dock-stack {
  position: absolute;
  top: 50%;
  right: calc(100% + 22px);
  width: min(430px, 36vw);
  height: 220px;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transform: translate(70px, -50%) scale(0.58);
  transform-origin: 100% 50%;
  transition:
    opacity 180ms ease,
    transform 440ms cubic-bezier(0.2, 0.9, 0.2, 1.18);
}

.dock-stack::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -30px;
  width: 390px;
  height: 250px;
  background: radial-gradient(
    ellipse at 100% 50%,
    rgba(199, 225, 255, 0.28),
    rgba(109, 162, 255, 0.12) 38%,
    transparent 72%
  );
  filter: blur(12px);
  transform: translateY(-50%);
}

.dock-card {
  position: absolute;
  top: 50%;
  right: 0;
  width: clamp(118px, 10vw, 154px);
  aspect-ratio: 1.28 / 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(245, 250, 255, 0.24), rgba(95, 131, 194, 0.09)),
    rgba(13, 18, 29, 0.76);
  border: 1px solid rgba(220, 237, 255, 0.42);
  border-radius: 18px;
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.46),
    0 0 30px rgba(130, 184, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  transform: translate(64px, -50%) rotate(0deg) scale(0.72);
  transform-origin: 100% 50%;
  transition: transform 460ms cubic-bezier(0.2, 0.9, 0.2, 1.18);
}

.dock-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.2), transparent 38%);
  pointer-events: none;
}

.dock-card span {
  color: rgba(214, 233, 255, 0.72);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.dock-card strong {
  font-size: clamp(0.72rem, 0.9vw, 0.9rem);
  line-height: 1.15;
}

.main-button-item:hover .dock-stack,
.main-button-item:focus-within .dock-stack {
  z-index: 1;
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}

.main-button-item:hover .dock-card:nth-child(1),
.main-button-item:focus-within .dock-card:nth-child(1) {
  transform: translate(-224px, -50%) rotate(-15deg);
}

.main-button-item:hover .dock-card:nth-child(2),
.main-button-item:focus-within .dock-card:nth-child(2) {
  transform: translate(-112px, -85%) rotate(-5deg);
}

.main-button-item:hover .dock-card:nth-child(3),
.main-button-item:focus-within .dock-card:nth-child(3) {
  transform: translate(-5px, -52%) rotate(9deg);
}

.main-button-item:hover .dock-stack-two .dock-card:nth-child(1),
.main-button-item:focus-within .dock-stack-two .dock-card:nth-child(1) {
  transform: translate(-150px, -66%) rotate(-11deg);
}

.main-button-item:hover .dock-stack-two .dock-card:nth-child(2),
.main-button-item:focus-within .dock-stack-two .dock-card:nth-child(2) {
  transform: translate(-22px, -44%) rotate(8deg);
}

/* Radial positioning: the button's left-center edge is the fan hinge. */
.dock-stack {
  --fan-width: clamp(320px, 30vw, 450px);
  --fan-height: clamp(250px, 28vw, 350px);
  --fan-radius: clamp(150px, 12vw, 190px);
  --fan-diagonal: clamp(106px, 8.5vw, 134px);
  --fan-y-two: clamp(52px, 5vw, 78px);

  top: 50%;
  right: 100%;
  width: var(--fan-width);
  height: var(--fan-height);
  pointer-events: none;
  transform: translate(52px, -50%) scale(0.65);
}

.dock-stack::before {
  top: 50%;
  right: -6px;
  width: calc(var(--fan-radius) + 158px);
  height: calc(var(--fan-diagonal) + var(--fan-diagonal) + 150px);
  background:
    radial-gradient(
      ellipse 44% 35% at 44% 20%,
      rgba(194, 224, 255, 0.27) 0%,
      rgba(108, 166, 248, 0.13) 48%,
      transparent 78%
    ),
    radial-gradient(
      ellipse 50% 31% at 18% 50%,
      rgba(203, 229, 255, 0.29) 0%,
      rgba(102, 157, 240, 0.13) 50%,
      transparent 80%
    ),
    radial-gradient(
      ellipse 44% 35% at 44% 80%,
      rgba(194, 224, 255, 0.27) 0%,
      rgba(108, 166, 248, 0.13) 48%,
      transparent 78%
    ),
    radial-gradient(
      ellipse 82% 68% at 100% 50%,
      rgba(229, 242, 255, 0.34) 0%,
      rgba(130, 184, 255, 0.18) 31%,
      rgba(76, 125, 213, 0.08) 62%,
      transparent 88%
    );
  border-radius: 48% 12% 12% 48% / 50% 24% 24% 50%;
  filter: blur(9px);
  transform: translateY(-50%);
  pointer-events: none;
}

.dock-stack-two::before {
  background:
    radial-gradient(
      ellipse 48% 40% at 44% 31%,
      rgba(198, 226, 255, 0.29) 0%,
      rgba(107, 165, 247, 0.13) 50%,
      transparent 80%
    ),
    radial-gradient(
      ellipse 48% 40% at 44% 69%,
      rgba(198, 226, 255, 0.29) 0%,
      rgba(107, 165, 247, 0.13) 50%,
      transparent 80%
    ),
    radial-gradient(
      ellipse 82% 62% at 100% 50%,
      rgba(229, 242, 255, 0.34) 0%,
      rgba(130, 184, 255, 0.18) 34%,
      rgba(76, 125, 213, 0.08) 64%,
      transparent 88%
    );
}

/* A single curved axe-head light field, matching the radial arc. */
.dock-stack::before,
.dock-stack-two::before {
  display: none;
}

.fan-illumination {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
  filter:
    drop-shadow(0 0 13px rgba(124, 182, 255, 0.25))
    drop-shadow(0 0 30px rgba(73, 132, 230, 0.16));
}

.fan-blade {
  fill: rgba(107, 163, 246, 0.105);
  stroke: rgba(190, 222, 255, 0.22);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.fan-blade-core {
  fill: rgba(187, 218, 255, 0.07);
  stroke: rgba(205, 230, 255, 0.1);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.dock-stack-two .fan-illumination {
  top: 15%;
  height: 70%;
}

.dock-card {
  top: 50%;
  right: 0;
  width: clamp(112px, 9vw, 142px);
  margin: 0;
  color: var(--text);
  border-style: solid;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
  transform: translate(42px, -50%) rotate(0deg) scale(0.62);
  transition:
    opacity 180ms ease,
    transform 460ms cubic-bezier(0.2, 0.9, 0.2, 1.18),
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.dock-card:hover {
  border-color: rgba(235, 246, 255, 0.82);
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.52),
    0 0 38px rgba(145, 197, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dock-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.main-button-item:hover .dock-stack,
.main-button-item:focus-within .dock-stack {
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}

.main-button-item:hover .dock-card,
.main-button-item:focus-within .dock-card {
  opacity: 1;
}

.main-button-item:hover .dock-card:nth-child(1),
.main-button-item:focus-within .dock-card:nth-child(1) {
  transform:
    translate(
      calc(50% - var(--fan-diagonal)),
      calc(-50% - var(--fan-diagonal))
    )
    rotate(-8deg);
}

.main-button-item:hover .dock-card:nth-child(2),
.main-button-item:focus-within .dock-card:nth-child(2) {
  transform:
    translate(calc(50% - var(--fan-radius)), -50%)
    rotate(0deg);
}

.main-button-item:hover .dock-card:nth-child(3),
.main-button-item:focus-within .dock-card:nth-child(3) {
  transform:
    translate(
      calc(50% - var(--fan-diagonal)),
      calc(-50% + var(--fan-diagonal))
    )
    rotate(8deg);
}

.main-button-item:hover .dock-stack-two .dock-card:nth-child(1),
.main-button-item:focus-within .dock-stack-two .dock-card:nth-child(1) {
  transform:
    translate(
      calc(50% - var(--fan-diagonal)),
      calc(-50% - var(--fan-y-two))
    )
    rotate(-7deg);
}

.main-button-item:hover .dock-stack-two .dock-card:nth-child(2),
.main-button-item:focus-within .dock-stack-two .dock-card:nth-child(2) {
  transform:
    translate(
      calc(50% - var(--fan-diagonal)),
      calc(-50% + var(--fan-y-two))
    )
    rotate(7deg);
}

/* Restored left-facing semicircular fan menu. */
.main-button-item .dock-stack {
  --fan-width: clamp(320px, 30vw, 450px);
  --fan-height: clamp(250px, 28vw, 350px);
  --fan-side-x: clamp(145px, 11vw, 210px);
  --fan-diagonal-x: clamp(88px, 7vw, 132px);
  --fan-y: clamp(82px, 8vw, 126px);
  --fan-y-two: clamp(52px, 5vw, 78px);

  top: 50%;
  right: 100%;
  width: var(--fan-width);
  height: var(--fan-height);
  pointer-events: none;
  transform: translate(52px, -50%) scale(0.65);
}

.main-button-item .dock-stack::before,
.main-button-item .dock-stack-two::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  right: -8px;
  width: 100%;
  height: 100%;
  border-radius: 58% 0 0 58% / 50% 0 0 50%;
  background: radial-gradient(
    ellipse at 100% 50%,
    rgba(225, 240, 255, 0.34) 0%,
    rgba(130, 184, 255, 0.21) 28%,
    rgba(86, 135, 225, 0.11) 58%,
    transparent 78%
  );
  clip-path: polygon(
    100% 50%,
    18% 0%,
    5% 14%,
    0% 50%,
    5% 86%,
    18% 100%
  );
  filter: blur(7px);
  transform: none;
  pointer-events: none;
}

.main-button-item .dock-card {
  top: 50%;
  right: 0;
  width: clamp(112px, 9vw, 142px);
  margin: 0;
  color: var(--text);
  border-style: solid;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
  transform: translate(42px, -50%) rotate(0deg) scale(0.62);
  transition:
    opacity 180ms ease,
    transform 460ms cubic-bezier(0.2, 0.9, 0.2, 1.18),
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.main-button-item:hover .dock-stack,
.main-button-item:focus-within .dock-stack {
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}

.main-button-item:hover .dock-card,
.main-button-item:focus-within .dock-card {
  opacity: 1;
}

.main-button-item:hover .dock-card:nth-child(1),
.main-button-item:focus-within .dock-card:nth-child(1) {
  transform:
    translate(
      calc(-1 * var(--fan-diagonal-x)),
      calc(-50% - var(--fan-y))
    )
    rotate(-8deg);
}

.main-button-item:hover .dock-card:nth-child(2),
.main-button-item:focus-within .dock-card:nth-child(2) {
  transform:
    translate(calc(-1 * var(--fan-side-x)), -50%)
    rotate(0deg);
}

.main-button-item:hover .dock-card:nth-child(3),
.main-button-item:focus-within .dock-card:nth-child(3) {
  transform:
    translate(
      calc(-1 * var(--fan-diagonal-x)),
      calc(-50% + var(--fan-y))
    )
    rotate(8deg);
}

.main-button-item:hover .dock-stack-two .dock-card:nth-child(1),
.main-button-item:focus-within .dock-stack-two .dock-card:nth-child(1) {
  transform:
    translate(
      calc(-1 * var(--fan-diagonal-x)),
      calc(-50% - var(--fan-y-two))
    )
    rotate(-7deg);
}

.main-button-item:hover .dock-stack-two .dock-card:nth-child(2),
.main-button-item:focus-within .dock-stack-two .dock-card:nth-child(2) {
  transform:
    translate(
      calc(-1 * var(--fan-diagonal-x)),
      calc(-50% + var(--fan-y-two))
    )
    rotate(7deg);
}

/* ------------------------------
   Modal
------------------------------ */

.modal {
  position: fixed;
  inset: 0;

  z-index: 100;

  display: grid;
  place-items: center;

  padding: 24px;

  background: rgba(3, 6, 12, 0.58);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  opacity: 0;

  transition: opacity 320ms ease;
}

.modal[hidden] {
  display: none;
}

.modal.is-open {
  opacity: 1;
}

.modal-window {
  position: relative;

  width: min(980px, 100%);
  max-height: 88vh;

  padding: 42px 32px 32px;

  overflow-y: auto;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.18),
      rgba(255, 255, 255, 0.06) 42%,
      rgba(120, 160, 255, 0.08) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 30px;

  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);

  opacity: 0;
  transform: translateX(72px) scale(0.96);

  transition:
    opacity 320ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.is-open .modal-window {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.modal-window::before {
  content: "";

  position: absolute;
  inset: 1px 12% auto;

  height: 1px;

  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.85),
    transparent
  );

  pointer-events: none;
}

.modal-window h2 {
  margin: 0 40px 28px 0;

  font-size: 2rem;
}

.close-button {
  position: absolute;
  top: 15px;
  right: 18px;

  width: 42px;
  height: 42px;

  color: var(--text);
  background: rgba(255, 255, 255, 0.08);

  border: 0;
  border-radius: 50%;

  font-size: 2rem;
  line-height: 1;

  cursor: pointer;

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(6deg) scale(1.05);
}

/* ------------------------------
   Project gallery
------------------------------ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  min-width: 0;

  overflow: hidden;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.16),
      rgba(255, 255, 255, 0.05)
    );

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;

  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);

  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);

  transition:
    opacity 320ms ease,
    transform 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.42);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;

  display: block;

  object-fit: cover;
}

.project-card h3 {
  margin: 0;
  padding: 16px 18px 18px;

  font-size: 1rem;
  letter-spacing: 0.03em;
}

.extra-projects {
  margin-top: 18px;
}

.extra-projects[hidden] {
  display: none;
}

.extra-projects .project-card {
  opacity: 0;
  transform: translateY(22px) scale(0.96);
}

.extra-projects.is-visible .project-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.extra-projects.is-visible .project-card:nth-child(2) {
  transition-delay: 70ms;
}

.extra-projects.is-visible .project-card:nth-child(3) {
  transition-delay: 140ms;
}

.more-projects-button {
  width: 100%;

  margin-top: 22px;
  padding: 14px 20px;

  color: var(--text);
  background: rgba(255, 255, 255, 0.1);

  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;

  font: inherit;
  font-weight: 650;
  letter-spacing: 0.04em;

  cursor: pointer;

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.more-projects-button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.more-projects-button[hidden] {
  display: none;
}

/* CV and Extra option windows */
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.option-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-card {
  min-height: 190px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(91, 132, 208, 0.07)),
    rgba(13, 18, 28, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

a.option-card:hover {
  transform: translateY(-6px);
  border-color: rgba(220, 237, 255, 0.55);
  background-color: rgba(255, 255, 255, 0.08);
}

.option-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.option-card > span:last-child {
  display: grid;
  gap: 7px;
}

.option-card strong {
  font-size: 1.05rem;
  letter-spacing: 0.025em;
}

.option-card small {
  color: var(--muted-text);
  font-size: 0.82rem;
  line-height: 1.45;
}

.option-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #e4efff;
  background: rgba(189, 218, 255, 0.12);
  border: 1px solid rgba(215, 234, 255, 0.3);
  border-radius: 17px;
  box-shadow: 0 0 28px rgba(109, 171, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.option-icon-play {
  font-size: 1rem;
}

.option-card-placeholder {
  cursor: default;
}

/* ------------------------------
   Under-construction content
------------------------------ */

.construction-message {
  margin: 0 0 22px;

  color: var(--muted-text);
  line-height: 1.6;
}

.construction-image {
  width: 100%;
  height: auto;

  display: block;

  border: 1px solid var(--border);
  border-radius: 14px;
}

/* ------------------------------
   Smaller screens
------------------------------ */

@media (max-width: 760px) {
  .site-header {
    top: 24px;
    right: 24px;
  }

  .contact-links {
    bottom: 20px;
    right: 24px;
  }

  .hero {
    align-items: flex-end;

    padding:
      120px
      24px
      50px;
  }

  .portrait {
    width: min(100%, 82.2vh);
    width: min(100%, 82.2svh);
  }

  .action-panel {
    width: min(340px, 76vw);
    margin-left: auto;
  }

  .main-button {
    padding: 15px 20px;
  }

  .dock-stack {
    display: none;
  }

  .modal-window {
    padding: 40px 20px 24px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .option-grid,
  .option-grid-two {
    grid-template-columns: 1fr;
  }

  .project-card img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 480px) {
  .site-header h1 {
    font-size: 1.45rem;
  }

  .action-panel {
    width: min(310px, 82vw);
  }

  .welcome-text {
    text-align: right;
  }
}

/*
  Remove animations for users who prefer
  reduced motion.
*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
