/* ==========================================================================
   Ren Kaneko - Wabi Sabi Portfolio
   ========================================================================== */

:root {
  --bg-cream: #f5f2eb;
  --bg-light: #f8f6f1;
  --text-dark: #1a1a1a;
  --text-gray: #666666;
  --text-light: #999999;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-jp: 'Noto Serif JP', serif;
}



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

/* html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background-color: var(--bg-cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
} */

/* viewport */
html, body{
  margin:0;
  height:100%;
  background:#eee;

  display:grid;
  place-items:center; /* centre la feuille */
}

/* la feuille */

.page{
  aspect-ratio: 210 / 297;  /* portrait */
  height: 100vh;            /* <- contrainte principale */
  width: auto;              /* largeur calculée via aspect-ratio */
  max-width: 100vw;         /* évite de dépasser sur mobile */

  background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  border-radius: 6px;

  box-sizing: border-box;
  padding: clamp(12px, 3vw, 24px);

  overflow: hidden;         /* <- ton contenu ne scroll pas non plus */
}

/* responsive écran */
@media screen{
  .page{
    transform-origin: top center;
    transform: scale(calc(min(1, 100vw / 794)));
  }
}

/* impression */
@media print{
  html, body{
    background:none;
    display:block;
  }

  .page{
    transform:none;
  }

  @page{
    size:A4;
    margin:0;
  }
}


/* WebGL Canvas */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Page Container */
.page {
  position: relative;
  min-height: 100vh;
  padding: 2rem 3rem;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ==========================================================================
   Typography
   ========================================================================== */

.body-text {
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.8;
  max-width: 420px;
  letter-spacing: 0.01em;
}

.quote {
  font-size: 0.75rem;
  font-style: italic;
  font-weight: 300;
  color: var(--text-gray);
  letter-spacing: 0.02em;
}

.top-quote {
  position: absolute;
  top: 2rem;
  right: 25%;
  max-width: 300px;
  text-align: right;
}

/* ==========================================================================
   Vertical Text
   ========================================================================== */

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vertical-text.left-top {
  position: fixed;
  left: 1.5rem;
  top: 2rem;
}

.vertical-text.left-bottom {
  position: fixed;
  left: 1.5rem;
  bottom: 2rem;
}

.vertical-text.right-side {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.vertical-text span {
  display: block;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav-top {
  position: fixed;
  top: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  z-index: 100;
}

.nav-item {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.nav-item:hover {
  opacity: 0.6;
}

.nav-arrows {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 100;
}

.nav-arrow {
  font-size: 1.25rem;
  color: var(--text-dark);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
  background: none;
  border: none;
  font-family: inherit;
}

.nav-arrow:hover {
  opacity: 0.5;
}

.back-nav {
  position: fixed;
  left: 4rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--text-dark);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.back-nav:hover {
  opacity: 0.5;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem 6rem;
  max-width: 1400px;
  margin: 0 auto;
}

.content.centered {
  display: flex;
  justify-content: center;
  align-items: center;
}

.text-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3rem;
  padding-left: 3rem;
}

.image-column {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.image-container {
  position: relative;
  max-width: 500px;
  overflow: hidden;
}

.main-image {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(0%);
  transition: filter 0.5s ease;
}

.main-image:hover {
  filter: grayscale(20%);
}

/* ==========================================================================
   Philosophy Page - Kanji
   ========================================================================== */

.kanji-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.kanji {
  font-family: var(--font-jp);
  font-size: clamp(8rem, 20vw, 16rem);
  font-weight: 400;
  line-height: 1;
  color: var(--text-dark);
}

.kanji-label {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.kanji-arrow {
  font-size: 1rem;
  margin-top: -0.5rem;
}

.portrait-container {
  position: fixed;
  top: 2rem;
  right: 8rem;
  width: 180px;
  height: auto;
  z-index: 10;
}

.portrait-image {
  width: 100%;
  height: auto;
  display: block;
}

.side-info {
  position: fixed;
  writing-mode: vertical-rl;
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  gap: 1rem;
}

.side-info.right {
  right: 2rem;
  bottom: 2rem;
}

.side-quote {
  position: fixed;
  writing-mode: vertical-rl;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-light);
  max-height: 200px;
}

.side-quote.left {
  left: 4rem;
  top: 2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1rem 6rem;
  font-size: 0.85rem;
  color: var(--text-dark);
}

.year {
  font-weight: 400;
}

.measurement {
  font-weight: 300;
}

.philosophy-footer {
  position: fixed;
  bottom: 2rem;
  left: 3rem;
  right: 3rem;
  padding: 0;
}

.philosophy-footer .footer-left,
.philosophy-footer .footer-right {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-light);
}

.philosophy-footer .footer-right {
  text-align: right;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .content {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
  }
  
  .text-column {
    padding-left: 0;
  }
  
  .image-column {
    justify-content: center;
  }
  
  .vertical-text.left-top,
  .vertical-text.left-bottom,
  .vertical-text.right-side {
    display: none;
  }
  
  .top-quote {
    position: relative;
    top: auto;
    right: auto;
    text-align: left;
    margin-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 1.5rem;
  }
  
  .body-text {
    font-size: 1rem;
  }
  
  .kanji {
    font-size: 6rem;
  }
  
  .portrait-container {
    width: 120px;
    right: 1rem;
  }
  
  .footer {
    padding: 1rem 2rem;
  }
}

/* ==========================================================================
   Animations (placeholders for WebGL transitions)
   ========================================================================== */

.page {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

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

/* Image reveal animation placeholder */
.main-image {
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

/* Hover states for interactive elements */
a, button {
  cursor: pointer;
}

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