/* VARIABLES & UNIVERSAL STYLES */
:root {
  --sand:          #f7f5f1;
  --black:            #1E1E1E;
  --cobalt:       #0212EE;
  --cherry:           #D20001;
  --pink:           #FEC6E9;

  --cobalt-light: #c8d0ff;
  --cherry-light:     #ffd6d6;
  --pink-light:     #FEC6E9;
  --black-subtle:     #555555;

  /* softness tokens */
  --radius-sm:   10px;
  --radius-md:   18px;
  --radius-lg:   28px;
  --radius-pill: 100px;
  --shadow-soft: 0 8px 32px rgba(30, 30, 30, 0.07);
  --shadow-lift: 0 16px 48px rgba(30, 30, 30, 0.12);
}

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

html { 
  scroll-behavior: smooth; 
}

body {
  background: var(--sand);
  color: var(--black);
  font-family: 'Figtree', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  cursor: none;
}

a:focus-visible, 
button:focus-visible, 
input:focus-visible, 
textarea:focus-visible {
  outline: 2px dashed var(--lime);
  outline-offset: 4px;
}

/* CURSOR  */
.cursor {
  width: 16px; 
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  position: fixed; 
  top: 0; 
  left: 0;
  pointer-events: none; 
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, transform 0.1s ease;
  mix-blend-mode: difference;
  will-change: transform;
}

.cursor.hovering {
  width: 56px; 
  height: 56px;
}

/* NAV  */
nav {
  position: fixed; 
  top: 0; 
  width: 100%;
  padding: 1.5rem 4rem;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  z-index: 100;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

nav.nav-hidden {
  transform: translateY(-100%);
}

.nav-logo {
  font-family: 'Raleway', sans-serif;
  font-size: 1.25rem; 
  font-weight: 500;
  letter-spacing: -0.02em; 
  color: var(--black); 
  text-decoration: none;
}

.nav-links { 
  display: flex; 
  gap: 2.5rem; 
}

.nav-links a {
  text-decoration: none; 
  color: var(--black);
  font-size: 0.85rem; 
  font-weight: 500;
  letter-spacing: 0.08em; 
  text-transform: uppercase; 
  position: relative;
  transition: color 0.25s ease;
}

.nav-links a:hover { 
  color: var(--cobalt); 
}

.nav-toggle {
  display: none; 
  flex-direction: column; 
  gap: 5px;
  background: none; 
  border: none; 
  cursor: pointer; 
  padding: 4px;
}

.nav-toggle span { 
  display: block; 
  width: 24px; 
  height: 2px; 
  background: var(--black); 
  border-radius: var(--radius-pill); 
  transition: all 0.3s ease; 
}

.nav-toggle.open span:nth-child(1) { 
  transform: translateY(7px) rotate(45deg); 
}

.nav-toggle.open span:nth-child(2) { 
  opacity: 0; 
}

.nav-toggle.open span:nth-child(3) { 
  transform: translateY(-7px) rotate(-45deg); 
}

nav.scrolled {
  background: rgba(243, 235, 238, 0.333);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(14px);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* UNIFIED TAG SYSTEM */
.tag {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
}

.project-tags {
  display: flex; 
  gap: 0.5rem; 
  flex-wrap: wrap; 
  margin-bottom: 0.75rem; 
} 

.tag.role {
  color: var(--cobalt);
  background: var(--cobalt-light); 
}

.tag.tool {
  color: var(--sand);
  background: var(--black);
  border-color: var(--black);
}

/* BACK LINK */
.cs-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
  transition: color 0.2s ease;
}

.cs-back-link:hover {
  color: var(--cobalt);
}

.cs-back-link svg {
  transition: transform 0.2s ease;
}

.cs-back-link:hover svg {
  transform: translateX(-4px);
}

/* NEXT PROJECT */
.cs-next {
  background: var(--black);
  padding: 5rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-next-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.75rem;
}

.cs-next-title {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  font-weight: 500;
  color: var(--sand);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
  display: block;
}

.cs-next-title:hover {
  color: var(--cobalt-light); 
}

.cs-next-arrow {
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sand);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.cs-next-arrow:hover {
  border-color: var(--cobalt-light);
  background: var(--cobalt-light);
  color: var(--black);
  transform: translateX(6px);
}

/* FOOTER  */
footer {
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 2rem 4rem;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  color: #606070; 
  font-size: 0.8rem;
}

/*INDEX STYLES*/

/* Background for the body*/ 
.bg-dark {
  background-color: var(--black);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.bg-dark, footer {
  position: relative;
  z-index: 10;
}

/* HERO  */
.hero-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1600px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 8rem 4rem 4rem;
  
  /* for overlap effect */
  position: sticky; 
  top: 0;
  z-index: 1; 

  color: var(--black);
}

.hero-content {
  flex: 1;
  position: relative;
}

.headline {
  font-size: clamp(3rem, 5vw, 6rem);
  font-weight: 500;
  font-family: "Raleway", sans-serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--cobalt);
}

