/* A pavilion's wall, the resume and the reading panel: glass over the world (walls.js). The words are the
   developer's (aero/content/), and an empty part of them takes no room. */

#inside {
  --c: hsl(var(--hue, 196) 90% 50%);
  --c-soft: hsl(var(--hue, 196) 95% 62% / 0.32);
  position: fixed;
  inset: 0 22px 0 auto;
  width: min(470px, calc(100vw - 44px));
  height: fit-content;
  max-height: calc(100dvh - 44px);
  margin: auto 0;
  padding: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  color: var(--ink);
  font: 16px/1.45 var(--font);
  background: radial-gradient(120% 60% at 0% 0%, var(--c-soft), transparent 60%), var(--glass);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
}

#inside[open] {
  display: flex;
  animation: inside-in 0.34s cubic-bezier(0.2, 0.9, 0.2, 1);
}

#inside::backdrop {
  background: transparent;
}

#inside::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 110px;
  border-radius: 27px 27px 60% 60% / 27px 27px 26px 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  pointer-events: none;
}

@keyframes inside-in {
  from {
    opacity: 0;
    transform: translateX(26px) scale(0.98);
  }
}

.inside-scroll:focus-visible {
  outline: none;
  box-shadow: none;
}

.inside-scroll {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 28px 16px;
  outline: none;
  /* Words that run on below the buttons fade, so the cut reads as more to scroll. The fade is the padding's height. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
}

/* While the glass is open, the world's names step back: the glass says the same. */
body:has(#inside[open]) #plaques {
  opacity: 0;
}

#inside article {
  margin: 0;
}

#inside h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 38px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: #04395f;
  text-shadow: 0 1px 0 #fff;
  overflow-wrap: anywhere;
}

#inside h1::before {
  content: "";
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0 14%, transparent 34%), radial-gradient(circle at 50% 60%, hsl(var(--hue, 196) 95% 64%), hsl(var(--hue, 196) 90% 36%));
  box-shadow: 0 2px 5px rgba(0, 40, 90, 0.45);
}

#inside .line {
  margin: 10px 0 0;
  font-size: 19px;
  line-height: 1.4;
}

#inside .media {
  margin: -26px -28px 18px;
}

#inside .media img,
#inside .media video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

#inside .built,
#inside .reach {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

#inside .built li,
#inside .reach a {
  display: block;
  padding: 4px 13px 5px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(214, 242, 255, 0.8));
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(6, 48, 79, 0.14), 0 1px 3px rgba(0, 60, 120, 0.2);
}

#inside .reach a:hover {
  background: linear-gradient(180deg, #fff, #c9f0ff);
}

#inside .text {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.6;
}

#inside .text > :first-child {
  margin-top: 0;
}

#inside .text h2,
#inside .text h3,
#inside .text h4 {
  margin: 1.3em 0 0.35em;
  font-weight: 600;
  line-height: 1.25;
}

#inside .text h2 {
  font-size: 22px;
}

#inside .text h3 {
  font-size: 19px;
}

#inside .text p,
#inside .text ul,
#inside .text ol,
#inside .text figure {
  margin: 0.7em 0;
}

#inside .text a {
  color: #0a62c9;
}

#inside .text code {
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 0.92em;
  background: rgba(6, 48, 79, 0.08);
}

#inside .text pre {
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(6, 48, 79, 0.08);
}

#inside .text pre code {
  padding: 0;
  background: none;
}

#inside .text blockquote {
  margin: 0.9em 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--c);
  color: var(--ink-soft);
}

#inside .text hr {
  height: 1px;
  margin: 1.4em 0;
  border: 0;
  background: rgba(6, 48, 79, 0.18);
}

#inside .text img {
  max-width: 100%;
  border-radius: 12px;
}

#inside .date {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.inside-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 6px 28px 22px;
}

#inside .act {
  display: inline-flex;
  align-items: center;
  padding: 9px 22px 10px;
  border-radius: 999px;
  border: 1px solid #0a62c9;
  font: 600 16px var(--font);
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0, 40, 100, 0.6);
  background: linear-gradient(180deg, #7fd4ff, #1f97f2 48%, #0a6fdc 52%, #36b1ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 3px 8px rgba(0, 70, 160, 0.4);
  cursor: pointer;
}

#inside .act:hover {
  filter: brightness(1.08);
}

#inside .act ~ .act:not(.quiet) {
  color: var(--ink);
  text-shadow: none;
  border-color: rgba(6, 48, 79, 0.2);
  background: linear-gradient(180deg, #fff, #e3f6ff 50%, #cdeeff);
  box-shadow: inset 0 1px 0 #fff, 0 2px 5px rgba(0, 60, 120, 0.25);
}

#inside .act.quiet {
  margin-left: auto;
  color: var(--ink);
  text-shadow: none;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(6, 48, 79, 0.16);
}

/* A piece of writing reads in the middle, wider, in a calmer column. */
#inside[data-kind="piece"] {
  inset: 0;
  width: min(760px, calc(100vw - 44px));
  margin: auto;
}

#inside[data-kind="piece"] .inside-scroll {
  padding: 34px 44px 16px;
}

#inside[data-kind="piece"] h1 {
  font-size: 42px;
}

#inside[data-kind="piece"] h1::before {
  display: none;
}

#inside[data-kind="piece"] .text {
  max-width: 38em;
  font-size: 18px;
  line-height: 1.65;
}

#inside[data-kind="piece"] .inside-actions {
  padding: 6px 44px 24px;
}

/* The resume's entry, first in the panel */

#links ul.first {
  margin-top: 12px;
}

@media (max-width: 700px) {
  /* The panel is a sheet at the bottom too: the glass takes its place while it is open. */
  body:has(#inside[open]) #panel {
    visibility: hidden;
  }

  #inside,
  #inside[data-kind="piece"] {
    inset: auto 8px calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 74dvh;
    margin: 0;
    border-radius: 24px;
  }

  #inside[data-kind="piece"] {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top));
  }

  @keyframes inside-in {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
  }

  .inside-scroll,
  #inside[data-kind="piece"] .inside-scroll {
    padding: 22px 20px 16px;
  }

  #inside .media {
    margin: -22px -20px 16px;
  }

  #inside h1,
  #inside[data-kind="piece"] h1 {
    font-size: 31px;
  }

  .inside-actions,
  #inside[data-kind="piece"] .inside-actions {
    gap: 7px;
    padding: 4px 16px 18px;
  }

  #inside .act {
    padding: 8px 17px 9px;
  }
}
