/* ---------- tokens ---------- */
:root {
  --ground: #0a0a0b;
  --surface: #151517;
  --surface-2: #202023;
  --ink: #ecebe7;
  --ink-2: #a7a39b;
  --ink-press: #d6d5d0;

  --font: "Archivo", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --gutter: 20px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--ground); }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) max(32px, env(safe-area-inset-bottom));
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 -10px;
}
.langs { display: flex; gap: 2px; }
.lang {
  font-size: 14px;
  padding: 10px;
  color: var(--ink-2);
  transition: color 160ms var(--ease);
}
.lang:hover { color: var(--ink); }
.lang[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.share {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transition: background-color 160ms var(--ease);
}
.share:hover { background: var(--surface); }
.share .icon { width: 22px; height: 22px; }

/* ---------- profile ---------- */
.profile { text-align: center; padding: 28px 0 36px; }
.avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}
.handle {
  margin: 20px 0 0;
  font-size: 26px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.tagline { margin: 8px auto 0; font-size: 16px; max-width: 36ch; text-wrap: balance; }
.location { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }

.social {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.social-item {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease);
}
.social-item:hover { background: var(--surface); }
.social-item:active { transform: scale(0.94); }
.social-item .icon { width: 28px; height: 28px; }

/* ---------- blocks ---------- */
.blocks { display: flex; flex-direction: column; gap: 8px; }

.block-heading {
  margin: 40px 0 6px;
  font-size: 22px;
  font-variation-settings: "wdth" 112;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.block-text { margin: 4px 0 8px; }

.link {
  display: grid;
  grid-template-columns: 40px 1fr 22px;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 18px 14px 16px;
  background: var(--surface);
  transition: background-color 180ms var(--ease), color 180ms var(--ease), transform 120ms var(--ease);
}
.link:not(:has(.link-icon)) { grid-template-columns: 1fr 22px; }
.link:hover { background: var(--ink); color: var(--ground); }
.link:active { transform: scale(0.985); }
.link.is-featured { background: var(--ink); color: var(--ground); min-height: 88px; }
.link.is-featured:hover { background: var(--ink-press); }

.link-icon { display: grid; place-items: center; }
.link-icon .icon { width: 26px; height: 26px; }
.link-text { display: flex; flex-direction: column; min-width: 0; }
.link-label { font-weight: 600; font-size: 17px; line-height: 1.3; }
.link-note { font-size: 14px; line-height: 1.35; margin-top: 2px; opacity: 0.68; }
.link-arrow .icon { width: 20px; height: 20px; transition: transform 200ms var(--ease); }
.link:hover .link-arrow .icon { transform: translate(2px, -2px); }

.block-image { margin: 0; }
.block-image img { width: 100%; height: auto; }
.block-image figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gallery li:first-child { grid-column: 1 / -1; }
.gallery li:first-child .gallery-item { aspect-ratio: 16 / 10; }
.gallery-item {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.gallery-item:hover img { transform: scale(1.04); }

.notice { padding: 20px; background: var(--surface); }

/* ---------- footer ---------- */
.foot { margin-top: 56px; text-align: center; }
.copy { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ---------- photo viewer ---------- */
.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(6, 6, 7, 0.97);
  color: var(--ink);
}
.viewer::backdrop { background: rgba(6, 6, 7, 0.97); }
.viewer[open] { display: grid; place-items: center; }
.viewer-figure { margin: 0; padding: 64px 16px; display: grid; justify-items: center; gap: 12px; }
.viewer-figure img { max-width: min(100%, 1200px); max-height: calc(100dvh - 160px); object-fit: contain; }
.viewer-figure figcaption { font-size: 15px; color: var(--ink-2); }
.viewer-btn {
  position: fixed;
  width: 52px;
  height: 52px;
  font-size: 30px;
  line-height: 1;
  background: var(--surface);
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.viewer-btn:hover { background: var(--ink); color: var(--ground); }
.viewer-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.viewer-prev, .viewer-next { top: 50%; transform: translateY(-50%); }
.viewer-prev { left: 12px; }
.viewer-next { right: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  margin: 0;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--ground);
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- entrance ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.profile > * { animation: rise 700ms var(--ease) both; }
.handle { animation-delay: 50ms; }
.tagline, .location { animation-delay: 100ms; }
.social { animation-delay: 150ms; }
.block { animation: rise 600ms var(--ease) both; animation-delay: calc(200ms + var(--i, 0) * 55ms); }

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

/* ---------- larger screens ---------- */
@media (min-width: 768px) {
  .page { padding-top: 32px; padding-bottom: 56px; }
  .profile { padding-top: 40px; }
  .avatar { width: 128px; height: 128px; }
  .handle { font-size: 30px; }
}
