:root {
  --bg: #0d1114;
  --text: #f4f7f5;
  --text-rgb: 244, 247, 245;
  --muted: rgba(var(--text-rgb), 0.72);
  --soft: rgba(var(--text-rgb), 0.54);
  --background-blur: 0px;
  --card-blur: 2px;
  --control-blur: 3px;
  --panel-blur: 10px;
  --card-brightness: 1;
  --tint-alpha: 0.58;
  --tint-mid-alpha: 0.34;
  --tint-end-alpha: 0.58;
  --line: rgba(var(--text-rgb), 0.24);
  --glass: rgba(11, 17, 18, 0.18);
  --glass-strong: rgba(12, 18, 20, 0.26);
  --hero-glass: rgba(19, 27, 27, 0.18);
  --status-glass: rgba(18, 22, 30, 0.18);
  --vr-glass: rgba(30, 19, 23, 0.18);
  --quote-glass: rgba(17, 21, 23, 0.18);
  --button: rgba(var(--text-rgb), 0.08);
  --button-hover: rgba(var(--text-rgb), 0.14);
  --mint: #9ee8ce;
  --amber: #f1d28d;
  --rose: #f0a9b7;
  --blue: #9fc7ff;
  --shadow: 0 18px 56px rgba(0, 0, 0, 0.24);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

html[data-bg-preset="soft"] {
  --background-blur: 0px;
  --background-scale: 1;
  --card-blur: 2px;
  --control-blur: 3px;
  --panel-blur: 10px;
  --tint-alpha: 0.58;
  --tint-mid-alpha: 0.34;
  --tint-end-alpha: 0.58;
  --glass: rgba(11, 17, 18, 0.18);
  --glass-strong: rgba(12, 18, 20, 0.26);
}

html[data-bg-preset="heavy"] {
  --background-blur: 0px;
  --background-scale: 1;
  --card-blur: 18px;
  --control-blur: 14px;
  --panel-blur: 18px;
  --tint-alpha: 0.72;
  --tint-mid-alpha: 0.48;
  --tint-end-alpha: 0.7;
  --glass: rgba(15, 20, 22, 0.46);
  --glass-strong: rgba(16, 22, 24, 0.58);
  --hero-glass: rgba(15, 20, 22, 0.46);
  --status-glass: rgba(15, 20, 22, 0.46);
  --vr-glass: rgba(20, 16, 20, 0.46);
  --quote-glass: rgba(15, 20, 22, 0.46);
}

html[data-bg-preset="frosted"] {
  --background-blur: 5px;
  --background-scale: 1.025;
  --card-blur: 12px;
  --control-blur: 10px;
  --panel-blur: 16px;
  --tint-alpha: 0.5;
  --tint-mid-alpha: 0.26;
  --tint-end-alpha: 0.5;
  --glass: rgba(230, 244, 240, 0.14);
  --glass-strong: rgba(230, 244, 240, 0.22);
  --hero-glass: rgba(230, 244, 240, 0.14);
  --status-glass: rgba(230, 244, 240, 0.14);
  --vr-glass: rgba(244, 230, 238, 0.14);
  --quote-glass: rgba(230, 244, 240, 0.14);
}

html[data-bg-preset="mdui"] {
  --background-blur: 0px;
  --background-scale: 1;
  --card-blur: 0px;
  --control-blur: 0px;
  --panel-blur: 8px;
  --tint-alpha: 0.66;
  --tint-mid-alpha: 0.42;
  --tint-end-alpha: 0.62;
  --glass: rgba(22, 28, 30, 0.68);
  --glass-strong: rgba(31, 38, 40, 0.76);
  --hero-glass: rgba(22, 28, 30, 0.68);
  --status-glass: rgba(22, 28, 30, 0.68);
  --vr-glass: rgba(29, 23, 28, 0.68);
  --quote-glass: rgba(22, 28, 30, 0.68);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

html[data-text-preset="white"] {
  --text: #f4f7f5;
  --text-rgb: 244, 247, 245;
}

html[data-text-preset="pink"] {
  --text: #ffd7e4;
  --text-rgb: 255, 215, 228;
}

html[data-text-preset="black"] {
  --text: #111715;
  --text-rgb: 17, 23, 21;
  --line: rgba(17, 23, 21, 0.28);
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.54);
  --hero-glass: rgba(255, 255, 255, 0.42);
  --status-glass: rgba(255, 255, 255, 0.42);
  --vr-glass: rgba(255, 255, 255, 0.42);
  --quote-glass: rgba(255, 255, 255, 0.42);
  --button: rgba(255, 255, 255, 0.3);
  --button-hover: rgba(255, 255, 255, 0.44);
  --tint-alpha: 0.32;
  --tint-mid-alpha: 0.16;
  --tint-end-alpha: 0.3;
}

html[data-text-preset="black"][data-bg-preset="mdui"] {
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --hero-glass: rgba(255, 255, 255, 0.72);
  --status-glass: rgba(255, 255, 255, 0.72);
  --vr-glass: rgba(255, 255, 255, 0.72);
  --quote-glass: rgba(255, 255, 255, 0.72);
}

.background,
.shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background {
  z-index: -3;
  background-image: var(--background-image, url("img/background.jpg"));
  background-position: center;
  background-size: cover;
  filter: blur(var(--background-blur)) brightness(var(--card-brightness));
  transform: scale(var(--background-scale, 1));
}

.shade {
  z-index: -2;
  background:
    radial-gradient(circle at 18% 12%, rgba(158, 232, 206, 0.11), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(241, 210, 141, 0.09), transparent 32%),
    linear-gradient(115deg, rgba(2, 6, 8, var(--tint-alpha)), rgba(7, 15, 18, var(--tint-mid-alpha)) 44%, rgba(7, 8, 10, var(--tint-end-alpha)));
}

.topbar {
  position: fixed;
  z-index: 10;
  top: 18px;
  left: 50%;
  display: flex;
  width: min(1180px, calc(100% - 28px));
  transform: translateX(-50%);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    padding 180ms ease;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar.is-glass {
  border-color: rgba(var(--text-rgb), 0.16);
  background: rgba(9, 14, 15, 0.3);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px) saturate(1.12);
  -webkit-backdrop-filter: blur(8px) saturate(1.12);
  padding: 8px;
}

.brand,
.language-control select,
.button,
.subtle-link,
.icon-button,
.subtle-button {
  border: 1px solid var(--line);
  background: rgba(12, 17, 18, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(var(--control-blur)) saturate(1.04);
  -webkit-backdrop-filter: blur(var(--control-blur)) saturate(1.04);
}

.brand {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 7px 14px 7px 7px;
  color: rgba(var(--text-rgb), 0.92);
  font-size: 0.95rem;
  font-weight: 680;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(var(--text-rgb), 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.language-control {
  display: inline-flex;
}

.language-control select {
  min-height: 42px;
  max-width: 180px;
  border-radius: 999px;
  padding: 0 30px 0 15px;
  color: var(--text);
  font: inherit;
  color-scheme: dark;
}

.icon-button,
.subtle-button {
  display: inline-grid;
  min-height: 42px;
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  place-items: center;
  font-size: 1rem;
}

.subtle-button {
  place-items: center;
  padding: 0 13px;
  color: var(--soft);
  font-size: 0.82rem;
}

.settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 28px));
  border: 1px solid rgba(var(--text-rgb), 0.18);
  border-radius: 8px;
  background: rgba(9, 14, 15, 0.46);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(var(--panel-blur)) saturate(1.1);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(1.1);
  padding: 16px;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-head .eyebrow {
  margin: 0;
}

.setting-row {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.preset-grid button {
  min-height: 38px;
  border: 1px solid rgba(var(--text-rgb), 0.16);
  border-radius: 8px;
  background: rgba(var(--text-rgb), 0.07);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.preset-grid button[aria-pressed="true"] {
  border-color: rgba(var(--text-rgb), 0.42);
  background: rgba(var(--text-rgb), 0.16);
  box-shadow: inset 0 0 0 1px rgba(var(--text-rgb), 0.1);
}

.color-presets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shell {
  width: min(1180px, calc(100% - 28px));
  max-width: 100%;
  margin: 0 auto;
  padding: 108px 0 42px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(var(--text-rgb), 0.065), rgba(var(--text-rgb), 0.02)), var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--card-blur)) saturate(1.04);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.04);
  padding: clamp(20px, 3vw, 30px);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.card::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(120deg, rgba(var(--text-rgb), 0.09), transparent 34%),
    repeating-linear-gradient(90deg, rgba(var(--text-rgb), 0.02) 0 1px, transparent 1px 5px);
  opacity: 0.28;
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--text-rgb), 0.32);
  background: linear-gradient(145deg, rgba(var(--text-rgb), 0.08), rgba(var(--text-rgb), 0.03)), var(--glass-strong);
}

