* { box-sizing: border-box; }
:root { font-family: "Open Sans", Arial, sans-serif; color: #171717; background: #fdfdfd; --portfolio-font-size: clamp(12px, .90vw, 17px); }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid #276793; outline-offset: 5px; }
.shell { display: grid; grid-template-columns: 13.25% minmax(0, 1fr); gap: 3.25vw; min-height: 100dvh; padding: 1.58vw 2.55vw; }
.sidebar { display: flex; flex-direction: column; align-items: flex-start; border-right: 1px solid #444; padding: .65vw 2.8vw 0 0; }
.signature { width: 100%; }
.sidebar .copyright { margin: auto 0 0; padding-top: 1rem; }
.signature { font: italic 400 clamp(20px, 1.7vw, 32px)/1.2 Georgia, serif; white-space: nowrap; letter-spacing: -.07em; }
.signature img { display: block; width: 94%; height: auto; margin-top: .32vw; }
.sidebar p, .project-copy { font-size: var(--portfolio-font-size); line-height: 1.18; }
#bio { margin: 1.4vw 0 0; text-align: justify; white-space: pre-line; }
.software { margin-top: 6.2vw; }
.software p { margin: 0 0 .65vw; }
.icons { display: grid; grid-template-columns: repeat(4, clamp(24px, 2.1vw, 39px)); gap: .3vw; }
.icons span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 16%; font-size: clamp(14px, 1.35vw, 24px); font-weight: 600; background: #061c30; color: #2bc1ff; }
.icons span:nth-child(2) { background:#270900; color:#ffb100; }
.icons span:nth-child(3) { background:#420019; color:#ff4a8a; }
.icons span:nth-child(4), .icons span:nth-child(5) { background:#100759; color:#b3a7ff; }
.icons span:nth-child(6) { background:#242424; color:#ea93f1; }
.icons span:nth-child(7) { background:transparent; color:#e67500; }
.icons span.original-icon { background: transparent; overflow: hidden; }
.icons img { width: 100%; height: 100%; object-fit: contain; }
.navigation, .tabs { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 2.7vw; border-bottom: 1px solid #444; padding: .62vw 2vw .8vw; font-size: var(--portfolio-font-size); letter-spacing: -.035em; }
[aria-current="page"], .tabs [aria-selected="true"] { text-decoration: line-through; text-decoration-thickness: 1px; }
main {
  container-type: inline-size;
  --project-gap: clamp(12px, 1.05vw, 22px);
  --project-inset-start: 4cqw;
  --project-inset-end: 1cqw;
  --project-size: calc((100cqw - var(--project-inset-start) - var(--project-inset-end) - var(--project-gap)) / 2);
  --project-offset-top: clamp(20px, 2.1vw, 44px);
}
.cover { display: block; width: 100%; aspect-ratio: 1; border-radius: 1.35vw; overflow: hidden; box-shadow: 0 20px 38px #0003; }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shell:has(:is(.projects, .detail)) {
  --portfolio-column-gap: clamp(24px, 3.25vw, 67px);
  width: clamp(900px, 64%, 1320px);
  max-width: 100%;
  margin-inline: auto;
  grid-template-columns: 21% minmax(0, 1fr);
  gap: var(--portfolio-column-gap);
  padding: clamp(22px, 1.85vw, 38px) 0;
}
.shell:has(:is(.projects, .detail)) .navigation { justify-content: space-between; gap: .5rem 1rem; }
.projects, .detail {
  margin: var(--project-offset-top) var(--project-inset-end) clamp(18px, 3vw, 62px) var(--project-inset-start);
  gap: var(--project-gap);
}
.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cover-placeholder { display: grid; place-items: end start; padding: 8%; color: #fff; font: 400 clamp(18px, 2vw, 38px)/1.1 Georgia, serif; background: #173a4e; }
.cover-placeholder.star-empires { background: #432c32; }
.cover-placeholder.samurai-empires { background: #efe1c5; color: #421e19; }
.cover-placeholder.ancient-empires { background: #b7d8d4; color: #452b1f; }
.detail { display: grid; grid-template-columns: var(--project-size) minmax(0, 1fr); column-gap: var(--portfolio-column-gap); }
.summary .cover { width: var(--project-size); }
.project-copy { white-space: pre-wrap; margin: 1.2vw .2vw; }
.project-logos { display:flex; gap: 1rem; align-items:center; flex-wrap:wrap; margin: 1.8vw .2vw; }
.project-logos img { max-height: 60px; max-width: 60%; }
.tabs { padding-top: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.tabs button, .image-button { border: 0; background: none; padding: 0; }
.image-button { display: block; width: 100%; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4vw; padding: 1.65vw 2.15vw 0 1.1vw; }
.gallery-column { display: flex; flex-direction: column; gap: 1.35vw; }
.gallery img { display: block; width: 100%; height: auto; filter: drop-shadow(0 7px 8px #0005); }
dialog { --lightbox-control: clamp(32px, 6vw, 44px); --lightbox-gap: 8px; border: 0; padding: 0; background: transparent; overflow: visible; max-width: none; max-height: none; }
dialog::backdrop { background: #000b; }
dialog img { display: block; max-width: min(92vw, calc(100vw - 2 * (var(--lightbox-control) + var(--lightbox-gap) + 6px))); max-height: min(88dvh, calc(100dvh - 2 * (var(--lightbox-control) + var(--lightbox-gap) + 6px))); object-fit: contain; }
dialog button { position: absolute; display: grid; place-items: center; z-index: 1; border: 0; padding: 0; border-radius: 50%; width: var(--lightbox-control); height: var(--lightbox-control); background: #fff; font: 24px/1 Arial, sans-serif; }
dialog button[hidden] { display: none; }
.lightbox-close { bottom: calc(100% + var(--lightbox-gap)); right: 0; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { right: calc(100% + var(--lightbox-gap)); }
.lightbox-next { left: calc(100% + var(--lightbox-gap)); }
.admin { max-width: 760px; margin: 2.55vw 0; }
.admin label { display: grid; gap: .4rem; margin: 1rem 0; }
.admin textarea, .admin select, .admin input, .admin button { font: inherit; }
.admin textarea, .admin select { padding: .55rem; }
.admin textarea { min-height: 85px; resize: vertical; }
.admin button { padding: .35rem .6rem; }
.admin fieldset { border: 1px solid #bbb; padding: 0 1rem 1rem; }
.category-list { display: grid; gap: 12px; margin-block: 16px; }
.category-list fieldset { min-width: 0; }
.category-list fieldset > button + button { margin-left: .4rem; }
.image-list { display: grid; gap: .55rem; padding: 0; }
.image-list li { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.image-list img { width: 64px; height: 48px; object-fit: contain; }
.image-list span { flex: 1 1 140px; overflow-wrap: anywhere; }
@media(max-width: 950px) {
  .shell:has(:is(.projects, .detail)) { padding-inline: 18px; }
  .shell { grid-template-columns: 165px minmax(0, 1fr); gap: 22px; }
  .sidebar { padding-right: 16px; }
  .detail { grid-template-columns: 1fr; }
  .summary { max-width: 370px; }
}
@media(max-width: 630px) {
  .shell:has(:is(.projects, .detail)) { padding: 18px; }
  main { --project-inset-start: 0px; --project-inset-end: 0px; --project-offset-top: 18px; }
  .shell { display: block; padding: 18px; }
  .sidebar { border: 0; min-height: 0; padding: 0; margin-bottom: 20px; }
  .signature { max-width: 190px; }
  #bio { max-width: 320px; text-align: left; }
  .software { margin-top: 16px; }
  .navigation { padding: 8px 0; }
  .cover { border-radius: 12px; box-shadow: 0 9px 18px #0003; }
  .gallery { gap: 10px; padding: 14px 0 0; }
  .gallery-column { gap: 10px; }
}