.italic-name {
  font-style: italic;
  font-weight: 400;
}

.hero-sidebar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 4rem;
  transform: translateY(2rem);
}

.circle-badge {
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
  animation: spin 12s linear infinite; 
}

.sidebar-text {
  font-family: "Figtree", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  max-width: 250px;
}

/* ABOUT  */
#about {
  background-color: var(--cobalt-light);
  position: relative;
  z-index: 10; 
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -20px 50px rgba(60, 60, 60, 0.038);  
}

.about-content {
  padding: 8rem 4rem;
  display: grid; 
  grid-template-columns: 1fr 2fr; 
  gap: 6rem; 
  align-items: start;
  color: var(--black);
  max-width: 1400px;
  margin: 0 auto; 
}

.section-label {
  font-size: 0.7rem; 
  font-weight: 500; 
  letter-spacing: 0.2em;
  text-transform: uppercase; 
  margin-bottom: 1.5rem;
}

.about-left h2 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(2.5rem, 4vw, 4.5rem); 
  font-weight: 500; 
  line-height: 1; 
  letter-spacing: -0.03em;
}

.about-left h2 em { 
  font-style: italic; 
  color: var(--cobalt);
}

#about .section-label { 
  color: var(--cobalt);
}

.about-right p { 
  font-size: 1.05rem; 
  line-height: 1.8; 
  color: var(--black); 
  margin-bottom: 1.5rem; 
}

/* PROJECTS  */
#projects { 
  padding: 8rem 4rem; 
  background: var(--black); 
  color: var(--sand); 
}

.section-header { 
  display: flex; 
  align-items: flex-end; 
  justify-content: space-between; 
  margin-bottom: 5rem; 
}

.section-header h2 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(2.5rem, 4vw, 4.5rem); 
  font-weight: 500; 
  line-height: 1; 
  letter-spacing: -0.03em;
  color: var(--sand); 
}

.section-header h2 em { 
  font-style: italic; 
  color: var(--cobalt-light); 
}

.project-count { 
  font-size: 0.75rem; 
  letter-spacing: 0.15em; 
  text-transform: uppercase; 
  color: rgba(243, 243, 235, 0.5);
  padding-bottom: 0.5rem; 
}

#projects .section-header,
#projects .projects-grid {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.projects-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 3rem; 
}

.project-card { 
  position: relative; 
  overflow: hidden; 
  transition: transform 0.4s cubic-bezier(.25, .46, .45, .94); 
}

.project-card:hover { 
  transform: translateY(-8px); 
}

.project-card:nth-child(2) { 
  margin-top: 4rem; 
}

.project-card:nth-child(odd):nth-child(n+3) { 
  margin-top: -2rem; 
}

.project-card:nth-child(even):nth-child(n+4) { 
  margin-top: 2rem; 
}

.project-img { 
  width: 100%; 
  aspect-ratio: 4/3;
  border-radius: var(--radius-md); 
  position: relative; 
  overflow: hidden; 
  margin-bottom: 1.5rem; 
}

.project-img-bg {
  width: 100%; 
  height: 100%; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 5rem; 
  transition: transform 0.5s ease;
}

.project-img-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  display: block;
}

.project-card:hover .project-img-bg { 
  transform: scale(1.05); 
}

.project-overlay {
  position: absolute; 
  inset: 0; 
  background: var(--black); 
  opacity: 0;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay { 
  opacity: 0.88; 
}

.overlay-text {
  color: var(--sand); 
  font-size: 0.9rem; 
  letter-spacing: 0.12em;
  text-transform: uppercase; 
  font-weight: 500; 
  border: none; 
  padding: 0;   
  transition: transform 0.3s ease;
}

.project-card:hover .overlay-text {
  transform: scale(1.05); 
}

.project-title { 
  font-family: 'Raleway', sans-serif; 
  font-size: 1.5rem; 
  font-weight: 400; 
  letter-spacing: -0.02em; 
  margin-bottom: 0.5rem; 
  color: var(--sand); 
}

#projects .tag.tool {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--sand);
}

