:root {
  --outside: #ddd0ea;
  --wall: #fffaf6;
  --wall-dots: #eedcf2;
  --ink: #29233a;
  --pink: #ef9fc4;
  --pink-deep: #d96aa1;
  --mint: #a8dfca;
  --mint-deep: #57aa8c;
  --yellow: #f6da72;
  --blue: #7eb4e8;
  --blue-deep: #3f77ad;
  --coral: #f19679;
  --wood: #e7b873;
  --screen: #29233a;
  --paper: #fffaf6;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --outside: #171525;
    --wall: #242236;
    --wall-dots: #353048;
    --ink: #fbf3e8;
    --pink: #d77aa8;
    --pink-deep: #f09dc6;
    --mint: #518f7c;
    --mint-deep: #9ddbc5;
    --yellow: #dcc35f;
    --blue: #5d8fbe;
    --blue-deep: #a7cef0;
    --coral: #d77c65;
    --wood: #b8864f;
    --screen: #11101c;
    --paper: #2e2b40;
    --shadow: 5px 5px 0 #0d0c13;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 280px;
  background: var(--outside);
  color: var(--ink);
  font-family: "DM Mono", monospace;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.room {
  position: fixed;
  inset: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  overflow: hidden;
  border: var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 18%, var(--wall-dots) 0 2px, transparent 2.5px) 0 0 / 34px 34px,
    var(--wall);
  box-shadow: 8px 8px 0 var(--ink);
  isolation: isolate;
}

.room::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 4%;
  right: 4%;
  bottom: 9.5%;
  border-top: 3px solid color-mix(in srgb, var(--ink) 68%, transparent);
}

.name-wall {
  position: absolute;
  z-index: 0;
  inset: 2% 13% auto;
  color: var(--pink);
  font-family: "Fredoka", sans-serif;
  font-size: clamp(60px, 10vw, 150px);
  font-weight: 700;
  line-height: .78;
  letter-spacing: -.035em;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
}

.name-wall span {
  display: block;
}

.object {
  position: absolute;
  z-index: 5;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transform-origin: 50% 80%;
}

.object:focus-visible {
  outline: 4px solid var(--blue-deep);
  outline-offset: 6px;
  border-radius: 8px;
}

.hint {
  position: absolute;
  z-index: 9;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.object:hover .hint,
.object:focus-visible .hint {
  background: var(--yellow);
}

/* Pink resume frame */
.portrait {
  left: 7.3%;
  top: 10%;
  width: clamp(92px, 10vw, 148px);
  aspect-ratio: 1 / 1.1;
}

.portrait .nail {
  position: absolute;
  left: 50%;
  top: -9%;
  width: 9px;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--wall);
}

.portrait .string {
  position: absolute;
  left: 21%;
  right: 18%;
  top: -2%;
  height: 31%;
  border-top: 2px solid var(--ink);
  transform: rotate(28deg);
  transform-origin: left;
}

.portrait .string.two {
  transform: rotate(-28deg);
  transform-origin: right;
}

.portrait-card {
  position: absolute;
  inset: 14% 4% 1%;
  border: var(--line);
  border-radius: 4px;
  background: var(--pink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-2deg);
}

.portrait-card svg {
  width: 100%;
  height: 100%;
  display: block;
}

.portrait .hint {
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
}

/* Desk and laptop */
.desk {
  left: 8%;
  bottom: 8%;
  width: clamp(270px, 30vw, 460px);
  height: clamp(190px, 23vw, 340px);
}

.desk-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  height: 18px;
  border: var(--line);
  background: var(--mint);
  box-shadow: 3px 3px 0 var(--ink);
}

.leg {
  position: absolute;
  top: 61%;
  width: 17px;
  height: 37%;
  border: var(--line);
  background: var(--wood);
}

.leg.l1 {
  left: 8%;
  transform: rotate(7deg);
}

.leg.l2 {
  left: 29%;
  transform: rotate(-5deg);
}

.leg.r1 {
  right: 8%;
  transform: rotate(-7deg);
}

.leg.r2 {
  right: 29%;
  transform: rotate(5deg);
}

