/* 
  yuhaku - Core Styles
  Theme: Tech & Poetic (Monotone with Cyan/Red accents)
*/

:root {
  /* Colors - White Theme */
  --bg-color: #fafafa;
  --text-main: #333333;
  --text-muted: #777777;
  --accent-cyan: #00b8cc;
  /* Slightly darker cyan for better contrast on white */
  --accent-red: #ff3366;
  --border-light: rgba(0, 0, 0, 0.08);
  /* Replaces rgba(255,255,255,0.1) for borders */

  /* Typography */
  --font-en: "Outfit", "Inter", sans-serif;
  --font-jp: "Noto Sans JP", sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-en);
  line-height: 1.6;
  overflow-x: hidden;
  font-weight: 300;
}

  .u-hidden-pc {
    display: none;
  }

  @media (max-width: 768px) {
  .u-hidden-pc {
    display: block;
  }
}



/* 
  =========================================
  Loading Animation (Tech & Poetic)
  =========================================
*/
.loading {
  position: fixed;
  inset: 0;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.loading--fadeout {
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
}

/* Delicate intersecting lines */
.loading__line {
  position: absolute;
  background: currentColor;
  opacity: 0.6;
}

.loading__line--cyan {
  width: 1px;
  height: 0;
  top: 50%;
  left: 45%;
  transform: translateY(-50%) rotate(15deg);
  background: var(--accent-cyan);
  animation: drawLineV 2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.loading__line--red {
  width: 0;
  height: 1px;
  top: 55%;
  left: 50%;
  transform: translateX(-50%) rotate(-10deg);
  background: var(--accent-red);
  animation: drawLineH 2.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes drawLineV {
  0% {
    height: 0;
    opacity: 0;
  }

  50% {
    opacity: 0.8;
  }

  100% {
    height: 150vh;
    opacity: 0.2;
  }
}

@keyframes drawLineH {
  0% {
    width: 0;
    opacity: 0;
  }

  50% {
    opacity: 0.8;
  }

  100% {
    width: 150vw;
    opacity: 0.2;
  }
}

/* Glitch Text */
.loading__text {
  position: relative;
  font-family: var(--font-en);
  font-size: 2rem;
  letter-spacing: 0.3em;
  font-weight: 300;
  color: var(--text-main);
  z-index: 2;
  opacity: 0;
  animation: loadingTextReveal 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.5s;
}

@keyframes loadingTextReveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: 0.5em;
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0.3em;
    filter: blur(0);
  }
}


@keyframes glitch-anim {
  0% {
    clip: rect(10px, 9999px, 80px, 0);
    transform: skew(0.5deg);
  }

  20% {
    clip: rect(60px, 9999px, 20px, 0);
    transform: skew(0.2deg);
  }

  40% {
    clip: rect(20px, 9999px, 50px, 0);
    transform: skew(0.8deg);
  }

  60% {
    clip: rect(80px, 9999px, 10px, 0);
    transform: skew(0.1deg);
  }

  80% {
    clip: rect(30px, 9999px, 90px, 0);
    transform: skew(0.6deg);
  }

  100% {
    clip: rect(70px, 9999px, 30px, 0);
    transform: skew(0.3deg);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip: rect(65px, 9999px, 100px, 0);
    transform: skew(0.5deg);
  }

  20% {
    clip: rect(10px, 9999px, 40px, 0);
    transform: skew(0.2deg);
  }

  40% {
    clip: rect(80px, 9999px, 10px, 0);
    transform: skew(0.8deg);
  }

  60% {
    clip: rect(30px, 9999px, 80px, 0);
    transform: skew(0.1deg);
  }

  80% {
    clip: rect(90px, 9999px, 20px, 0);
    transform: skew(0.6deg);
  }

  100% {
    clip: rect(20px, 9999px, 70px, 0);
    transform: skew(0.3deg);
  }
}

/* 
  =========================================
  App Main Layout
  =========================================
*/
.app-hidden {
  opacity: 0;
  visibility: hidden;
}

.app-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 2s ease;
}

/* 
  =========================================
  Typography & Utility
  =========================================
*/
.section {
  padding: 120px 0;
  position: relative;
}

.section__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

.section__title {
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  margin-bottom: 3rem;
  font-weight: 300;
  position: relative;
  display: inline-block;
}

.section__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 100%;
  height: 1px;
  background-color: var(--accent-cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease;
}

.section:hover .section__title::after {
  transform: scaleX(1);
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border: 1px solid var(--text-main);
  border-radius: 4px;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent-red);
  color: #fff;
  background-color: var(--accent-red);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