.span-4 {
  min-width: 0;
  grid-column: span 4;
}

.span-5 {
  min-width: 0;
  grid-column: span 5;
}

.span-7 {
  min-width: 0;
  grid-column: span 7;
}

.span-12 {
  min-width: 0;
  grid-column: span 12;
}

.hero-card {
  min-height: 410px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(145deg, rgba(158, 232, 206, 0.12), rgba(255, 255, 255, 0.035)),
    var(--hero-glass);
}

.hero-card h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(3.3rem, 8vw, 7.4rem);
  line-height: 0.9;
  font-weight: 780;
}

.hero-card h1 span {
  display: block;
}

html[lang="ja"] .hero-card h1 {
  font-size: clamp(2.9rem, 6.8vw, 5.9rem);
  line-height: 1.02;
}

.hero-copy {
  max-width: 680px;
  margin: 22px 0 0;
  color: rgba(var(--text-rgb), 0.74);
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.65;
  overflow-wrap: break-word;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.7vw, 2.2rem);
  line-height: 1.12;
  font-weight: 740;
}

p {
  color: rgba(var(--text-rgb), 0.72);
  line-height: 1.72;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.status-card {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(145deg, rgba(159, 199, 255, 0.11), rgba(255, 255, 255, 0.035)),
    var(--status-glass);
}

.pulse {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  place-items: center;
}

.pulse::before,
.pulse::after {
  content: "";
  grid-area: 1 / 1;
  border-radius: 999px;
}

.pulse::before {
  width: 11px;
  height: 11px;
  background: var(--mint);
  box-shadow: 0 0 0 8px rgba(158, 232, 206, 0.1);
  animation: pulse-core 1.8s ease-in-out infinite;
}

.pulse::after {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(158, 232, 206, 0.5);
  animation: pulse-ring 1.8s ease-out infinite;
}

@keyframes pulse-core {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.78;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.7);
    opacity: 0.72;
  }

  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  color: var(--text);
  font-weight: 720;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

  .button:hover,
