/* A personal website (D-355): css/style.css does the page, this adds what only a person's page has
   (who it is at the top, experience, work, education) and its own look (D-347).
   Ansha Cerbia, UI/UX designer. One idea everywhere: the selection frame of a design tool. The
   highlighted words, the screen at the top, the service cards, the steps, the experience rail and
   the name in the footer carry a thin violet frame with square handles; a cursor with a name tag
   points at them; a layout grid runs behind the top. Violet is the selection, lime the highlight,
   near-black the canvas. */
:root {
  --ink: #0f0e17;
  --body: #3b3a47;
  --muted: #5f5e6d;
  --paper: #f5f5f7;
  --soft: #e9e8f0;
  --card: #ffffff;
  --line: rgba(15, 14, 23, 0.12);
  --brand: #5b2eff;
  --brand-2: #3d16d9;
  --on-brand: #ffffff;
  --accent: #c6ff3d;
  --on-accent: #0f0e17;
  --dark: #0f0e17;
  --dark-2: #1c1a29;
  --on-dark: #f5f5f7;
  --radius: 22px;
  --radius-sm: 12px;
  /* Inter, the design tool's own default type: steady, even letters (Syne read as wobbly) */
  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --display-weight: 700;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

h1 {
  font-size: clamp(2.3rem, 9.2vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.04;
}
.statement {
  font-weight: 700;
  font-size: clamp(1.75rem, 5.2vw, 3.5rem);
  line-height: 1.12;
}
.contact__title {
  font-size: clamp(2.5rem, 10vw, 6rem);
}

/* --- The selection frame: an outline with four square handles (--sel: its colour, --handle: the
   handles' inside, --gap: how far outside the box) --- */
.sel,
h1 em,
.statement em {
  position: relative;
}
.sel::before,
.sel::after,
h1 em::before,
h1 em::after,
.statement em::before,
.statement em::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.sel::before,
h1 em::before,
.statement em::before {
  inset: calc(-1 * var(--gap, 6px));
  border: 1.5px solid var(--sel, var(--brand));
}
.sel::after,
h1 em::after,
.statement em::after {
  --hs: var(--sel, var(--brand));
  --hf: var(--handle, var(--paper));
  inset: calc(-1 * var(--gap, 6px) - 4px);
  background:
    linear-gradient(var(--hf), var(--hf)) 1.5px 1.5px / 6px 6px no-repeat,
    linear-gradient(var(--hf), var(--hf)) calc(100% - 1.5px) 1.5px / 6px 6px no-repeat,
    linear-gradient(var(--hf), var(--hf)) 1.5px calc(100% - 1.5px) / 6px 6px no-repeat,
    linear-gradient(var(--hf), var(--hf)) calc(100% - 1.5px) calc(100% - 1.5px) / 6px 6px
      no-repeat,
    linear-gradient(var(--hs), var(--hs)) 0 0 / 9px 9px no-repeat,
    linear-gradient(var(--hs), var(--hs)) 100% 0 / 9px 9px no-repeat,
    linear-gradient(var(--hs), var(--hs)) 0 100% / 9px 9px no-repeat,
    linear-gradient(var(--hs), var(--hs)) 100% 100% / 9px 9px no-repeat;
}

/* *a word* in the big heading and the statement: selected, the frame landing after the words */
h1 em,
.statement em {
  --gap: 3px;
  display: inline-block;
  margin: 0 0.04em;
  padding: 0 0.08em;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
}
.js h1 em::before,
.js h1 em::after,
.js .statement em::before,
.js .statement em::after {
  opacity: 0;
  transform: scale(1.12);
  transition:
    opacity 0.5s var(--ease) var(--sd, 0.9s),
    transform 0.7s var(--ease) var(--sd, 0.9s);
}
.statement em {
  --sd: 0s;
}
.js .split-in em::before,
.js .split-in em::after,
.js .statement.in em::before,
.js .statement.in em::after {
  opacity: 1;
  transform: none;
}

/* a cursor with a name tag, like a collaborator's in a shared file */
.cursor {
  display: flex;
  align-items: flex-start;
  gap: 1px;
  pointer-events: none;
}
.cursor svg {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--ink);
  filter: drop-shadow(0 4px 6px rgba(15, 14, 23, 0.3));
}
.cursor b {
  margin-top: 20px;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 13px/1.2 var(--display);
  white-space: nowrap;
}

/* section labels: the number in a selection badge, a redline measuring the rest */
.eyebrow {
  gap: 12px;
  letter-spacing: 0.12em;
}
.eyebrow::before {
  padding: 5px 7px 4px;
  border-radius: 4px;
  background: var(--brand);
  color: var(--on-brand);
  font: 700 12px/1 var(--display);
  letter-spacing: 0.02em;
}
.eyebrow::after {
  height: 9px;
  border-inline: 1.5px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat;
}
.eyebrow--light::before,
.services .eyebrow::before {
  background: var(--accent);
  color: var(--on-accent);
}

/* --- Header --- */
.brand__mark {
  border-radius: 8px;
  font-size: 14px;
}

/* --- Top: a layout grid behind it, and the screen --- */
.hero__bg::before {
  background:
    radial-gradient(
      40% 36% at 78% 30%,
      color-mix(in srgb, var(--brand) 16%, transparent),
      transparent 70%
    ),
    radial-gradient(
      30% 26% at 14% 70%,
      color-mix(in srgb, var(--accent) 34%, transparent),
      transparent 70%
    );
}
.hero__bg::after {
  inset: 0 auto 0 50%;
  width: min(100% - 2 * var(--gutter) + 16px, var(--wrap) + 16px);
  transform: translateX(-50%);
  background: repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--brand) 6%, transparent) 0 calc(25% - 16px),
      transparent 0 25%
    )
    8px 0;
  -webkit-mask-image: linear-gradient(#000 30%, transparent 95%);
  mask-image: linear-gradient(#000 30%, transparent 95%);
  opacity: 1;
}

/* the screen in CSS, until the 3D is ready and on phones without 3D */
.mock {
  position: relative;
  width: min(42vw, 190px);
  aspect-ratio: 134 / 190;
  border-radius: 22px;
  background: var(--ink);
  box-shadow:
    0 0 0 5px #d8d8e0,
    0 0 0 6px rgba(15, 14, 23, 0.1),
    0 40px 60px -30px rgba(15, 14, 23, 0.6);
  /* room on the right for the cursor's name tag */
  translate: -40px 0;
  animation: mock-float 6s ease-in-out infinite;
}
:where(.mock) i {
  position: absolute;
  left: 10.5%;
  right: 10.5%;
  border-radius: 5px;
}
.mock__bar {
  top: 8.3%;
  height: 6.8%;
  background: color-mix(in srgb, var(--ink) 80%, var(--paper));
}
.mock__img {
  top: 20.5%;
  height: 32.6%;
  background: var(--brand);
}
.mock__line {
  top: 58.7%;
  right: 26.5%;
  height: 3.7%;
  border-radius: 99px;
  background: var(--paper);
}
.mock__line--short {
  top: 65.5%;
  right: 47.4%;
  background: color-mix(in srgb, var(--ink) 50%, var(--paper));
}
.mock__btn {
  top: 77.1%;
  right: 52.6%;
  height: 9%;
  border-radius: 99px;
  background: var(--accent);
}
.mock__sel {
  --gap: 4px;
  position: absolute;
  left: 10.5%;
  right: 10.5%;
  top: 20.5%;
  height: 32.6%;
}
.mock__cursor {
  position: absolute;
  left: calc(89.5% + 2px);
  top: calc(53.1% + 2px);
  animation: nudge 5s ease-in-out infinite;
}
@keyframes mock-float {
  50% {
    transform: translateY(-10px) rotate(-2deg);
  }
}
@keyframes nudge {
  50% {
    transform: translate(-6px, -4px);
  }
}

/* the bands: square handles between the words */
.ribbon svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
  color: var(--ink);
}
.ribbon--b svg {
  fill: var(--paper);
  color: var(--brand);
}