/* 
  =========================================
  Header
  =========================================
*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 30px 5%;
  z-index: 100;
  background-color: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(8px);
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
}

.header__logo {
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  font-weight: 400;
}

.header__logo span {
  color: var(--accent-cyan);
}

.header__nav {
  display: flex;
  gap: 40px;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

.header__nav a {
  position: relative;
  display: inline-block;
  transition: color 0.4s ease, transform 0.4s ease;
}

.header__nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent-red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
}

.header__nav a:hover {
  color: var(--accent-red);
}

.header__nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* 
  =========================================
  Hero
  =========================================
*/
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 10%;
  position: relative;
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero__subtitle {
  font-size: 1rem;
  letter-spacing: 0.3em;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.hero__title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.1;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 1.5s ease 2.5s forwards;
}

.hero__line {
  width: 0;
  height: 1px;
  background: var(--text-muted);
  margin-bottom: 40px;
  animation: drawLineHero 1.5s ease 3s forwards;
}

.hero__description {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--text-main);
  max-width: 600px;
  opacity: 0;
  animation: fadeUp 1.5s ease 3.5s forwards;
}

.hero__decorator {
  position: absolute;
  right: -10vw;
  top: 50%;
  transform: translateY(-50%);
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  border: 1px solid var(--accent-red);
  opacity: 0.5;
  z-index: 1;
}

.hero__decorator::after {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  border-top-color: transparent;
  animation: spin 30s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(4px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes drawLineHero {
  0% {
    width: 0;
  }

  100% {
    width: 100%;
    max-width: 400px;
  }
}

/* Subtle Continuous Glitch for Hero Title */
.glitch-hover {
  position: relative;
}

.glitch-hover::before,
.glitch-hover::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
}

.glitch-hover::before {
  left: 2px;
  text-shadow: -2px 0 var(--accent-cyan);
  opacity: 0.7;
  animation: glitch-anim-subtle 3s infinite linear alternate-reverse;
}

.glitch-hover::after {
  left: -2px;
  text-shadow: 2px 0 var(--accent-red);
  opacity: 0.7;
  animation: glitch-anim-subtle-2 4s infinite linear alternate-reverse;
}

.glitch-hover:hover::before {
  opacity: 1;
  left: 3px;
  background: var(--bg-color);
  animation: glitch-anim-2 0.3s infinite linear alternate-reverse;
}

.glitch-hover:hover::after {
  opacity: 1;
  left: -3px;
  background: var(--bg-color);
  animation: glitch-anim 0.3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-subtle {

  0%,
  88% {
    clip: rect(0, 9999px, 0, 0);
    transform: skew(0deg) translate(0);
  }

  89% {
    clip: rect(20px, 9999px, 60px, 0);
    transform: skew(1.5deg) translate(-2px);
  }

  91% {
    clip: rect(80px, 9999px, 120px, 0);
    transform: skew(-1deg) translate(2px);
  }

  94% {
    clip: rect(40px, 9999px, 90px, 0);
    transform: skew(1deg) translate(-1px);
  }

  100% {
    clip: rect(0, 9999px, 0, 0);
    transform: skew(0deg) translate(0);
  }
}

@keyframes glitch-anim-subtle-2 {

  0%,
  85% {
    clip: rect(0, 9999px, 0, 0);
    transform: skew(0deg) translate(0);
  }

  86% {
    clip: rect(60px, 9999px, 100px, 0);
    transform: skew(-1.5deg) translate(2px);
  }

  89% {
    clip: rect(10px, 9999px, 50px, 0);
    transform: skew(1deg) translate(-2px);
  }

  93% {
    clip: rect(90px, 9999px, 130px, 0);
    transform: skew(-1deg) translate(1px);
  }

  100% {
    clip: rect(0, 9999px, 0, 0);
    transform: skew(0deg) translate(0);
  }
}

/* 
  =========================================
  Profile
  =========================================
*/
.profile__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 80px;
}

.profile__image-wrap {
  flex: 1;
  max-width: 400px;
  min-width: 300px;
  position: relative;
}

.profile__image {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: grayscale(100%) opacity(0.9) contrast(1.1);
  transition: all 0.8s ease;
}

.profile__image-wrap:hover .profile__image {
  filter: grayscale(0%) opacity(1) contrast(1);
}

.profile__image-decorator {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--accent-red);
  z-index: -1;
  transition: transform 0.6s ease;
}

