/* ===== Nancy Studio - Design System ===== */

* {
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  box-sizing: border-box;
}

:root {
  --color-bg: #eaeeee;
  --color-text: #000000;
  --color-text-secondary: #777777;
  --color-border: #999999;
  --color-selection-bg: #000000;
  --color-selection-text: #ffffff;

  --font-serif: 'Noto Serif SC', '游明朝体', 'Yu Mincho', 'YuMincho',
    'ヒラギノ明朝 Pro', 'Hiragino Mincho Pro', 'MS P明朝', 'MS PMincho',
    'Georgia', serif;

  --sidebar-width: 360px;
  --content-padding: 18px;
  --sidebar-padding: 50px;

  --font-size-base: 14px;
  --font-size-sm: 12px;
  --font-size-lg: 16px;
  --font-size-h1: 28px;
  --font-size-h2: 22px;
  --font-size-nav: 14px;
  --font-size-lang: 13px;
  --font-size-footer: 13px;
  --font-size-logo: 15px;
  --line-height: 1.6em;

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease-in-out;
}

::selection {
  background: var(--color-selection-bg);
  color: var(--color-selection-text);
}

html {
  font-size: 62.5%;
}

body {
  font-family: var(--font-serif);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 1s ease-in-out;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text-secondary);
}

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

button {
  font-family: var(--font-serif);
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
}

/* ===== Sidebar (Desktop) ===== */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-bg);
  padding: var(--sidebar-padding);
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-logo {
  font-size: var(--font-size-logo);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 40px;
  display: block;
}

.sidebar-logo a {
  color: var(--color-text);
}

.sidebar-nav {
  display: flex;
  flex-wrap: wrap;
}

.sidebar-nav-column {
  margin-right: 40px;
}

.sidebar-nav a {
  display: block;
  font-size: var(--font-size-nav);
  padding: 4px 0;
  position: relative;
}

.sidebar-nav a.router-link-active::before {
  content: '';
  position: absolute;
  left: -1em;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text);
}

.sidebar-subnav {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-subnav a {
  display: block;
  font-size: var(--font-size-nav);
  padding: 4px 0;
  color: var(--color-text-secondary);
}

.sidebar-subnav a:hover {
  color: var(--color-text);
}

.sidebar-subnav a.router-link-active {
  color: var(--color-text);
}

.sidebar-subnav a.router-link-active::before {
  background: var(--color-text-secondary);
}

.sidebar-lang {
  margin-top: 40px;
  font-size: var(--font-size-lang);
}

.sidebar-lang a {
  display: inline-block;
  padding: 0 2px;
}

.sidebar-lang a + a::before {
  content: ' / ';
  color: var(--color-text);
}

/* ===== Mobile Header ===== */
.mobile-header {
  display: none;
  padding: var(--content-padding);
  background: var(--color-bg);
  position: relative;
  z-index: 200;
}

.mobile-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-logo {
  font-size: var(--font-size-logo);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.mobile-menu-toggle {
  font-size: var(--font-size-nav);
  padding: 4px 8px;
}

/* ===== Mobile Overlay ===== */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  z-index: 10000;
  padding: var(--sidebar-padding);
  display: none;
  flex-direction: column;
  justify-content: center;
}

.mobile-overlay.active {
  display: flex;
}

.mobile-overlay-close {
  position: absolute;
  top: var(--content-padding);
  right: var(--content-padding);
  font-size: var(--font-size-nav);
  padding: 4px 8px;
}

.mobile-overlay-nav a {
  display: block;
  font-size: 18px;
  padding: 8px 0;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.mobile-overlay-nav a:nth-child(1) { animation-delay: 0.1s; }
.mobile-overlay-nav a:nth-child(2) { animation-delay: 0.15s; }
.mobile-overlay-nav a:nth-child(3) { animation-delay: 0.2s; }

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

/* ===== Main Content Area ===== */
.app-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: var(--content-padding);
}

/* ===== Footer ===== */
.app-footer {
  position: fixed;
  bottom: var(--content-padding);
  left: var(--sidebar-padding);
  font-size: var(--font-size-footer);
  color: var(--color-text-secondary);
  z-index: 50;
}

.app-footer a {
  color: var(--color-text-secondary);
}

.app-footer a:hover {
  color: var(--color-text);
}

/* ===== Works Grid ===== */
.works-grid {
  max-width: 1200px;
}

.works-grid-item {
  margin-bottom: 5em;
  cursor: pointer;
}

.works-grid-item img {
  width: 100%;
  margin-bottom: 0.8em;
}

.works-grid-item h2 {
  font-size: var(--font-size-base);
  font-weight: 500;
  margin-bottom: 0.2em;
}

/* ===== Work Detail ===== */
.work-detail-title {
  font-size: var(--font-size-h2);
  font-weight: 500;
  margin-bottom: 0.3em;
}

.work-info-toggle {
  display: inline-block;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  padding: 4px 0;
  margin-bottom: 1.5em;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.work-info-toggle:hover {
  border-bottom-color: var(--color-text-secondary);
}

.work-info-table {
  display: table;
  width: 100%;
  max-width: 800px;
  margin-bottom: 4em;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  padding-top: 1em;
}

.work-info-row {
  display: table-row;
}

.work-info-label {
  display: table-cell;
  width: 140px;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  vertical-align: top;
  padding: 3px 0;
  white-space: nowrap;
}

.work-info-value {
  display: table-cell;
  font-size: var(--font-size-base);
  padding: 3px 0 3px 1em;
}

/* ===== Case Category Tabs ===== */
.case-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.case-tab {
  font-size: var(--font-size-base);
  padding: 8px 20px;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  margin-bottom: -1px;
}

.case-tab:hover {
  color: var(--color-text);
}

.case-tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* ===== Photo Grid ===== */
.photo-grid {
  display: flex;
  flex-direction: column;
  gap: var(--content-padding);
}

.photo-grid-img {
  width: 100%;
  display: block;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.photo-grid-img:hover {
  opacity: 0.85;
}

/* ===== Biography ===== */
.biography-page {
  max-width: 800px;
}

.biography-page h1 {
  font-size: var(--font-size-h1);
  font-weight: 500;
  margin-bottom: 1em;
}

.biography-section {
  margin-bottom: 4em;
  padding-top: var(--content-padding);
}

.biography-section-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: 1em;
}

/* ===== Contact ===== */
.contact-page {
  max-width: 800px;
}

.contact-page h1 {
  font-size: var(--font-size-h1);
  font-weight: 500;
  margin-bottom: 1em;
}

.contact-section {
  margin-bottom: 2em;
}

.contact-section p {
  margin-bottom: 0.5em;
  line-height: var(--line-height);
}

.contact-section a {
  color: var(--color-text);
}

.contact-section a:hover {
  color: var(--color-text-secondary);
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 4em;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

/* ===== Transitions ===== */
.fade-enter-active,
.fade-leave-active {
  transition: opacity var(--transition-normal);
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* ===== Responsive ===== */
@media screen and (max-width: 1365px) {
  .app-content {
    width: 70%;
  }
}

@media screen and (max-width: 1023px) {
  .app-sidebar {
    display: none;
  }

  .app-content {
    margin-left: 0;
    width: 100%;
  }

  .mobile-header {
    display: block;
  }

  .app-footer {
    position: relative;
    bottom: auto;
    left: auto;
    padding: 6em var(--content-padding) var(--content-padding);
  }
}

@media screen and (max-width: 480px) {
  :root {
    --sidebar-padding: 24px;
    --content-padding: 12px;
  }
}