.subtle-link:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

.button.primary {
  border-color: rgba(158, 232, 206, 0.52);
  background: rgba(158, 232, 206, 0.12);
}

.button.compact {
  min-height: 40px;
  margin-top: 10px;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.mini-actions .button {
  min-height: 40px;
}

.subtle-link {
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--soft);
  font-size: 0.82rem;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.post-list,
.project-list,
.repo-strip,
.link-grid {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.post-item,
.project-item,
.repo-pill,
.link-grid a {
  border: 1px solid rgba(var(--text-rgb), 0.14);
  border-radius: 8px;
  background: rgba(var(--text-rgb), 0.055);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.project-item.is-disabled {
  cursor: default;
}

.project-item.is-disabled:hover {
  transform: none;
}

.post-item,
.project-item {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.post-item:hover,
.project-item:hover,
.repo-pill:hover,
.link-grid a:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--text-rgb), 0.3);
  background: rgba(var(--text-rgb), 0.09);
}

.post-item time,
.project-item small {
  color: rgba(var(--text-rgb), 0.54);
  font-size: 0.82rem;
}

.post-item time {
  margin-top: 2px;
}

.project-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-note {
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 0.86rem;
}

.repo-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.repo-pill {
  min-height: 104px;
  padding: 12px;
  color: rgba(var(--text-rgb), 0.72);
  font-size: 0.9rem;
}

.repo-pill strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-pill span {
  display: block;
  margin-top: 6px;
  color: rgba(var(--text-rgb), 0.54);
  font-size: 0.78rem;
}

.repo-pill small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 8px;
  color: rgba(var(--text-rgb), 0.66);
  font-size: 0.78rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.vr-card {
  background:
    linear-gradient(145deg, rgba(240, 169, 183, 0.13), rgba(255, 255, 255, 0.035)),
    var(--vr-glass);
}

.category-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.category-group {
  display: grid;
  gap: 8px;
}

.category-label {
  color: rgba(var(--text-rgb), 0.54);
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid rgba(var(--text-rgb), 0.16);
  border-radius: 999px;
  background: rgba(var(--text-rgb), 0.08);
  padding: 8px 11px;
  color: rgba(var(--text-rgb), 0.82);
  font-size: 0.88rem;
}

.now-updated {
  margin: auto 0 0;
  padding-top: 22px;
  color: rgba(var(--text-rgb), 0.48);
  font-size: 0.78rem;
  line-height: 1.45;
}

.link-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.link-grid a {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  color: rgba(var(--text-rgb), 0.88);
  font-weight: 720;
}

.link-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: rgba(var(--text-rgb), 0.08);
  color: var(--mint);
}