.monitor {
  position: absolute;
  z-index: 3;
  left: 14%;
  top: 3%;
  width: 61%;
  height: 48%;
  border: var(--line);
  border-radius: 7px;
  background: var(--screen);
  box-shadow: 5px 5px 0 var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.monitor::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 4%;
  border-top: 2px solid color-mix(in srgb, #fff 26%, transparent);
}

.monitor::after {
  content: "";
  position: absolute;
  left: -7%;
  top: 100%;
  width: 114%;
  height: 14%;
  border: var(--line);
  border-top-width: 2px;
  border-radius: 0 0 9px 9px;
  background: var(--blue);
  box-shadow: 3px 3px 0 var(--ink);
}

.monitor-word {
  font-family: "Titan One", sans-serif;
  font-size: clamp(26px, 3.4vw, 50px);
  letter-spacing: .02em;
}

.monitor .cursor {
  width: 9px;
  height: 1.1em;
  background: var(--yellow);
  margin-left: 7px;
}

.monitor-line {
  display: flex;
  align-items: center;
}

.monitor:hover,
.monitor:focus-visible {
  transform: rotate(-2deg);
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.desk .hint {
  left: 39%;
  top: -8px;
  transform: translateX(-50%);
}

.cup {
  position: absolute;
  z-index: 2;
  right: 13%;
  top: 39%;
  width: 13%;
  height: 18%;
  border: var(--line);
  border-radius: 2px 2px 9px 9px;
  background: var(--pink);
}

.cup::after {
  content: "";
  position: absolute;
  width: 44%;
  height: 50%;
  right: -43%;
  top: 16%;
  border: var(--line);
  border-left: 0;
  border-radius: 0 50% 50% 0;
}

.steam {
  position: absolute;
  right: 17%;
  top: 23%;
  width: 11px;
  height: 35px;
  border-left: 3px solid var(--ink);
  border-radius: 50%;
}

/* Saeede's custom character / About */
.mascot {
  left: 28.55%;
  bottom: 6.5%;
  width: clamp(420px, 48.25vw, 712px);
  height: auto;
  display: grid;
  place-items: end center;
  cursor: default;
}

.mascot:hover {
  animation: none;
}

.character-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 8396 / 6666.6665;
}

.mascot-character {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(4px 4px 0 color-mix(in srgb, var(--ink) 78%, transparent));
}

/* Clickable SVG layers */
.mascot-character #Laptop,
.mascot-character #girl,
.mascot-character #board>g:first-of-type,
.mascot-character #board>g:last-of-type {
  pointer-events: auto;
  cursor: pointer;
}

.mascot-character #Laptop:focus,
.mascot-character #girl:focus,
.mascot-character #board>g:first-of-type:focus,
.mascot-character #board>g:last-of-type:focus {
  outline: none;
}

.svg-tip {
  left: 0;
  top: 0;
  transform: translate(-50%, -115%);
  background: var(--yellow);
  opacity: 0;
  transition: opacity .15s ease;
}

.svg-tip.show {
  opacity: 1;
}

.laptop-glow {
  position: absolute;
  left: 53%;
  top: 42%;
  width: 20%;
  height: 14%;
  border-radius: 45%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--blue) 48%, transparent), transparent 68%);
  opacity: .12;
  pointer-events: none;
}

/* Plant and cabinet */
.plant {
  right: 7%;
  bottom: 8%;
  width: clamp(150px, 17vw, 250px);
  height: clamp(190px, 23vw, 330px);
}

.cabinet {
  position: absolute;
  left: 3%;
  right: 4%;
  bottom: 0;
  height: 48%;
  border: var(--line);
  border-radius: 8px 8px 3px 3px;
  background: var(--blue);
  box-shadow: 4px 4px 0 var(--ink);
}

.drawer {
  position: absolute;
  left: 8%;
  width: 55%;
  height: 24%;
  border: 2px solid var(--ink);
  background: var(--wood);
}

.drawer.one {
  top: 10%;
}

.drawer.two {
  top: 39%;
}

.drawer.three {
  top: 68%;
}

.drawer::after {
  content: "";
  position: absolute;
  left: 41%;
  top: 40%;
  width: 18%;
  border-top: 2px solid var(--ink);
}

.pot {
  position: absolute;
  z-index: 2;
  right: 8%;
  bottom: 47%;
  width: 28%;
  height: 18%;
  border: var(--line);
  border-radius: 2px 2px 10px 10px;
  background: var(--pink);
}

.plant-stem {
  position: absolute;
  z-index: 1;
  right: 20%;
  bottom: 63%;
  width: 4px;
  height: 23%;
  background: var(--ink);
  transform-origin: bottom;
}

.leaf {
  position: absolute;
  width: 26px;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 80% 10% 80% 10%;
  background: var(--mint);
}

.leaf.one {
  right: 0;
  top: 7%;
  transform: rotate(-22deg);
}

.leaf.two {
  right: 8px;
  top: 31%;
  transform: rotate(155deg);
}

