.main-home {
  max-width: 1184px;
  margin-top: clamp(30px, 5vh, 54px);
}

.home-stage {
  --compact-console-height: clamp(320px, 49vh, 464px);
  --home-gap: clamp(18px, 3vw, 32px);
  --compact-map-height: 64px;
  --map-ease: .48s cubic-bezier(.22,.82,.23,1);
  gap: var(--home-gap);
  align-items: stretch;
}

.home-stage .home-profile {
  align-self: stretch;
  border-radius: 28px;
  padding: clamp(24px, 3.1vw, 40px);
  box-sizing: border-box;
  animation: none;
}

.home-stage .home-side {
  min-width: 0;
  padding-top: 0;
  animation: none;
}

.home-stage .home-console {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: var(--compact-console-height);
  box-sizing: border-box;
}

.home-stage .linux-screen { min-height: 0; height: 100%; }
.home-stage:has(.home-network.is-expanded) .home-console { height: clamp(418px, 66vh, 650px); }
@media (min-width:681px) {
  .home-stage { row-gap: 0; }
  .home-stage .home-side { container-type: size; }
  .home-stage .home-console { height: calc(100cqh - var(--compact-map-height) - var(--home-gap)); }
  .home-stage:has(.home-network.is-expanded) .home-console { height: 100cqh; }
}
@media (prefers-reduced-motion:no-preference) {
  .home-stage .home-console { transition: height var(--map-ease); }
}
.home-stage .home-social { margin-top: 22px; }
.home-stage .home-avatar { margin-block: 19px 14px; }
.home-stage .home-name h1 {
  font-size: clamp(52px, 6.1vw, 92px);
  font-weight: 760;
  letter-spacing: -.074em;
  line-height: 1;
}
.home-stage .home-intro { margin-top: 18px; }
.home-stage .home-buttons { margin-top: 20px; }
.home-stage .home-name > p::after { animation: none; }
.home-stage .home-profile > :is(.home-avatar,.home-name,.home-intro,.home-buttons,.home-social) { animation: none; }

