/* ========================================
   Portfolio - Style Sheet
   ======================================== */

/* ----------------------------------------
   CSS Custom Properties
   ---------------------------------------- */
:root {
  /* Colors */
  --bg: #FFFFFF;
  --bg-alt: #F5F5F5;
  --ink: #222222;
  --ink-light: #666666;
  --rule: #DDDDDD;
  --white: #FFFFFF;

  /* Typography */
  --font-serif-ja: "Noto Sans JP", sans-serif;
  --font-serif-en: "Noto Sans JP", sans-serif;
  --font-sans: "Noto Sans JP", sans-serif;

  /* Type Scale */
  --fs-h1: clamp(2.5rem, 8vw, 5.5rem);
  --fs-h2: clamp(1.5rem, 3vw, 2rem);
  --fs-h3: 1.25rem;
  --fs-body: 0.9375rem;
  --fs-caption: 0.75rem;

  /* Spacing */
  --section-gap-pc: 120px;
  --section-gap-sp: 72px;
  --container-max: 1120px;
  --container-padding: 24px;

  /* Transitions */
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease-out;
}

/* ----------------------------------------
   Reset & Base
   ---------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* scroll-behavior is handled by JavaScript for better control */
}

/* Reduced motion media query disabled - animations always enabled */

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.9;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

ul,
ol {
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ----------------------------------------
   Utility Classes
   ---------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------
   Scroll Animation
   ---------------------------------------- */

/* Base fade animation */
.js-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade up animation */
.js-fade-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade in with scale */
.js-fade-scale {
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-fade-scale.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Fade from left */
.js-fade-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-fade-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Fade from right */
.js-fade-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-fade-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delay classes */
.js-delay-1 { transition-delay: 0.1s; }
.js-delay-2 { transition-delay: 0.2s; }
.js-delay-3 { transition-delay: 0.3s; }
.js-delay-4 { transition-delay: 0.4s; }
.js-delay-5 { transition-delay: 0.5s; }
.js-delay-6 { transition-delay: 0.6s; }

/* Hero animation */
.hero__title,
.hero__subtitle {
  opacity: 0;
  transform: translateY(30px);
}

.hero__title.is-visible {
  animation: heroFadeIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.hero__subtitle.is-visible {
  animation: heroFadeIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
}

@keyframes heroFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section heading line animation */
.section__heading-line {
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
}

.section__heading.is-visible .section__heading-line {
  transform: scaleX(1);
}

.section__heading-text {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section__heading.is-visible .section__heading-text {
  opacity: 1;
  transform: translateY(0);
}

/* Work card stagger animation */
.work-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              background-color var(--transition-base);
}

.work-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* About section animation */
.about__photo-wrapper {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.about__photo-wrapper.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.about__info {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s,
              transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s;
}

.about__info.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ----------------------------------------
   Site Header
   ---------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px var(--container-padding);
  background-color: var(--bg);
  border-bottom: 1px solid var(--rule);
  z-index: 1000;
}

body {
  padding-top: 65px;
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header__logo {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
}

.site-header__nav-list {
  display: flex;
  gap: 32px;
  list-style: none;
}

.site-header__nav-list a {
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--transition-base);
}

.site-header__nav-list a:hover {
  color: var(--ink-light);
}

.site-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.site-header__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--ink);
  transition: var(--transition-base);
}

.site-header__hamburger.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.site-header__hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.site-header__hamburger.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 640px) {
  .site-header__logo {
    font-size: 1rem;
  }

  .site-header__hamburger {
    display: flex;
  }

  .site-header__nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
    z-index: 100;
  }

  .site-header__nav.is-active {
    opacity: 1;
    visibility: visible;
  }

  .site-header__nav-list {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .site-header__nav-list a {
    font-size: 1.25rem;
  }
}

/* ----------------------------------------
   Hero Section
   ---------------------------------------- */
.hero {
  padding: 181px var(--container-padding) 80px;
}

.hero__container {
  max-width: var(--container-max);
  margin: 0 auto;
  text-align: center;
}

.hero__title {
  font-size: 45px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 16px;
}

.hero__subtitle {
  font-size: clamp(12px, 2vw, 14px);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-light);
}

@media (max-width: 768px) {
  .hero {
    padding-bottom: 60px;
  }
}

/* ----------------------------------------
   Section Common
   ---------------------------------------- */
.section {
  padding: var(--section-gap-pc) var(--container-padding);
}

.section__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.section__heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 64px;
  font-family: var(--font-serif-en);
  font-size: var(--fs-h2);
  font-weight: 400;
  letter-spacing: 0.15em;
}

.section__heading-line {
  flex: 1;
  max-width: 120px;
  height: 1px;
  background-color: var(--rule);
}

.section__heading-text {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--section-gap-sp) var(--container-padding);
  }

  .section__heading {
    margin-bottom: 48px;
  }
}