/* --- Who it is, above the big heading --- */
.me {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
}
.me__photo {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand);
  color: var(--on-brand);
  font: 800 17px/1 var(--display);
  box-shadow:
    0 0 0 3px var(--paper),
    0 0 0 5px var(--brand);
}
.me strong {
  display: block;
  color: var(--ink);
  font: 700 1.1rem/1.2 var(--display);
  letter-spacing: -0.01em;
}
.me small {
  display: block;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
.me small:empty {
  display: none;
}
/* "open for new work": a dot that breathes */
.status-open {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 28px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--wa) 12%, transparent);
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}
.status-open::before {
  content: '';
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--wa);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--wa) 60%, transparent);
  animation: breathe 2.4s ease-out infinite;
}
@keyframes breathe {
  to {
    box-shadow: 0 0 0 10px transparent;
  }
}
.stage__initials {
  color: var(--accent);
  font: 800 clamp(3.4rem, 15vw, 5.4rem)/1 var(--display);
  letter-spacing: -0.04em;
}
img.avatar {
  background: none;
}

/* --- Services: each card a frame on the canvas, handle marks in its corners --- */
.card::before {
  --h: color-mix(in srgb, var(--card-ink) 40%, transparent);
  content: '';
  position: absolute;
  inset: 12px;
  pointer-events: none;
  background:
    linear-gradient(var(--h), var(--h)) 0 0 / 7px 7px no-repeat,
    linear-gradient(var(--h), var(--h)) 100% 0 / 7px 7px no-repeat,
    linear-gradient(var(--h), var(--h)) 0 100% / 7px 7px no-repeat,
    linear-gradient(var(--h), var(--h)) 100% 100% / 7px 7px no-repeat;
}
.card__no {
  font-weight: 800;
}
.closing {
  background: var(--brand);
}