.name-type .name-period { position: relative; color: transparent; }
.home-period-dot {
  position: absolute;
  left: 50%;
  bottom: .13em;
  width: clamp(10px, .19em, 16px);
  aspect-ratio: 1;
  border-radius: 50%;
  translate: -50%;
  background: var(--blue);
}
.home-profile.has-pet .name-period { visibility: hidden; }
@media (prefers-reduced-motion:no-preference) {
  .home-stage .home-profile:has(.home-pet-area) { padding-bottom: max(32px, 3.1vw); }
}
.home-pet-area {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.home-pet {
  position: absolute;
  z-index: 3;
  inset: 0 auto auto 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  transition: none;
}
.home-pet[hidden] { display: none; }
.home-pet[data-perched] { pointer-events: none; }
.home-pet[data-perched]::before {
  position: absolute;
  inset: 0 0 11px;
  pointer-events: auto;
  content: "";
}
.home-pet:active { cursor: grabbing; }
.home-pet:focus-visible { outline: 2px solid var(--blue); outline-offset: -4px; }
.home-pet-body {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pet-tone, var(--blue));
  pointer-events: none;
  box-shadow: inset 0 -2px 3px #14285e30, 0 2px 4px #172e642f;
  transform-origin: 50% 90%;
  transition: background-color .34s ease, scale .15s ease-out;
}
.home-pet[data-mood=curious] { --pet-tone: #23a69a; }
.home-pet[data-mood=playful] { --pet-tone: #e8a640; }
.home-pet[data-mood=startled] { --pet-tone: #e57971; }
.home-pet[data-mood=sleepy] { --pet-tone: #8b8cae; }
.home-pet[data-pose=seed] .home-pet-body {
  background: var(--blue);
  box-shadow: none;
  scale: var(--pet-seed-scale, 1);
  transform-origin: center;
  transition: none;
}
.home-pet:is([data-pose=fall],[data-pose=drop],[data-pose=throw]) .home-pet-body::before {
  position: absolute;
  inset: auto 24% 80%;
  height: 28px;
  border-radius: 50% 50% 25% 25%;
  background: linear-gradient(transparent, color-mix(in srgb, var(--pet-tone, var(--blue)) 50%, transparent));
  content: "";
  pointer-events: none;
}
.home-pet-spark {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--spark-tone, var(--blue));
  box-shadow: 0 0 4px var(--spark-tone, var(--blue));
  pointer-events: none;
}
.home-pet-spark.is-ring {
  width: 22px;
  height: 8px;
  margin: -4px -11px;
  border: 1px solid var(--spark-tone, var(--blue));
  background: transparent;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .main-home .home-profile::after {
    position: absolute;
    content: "";
    inset: 0;
    border: 1px solid transparent;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(150px circle at var(--rim-x, 50%) var(--rim-y, 50%), #f5fbffc9, #75b5f968 62%, transparent) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .24s;
  }
  .main-home .home-profile.is-lit::after { opacity: 1; }
  .home-network-link:hover .icon { animation: launch-arrow .46s cubic-bezier(.18,.8,.28,1.22); }
  @keyframes launch-arrow {
    40% { translate: 5px -5px; }
    100% { translate: 0 0; }
  }
}

body[data-page="home"] {
  --cover-top: #e4eff519;
  --cover-tint: #dae8f022;
}

[data-theme="dark"] body[data-page="home"] {
  --cover-top: #050b1625;
  --cover-tint: #050b1657;
}

@property --map-open {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
.main-home .home-network {
  --map-open: 0;
  grid-column: 1 / -1;
  position: relative;
  min-width: 0;
  display: block;
  overflow: visible;
  padding: 0;
  border-radius: calc(22px + 2px * var(--map-open));
  transition: --map-open var(--map-ease), background-color .35s, border-color .35s, box-shadow .35s;
}
.main-home .home-network.is-expanded {
  --map-open: 1;
  background-color: #08151f;
  border-color: #3f6377;
  box-shadow: 0 18px 44px #0004;
}
.home-network-details {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows var(--map-ease), visibility 0s .48s;
}
.home-network.is-expanded .home-network-details {
  grid-template-rows: 1fr;
  visibility: visible;
  transition-delay: 0s;
}
.home-network-clip {
  min-height: 0;
  overflow: hidden;
  border-radius: 0 0 22px 22px;
}

.home-network-header,
.home-network-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 14px clamp(17px, 2.4vw, 29px);
}
.home-network-header {
  justify-content: start;
  flex-wrap: nowrap;
  gap: 8px;
  padding-block: calc(10px + 4px * var(--map-open));
  padding-inline: calc(16px + 9px * var(--map-open));
}

.home-network-link {
  color: #e4f3f8;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
}
.home-network-link h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(16px, 2vw, 23px);
  letter-spacing: -.03em;
}
.home-network-link .icon { width: 15px; height: 15px; color: #a2d8ee; }
.home-network-link:hover { color: #a2e5ff; }
.home-network .home-network-toggle { order: 1; margin-left: auto; }
.home-network .home-network-toggle .icon { transition: rotate .25s; }
.home-network.is-expanded .home-network-toggle .icon { rotate: 180deg; }
.home-project-preview {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  color: var(--ink);
}
.home-project-preview h2 { margin: 0; font-size: 16px; font-weight: 600; }
.home-network.is-expanded .home-project-preview,
.home-network:not(.is-expanded) .home-network-link { display: none; }
.home-network .home-network-toggle {
  width: 40px;
  height: 42px;
  margin: 0;
  padding: 0;
  flex: none;
}
.home-network:not(.is-expanded) .home-network-toggle {
  color: var(--ink);
}
.home-network:not(.is-expanded) :focus-visible { outline-color: var(--blue); }
@media(min-width:681px){
  .main-home .home-network {
    --console-share: .50980392;
    justify-self: end;
    width: calc(100% * var(--map-open) + (100% - var(--home-gap)) * var(--console-share) * (1 - var(--map-open)));
    margin-top: calc((var(--home-gap) + var(--compact-map-height)) * var(--map-open) - var(--compact-map-height));
  }
}
@media (681px <= width <= 1000px) {
  .main-home .home-network { --console-share: .5; }
}
@media(prefers-reduced-motion:reduce){
  .main-home .home-network, .home-network-details, .home-network .home-network-toggle .icon { transition:none; }
}
.home-network-icon { position: relative; display: grid; place-items: center; width: 32px; height: 32px; }
.home-network-icon > .icon { width: 22px; height: 22px; }
.home-network-icon > img { position: absolute; inset: 0; }
.home-network-icon .mct-home-icon { width: 32px; height: 32px; object-fit: contain; }
.home-network-icon:has(img:not([hidden])) > .icon { visibility: hidden; }

.home-network-controls {
  display: flex;
  width: fit-content;
  gap: 3px;
  margin: 0 clamp(14px, 2.4vw, 29px) 12px;
  padding: 3px;
  border-radius: 100px;
  background: #112532;
  border: 1px solid #4d78955e;
}
.home-network-controls[hidden],
.home-network-viewport[hidden],
.home-network-caption [hidden] { display: none; }

.home-network button {
  appearance: none;
  color: #cae4ed;
  background: transparent;
  font: inherit;
  font-size: 12px;
  padding: 9px 13px;
  border: 0;
  border-radius: 100px;
  cursor: pointer;
}
.home-network button:hover { background: #b2dcf02b; color: white; }
.home-network button[aria-pressed="true"] { background: #ace5fa; color: #102e3e; }
.home-network :is(a,button):focus-visible { outline: 2px solid #c8efff; outline-offset: 3px; }
.home-network-viewport {
  position: relative;
  height: clamp(220px, 30vw, 338px);
  border-block: 1px solid #42688170;
  background: #091825;
}
.main-home .home-network-viewport .relay-field {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: pan-y;
}
.home-network-viewport.is-dragging .relay-field { cursor: grabbing; }
.home-network-action { position: absolute; bottom: 12px; left: 14px; }
.home-network-action button { background: #17384a; border: 1px solid #89bdcf72; }
.home-network-action .icon { width: 12px; height: 12px; vertical-align: -.12em; }
.home-network-caption { color: #bedae5; font-size: 12px; }
.home-network-caption p { margin: 0; }
.home-network-caption p { color: inherit; }
.home-network-caption > span { color: #a7c1cf; }
.main-home .home-writing > header > h2 { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  html[data-home-entrance="waiting"] .wallpaper .daily-wallpaper.is-opening { animation: none; }
  html:is([data-home-entrance="play"],[data-home-entrance="played"]) .wallpaper .daily-wallpaper.is-opening {
    animation: landscape-exposure 1.05s cubic-bezier(.16,.72,.22,1) both;
  }
  html[data-home-entrance="play"] .home-stage {
    --arrival-ease: cubic-bezier(.2,.78,.25,1);
  }
  html[data-home-entrance="play"] .home-stage .home-profile {
    animation: arrival-profile .52s var(--arrival-ease) backwards;
  }
  html[data-home-entrance="play"] .home-stage .home-console {
    animation: arrival-console .75s var(--arrival-ease) .09s backwards;
  }
  html[data-home-entrance="play"] .home-avatar img {
    animation: arrival-avatar .68s var(--arrival-ease) backwards;
  }
  html[data-home-entrance="play"] .name-type i {
    animation: arrival-letter .565s var(--arrival-ease) calc(45ms + var(--letter-index) * 36ms) backwards;
  }
  html[data-home-entrance="play"] .home-stage :is(.home-name>p,.home-profile>.home-intro,.home-profile>.home-buttons,.home-profile>.home-social) {
    animation: arrival-detail .49s var(--arrival-ease) var(--detail-delay, 100ms) backwards;
  }
  .home-intro { --detail-delay: 166ms; }
  .home-buttons { --detail-delay: 232ms; }
  .home-social { --detail-delay: 298ms; }
  @keyframes arrival-profile { from { opacity: 0; } }
  @keyframes arrival-console {
    from { clip-path: inset(0 0 100% 0 round 18px); }
    to { clip-path: inset(0 round 18px); }
  }
  @keyframes arrival-avatar {
    from { clip-path: inset(0 100% 0 0 round 25px); scale: 1.08; }
    to { clip-path: inset(0 round 25px); scale: 1; }
  }
  @keyframes arrival-letter {
    from { transform: perspective(270px) translateY(.48em) rotateX(-76deg); opacity: 0; }
    72% { transform: perspective(270px) translateY(-.06em) rotateX(7deg); opacity: 1; }
    to { transform: none; opacity: 1; }
  }
  @keyframes arrival-detail {
    from { clip-path: inset(0 0 90% 0); opacity: .1; }
    to { clip-path: inset(0); opacity: 1; }
  }
  @keyframes landscape-exposure {
    from { clip-path: inset(0 92% 0 0); opacity: .18; }
    to { clip-path: inset(0); opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .main-home .home-network .relay-field { cursor: default; }
  .home-network-viewport .home-network-action { display: none; }
}

@media (max-width: 680px) {
  .home-stage .home-name h1 { font-size: clamp(50px, 12.5vw, 76px); }
  .home-stage .home-profile { padding: 24px; }
  .home-network-header { padding-inline: 16px; }
  .home-network-viewport { height: 240px; }
}

@media (max-width: 360px) {
  .home-stage .home-profile { padding-inline: 19px; }
  .home-network-controls > button { padding-inline: 11px; }
}