.leaf.three {
  right: -13px;
  top: 49%;
  transform: rotate(-13deg);
}

.plant .hint {
  right: 0;
  top: 24%;
}

.dust {
  position: absolute;
  z-index: 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink-deep);
  opacity: .65;
  pointer-events: none;
}

.dust.d1 {
  left: 39%;
  top: 17%;
}

.dust.d2 {
  left: 72%;
  top: 51%;
  background: var(--blue-deep);
}

.dust.d3 {
  left: 44%;
  top: 41%;
  background: var(--yellow);
}

.dust.d4 {
  left: 21%;
  top: 38%;
}

.room-note {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 1.5%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 9px;
  white-space: nowrap;
}

.room-note span {
  background: var(--paper);
  padding: 3px 7px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

dialog {
  width: min(680px, calc(100vw - 34px));
  max-height: min(80dvh, 700px);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: var(--line);
  border-radius: 14px;
  box-shadow: 9px 9px 0 var(--ink);
  overflow: hidden;
}

dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 54%, transparent);
  backdrop-filter: blur(3px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: var(--line);
  background: var(--yellow);
}

.modal-head h2 {
  margin: 0;
  font: 400 clamp(24px, 4vw, 40px) "Titan One", sans-serif;
}

.close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.close:hover,
.close:focus-visible {
  background: var(--pink);
  outline: 3px solid var(--blue-deep);
  outline-offset: 2px;
}

.modal-body {
  padding: clamp(18px, 4vw, 34px);
  overflow-y: auto;
  max-height: calc(80dvh - 78px);
}

.modal-body p {
  margin: 0 0 20px;
  line-height: 1.65;
  font-size: clamp(13px, 1.8vw, 16px);
}

.project-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.project-card {
  border: 2px solid var(--ink);
  padding: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--mint);
}

.project-card:nth-child(2) {
  background: var(--pink);
}

.project-card small {
  font-weight: 500;
}

.project-card h3 {
  margin: 10px 0 7px;
  font: 400 clamp(23px, 3vw, 34px) "Titan One", sans-serif;
}

.project-card p {
  margin: 0;
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.chip {
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  padding: 5px 8px;
  font-size: 9px;
  background: var(--paper);
}

.resume-grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 26px;
}

.resume-grid h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.resume-grid ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
  font-size: 13px;
}

.cta {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  background: var(--blue);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.cta:hover,
.cta:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
  outline: none;
}

.tiny-note {
  font-size: 11px !important;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
}

@media (min-width: 761px) {
  .room {
    inset: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--outside);
  }

  .room::after {
    display: none;
  }

  .mascot {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .character-stage {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
}

@media (max-width: 760px) {
  .room {
    inset: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-radius: 13px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .room::after {
    display: block;
    left: 2%;
    right: 2%;
    bottom: 5%;
  }

  .name-wall {
    display: block;
    inset: 10% 1% auto;
    font-size: clamp(46px, 15vw, 64px);
    line-height: .84;
  }

  .dust,
  .room-note {
    display: none;
  }

  .mascot {
    left: -5%;
    right: auto;
    top: auto;
    bottom: 3.5%;
    width: 105vw;
    height: auto;
  }

  .character-stage {
    width: 100%;
    height: auto;
    aspect-ratio: 8396 / 6666.6665;
  }

  .mascot-character {
    display: block;
  }

  .hint {
    font-size: 8px;
    padding: 4px 6px;
  }

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

  .modal-body {
    padding: 18px;
  }
}

@media (max-width: 420px) and (max-height: 720px) {
  .name-wall {
    top: 8%;
  }

  .mascot {
    bottom: 2.5%;
    width: 105vw;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .room {
    inset: 5px;
  }
}

/* Keep the approved composition intact at every viewport size. The scene and
   its interaction layer share one aspect-ratio box, so nothing drifts or
   changes scale independently when the browser becomes narrow or tall. */
@media screen {
  .room {
    inset: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background:
      radial-gradient(circle at 12% 18%, var(--wall-dots) 0 2px, transparent 2.5px) 0 0 / 34px 34px,
      var(--wall);
  }

  .room::after {
    display: none;
  }


  .mascot {
    position: absolute;
    left: 50%;
    top: 64%;
    right: auto;
    bottom: auto;
    width: min(100%, calc(75dvh * 6297 / 5000));
    height: auto;
    aspect-ratio: 6297 / 5000;
    transform: translate(-50%, -50%);
    display: block;
    cursor: default;
  }

  .character-stage {
    width: 100%;
    height: 100%;
    aspect-ratio: 6297 / 5000;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}