﻿/*
 * Joffoo Portal Design System
 * Warm paper (#FAF7F0), deep ink (#161410), single yellow primary (#F6C417).
 * Spines sit directly on the page paper; directory rows use 1px hairlines.
 */

:root {
  --bg: #FAF7F0;
  --bg-muted: #EFECE4;
  --fg: #161410;
  --fg-muted: #6B645B;
  --fg-faint: #9B9388;
  --border: #DFD9CC;
  --card: #FFFFFF;
  --primary: #F6C417;
  --primary-hover: #E5B50E;
  --primary-fg: #161410;
  --flat: rgba(22, 20, 16, 0.055);
  --flat-hover: rgba(22, 20, 16, 0.095);
  --flat-active: rgba(22, 20, 16, 0.14);

  --display: "Fraunces", "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px / 1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: #FFE36E;
  color: var(--fg);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration-color: var(--border);
  text-underline-offset: 4px;
}

a:hover {
  text-decoration-color: currentColor;
}

code {
  font: 400 14px / 1.5 var(--mono);
  background: var(--bg-muted);
  color: var(--fg);
  padding: 2px 6px;
  border-radius: 6px;
}

.wrap {
  width: min(1140px, 100% - 36px);
  margin-inline: auto;
}

/* Top Bar & Joffoo Visual Anchor */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-block: 22px 18px;
  border-bottom: 1px solid var(--border);
}

.identity-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-height: 44px;
}

.avatar-stack {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(22, 20, 16, 0.14);
  flex: none;
  background: var(--bg-muted);
}

.avatar-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 260ms var(--ease-out);
}

.avatar-stack .avatar-alt {
  opacity: 0;
}

.identity-lockup:hover .avatar-stack .avatar-alt {
  opacity: 1;
}

.logo-mark {
  width: 32px;
  height: 32px;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.logo-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-domain {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 3px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  gap: 2px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
  letter-spacing: 0.04em;
  transition: all 140ms var(--ease-out);
}

.lang-btn:hover {
  color: var(--fg);
}

.lang-btn.is-active {
  background: var(--fg);
  color: var(--bg);
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: background-color 150ms, color 150ms;
}

.nav a:hover {
  background: var(--flat);
  color: var(--fg);
}

.nav a[aria-current="page"] {
  background: var(--fg);
  color: var(--bg);
}

/* Hero Intro */
.hero {
  position: relative;
  padding-block: 30px 26px;
}

.hero::before {
  content: "";
  position: absolute;
  top: -10px;
  right: -20px;
  width: min(520px, 60vw);
  height: min(520px, 60vw);
  background-image: url("./avatar-halftone-45.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center top;
  opacity: 0.055;
  pointer-events: none;
  z-index: 0;
}

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 28px;
}

.hero-quote-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.hero-quote {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.15vw, 2.7rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 820px;
}

.hero-en {
  margin: 8px 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  color: var(--fg-muted);
}

.catalog-stamp {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-muted);
  text-align: right;
  line-height: 1.65;
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .hero-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .catalog-stamp {
    text-align: left;
  }
}

/* First-screen Stage: Spines directly on paper (left) + Pulled Sleeve (right) */
.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 36px;
  align-items: stretch;
}

.shelf-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.shelf-wrap {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 24px 2px 0;
  overflow: visible;
  height: 454px;
  box-sizing: border-box;
}

.shelf-wrap::-webkit-scrollbar {
  display: none;
}

.spine-btn {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: block;
  transform: translateY(0);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.25, 1);
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.spine-btn svg {
  display: block;
  height: 430px;
  width: auto;
  max-width: none;
  pointer-events: none;
}

.spine-btn:hover {
  transform: translateY(-8px);
}

.spine-btn.is-active {
  transform: translateY(-14px);
}

.shelf-hint {
  margin-top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  height: 38px;
  box-sizing: border-box;
}

/* Active Sleeve Liner Notes */
.sleeve-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 20px;
  display: grid;
  gap: 14px;
}

