/*
 * Personal corners of the desktop (hyd-personal-details.js, HydContact). The small profile badge, the about
 * block and its action buttons, the footer text links that open the postcard and the about window, and the
 * email dialog (#email-manad) with its title bar, form fields and send button. Colours here are the default
 * plum values; hyd-theme.css re-colours these surfaces from the active theme where it matches them.
 */

/* Personal corners inside the same desktop, not another landing page. */
.manad-avatar {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

.manad-avatar > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 1px #0c041844);
}

/* Placement of the #desk-notes window on the wide desktop; tablet and phone positions are further down. */
#home #desk-notes {
  width: 256px;
  left: 15%;
  top: 490px;
}

/* --- About block --- */
.about-manad {
  padding: 13px 12px 12px;
  background: radial-gradient(ellipse at 0 0, #59396055, transparent 85%), #25192e;
  color: #f3e5f4;
}

.about-intro {
  display: flex;
  gap: 10px;
  align-items: center;
}

.about-intro .manad-avatar {
  width: 40px;
  height: 40px;
}

.about-manad h2 {
  font:
    700 calc(15 * var(--px))/1.25 Tahoma,
    sans-serif;
  letter-spacing: 0;
  margin: 0;
  color: #ffedf9;
}

.about-manad h2 > span {
  color: #d99dc7;
}

.about-manad p {
  font:
    calc(12 * var(--px))/1.6 Tahoma,
    sans-serif;
  color: #dfcce7;
  margin: 11px 0 12px;
  max-width: 36ch;
}

.about-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.about-actions button {
  font:
    calc(10 * var(--px))/1.3 Tahoma,
    sans-serif;
  min-height: 29px;
  padding: 5px 7px;
  border: 1px solid;
  border-color: #aa8fbc #24182d #24182d #aa8fbc;
  border-radius: 3px;
  background: linear-gradient(#624b73, #3c2a47);
  color: #f9e8f7;
  box-shadow: inset 0 1px #dbc3e944;
  cursor: pointer;
}

.about-actions button:hover {
  background: linear-gradient(#82608c, #543963);
}

.about-actions button:active {
  border-style: inset;
  translate: 0 1px;
}

/* --- Footer text links --- */
.site-footer [data-postcard],
.site-footer [data-show-about] {
  color: #e6c5e0;
  font:
    11px Tahoma,
    sans-serif;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

/* --- Email dialog (#email-manad) --- */
#email-manad {
  position: fixed;
  inset: 0;
  margin: auto;
  width: 420px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 3px;
  background: #291c33;
  border: 1px solid;
  border-color: #e3cde9 #765584 #765584 #e3cde9;
  border-radius: 7px;
  box-shadow: 0 12px 70px #050109aa;
  color: #f2dfee;
  rotate: 0deg;
  transform: none;
}

#email-manad[open],
#email-manad > form {
  display: flex;
  flex-direction: column;
}

#email-manad > form {
  flex: 1;
  min-height: 0;
}

#email-manad::backdrop {
  background: #0e071ab3;
  backdrop-filter: blur(3px);
}

.personal-titlebar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 7px;
  background: linear-gradient(#e9ddef, #b398c5 48%, #cdb4d9 52%, #dfcde6);
  border: 1px solid #9978aa;
  border-radius: 4px 4px 0 0;
  color: #34203e;
  font:
    11px Tahoma,
    sans-serif;
}

.personal-titlebar .personal-close {
  border: 1px solid #9275a0;
  border-radius: 4px;
  background: linear-gradient(#faf0fa, #bba7c9);
  color: #35233d;
  font: 18px Tahoma;
  min-width: 27px;
  min-height: 25px;
  cursor: pointer;
}

.personal-email-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 17px;
}

.personal-email-body h2 {
  font:
    700 22px Tahoma,
    sans-serif;
  margin: 0 0 9px;
  color: #fceafa;
  letter-spacing: 0;
}

.personal-email-body p {
  font:
    12px/1.5 Tahoma,
    sans-serif;
  color: #dec4e3;
  margin: 0 0 15px;
}

.personal-email-body label {
  display: grid;
  gap: 5px;
  font:
    11px Tahoma,
    sans-serif;
  margin: 0 0 12px;
  color: #e2cee8;
}

.personal-email-body :is(input, textarea) {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid;
  border-color: #130b1c #8a6b99 #8a6b99 #130b1c;
  border-radius: 3px;
  background: #190f22;
  color: #f9e7f5;
  font:
    13px/1.5 Tahoma,
    sans-serif;
  padding: 8px;
  resize: vertical;
}

.personal-email-body > button {
  border: 1px solid;
  border-color: #f6e9fa #735a83 #735a83 #f6e9fa;
  border-radius: 4px;
  background: linear-gradient(#efe3f6, #b396c6);
  color: #2e1c3c;
  padding: 9px 14px;
  font:
    12px Tahoma,
    sans-serif;
  cursor: pointer;
}

.personal-email-body > button:disabled {
  opacity: 0.5;
  cursor: default;
}

.personal-email-body small {
  display: block;
  color: #c5abcd;
  font:
    10px/1.5 Tahoma,
    sans-serif;
  margin-top: 12px;
}

#email-manad :focus-visible {
  outline: 2px solid #efb7dd;
  outline-offset: 2px;
}

/* Tablet widths (621px to 900px): the notes window moves. */
@media (min-width: 621px) and (max-width: 900px) {
  #home #desk-notes {
    left: 16%;
    top: 555px;
    width: 243px;
  }
}

/* Phone widths (620px and below): windows and the about block fill the width. */
@media (max-width: 620px) {
  #home #desk-notes {
    left: auto;
    top: auto;
    width: 100%;
  }

  #home #desk-view {
    width: 100%;
    margin-left: 0;
  }

  #home #desk-view .desktop-sky img {
    height: 190px;
  }

  .about-manad {
    padding: 15px;
  }

  .about-manad p {
    max-width: none;
  }

  .about-actions button {
    min-height: 34px;
    padding: 7px 10px;
  }

  .site-footer [data-show-about],
  .site-footer [data-postcard] {
    padding-block: 5px;
  }
}

/*
 * Touch and phones: a 44px close button, and 16px fields so iOS Safari does not zoom in when a field is
 * focused.
 */
@media (max-width: 620px), (any-pointer: coarse) {
  #email-manad .personal-titlebar .personal-close {
    flex: none;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  #email-manad .personal-email-body :is(input, textarea) {
    font-size: 16px;
  }
}

/* The address beside "email me" (hyd-personal-details.js): a p in the About text’s own type and
   colour (.about-manad p), without that paragraph’s margins, selectable for copying where the email
   app cannot open. */
.about-actions .about-email {
  align-self: center;
  margin: 0;
  user-select: text;
  -webkit-user-select: text;
  overflow-wrap: anywhere;
}