.link-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

@media (prefers-reduced-motion: reduce) {
  .pulse::before,
  .pulse::after {
    animation: none;
  }
}

.quote-card {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    linear-gradient(90deg, rgba(158, 232, 206, 0.08), rgba(241, 210, 141, 0.07), rgba(240, 169, 183, 0.08)),
    var(--quote-glass);
  text-align: center;
}

.quote-card p {
  max-width: 900px;
  margin: 0;
  color: rgba(var(--text-rgb), 0.82);
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.credit {
  color: rgba(var(--text-rgb), 0.48);
  font-size: 0.72rem;
  line-height: 1.5;
}

.credit a {
  border-bottom: 1px solid rgba(var(--text-rgb), 0.28);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 920px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .span-4,
  .span-5,
  .span-7,
  .span-12 {
    grid-column: span 6;
  }

  .hero-card {
    min-height: 520px;
  }

  .project-list,
  .repo-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    top: 12px;
    right: 10px;
    left: 10px;
    width: auto;
    transform: none;
  }

  .topbar.is-glass {
    padding: 6px;
  }

  .brand {
    min-height: 38px;
    padding-right: 11px;
  }

  .brand span:last-child {
    display: none;
  }

  .language-control select {
    min-height: 38px;
    width: 92px;
    max-width: 92px;
    padding: 0 22px 0 12px;
    font-size: 0.84rem;
  }

  .icon-button {
    width: 36px;
    min-height: 38px;
  }

  .top-actions {
    flex-direction: row-reverse;
    gap: 6px;
  }

  .settings-panel {
    right: 0;
  }

  .shell {
    width: calc(100% - 20px);
    padding-top: 82px;
  }

  .grid {
    gap: 10px;
  }

  .card {
    min-height: auto;
    padding: 18px;
  }

  .hero-card {
    min-height: 470px;
  }

  .hero-card h1 {
    font-size: clamp(2.7rem, 14vw, 3.8rem);
  }

  html[lang="ja"] .hero-card h1 {
    font-size: clamp(2.05rem, 10vw, 2.75rem);
    line-height: 1.02;
  }

  .hero-copy {
    max-width: 30ch;
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .status-card p {
    max-width: 31ch;
    font-size: 0.95rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