.profile__image-wrap:hover .profile__image-decorator {
  transform: translate(10px, 10px);
  border-color: var(--accent-cyan);
}

.profile__text {
  flex: 1;
  min-width: 300px;
}

.profile__name {
  font-family: var(--font-jp);
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.profile__bio {
  font-family: var(--font-jp);
  color: var(--text-muted);
  line-height: 2.2;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

/* 
  =========================================
  Works
  =========================================
*/
.works__list {
  display: flex;
  flex-direction: column;
  gap: 60px;
  margin-top: 40px;
}

.work__item {
  position: relative;
  cursor: pointer;
}

.work__info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  transition: transform 0.4s ease;
}

.work__category {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
}

.work__title {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--text-main);
  transition: color 0.4s ease;
}

.work__line {
  width: 100%;
  height: 1px;
  background: var(--border-light);
  position: relative;
}

.work__line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: var(--accent-red);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.work__item:hover .work__info {
  transform: translateX(20px);
}

.work__item:hover .work__title {
  color: var(--accent-red);
}

.work__item:hover .work__line::after {
  width: 100%;
}

/* 
  =========================================
  Updates (Notes & Instagram)
  =========================================
*/
.updates__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

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

.updates__list {
  list-style: none;
}

.updates__list li {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.update__link {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: transform 0.3s ease;
}

.update__link:hover {
  transform: translateX(10px);
}

.update__link--note {
  flex-direction: row;
}

.update__thumb {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  background-color: #f0f0f0;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.update__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.update__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.update__date {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
}

.update__likes {
  font-size: 0.8rem;
  color: var(--accent-red);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.update__title {
  font-family: var(--font-jp);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.4;
}

.update__excerpt {
  font-family: var(--font-jp);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.ig__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ig__item {
  aspect-ratio: 1;
  background-color: #f0f0f0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-light);
}

.ig__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, var(--accent-red), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ig__item:hover::after {
  opacity: 0.2;
}

/* 
  =========================================
  Contact & Footer
  =========================================
*/
.contact {
  text-align: center;
  padding: 150px 0;
}

.contact__text {
  font-family: var(--font-jp);
  color: var(--text-muted);
  margin-bottom: 80px;
  letter-spacing: 0.1em;
}

.contact__links {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.footer {
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* 
  =========================================
  Responsive (Tablet & Mobile)
  =========================================
*/

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .section {
    padding: 100px 0;
  }

  .hero__title {
    font-size: clamp(2.5rem, 6vw, 4rem);
  }

  .profile__inner {
    gap: 40px;
  }
}

/* Mobile (Optimized for 375px base, max-width: 768px) */
@media (max-width: 768px) {

  .header {
    padding: 20px 5%;
  }

  .header__inner {
    flex-direction: column;
    gap: 15px;
  }

  .header__nav {
    gap: 20px;
    font-size: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .section {
    padding: 80px 0;
  }

  .section__inner {
    padding: 0 5%;
  }

  .section__title {
    font-size: 1.2rem;
    margin-bottom: 2rem;
  }

  .hero {
    padding: 0 5%;
    text-align: left;
  }

  .hero__title {
    font-size: 2.5rem;
    /* Fits well on 375px */
    margin-bottom: 20px;
  }

  .hero__subtitle {
    font-size: 0.85rem;
  }

  .hero__description {
    font-size: 0.95rem;
  }

  .hero__decorator {
    width: 250px;
    height: 250px;
    right: -50px;
    opacity: 0.3;
  }

  .profile__inner {
    flex-direction: column;
    gap: 40px;
  }

  .profile__image-wrap {
    width: 100%;
    max-width: 100%;
  }

  .profile__text {
    width: 100%;
  }

  .profile__name {
    font-size: 1.2rem;
  }

  .profile__bio {
    font-size: 0.85rem;
    line-height: 2;
  }

  .work__title {
    font-size: 1.8rem;
  }

  .works__list {
    gap: 40px;
  }

  .update__thumb {
    width: 80px;
    height: 80px;
  }

  .update__title {
    font-size: 0.95rem;
  }

  .update__excerpt {
    font-size: 0.8rem;
  }

  .ig__grid {
    gap: 10px;
  }

  .contact {
    padding: 100px 0;
  }

  .contact__text {
    margin-bottom: 50px;
    font-size: 0.85rem;
  }

  .contact__links {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}

/* Very Small Mobile (adjustments for extremely narrow screens if needed, though 375px is covered above) */
@media (max-width: 374px) {
  .hero__title {
    font-size: 2.2rem;
  }
}