:root {
  --width-main-content: 920px;
  --bg:           #f3f2fc;
  --surface:      #fcfdff;
  --border:       #e2e8f0;
  --text:         #0f172a;
  --text-muted:   #475569;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --shadow:       0 1px 2px rgb(15 23 42 / 0.06),
                  0 4px 12px rgb(15 23 42 / 0.08);
  --shadow-hover: 0 2px 4px rgb(15 23 42 / 0.08),
                  0 8px 24px rgb(15 23 42 / 0.12);
  --border-radius: 5px;
}

html {
  font-size: 18px;
  margin: 0;
  padding: 0;
  border: 0;
}

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 65px;
}

header > .header-links {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 95vw;
  max-width: var(--width-main-content);
  margin: 0 auto;
  padding: 15px 0 10px;
  border-bottom: 1px solid var(--border);
}

.socials {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.5em;
  padding: 0 3px;
}

.socials > a {
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.socials > a:hover {
  color: var(--accent-hover);
}

a > svg {
  vertical-align: text-top;
}

nav {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

nav > a {
  color: var(--text);
  font-weight: 500;
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 10px;
  text-decoration: none;
}

nav > a:hover {
  color: var(--accent-hover);
}

footer {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

footer > .footer-content {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: var(--width-main-content);
  padding: 10px 0 15px;
  border-top: 1px solid var(--border);
}

footer > .footer-content > a,span {
  font-size: 0.65em;
  color: var(--text-muted);
}

footer > .footer-content > a:hover {
  color: var(--accent-hover);
}

main {
  margin: 0 auto 0 auto;
  padding: 0 5px 0 5px;
  width: 95vw;
  min-height: 100vh;
  max-width: var(--width-main-content);
}

h1, h2, h3, h4, h5, h6{
  margin: 15px 0 10px;
}

p {
  margin: 10px 0 15px;
}

hr {
  height: 0.1px;
  width: 40%;
  margin: 0 auto;
  padding: 0;
  background: var(--text-muted);
}

.vertical-panels {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 10px 0;
}

.panel {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.about-me {
  display: flex;
  container-type: inline-size;
  --portrait-width: min(300px, 40cqi);
  --portrait-height: calc(var(--portrait-width) * 1.25);
}

.about-me-info {
  flex: 1;
  min-width: 0;
  margin: 0 7px;
}

/* Invisible float to push the portrait down to the bottom */
.about-me-info::before {
  content: "";
  float: right;
  height: calc(100% - var(--portrait-height));
}

/* Height is measured with the portrait at the top, where the heading absorbs
   some of the wrapping, so leave room for the extra lines once it moves down */
.about-me-info::after {
  content: "";
  display: block;
  height: 3em;
}

.self-portrait {
  float: right;
  clear: right;
  width: var(--portrait-width);
  height: var(--portrait-height);
  margin: 0 -7px 0 7px;
  object-fit: scale-down;
  object-position: bottom right;
}

.projects {
  display: flex;
  flex-direction: column;
  padding: 0 5px;
}

.projects-container {
  margin: 0 0 10px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 50px;
}

@media (max-width: 650px) {
  .projects-container {
    grid-template-columns: 1fr;
  }
}

.project-frame {
  background-color: var(--surface);
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.project-frame:hover,
.project-frame:focus-visible {
  color: var(--accent-hover);
  border: 1px solid var(--accent-hover);
}

.project-frame > h3 {
  font-size: 1em;
  text-align: center;
  margin: 3px 0;
}

.project-frame > figure {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  aspect-ratio: 16 / 9;
}

.project-frame > figure > img {
  flex: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden-text {
  cursor: pointer;
  font-size: 0.03em;
  height: 100%;
  padding-block: 10em;
}

.hidden-text:active {
  font-size: 0.5em;
}

.not-selectable {
  user-select: none;
}