/* --- Experience: a rail that fills as you scroll, a handle at each stop --- */
.xp__list {
  position: relative;
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0 0 0 30px;
  list-style: none;
}
.xp__list::before,
.xp__list::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line);
}
.xp__list::after {
  background: var(--brand);
  transform: scaleY(var(--fill, 0));
  transform-origin: top;
}
.xp__item {
  position: relative;
}
.xp__item::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 6px;
  z-index: 1;
  width: 14px;
  height: 14px;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--ink);
  transition:
    background 0.4s 0.3s,
    box-shadow 0.4s 0.3s;
}
.xp__item.in::before {
  background: var(--paper);
  box-shadow:
    inset 0 0 0 2px var(--brand),
    0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.xp__when {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.xp__body h3 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}
.xp__where {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 600;
}
.xp__text {
  max-width: 40em;
  margin-top: 12px;
}

/* --- Work --- */
.works {
  background: var(--soft);
}
.works__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.work {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease);
}
.work:nth-child(n + 7) {
  display: none;
}
.is-all .work {
  display: flex;
}
.work__photo {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.work__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.work:hover .work__photo img {
  transform: scale(1.05);
}
/* no picture yet: a wireframe's image placeholder, crossed from corner to corner */
.work__photo--none {
  display: grid;
  place-items: center;
  background:
    linear-gradient(
      to top right,
      transparent calc(50% - 1px),
      color-mix(in srgb, var(--on-dark) 16%, transparent) 0 calc(50% + 1px),
      transparent 0
    ),
    linear-gradient(
      to bottom right,
      transparent calc(50% - 1px),
      color-mix(in srgb, var(--on-dark) 16%, transparent) 0 calc(50% + 1px),
      transparent 0
    ),
    var(--dark-2);
  color: var(--accent);
  font: 800 4.2rem/1 var(--display);
  letter-spacing: -0.05em;
}
.work__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
}
.work__meta {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.work h3 {
  font-size: clamp(1.35rem, 2.6vw, 1.6rem);
}
.work h3 small {
  color: var(--muted);
  font: 600 0.95rem/1 var(--font);
  letter-spacing: 0;
  white-space: nowrap;
}
.work .link {
  margin-top: auto;
  align-self: flex-start;
}

/* --- Education --- */
.edu__grid {
  display: grid;
  gap: 32px;
}
.edu__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}
.edu__list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.edu__year {
  color: var(--brand);
  font: 700 1rem/1.3 var(--display);
}
.edu__list h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
}
.edu__list p {
  margin: 4px 0 0;
  color: var(--muted);
}

/* --- Steps: square handles on the rail, selected as they come into view --- */
.steps__no {
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font: 700 1.05rem/1 var(--display);
}
.steps__list li.in .steps__no {
  background: var(--brand);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--on-brand);
}

/* --- Footer: the name, selected, and a cursor (the visitor's) pointing at it --- */
.foot__frame {
  --gap: 0px;
  --sel: var(--accent);
  --handle: var(--dark);
  margin: clamp(48px, 8vw, 88px) var(--gutter) 0;
}
.foot__word {
  margin: 0;
  padding: 6px 10px 12px;
}
.foot__frame + .foot__base {
  margin-top: 56px;
}
.foot__cursor {
  position: absolute;
  right: 8%;
  bottom: -34px;
  animation: nudge 5s ease-in-out infinite;
}
.foot__cursor b {
  background: var(--brand);
  color: var(--on-brand);
}
.js .foot__frame::before,
.js .foot__frame::after {
  transition:
    opacity 0.6s var(--ease) 1.1s,
    transform 0.8s var(--ease) 1.1s;
}
.js .foot__cursor {
  transition:
    opacity 0.6s 1.5s,
    translate 0.9s var(--ease) 1.5s;
}
.js .foot__frame:has(.foot__word:not(.in))::before,
.js .foot__frame:has(.foot__word:not(.in))::after {
  opacity: 0;
  transform: scale(1.03);
}
.js .foot__frame:has(.foot__word:not(.in)) .foot__cursor {
  opacity: 0;
  translate: 40px 30px;
}

@media (min-width: 640px) {
  .works__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .edu__list li {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 20px;
  }
}
@media (min-width: 960px) {
  .hero__bg::after {
    background: repeating-linear-gradient(
        90deg,
        color-mix(in srgb, var(--brand) 6%, transparent) 0 calc(100% / 12 - 16px),
        transparent 0 calc(100% / 12)
      )
      8px 0;
  }
  .mock {
    width: 250px;
    border-radius: 28px;
    translate: -60px 0;
  }
  .cursor svg {
    width: 30px;
    height: 30px;
  }
  .cursor b {
    margin-top: 24px;
    font-size: 14px;
  }
  .xp__list {
    max-width: 880px;
  }
  .xp__item {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 28px;
  }
  .xp__when {
    margin-top: 4px;
  }
  .xp__body {
    grid-column: 2;
  }
  .works__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
  .edu__grid {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 72px;
    align-items: start;
  }
  .edu__grid header {
    position: sticky;
    top: calc(var(--head) + 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-open::before,
  .mock,
  .mock__cursor,
  .foot__cursor {
    animation: none;
  }
}