/* ----------------------------------------
   Works Grid
   ---------------------------------------- */
.works__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

@media (max-width: 768px) {
  .works__grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------
   Work Card
   ---------------------------------------- */
.work-card {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background-color var(--transition-base);
}

.work-card__link {
  display: block;
  height: 100%;
  padding: 32px;
  position: relative;
}

.work-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--bg-alt);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.work-card:hover .work-card__link::after {
  opacity: 0.5;
}

.work-card__link:focus-visible {
  outline-offset: -4px;
}

.work-card__image-wrapper {
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
  aspect-ratio: 520 / 360;
  background-color: var(--bg-alt);
}


.work-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-base);
}

.work-card:hover .work-card__image {
  transform: scale(1.03);
}

.work-card:has(.work-card__category--banner):hover .work-card__image {
  transform: none;
}

.work-card__category {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #252525;
  background-color: #e4ff51;
  padding: 4px 12px;
  border-radius: 2px;
  z-index: 1;
}

.work-card__category--design {
  background-color: #e4ff51;
}

.work-card__category--banner {
  background-color: #ffb23d;
}

.work-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-card__title {
  font-family: var(--font-serif-ja);
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.work-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-card__desc {
  font-size: var(--fs-body);
  color: var(--ink-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .work-card__link {
    padding: 24px;
  }
}

/* ----------------------------------------
   Tag
   ---------------------------------------- */
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: var(--fs-caption);
  letter-spacing: 0.05em;
  border: 1px solid var(--rule);
  border-radius: 100px;
  white-space: nowrap;
}

.tag--filled {
  background-color: var(--bg-alt);
  border-color: transparent;
}

/* ----------------------------------------
   Button
   ---------------------------------------- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: var(--fs-body);
  font-weight: 500;
  letter-spacing: 0.1em;
  border-radius: 100px;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.btn--primary {
  color: var(--white);
  background-color: var(--ink);
}

.btn--primary:hover {
  background-color: var(--ink-light);
}

.btn--outline {
  color: var(--ink);
  background-color: transparent;
  border: 1px solid var(--ink);
}

.btn--outline:hover {
  color: var(--white);
  background-color: var(--ink);
}

/* ----------------------------------------
   About Section
   ---------------------------------------- */
.about__content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  align-items: start;
}

.about__photo-wrapper {
  position: relative;
}

.about__photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.about__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about__name-ja {
  font-family: var(--font-serif-ja);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.15em;
}

.about__name-en {
  font-family: var(--font-serif-en);
  font-size: var(--fs-caption);
  letter-spacing: 0.15em;
  color: var(--ink-light);
  margin-top: -26px;
}

.about__bio {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about__attributes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.about__more {
  margin-top: 16px;
}

.about__detail {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.about__detail[hidden] {
  display: none;
}

.about__detail-heading {
  font-family: var(--font-serif-ja);
  font-size: var(--fs-h3);
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 0.1em;
}

.about__timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about__timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
}

.about__timeline-item dt {
  font-family: var(--font-serif-en);
  font-size: var(--fs-body);
  color: var(--ink-light);
}

.about__timeline-item dd {
  font-size: var(--fs-body);
}

@media (max-width: 768px) {
  .about__content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about__photo-wrapper {
    max-width: 280px;
    margin: 0 auto;
  }
}

/* ----------------------------------------
   Fixed Navigation
   ---------------------------------------- */
.fixed-nav {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
}

.fixed-nav__list {
  display: flex;
  gap: 4px;
  padding: 6px;
  background-color: var(--white);
  border: 1px solid var(--rule);
  border-radius: 100px;
  box-shadow: 0 2px 12px rgba(27, 53, 82, 0.08);
}

.fixed-nav__link {
  display: block;
  padding: 10px 18px;
  font-family: var(--font-serif-en);
  font-size: var(--fs-caption);
  letter-spacing: 0.1em;
  border-radius: 100px;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.fixed-nav__link:hover {
  background-color: var(--bg-alt);
}

.fixed-nav__link.is-active {
  color: var(--white);
  background-color: var(--ink);
}

@media (max-width: 640px) {
  .fixed-nav {
    bottom: 16px;
    right: 16px;
  }

  .fixed-nav__list {
    padding: 4px;
  }

  .fixed-nav__link {
    padding: 8px 12px;
    font-size: 0.625rem;
  }
}

/* ----------------------------------------
   Site Footer
   ---------------------------------------- */
.site-footer {
  padding: 40px var(--container-padding);
  text-align: center;
  border-top: 1px solid var(--rule);
}

.site-footer__copyright {
  font-family: var(--font-serif-en);
  font-size: var(--fs-caption);
  letter-spacing: 0.1em;
  color: var(--ink-light);
}