/* SKILLS  */
#skills {
  max-width: 1400px;
  margin: 0 auto;
}

.skills-content {
  padding: 8rem 4rem;
  background: var(--sand);
  color: var(--black);
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: 2rem;
  max-width: 1400px;
}

.skills-header { 
  margin-bottom: 5rem; 
}

.skills-header h2 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(2.5rem, 4vw, 4.5rem); 
  font-weight: 500; 
  line-height: 1; 
  letter-spacing: -0.03em;
}

.skills-header h2 em { 
  font-style: italic; 
  font-weight: 400;
  color: var(--cobalt); 
}

#skills .section-label { 
  color: rgba(34, 34, 34, 0.5); 
}

.skills-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 4rem; 
}

.skill-group h3 {
  font-size: 0.7rem; 
  font-weight: 500; 
  letter-spacing: 0.2em; 
  text-transform: uppercase;
  color: var(--cobalt); 
  margin-bottom: 2rem; 
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(34, 34, 34, 0.15);
}

.skill-item { 
  display: flex; 
  align-items: center; 
  gap: 1rem; 
  margin-bottom: 1.25rem; 
  font-size: 1rem; 
}

.skill-dot { 
  width: 8px; 
  height: 8px; 
  background: var(--cobalt); 
  border-radius: 50%; 
  flex-shrink: 0; 
}

.skills-marquee { 
  margin-top: 5rem; 
  overflow: hidden; 
  border-top: 1px solid rgba(34, 34, 34, 0.15); 
  padding-top: 2rem; 
}

.marquee-track { 
  display: flex; 
  gap: 4rem; 
  animation: marquee 20s linear infinite; 
  white-space: nowrap; 
}

.marquee-item { 
  font-family: 'Raleway', sans-serif; 
  font-size: 1.5rem; 
  font-weight: 600;
  opacity: 0.30; 
  flex-shrink: 0;
  color: var(--cobalt);
}

/* CONTACT  */
#contact {
  padding: 8rem 4rem;
  background: var(--cobalt);
  color: var(--sand);
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-top: 2rem;
}

#contact::before {
  content: '';
  position: absolute;
  top: 0; 
  left: 50%; 
  transform: translateX(-50%);
  width: 60px; 
  height: 4px;
  background: var(--black);
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
}

.contact-inner { 
  max-width: 1000px; 
  margin: 0 auto; 
  position: relative; 
  z-index: 1; 
}

#contact .section-label { 
  color: var(--sand); 
}

#contact h2 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(3rem, 6vw, 6rem); 
  font-weight: 500; 
  line-height: 0.95; 
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem; 
  color: var(--sand);
}

#contact h2 em { 
  font-style: italic; 
  color: var(--sand); 
  font-family: 'Raleway', 'Noto Sans JP', sans-serif;
}

.contact-subtitle {
  color: var(--sand); 
  font-size: 1.05rem; 
  line-height: 1.7; 
  margin-bottom: 3.5rem;
}

