/* Only the blues and white of the profile picture. The apps are the only things that bring their own colour. */
:root {
  --ink: #14265f;
  --night: #183078;
  --royal: #3060c0;
  --sky: #6090d8;
  --pale: #c0d8f0;
  --cloud: #f6fbff;
  --edge: 2.5px 0 var(--night), 2.2px 1.2px var(--night), 1.2px 2.2px var(--night), 0 2.5px var(--night), -1.2px 2.2px var(--night), -2.2px 1.2px var(--night), -2.5px 0 var(--night), -2.2px -1.2px var(--night), -1.2px -2.2px var(--night), 0 -2.5px var(--night), 1.2px -2.2px var(--night), 2.2px -1.2px var(--night);
  --round: 27px 23px 29px 21px / 22px 28px 21px 27px; /* a little uneven, as if drawn by hand */
  --font: "Zen Maru Gothic", ui-rounded, "Hiragino Maru Gothic ProN", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { min-height: 100%; background: linear-gradient(var(--night), var(--royal) 60%, var(--sky)) fixed; }
body { min-height: 100dvh; overflow-x: hidden; color: var(--cloud); font: 500 17px/1.5 var(--font); -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 7px var(--ink); }
dialog :focus-visible { outline-color: var(--royal); box-shadow: none; }
.unseen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.noscript { position: fixed; inset: auto 20px 24px; text-align: center; }

#sky { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: 0; transition: opacity 0.9s; }
#sky.on { opacity: 1; }
#feathers { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#feathers i { position: absolute; animation: fall linear forwards; }
#feathers svg { display: block; overflow: visible; animation: sway ease-in-out infinite alternate; }
@keyframes fall { to { transform: translate(var(--aside), calc(100dvh + 90px)); } }
@keyframes sway { from { transform: translateX(calc(var(--side) * -24px)) rotate(calc(var(--side) * 64deg)); } to { transform: translateX(calc(var(--side) * 24px)) rotate(calc(var(--side) * -12deg)); } }

/* Writing that sits straight on the sky gets an ink edge, so clouds can drift behind it. */
.status, .bio, .apps span, .curled i { text-shadow: var(--edge); }

.screen { display: grid; grid-template-rows: auto 1fr auto; gap: clamp(10px, 2.4dvh, 26px); width: min(100%, 440px); min-height: 100dvh; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 20px calc(126px + env(safe-area-inset-bottom)); }
.status { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; font-weight: 900; }
#mood { display: flex; align-items: center; gap: 9px; }
.beat { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.beat i { width: 5px; height: 100%; border: 1.5px solid var(--night); border-radius: 3px; background: var(--cloud); transform-origin: bottom; animation: beat 0.9s ease-in-out infinite alternate; }
.beat i:nth-child(2) { animation-duration: 0.62s; }
.beat i:nth-child(3) { animation-duration: 1.1s; }
@keyframes beat { from { transform: scaleY(0.28); } to { transform: scaleY(1); } }

.me { align-self: center; text-align: center; }
/* --a is how big the picture is. The wings and the halo grow with it. */
.angel { --a: 132; position: relative; cursor: pointer; width: calc(var(--a) * 1px); height: calc(var(--a) * 1px); margin: calc(var(--a) * 0.26px) auto 0; }
.angel img { position: relative; display: block; width: 100%; height: 100%; border: calc(var(--a) * 0.03px) solid var(--cloud); border-radius: 50%; box-shadow: 0 0 0 3px var(--ink); }
.angel svg { position: absolute; overflow: visible; }
.wing { position: absolute; top: 47%; left: 16%; scale: calc(var(--a) / 161); }
.wing { animation: unfold 1s cubic-bezier(0.2, 1.25, 0.4, 1) backwards; }
@keyframes unfold { from { scale: 0; } }
.wing.right { left: 84%; scale: calc(var(--a) / -161) calc(var(--a) / 161); }
.wing svg { width: 1px; height: 1px; animation: flap 4.6s ease-in-out infinite alternate; }
.wing svg:first-child { --far: 1.7; }
@keyframes flap { from { transform: rotate(calc(var(--far, 1) * 2.5deg)); } to { transform: rotate(calc(var(--far, 1) * -4deg)); } }
.halo { left: 11%; top: -23%; width: 78%; height: 26%; animation: hover 3.2s ease-in-out infinite alternate; }
@keyframes hover { from { transform: translateY(3px) rotate(-5deg); } to { transform: translateY(-4px) rotate(3deg); } }

.name { margin: 18px auto 0; }
.name svg { display: block; width: min(100%, 340px); height: auto; margin: 0 auto; overflow: visible; }
.name .roll { transform-box: fill-box; transform-origin: center; animation: roll-in 1.5s cubic-bezier(0.2, 0.8, 0.25, 1) backwards; }
.name .roll:last-of-type { animation-delay: 0.16s; }
@keyframes roll-in { from { transform: translateX(-420px) rotate(-900deg); } }
.bio { margin-top: 6px; font-weight: 700; font-size: 18px; }

.now { display: grid; grid-template-columns: 1fr auto; align-items: baseline; width: 100%; padding: 12px 20px 6px; border: 3px solid var(--ink); border-radius: var(--round); background: var(--cloud); color: var(--ink); text-align: left; transition: transform 0.18s; }
.now:empty { display: none; }
.now:active { transform: scale(0.98); }
.now span { display: contents; }
.now b { font-size: 27px; font-weight: 900; line-height: 1.2; }
.now small { color: var(--royal); font-size: 15px; font-weight: 700; }
.now em { grid-column: 1 / -1; padding-bottom: 8px; font-style: normal; }
.now canvas { grid-column: 1 / -1; width: 100%; height: clamp(92px, 14dvh, 128px); margin-top: 4px; }

.icons { position: relative; margin-top: 20px; }
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 6px; padding: 0; list-style: none; }
.apps button { display: block; width: 100%; padding: 0; border: 0; border-radius: 18px; background: none; color: inherit; text-align: center; }
.icon { display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 21px 18px 22px 17px / 18px 21px 17px 20px; color: #fff; font: 900 36px/1 var(--font); }
.apps .icon, .curled { width: 68px; height: 68px; margin: 0 auto 5px; }
.apps .icon { transition: transform 0.18s; }
.apps button:active .icon { transform: scale(0.92); }
.apps span { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.curled { position: relative; }
.curled svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 90%; }
.awake .curled svg { animation: hop 0.45s cubic-bezier(0.3, 0.7, 0.4, 1), bop 0.47s 0.45s ease-in-out infinite alternate; }
@keyframes hop { 30% { transform: translateY(-20px) scale(0.94, 1.08); } 72% { transform: scale(1.1, 0.86); } }
@keyframes bop { to { transform: scale(1.05, 0.93); } }
.curled i { position: absolute; top: -4px; right: -3px; font: 900 20px/1 var(--font); opacity: 0; animation: snore 5.4s ease-out infinite; }
li:nth-child(3) i { animation-delay: 1.8s; }
li:nth-child(4) i { animation-delay: 3.6s; }
.awake i { visibility: hidden; }
@keyframes snore { 0% { opacity: 0; transform: translate(-8px, 10px) scale(0.5); } 12% { opacity: 1; } 34%, 100% { opacity: 0; transform: translate(9px, -17px) scale(1.15) rotate(14deg); } }

.whisper { position: absolute; z-index: 1; bottom: calc(100% - 8px); padding: 6px 16px; border: 3px solid var(--ink); border-radius: 19px; background: var(--cloud); color: var(--ink); font-weight: 700; white-space: nowrap; opacity: 0; transform: translateY(8px) scale(0.8); transform-origin: var(--at, 50%) 100%; transition: opacity 0.16s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); pointer-events: none; }
.whisper::before, .whisper::after { content: ""; position: absolute; top: 100%; left: calc(var(--at, 50%) - 12px); border: 9px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.whisper::after { top: calc(100% - 4px); border-top-color: var(--cloud); }
.whisper.on { opacity: 1; transform: none; }

/* The dock is a cloud. */
.dock { position: fixed; z-index: 1; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 4px; width: min(calc(100% - 24px), 400px); height: 104px; padding: 30px 26px 0; transform: translateX(-50%); color: var(--ink); }
.dock > svg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; overflow: visible; }
.dock button, .dock a { flex: 1 1 0; display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0; padding: 4px 2px; border: 0; border-radius: 16px; background: none; color: inherit; font-size: 14px; font-weight: 700; text-decoration: none; transition: transform 0.18s; }
.dock button svg, .dock a svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Windows: a sheet from the bottom on phones, something you can drag about on computers. */
dialog { max-width: none; max-height: none; padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: rgb(20 38 95 / 0.5); }
#window[open] { position: fixed; inset: auto 0 0; display: grid; grid-template-rows: auto 1fr; width: min(100%, 520px); max-height: 92dvh; margin: 0 auto; border: 3px solid var(--ink); border-bottom: 0; border-radius: 30px 27px 0 0; background: var(--cloud); overflow: hidden; }
.bar { touch-action: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 24px; border-bottom: 3px solid var(--ink); background: var(--pale) radial-gradient(circle, var(--sky) 1.3px, transparent 1.6px) 0 0 / 7px 7px; }
.bar h2 { padding: 0 10px; margin-left: -10px; border-radius: 12px; background: var(--pale); font-size: 24px; font-weight: 900; line-height: 1.3; }
#close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: 50%; background: var(--cloud); }
#close svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.inside { overflow: auto; padding: 22px 24px calc(26px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.inside > * > * + * { margin-top: 16px; }

.essay { line-height: 1.65; }
.essay h3 { font-size: 21px; font-weight: 900; line-height: 1.3; }
.inside > .essay > h3 { margin-top: 32px; }
.inside > .essay > h3 + p { margin-top: 8px; }
.inside > .essay > .go { margin-top: 28px; }

.app-top { display: flex; align-items: center; gap: 16px; }
.app-top .icon { flex: none; width: 76px; height: 76px; }
.app-top b { display: block; font-size: 19px; font-weight: 900; line-height: 1.35; }
.app-top small { color: var(--app, var(--royal)); font-size: 15px; font-weight: 700; }
.frame { padding: 12px 16px 8px; border: 3px solid var(--ink); border-radius: var(--round); background: #fff; }
.frame canvas { display: block; width: 100%; height: 150px; }
.tiny, figcaption { color: #4a5c94; font-size: 14px; }
figcaption { margin-top: 6px; }

.go { display: block; width: 100%; padding: 14px 20px; border: 3px solid var(--ink); border-radius: var(--round); background: var(--app, var(--royal)); color: #fff; font-size: 18px; font-weight: 900; text-align: center; text-decoration: none; transition: transform 0.15s, background 0.15s; }
.go:active { transform: scale(0.98); }
.inside > * > .other { display: flex; gap: 10px; margin-top: 10px; }
.plain { flex: 1; padding: 11px 12px; border: 3px solid var(--ink); border-radius: var(--round); background: var(--cloud); font-weight: 700; text-align: center; text-decoration: none; color: inherit; }

fieldset { min-width: 0; padding: 0; border: 0; }
legend, form label { font-weight: 700; }
form label { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: block; padding: 7px 15px; border: 3px solid var(--ink); border-radius: 99px; background: #fff; }
.chips input:checked + span { background: var(--ink); color: #fff; }
.chips input:focus-visible + span { outline: 3px solid var(--royal); outline-offset: 3px; }
form input:not([type="radio"]), textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 3px solid var(--ink); border-radius: 16px 14px 17px 13px; background: #fff; font-weight: 500; }
textarea { resize: vertical; min-height: 108px; }
::placeholder { color: #5a6ca3; opacity: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note { font-weight: 700; }
.note:empty { display: none; }
.note.wrong { color: #b3124a; }

/* Phones have an email app. Gmail's website is for computers. */
@media (pointer: coarse) {
  .gmail { display: none; }
}

@media (hover: hover) {
  .now:hover { transform: rotate(-0.6deg) scale(1.015); }
  .apps button:hover .icon { transform: translateY(-3px) rotate(-3deg); }
  .apps li:not(.awake) button:hover .curled svg { transform: rotate(-12deg); transition: transform 0.25s; }
  .dock button:hover, .dock a:hover { transform: translateY(-4px); }
  .go:hover { background: var(--night); }
  .plain:hover { background: var(--pale); }
}

/* Phones where the browser takes up a lot of the screen */
@media (max-height: 760px) and (max-width: 899px) {
  .angel { --a: 108; }
  .name { margin-top: 10px; }
  .name svg { width: min(100%, 300px); }
  .now { grid-template-columns: auto 54%; align-items: center; justify-content: space-between; padding: 6px 12px 6px 20px; }
  .now span { display: block; }
  .now b, .now small { display: block; }
  .now canvas { grid-column: auto; width: 100%; height: 88px; margin: 0; }
  .icons { margin-top: 14px; }
}
@media (max-height: 655px) and (max-width: 899px) {
  .screen { row-gap: 10px; }
  .angel { --a: 92; }
  .name svg { width: min(100%, 262px); }
  .bio { margin-top: 2px; font-size: 17px; }
  .now canvas { height: 76px; }
}
/* A phone on its side: the dock comes after everything else instead of covering it. */
@media (max-height: 480px) {
  .screen { min-height: 0; padding-bottom: 12px; }
  .dock { position: relative; margin-bottom: 14px; }
}

/* On a computer the phone turns into a desktop. */
@media (min-width: 900px) {
  .screen { grid-template-columns: 1.15fr 1fr; grid-template-rows: auto 1fr; column-gap: clamp(40px, 7vw, 120px); width: min(100%, 1180px); padding-inline: 40px; }
  .status { grid-column: 1 / -1; }
  .me { align-self: center; }
  .angel { --a: 168; }
  .name { margin-top: 18px; }
  .name svg { width: min(100%, 420px); }
  .bio { font-size: 21px; }
  .stuff { align-self: center; }
  .now { padding: 18px 28px 10px; }
  .now b { font-size: 36px; }
  .now small { font-size: 17px; }
  .now canvas { height: 176px; }
  .icons { margin-top: 30px; }
  .apps .icon, .curled { width: 84px; height: 84px; }
  .apps span { font-size: 16px; }
  #window[open] { inset: 0; width: 500px; height: fit-content; max-height: 88dvh; margin: auto; border-bottom: 3px solid var(--ink); border-radius: 30px 27px 32px 25px / 26px 31px 25px 30px; }
  .bar { cursor: grab; user-select: none; }
  .bar:active { cursor: grabbing; }
}

@media (min-width: 1200px) and (min-height: 721px) {
  .angel { --a: 216; }
  .name { margin-top: 30px; }
  .name svg { width: min(100%, 500px); }
}
@media (min-width: 1600px) and (min-height: 900px) {
  .screen { width: min(100%, 1480px); }
  .angel { --a: 276; }
  .name svg { width: min(100%, 640px); }
  .bio { margin-top: 12px; font-size: 25px; }
  .now canvas { height: 214px; }
  .apps .icon, .curled { width: 104px; height: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #feathers { display: none; }
}
