:root {
  color-scheme: light;
  --ink: #455368;
  --muted: #66788e;
  --line: #b4c6da;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  min-height: 100vh;
  background: radial-gradient(ellipse at 16% 10%, #fff 0, transparent 45%), radial-gradient(ellipse at 85% 75%, #e7dff4 0, transparent 55%), linear-gradient(135deg, #e0e9f4, #f4f5fa 55%, #dbe8ef);
  font-size: 14px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(#738cac12 1px, transparent 1px), linear-gradient(90deg, #738cac12 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(#000, transparent 95%);
}

/* ページ全体 */
.page {
  max-width: 870px;
  margin: auto;
  padding: 35px 20px 25px;
  position: relative;
  z-index: 1;
}

.mono,
.section-label,
footer {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: .12em;
}

.page-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 24px;
}

.status::before {
  content: "◦";
  color: #739bad;
  margin-right: 7px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.page-header h1 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: clamp(44px, 10vw, 80px);
  letter-spacing: -.06em;
  line-height: .95;
  margin: 0;
  text-shadow: 1px 1px white;
}

.page-header p {
  margin: 10px 0 0;
  font-family: "Yu Mincho", serif;
  letter-spacing: .16em;
  font-size: 12px;
}

.page-header .edition-label {
  text-align: right;
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
}

/* プロフィール帳 */
.profile-card {
  position: relative;
  background: #f9fbffb8;
  border: 1px solid #fff;
  box-shadow: 0 20px 75px #7691b02b, 0 0 0 1px #9db4d14d;
  border-radius: 6px;
  padding: 22px;
  backdrop-filter: blur(12px);
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #a0b7cf55;
  border-radius: 3px;
  pointer-events: none;
}

.profile-layout {
  display: grid;
  grid-template-columns: 1fr 1.22fr;
  gap: 22px;
}

.portrait-panel {
  position: relative;
  padding: 8px 8px 0;
}

.portrait-label {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.portrait {
  position: relative;
  aspect-ratio: 1;
  max-width: 280px;
  margin: 15px auto 10px;
  background: radial-gradient(circle, #fff 0, #d9e6f1 45%, #b6cce4 100%);
  border: 7px solid white;
  box-shadow: 0 5px 16px #8095b333;
  transform: rotate(-2deg);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 37%;
  position: absolute;
  inset: 0;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0px, transparent 4px, #fff4 5px);
  pointer-events: none;
}

.portrait-spark {
  position: absolute;
  right: 9px;
  top: 29px;
  color: #829dbb;
  font-size: 35px;
  z-index: 2;
  text-shadow: 0 0 8px white;
  animation: glow 5s infinite alternate;
}

.portrait-caption {
  text-align: center;
  font-size: 10px;
  letter-spacing: .17em;
  color: var(--muted);
  margin: 14px 0;
}

.details-panel {
  border-left: 1px dashed var(--line);
  padding: 7px 0 0 22px;
}

.section-label {
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 10px;
}

.profile-fields {
  margin: 0;
}

.profile-field {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed #b9c8d8;
  align-items: baseline;
}

.profile-field dt {
  color: var(--muted);
  font-size: 11px;
}

.profile-field dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.social-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.social-links a,
button {
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  text-decoration: none;
  border: 1px solid #aebed2;
  background: #fff9;
  padding: 9px 12px;
  border-radius: 3px;
  transition: background .2s, transform .2s;
}

button,
.social-links a {
  cursor: pointer;
}

.social-links a:hover,
button:hover {
  background: white;
  transform: translateY(-2px);
}

/* 背景の光 */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particles i {
  position: absolute;
  color: #fff;
  text-shadow: 0 0 5px #87a6cb;
  animation: float 8s ease-in-out infinite alternate;
  font-style: normal;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  color: var(--muted);
  margin-top: 20px;
}

@keyframes float {
  from {
    transform: translateY(0);
    opacity: .3;
  }

  to {
    transform: translateY(-28px);
    opacity: .9;
  }
}

@keyframes glow {
  from {
    opacity: .4;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 570px) {
  .page {
    padding: 22px 14px;
  }

  .profile-card {
    padding: 16px;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .details-panel {
    border-left: 0;
    border-top: 1px dashed var(--line);
    padding: 16px 4px 4px;
  }

  .portrait {
    max-width: 210px;
  }

  .page-header .edition-label {
    font-size: 8px;
  }

  .profile-field {
    grid-template-columns: 95px 1fr;
  }
}

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

/* 起動画面と表示アニメーション */
.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, #fff, #e3ecf7 65%, #dbe4f0);
  pointer-events: none;
  animation: intro-out 1.7s both;
}

.intro-content {
  text-align: center;
  width: min(72vw, 290px);
  animation: intro-in .45s both;
}

.intro-kicker,
.intro-caption {
  font-size: 9px;
  color: #647d97;
  letter-spacing: .21em;
}

.intro-name {
  font-family: Georgia, serif;
  font-size: clamp(42px, 10vw, 65px);
  letter-spacing: -.06em;
  color: #455368;
  margin: 15px 0 20px;
  text-shadow: 1px 0 #91c5d9, -1px 0 #d6badf;
}

.intro-track {
  height: 2px;
  background: #cbd9e8;
  margin: 0 0 14px;
  overflow: hidden;
}

.intro-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #b2a8d5, #88b8d1);
  transform-origin: left;
  animation: load-line 1.03s cubic-bezier(.2, .65, .25, 1) both;
}

.page-header h1 {
  position: relative;
}

.page-header h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: #839fc0;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(45% 0 35% 0);
  animation: title-glitch .55s 1.56s both;
}

.page-status,
.page-header,
.profile-card,
footer {
  animation: page-reveal .75s cubic-bezier(.2, .65, .25, 1) both;
}

.page-status {
  animation-delay: 1.05s;
}

.page-header {
  animation-delay: 1.16s;
}

.profile-card {
  animation-delay: 1.30s;
}

footer {
  animation-delay: 1.46s;
}

.profile-card {
  overflow: hidden;
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, #ffffff90 50%, transparent 65%);
  transform: translateX(-120%);
  animation: scan 1.05s 1.4s both;
  pointer-events: none;
}

.social-links a,
.social-links button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.social-links a:hover,
.social-links button:hover {
  box-shadow: 0 0 12px #acc5e180;
  border-color: #8daac6;
}

.social-links a:focus-visible,
.social-links button:focus-visible {
  outline: 2px solid #7895b8;
  outline-offset: 3px;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes intro-out {
  0%,
  66% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes load-line {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes page-reveal {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scan {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(120%);
  }
}

@keyframes title-glitch {
  0%,
  100% {
    opacity: 0;
    transform: translateX(0);
  }

  35% {
    opacity: .42;
    transform: translateX(2px);
  }

  65% {
    opacity: .26;
    transform: translateX(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro,
  .profile-card::after,
  .page-header h1::after {
    display: none;
  }

  .page-status,
  .page-header,
  .profile-card,
  footer {
    opacity: 1;
    transform: none;
  }
}


/* ページ移動 */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 10px;
  animation: page-reveal .6s 1.4s both;
}

.page-nav a,
.page-current {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.page-nav a {
  color: var(--ink);
  background: #ffffff99;
  text-decoration: none;
  transition: background .2s, box-shadow .2s;
}

.page-nav a:hover {
  background: white;
  box-shadow: 0 0 12px #acc5e180;
}

.page-nav a:focus-visible,
.photo a:focus-visible {
  outline: 2px solid #7895b8;
  outline-offset: 3px;
}

.page-current {
  border-color: transparent;
  color: var(--muted);
}

/* 写真ギャラリー */
.gallery-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 3px 13px;
  border-bottom: 1px dashed var(--line);
}

.gallery-heading .section-label {
  margin: 0;
}

.gallery-count {
  color: var(--muted);
  font-size: 9px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
  gap: 18px;
  align-items: start;
  padding: 19px 3px 3px;
}

.photo {
  min-width: 0;
  margin: 0;
  padding: 7px;
  background: white;
  box-shadow: 0 4px 14px #8095b325;
}

.photo a {
  display: block;
  cursor: zoom-in;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
}

.photo figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 3px 3px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.photo time {
  font-family: ui-monospace, Consolas, monospace;
  color: var(--muted);
  font-size: 10px;
}

.gallery-page .page-status { animation-delay: 0s; }
.gallery-page .page-header { animation-delay: .08s; }
.gallery-page .gallery-card { animation-delay: .16s; }
.gallery-page .page-nav { animation-delay: .24s; }
.gallery-page footer { animation-delay: .3s; }
.gallery-page .page-header h1::after { animation-delay: .15s; }
.gallery-page .gallery-card::after { animation-delay: .2s; }

@view-transition {
  navigation: auto;
}

::view-transition-old(root) { animation-duration: .24s; }
::view-transition-new(root) { animation-duration: .4s; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .page-nav { animation: none; }
}

.photo-number {
  color: var(--muted);
  font-size: 10px;
}

.photo-viewer {
  max-width: min(94vw, 1000px);
  max-height: 94vh;
  padding: 10px;
  border: 1px solid white;
  border-radius: 6px;
  background: #f4f7fc;
  color: var(--ink);
  box-shadow: 0 12px 60px #17233445;
}

.photo-viewer::backdrop {
  background: #23344bd9;
}

.viewer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 0 3px 8px;
  font-size: 11px;
}

.viewer-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
}

.viewer-image {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
}
