:root {
  color-scheme: dark;
  --background: #111610;
  --surface: #1b221a;
  --surface-hover: #242e20;
  --text: #f2f5ef;
  --muted: #b2bcac;
  --border: #35402f;
  --accent: #c4dea8;
  --icon-surface: #252e22;
  --light-icon-display: none;
  --dark-icon-display: block;
  --monochrome-filter: brightness(0) invert(1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --background: #f5f5f2;
    --surface: #ffffff;
    --surface-hover: #f0f4ea;
    --text: #212821;
    --muted: #596253;
    --border: #dce1d6;
    --accent: #42672e;
    --icon-surface: #f2f4ee;
    --light-icon-display: block;
    --dark-icon-display: none;
    --monochrome-filter: brightness(0);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f5f5f2;
  --surface: #ffffff;
  --surface-hover: #f0f4ea;
  --text: #212821;
  --muted: #596253;
  --border: #dce1d6;
  --accent: #42672e;
  --icon-surface: #f2f4ee;
  --light-icon-display: block;
  --dark-icon-display: none;
  --monochrome-filter: brightness(0);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  width: calc(100% - 40px);
  max-width: 520px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px 0 56px;
}

.toolbar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

.theme-toggle {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.theme-icon,
.homepage-icon {
  filter: var(--monochrome-filter);
}

.icon-on-light {
  display: var(--light-icon-display);
}

.icon-on-dark {
  display: var(--dark-icon-display);
}

.profile {
  margin: 32px 0 36px;
  text-align: center;
}

.avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 20px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--icon-surface);
  box-shadow: 0 0 0 1px var(--border);
  object-fit: cover;
  object-position: center;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 700;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.bio {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.profile::after {
  display: block;
  width: 28px;
  height: 3px;
  margin: 22px auto 0;
  background: var(--accent);
  content: "";
}

.link-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-card {
  display: grid;
  min-height: 90px;
  grid-template-columns: 44px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.link-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--icon-surface);
}

.link-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.service-name {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.link-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.handle {
  display: inline-block;
}

.link-arrow {
  width: 9px;
  height: 9px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  color: var(--muted);
}

:is(.theme-toggle, .link-card):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

@media (hover: hover) {
  :is(.theme-toggle, .link-card):hover {
    border-color: var(--accent);
    background: var(--surface-hover);
  }

  .link-card:hover {
    transform: translateY(-2px);
  }
}

.link-card:active {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 360px) {
  .link-card {
    gap: 12px;
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .link-card {
    transition: none;
  }

  .link-card:hover {
    transform: none;
  }
}
