/* ===== BASE ===== */
html { scroll-behavior: smooth; }
body { font-family: 'Noto Sans JP', sans-serif; }

/* Smooth fade-in on scroll — elegant, slow reveal */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1), transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    transition: opacity 0.3s ease;
    transform: none;
  }
}

/* Hero text-focus-in — cinematic rack-focus effect */
/* 3.5s linear, easing baked into keyframe values for smooth blur gradient */
.text-focus-in {
  -webkit-animation: text-focus-in 3.5s linear both;
          animation: text-focus-in 3.5s linear both;
}
/* Animation complete — JS applies this class to fully remove GPU layer
   so iOS WebKit renders text with the sharp CPU font rasterizer. */
.text-focus-in-done {
  animation: none !important;
  -webkit-animation: none !important;
  opacity: 1 !important;
  filter: none !important;
  -webkit-filter: none !important;
  transform: none !important;
  -webkit-transform: none !important;
}
@-webkit-keyframes text-focus-in {
  0%   { -webkit-filter: blur(14px); filter: blur(14px); opacity: 0;    -webkit-transform: translateY(22px); transform: translateY(22px); }
  15%  { -webkit-filter: blur(11px); filter: blur(11px); opacity: 0.4;  -webkit-transform: translateY(6px);  transform: translateY(6px); }
  28%  { -webkit-filter: blur(8px);  filter: blur(8px);  opacity: 0.75; -webkit-transform: translateY(0);    transform: translateY(0); }
  42%  { -webkit-filter: blur(4px);  filter: blur(4px);  opacity: 0.9;  -webkit-transform: translateY(0);    transform: translateY(0); }
  60%  { -webkit-filter: blur(1.5px);filter: blur(1.5px);opacity: 0.97; -webkit-transform: translateY(0);    transform: translateY(0); }
  80%  { -webkit-filter: blur(0.3px);filter: blur(0.3px);opacity: 1;    -webkit-transform: translateY(0);    transform: translateY(0); }
  100% { -webkit-filter: blur(0px);  filter: blur(0px);  opacity: 1;    -webkit-transform: translateY(0);    transform: translateY(0); }
}
@keyframes text-focus-in {
  0%   { filter: blur(14px);  opacity: 0;    transform: translateY(22px); }
  15%  { filter: blur(11px);  opacity: 0.4;  transform: translateY(6px); }
  28%  { filter: blur(8px);   opacity: 0.75; transform: translateY(0); }
  42%  { filter: blur(4px);   opacity: 0.9;  transform: translateY(0); }
  60%  { filter: blur(1.5px); opacity: 0.97; transform: translateY(0); }
  80%  { filter: blur(0.3px); opacity: 1;    transform: translateY(0); }
  100% { filter: blur(0px);   opacity: 1;    transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .text-focus-in {
    animation: none;
    opacity: 1;
    -webkit-filter: none;
    filter: none;
  }
}

/* Hero parallax-like overlay */
.hero-overlay {
  background: linear-gradient(180deg, rgba(15,26,31,0.35) 0%, rgba(15,26,31,0.45) 40%, rgba(15,26,31,0.75) 100%);
}

/* Section divider line */
.section-line {
  width: 40px;
  height: 1px;
  background: #2a5769;
}

/* Project card hover */
.project-card {
  cursor: pointer;
}
.project-card .project-img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .project-img {
  transform: scale(1.05);
}
.project-card:focus-visible {
  outline: 2px solid #2a5769;
  outline-offset: 4px;
}

/* Button base */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  border: 1px solid #b3dbe7;
  color: #b3dbe7;
  font-size: 13px;
  letter-spacing: 0.1em;
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.btn-primary:hover {
  background: #b3dbe7;
  color: #0f1a1f;
}
.btn-primary:focus-visible {
  outline: 2px solid #b3dbe7;
  outline-offset: 4px;
}
.btn-primary:active {
  background: #1d3f4d;
  color: #fff;
}

.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.1em;
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s;
  cursor: pointer;
}
.btn-white:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}
.btn-white:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
.btn-white:active {
  background: rgba(255,255,255,0.25);
}

/* ===== LINE friend CTA (footer) ===== */
.line-cta-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(6, 199, 85, 0.10) 0%, rgba(6, 199, 85, 0) 55%),
    rgba(36, 61, 74, 0.35);
  transition: border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.line-cta-card:hover {
  border-color: rgba(6, 199, 85, 0.35);
}

/* Icon tile — LINE green square with white glyph */
.line-icon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #06c755;
  box-shadow: 0 8px 24px -8px rgba(6, 199, 85, 0.55);
}
.line-icon-tile img {
  width: 100%;
  height: 100%;
  /* SVG ships black — invert to white so it reads on the green tile */
  filter: brightness(0) invert(1);
}

/* Add-friend button */
.line-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 9999px;
  background: #06c755;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  white-space: nowrap;
  box-shadow: 0 10px 28px -10px rgba(6, 199, 85, 0.6);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.line-btn img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}
.line-btn:hover {
  background: #05b54c;
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -10px rgba(6, 199, 85, 0.7);
}
.line-btn:focus-visible {
  outline: 2px solid #06c755;
  outline-offset: 4px;
}
.line-btn:active {
  transform: translateY(0);
  background: #04a042;
}
@media (prefers-reduced-motion: reduce) {
  .line-btn { transition: background-color 0.2s ease; }
  .line-btn:hover { transform: none; }
}

/* Noise texture for depth */
.noise::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Hamburger */
.hamburger span {
  display: block;
  width: 24px;
  height: 1px;
  background: #fff;
  transition: transform 0.3s, opacity 0.3s;
}

/* Nav link hover */
.nav-link {
  position: relative;
  transition: opacity 0.3s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #fff;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-link:hover::after {
  width: 100%;
}
.nav-link:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 4px;
}

/* CTA block hover */
.cta-block {
  cursor: pointer;
  transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cta-block:hover {
  background-color: rgba(42, 87, 105, 0.9);
}
.cta-block:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}
.cta-block:active {
  background-color: rgba(29, 63, 77, 0.95);
}

/* Hero slider — Ken Burns zoom */
@keyframes kenburns {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slide.active {
  opacity: 1;
}
.hero-slide.active img {
  animation: kenburns 12s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide.active img {
    animation: none;
  }
  .hero-slide {
    transition: opacity 0.3s ease;
  }
}

/* Scroll indicator reveal — delayed fade-in via CSS animation */
.scroll-indicator-reveal {
  opacity: 0;
  animation: scrollIndicatorReveal 1.4s cubic-bezier(0.22, 1, 0.36, 1) 2s forwards;
}
@keyframes scrollIndicatorReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-indicator-reveal {
    animation: none;
    opacity: 1;
  }
}

/* Scroll indicator animation */
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; opacity: 1; }
  40% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0.3; }
}
.scroll-line {
  animation: scrollLine 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f1a1f; }
::-webkit-scrollbar-thumb { background: #2a5769; border-radius: 3px; }
