*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0e0d0b;
  --ink: #beb6a6;
  --muted: #4e4a44;
  --dim: #8a8278;
  --line: #222018;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ee; --ink: #2a2620; --muted: #9a9080;
    --dim: #5a5248; --line: #ddd8cc;
  }
}
body.dark  { --bg: #0e0d0b; --ink: #beb6a6; --muted: #4e4a44; --dim: #8a8278; --line: #222018; }
body.light { --bg: #f5f3ee; --ink: #2a2620; --muted: #9a9080; --dim: #5a5248; --line: #ddd8cc; }

body {
  font-size: 125%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Serif JP', serif;
  font-weight: 200;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 8vw, 5rem) clamp(1.4rem, 6vw, 3rem);
  transition: background 0.5s, color 0.5s;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Theme button ── */
.theme-btn {
  position: fixed;
  top: 1.8rem; right: 1.8rem; z-index: 10;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  cursor: pointer; outline: none;
  opacity: 0; transition: opacity 0.4s;
  -webkit-tap-highlight-color: transparent;
}
body:hover .theme-btn { opacity: 1; }
.theme-btn::after {
  content: ''; display: block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted);
  transition: background 0.4s, transform 0.3s;
}
.theme-btn:hover::after { background: var(--ink); transform: scale(1.7); }
@media (hover: none) { .theme-btn { opacity: 0.5; } }

/* ── Main ── */
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  opacity: 0;
  animation: fadein 2s ease forwards 0.4s;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Title / Subtitle ── */
.title {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: 1rem;
  transition: color 0.5s;
}

.subtitle {
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  color: var(--muted);
  letter-spacing: 0.05em;
  line-height: 2.1;
  font-weight: 200;
  margin-bottom: clamp(3rem, 8vw, 5rem);
  transition: color 0.5s;
}
.subtitle p + p { margin-top: 0.8em; }

/* ── Profiles ── */
.profiles {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.3s;
}
.profile-item:first-child { border-top: 1px solid var(--line); }

.profile-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-id {
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--ink);
  transition: color 0.3s;
}

.profile-url {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  transition: color 0.3s;
}

.profile-arrow {
  font-size: 0.7rem;
  color: var(--muted);
  transition: color 0.3s, transform 0.3s;
}

.profile-item:hover .profile-id    { color: var(--ink); }
.profile-item:hover .profile-url   { color: var(--dim); }
.profile-item:hover .profile-arrow { color: var(--ink); transform: translateX(4px); }

/* ── Footer ── */
.footer {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-intro {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 2;
  font-weight: 200;
  max-width: 320px;
  transition: color 0.5s;
}
.footer-intro p + p { margin-top: 0.4em; }

.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}

.contact-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.5s;
}

.contact-val {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.3s, border-color 0.3s;
}
a.contact-val:hover { color: var(--ink); border-color: var(--muted); }

.footer-bottom {
  width: 100%;
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.log-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.3s, border-color 0.3s;
}
.log-link:hover { color: var(--ink); border-color: var(--muted); }

.copyright {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--dim);
  transition: color 0.5s;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .footer { flex-direction: column; gap: 2rem; }
  .footer-contact { align-items: flex-start; }
}