.contact-links {
  display: flex; 
  justify-content: center; 
  gap: 0.75rem; 
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.contact-link {
  display: inline-flex; 
  align-items: center; 
  gap: 0.5rem;
  color: var(--sand); 
  text-decoration: none;
  font-size: 0.8rem; 
  font-weight: 500;
  letter-spacing: 0.08em; 
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  border: 2px solid var(--sand);
  border-radius: var(--radius-pill);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.2s ease, transform 0.2s ease;
}

.contact-link:hover {
  background: var(--sand);
  border-color: var(--cobalt-light);
  color: var(--black);
  transform: translateY(-2px);
}

.contact-typewriter-text {
  border-right: 3px solid var(--sand); 
  padding-right: 4px;
  animation: blinkCursorContact 0.75s step-end infinite;
}

.typewriter-text {
  border-right: 3px solid var(--cobalt); 
  padding-right: 4px;
  animation: blinkCursor 0.75s step-end infinite;
}

/* KEYFRAMES  */
@keyframes blinkCursorContact {
  from, to { border-color: transparent; }
  50% { border-color: var(--sand); }
}

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

@keyframes blinkCursor {
  from, to { border-color: transparent; }
  50% { border-color: var(--cobalt); }
}

@keyframes marquee {
  from { 
    transform: translateX(0); 
  }
  to { 
    transform: translateX(-50%); 
  }
}

.reveal { 
  opacity: 0; 
  transform: translateY(36px); 
  transition: opacity 0.7s ease, transform 0.7s ease; 
}

.reveal.visible { 
  opacity: 1; 
  transform: translateY(0); 
}

/* RESPONSIVE  */
@media (max-width: 1024px) {
  .hero-container { 
    padding: 8rem 2.5rem 4rem; 
  }
  nav { 
    padding: 1.5rem 2.5rem; 
  }
  #about .about-content { 
    grid-template-columns: 1fr; 
    gap: 3rem; 
    padding: 6rem 2.5rem; 
  }
  #projects { 
    padding: 6rem 2.5rem; 
  }
  .projects-grid { 
    gap: 2rem; 
  }
  .project-card:nth-child(2) { 
    margin-top: 2.5rem; 
  }
  .project-card:nth-child(3) { 
    margin-top: -1rem; 
  }
  .project-card:nth-child(4) { 
    margin-top: 1rem; 
  }
  #skills .skills-content { 
    padding: 6rem 2.5rem; 
    margin: 1rem; 
  }
  .skills-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 2.5rem; 
  }
  #contact { 
    padding: 6rem 2.5rem; 
    margin-top: 1rem; 
  }
  footer { 
    padding: 2rem 2.5rem; 
  }
  .cs-next {
    padding: 4rem 2.5rem;
  }
}

@media (max-width: 768px) {
  .hero-container {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3rem;
    padding: 7rem 1.5rem 4rem;
    min-height: auto;
    height: 100svh;
  }
  .hero-sidebar {
    margin-left: 0;
    transform: translateY(0);
  }
  .cursor { 
    display: none; 
  }
  body { 
    cursor: auto; 
  }
  a, button { 
    cursor: pointer; 
  }
  nav { 
    padding: 1.25rem 1.5rem; 
    background: rgba(243, 243, 235, 0.96); 
    backdrop-filter: blur(8px); 
  }
  .nav-toggle { 
    display: flex; 
  }
  .nav-links {
    display: none; 
    flex-direction: column; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0;
    background: var(--sand); 
    padding: 2rem 1.5rem; 
    gap: 1.5rem;
    border-top: 1px solid var(--cobalt-light);
    box-shadow: var(--shadow-lift);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
  .nav-links.open { 
    display: flex; 
  }
  .nav-links a { 
    font-size: 1rem; 
  }
  #about {
    border-radius: var(--radius-md); 
  }
  #about .about-content { 
    grid-template-columns: 1fr; 
    gap: 2.5rem; 
    margin: 0; 
    padding: 5rem 1.5rem; 
  }
  #projects { 
    padding: 5rem 1.5rem; 
  }
  .section-header { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 0.75rem; 
    margin-bottom: 3rem; 
  }
  .projects-grid { 
    grid-template-columns: 1fr; 
    gap: 2.5rem; 
  }
  .project-card:nth-child(n) { 
    margin-top: 0; 
  }
  #skills .skills-content { 
    padding: 5rem 1.5rem; 
    margin: 0.75rem; 
    border-radius: var(--radius-md); 
  }
  .skills-grid { 
    grid-template-columns: 1fr; 
    gap: 2.5rem; 
  }
  #contact { 
    padding: 5rem 1.5rem; 
    margin-top: 0.75rem; 
    border-radius: var(--radius-md) var(--radius-md) 0 0; 
  }
  .contact-links { 
    gap: 0.5rem; 
  }
  .contact-link { 
    font-size: 0.72rem; 
    padding: 0.75rem 1.2rem; 
  }
  footer { 
    flex-direction: column; 
    gap: 0.75rem; 
    text-align: center; 
    padding: 2rem 1.5rem; 
  }
  .cs-next {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    padding: 3.5rem 1.5rem;
  }
}

/* ACCESSIBILITY: PREFERS REDUCED MOTION  */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  
  .marquee-track {
    animation-play-state: paused !important;
  }
}