.sleeve-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-muted);
}

.sleeve-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sleeve-author img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
}

.sleeve-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(22, 20, 16, 0.1);
  background: #141416;
}

.sleeve-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms cubic-bezier(0.2, 0.8, 0.25, 1);
  will-change: opacity;
  pointer-events: none;
}

.sleeve-media img.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.sleeve-title {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.sleeve-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg);
}

.sleeve-boundary {
  margin: 0;
  font-size: 14.5px;
  color: var(--fg-muted);
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.sleeve-boundary:empty {
  display: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

/* Flat Capsule Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  background: var(--flat);
  color: var(--fg);
  font: 500 14.5px / 1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, transform 120ms;
}

.btn:hover {
  background: var(--flat-hover);
}

.btn:active {
  transform: scale(0.97);
  background: var(--flat-active);
}

.btn.primary {
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 600;
}

.btn.primary:hover {
  background: var(--primary-hover);
}

/* Sections & Hairline Tracklist Directory */
.section {
  padding-block: 44px 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "Source Han Serif SC", var(--display);
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.section-sub {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-muted);
}

.rows {
  display: grid;
  gap: 1px;
  background: var(--border);
  border-block: 1px solid var(--border);
}

.row {
  background: var(--bg);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  gap: 12px 24px;
  align-items: center;
  padding-block: 15px;
}

.row-spine {
  display: flex;
  align-items: center;
  min-width: 0;
}

.row-spine svg {
  width: 205px;
  height: auto;
  display: block;
}

.row-tag {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--fg-muted);
}

.row-body {
  min-width: 0;
}

.row-title {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  display: inline-block;
}

.row-title:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.row-note {
  margin: 3px 0 0;
  font-size: 15px;
  color: var(--fg-muted);
}

.row-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.row-links .btn {
  min-height: 38px;
  padding: 0 15px;
  font-size: 14px;
}

/* Subpages: Skills & Tools */
.page-header {
  padding-block: 36px 24px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-lead {
  margin: 12px 0 0;
  font-size: 16px;
  color: var(--fg-muted);
  max-width: 680px;
}

.skill-showcase {
  padding-block: 36px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 32px;
  align-items: start;
}

.skill-spine-bar {
  margin-bottom: 16px;
  width: 100%;
}

.skill-spine-bar svg {
  width: 100%;
  height: auto;
  display: block;
}

.skill-cover {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(22, 20, 16, 0.12);
  background: var(--bg-muted);
}

.skill-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.skill-specs {
  display: grid;
  gap: 14px;
}

.skill-specs h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
}

.spec-block {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.spec-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.spec-text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
}

/* Footer */
.footer {
  margin-top: 48px;
  padding-block: 26px 44px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14.5px;
  color: var(--fg-muted);
}

.footer-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-left img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .hero-stage {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .spine-btn svg {
    height: 360px;
  }
  .skill-showcase {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .top-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .nav {
    gap: 4px;
    flex-wrap: nowrap;
  }
  .nav a {
    padding: 4px 6px;
    font-size: 13px;
  }
  .lang-btn {
    padding: 3px 6px;
    font-size: 11px;
  }
  .catalog-stamp {
    text-align: left;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .spine-btn svg {
    height: 330px;
  }
  .sleeve-title {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.section-sub-link {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 140ms ease;
}
.section-sub-link:hover {
  color: var(--fg);
}

html[lang="ja"] {
  --display: "Fraunces", "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --sans: "IBM Plex Sans", "Noto Sans JP", "Hiragino Sans", "Meiryo", system-ui, sans-serif;
}

html[lang="ja"] .section-head h2 {
  font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

html[lang="en"] .hero-quote {
  font-size: clamp(1.35rem, 1.9vw, 1.68rem);
  letter-spacing: -0.015em;
}

@media (min-width: 901px) {
  html[lang="en"] .hero-quote {
    white-space: nowrap;
    line-height: 51px;
  }
}
