/* 背景装飾: S字グラデ線 */

main {
  position: relative;
}

.p-top__deco {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;           
  z-index: -1;            
  pointer-events: none;
  overflow: hidden;       
}

.p-top__deco-inner {
  position: absolute;
  top: 168.133vw;                   
  left: 55%;                        
  transform: translateX(-50%);
  width: 134%;                      
  aspect-ratio: 1005.96 / 2544;     
}

.p-top__deco-inner--2 {
  top: 639.733vw;                   
  left: 49.6%;                      
}
.p-top__deco-inner--3 {
  top: 1006.8vw;                    
  left: 44.93%;                     
}
.p-top__deco-inner--4 {
  top: 1586.667vw;                  
  left: 44.93%;
}

.p-top__deco-inner img,
.p-top__deco-svg {
  width: 100%;
  height: 100%;
  
}

.p-top__deco-dot {
  opacity: 0;
  transition: opacity 0.25s ease-out;
}
.p-top__deco-dot.is-active {
  opacity: 1;
}

@media (min-width: 768px) {
  
  .p-top__deco-inner {
    
    width: min(39.295vw, 754px);   
    left: 48%;            
    top: 50.99vw;         
  }
  
  .p-top__deco-inner--2 {
    top: 232.396vw;
  }
  
  .p-top__deco-inner--3 {
    top: 345.99vw;
  }
}

/* Hero */

.p-top__hero {
  position: relative;
  width: 100%;
  aspect-ratio: 750 / 1300;            
  overflow: hidden;
  border-bottom-left-radius: 13.333vw; 
  background-color: #F5F5F5;
  isolation: isolate;                  
}

.p-top__hero-defs { position: absolute; width: 0; height: 0; }

.p-top__hero-track { position: absolute; inset: 0; }
.p-top__hero-track--pc { display: none; }    

.p-top__hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;                          
}

.p-top__hero-bg,
.p-top__hero-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.p-top__hero-bg { z-index: 1; }
.p-top__hero-fg { z-index: 3; }

.p-top__hero-slide--solid { background-color: #F5F5F5; }

.p-top__hero-star {
  position: absolute;
  z-index: 5;
  width: 23.6%;                       
  height: auto;
  display: block;
  pointer-events: none;
}

.p-top__hero-track--sp .p-top__hero-star { left: 67.6%; top: 27.615%; }                   
.p-top__hero-track--sp .p-top__hero-slide--1 .p-top__hero-star { left: 59.333%; top: 29.538%; }  
.p-top__hero-track--sp .p-top__hero-slide--2 .p-top__hero-star { left: 62.667%; top: 29.462%; }  

.p-top__hero-track--sp .p-top__hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(to bottom, rgba(183, 193, 203, 0) 72.077%, var(--color-hero-gradient-end) 100%);
  pointer-events: none;
}

.p-top__hero-ring {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
.p-top__hero-ring-path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;              
  stroke-linecap: round;              
}

.p-top__hero-track--sp .p-top__hero-ring-path { stroke-width: 13.97; }
.p-top__hero-track--pc .p-top__hero-ring-path { stroke-width: 12.06; }

.p-top__hero-track--sp .p-top__hero-ring {
  left: 7.333%;
  top: 27.615%;
  width: 84.933%;
  height: 49.077%;
}

.p-top__hero-catch {
  position: absolute;
  left: 5.867%;                        
  top: 15.769%;                        
  z-index: 3;
  margin: 0;
  font-family: var(--ff-serif);
  font-weight: var(--fw-regular);
  font-size: 7.467vw;                  
  line-height: 1.589;                  
  color: var(--color-text);
  white-space: nowrap;
}

.p-top__hero-msg {
  position: absolute;
  z-index: 3;
  margin: 0;
  color: var(--color-text-inverse);
  font-weight: var(--fw-medium);
}
.p-top__hero-msg--pc { display: none; }
.p-top__hero-msg-lg { display: block; }
.p-top__hero-msg-sm { display: block; }

.p-top__hero-msg--sp { left: 7.333%; top: 77%; }
.p-top__hero-msg--sp .p-top__hero-msg-lg { font-size: 4.8vw; line-height: 1.611; }                    
.p-top__hero-msg--sp .p-top__hero-msg-sm { font-size: 2.933vw; line-height: 2.409; margin-top: 0.5vw; } 

.p-top__hero-opening {
  position: fixed;                     
  inset: 0;
  z-index: 90;                         
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
}

body.is-hero-loaded .p-top__hero-opening {
  animation: heroOpeningOut 0.8s ease forwards;
}
.p-top__hero-opening-text {
  margin: 0;
  text-align: center;
  font-family: var(--ff-en);          
  font-weight: 700;
  font-size: 4.8vw;                    
  letter-spacing: 0.02em;
  line-height: 1.72;
  color: var(--color-primary);
}

.p-top__hero-opening-line { display: block; }

/* FIX: SP 4枚化 → 20sループ・5sずらし (delay 0/5/10/15) */
body.is-hero-loaded .p-top__hero-track--sp .p-top__hero-slide--1 { animation: heroSlideSp 20s 0s linear infinite; }
body.is-hero-loaded .p-top__hero-track--sp .p-top__hero-slide--2 { animation: heroSlideSp 20s 5s linear infinite; }
body.is-hero-loaded .p-top__hero-track--sp .p-top__hero-slide--3 { animation: heroSlideSp 20s 10s linear infinite; }
body.is-hero-loaded .p-top__hero-track--sp .p-top__hero-slide--4 { animation: heroSlideSp 20s 15s linear infinite; }
body.is-hero-loaded .p-top__hero-track--sp .p-top__hero-slide--1 .p-top__hero-ring-path { animation: heroDrawRing 20s 0s linear infinite; }
body.is-hero-loaded .p-top__hero-track--sp .p-top__hero-slide--2 .p-top__hero-ring-path { animation: heroDrawRing 20s 5s linear infinite; }
body.is-hero-loaded .p-top__hero-track--sp .p-top__hero-slide--3 .p-top__hero-ring-path { animation: heroDrawRing 20s 10s linear infinite; }
body.is-hero-loaded .p-top__hero-track--sp .p-top__hero-slide--4 .p-top__hero-ring-path { animation: heroDrawRing 20s 15s linear infinite; }

@media (min-width: 768px) {
  .p-top__hero {
    aspect-ratio: 1920 / 800;
    border-bottom-left-radius: 0;
    background-color: #f5f5f5;
  }
  .p-top__hero-track--sp { display: none; }
  .p-top__hero-track--pc {
    display: block;
    left: auto;
    right: 0;
    width: 81.979%;
    border-bottom-left-radius: 5.208vw;
    overflow: hidden;
  }

  .p-top__hero-track--pc .p-top__hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    background: linear-gradient(to bottom, rgba(183, 193, 203, 0) 65.286%, var(--color-hero-gradient-end) 98.264%);
    pointer-events: none;
  }

  /* FIX: 星の位置 (Figma 98:76/95/115/134 — 全スライド共通 x=1284,y=247) */
  .p-top__hero-track--pc .p-top__hero-star {
    left: 59.576%;                    /* (1284 - 346.27) / 1574 */
    top: 30.875%;                     /* 247 / 800 */
    width: 11.185%;                   /* 176 / 1574 */
  }

  .p-top__hero-track--pc .p-top__hero-ring {
    left: 27.099%;
    top: 16.875%;
    width: 46.887%;
    height: 92.25%;
  }

  .p-top__hero-catch {
    left: 6.472%;
    top: 43.375%;
    font-size: 2.337vw;
    line-height: 1.589;
  }

  .p-top__hero-msg--sp { display: none; }
  .p-top__hero-msg--pc { display: block; left: 21.539%; top: 82.5%; }
  .p-top__hero-msg--pc .p-top__hero-msg-lg { font-size: 1.25vw; line-height: 1.625; }
  .p-top__hero-msg--pc .p-top__hero-msg-sm { font-size: 0.833vw; line-height: 1.875; margin-top: 0.2vw; }

  .p-top__hero-opening-text { font-size: 1.25vw; }
  .p-top__hero-opening-line { display: inline; }

  /* PC 4枚化 → 20sループ・5sずらし (delay 0/5/10/15) */
  body.is-hero-loaded .p-top__hero-track--pc .p-top__hero-slide--1 { animation: heroSlidePc 20s 0s linear infinite; }
  body.is-hero-loaded .p-top__hero-track--pc .p-top__hero-slide--2 { animation: heroSlidePc 20s 5s linear infinite; }
  body.is-hero-loaded .p-top__hero-track--pc .p-top__hero-slide--3 { animation: heroSlidePc 20s 10s linear infinite; }
  body.is-hero-loaded .p-top__hero-track--pc .p-top__hero-slide--4 { animation: heroSlidePc 20s 15s linear infinite; }
  body.is-hero-loaded .p-top__hero-track--pc .p-top__hero-slide--1 .p-top__hero-ring-path { animation: heroDrawRingPc 20s 0s linear infinite; }
  body.is-hero-loaded .p-top__hero-track--pc .p-top__hero-slide--2 .p-top__hero-ring-path { animation: heroDrawRingPc 20s 5s linear infinite; }
  body.is-hero-loaded .p-top__hero-track--pc .p-top__hero-slide--3 .p-top__hero-ring-path { animation: heroDrawRingPc 20s 10s linear infinite; }
  body.is-hero-loaded .p-top__hero-track--pc .p-top__hero-slide--4 .p-top__hero-ring-path { animation: heroDrawRingPc 20s 15s linear infinite; }
}

@keyframes heroOpeningOut {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }   
}
@keyframes heroSlideSp {        /* SP 4枚/20s・5sずらし: 可視終了27.5% > ずらし25% で途切れずクロスフェード */
  0% { opacity: 0; }
  5% { opacity: 1; }
  22.5% { opacity: 1; }
  27.5% { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes heroSlidePc {        /* PC 4枚/20s・5sずらし: 可視終了27.5% > ずらし25% で途切れずクロスフェード */
  0% { opacity: 0; }
  5% { opacity: 1; }
  22.5% { opacity: 1; }
  27.5% { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes heroDrawRing {
  0% { stroke-dashoffset: 100; }
  7% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
@keyframes heroDrawRingPc {
  0% { stroke-dashoffset: 100; }
  7.7% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}

/* お知らせ */

.p-top__news {
  margin-top: 20px;                    
  padding-inline: 12.5px;              
}

@media (min-width: 768px) {
  .p-top__news {
    margin-top: 88px;                  
    padding-inline: 0;
    width: min(var(--pc-content-width), 100% - var(--pc-content-gutter) * 2);
    margin-inline: auto;
  }
}

/* ABOUT */

.p-top__about {
  padding: 72px 17.5px 0;       
}

.p-top__about-head {
  margin-bottom: 20px;             
}

.p-top__about-lead {
  margin: 0 0 20px;                
  font-weight: 500;
  font-size: 14px;                 
  line-height: 1.8;
  letter-spacing: 0.05em;          
  color: var(--color-text);
}

.p-top__about-stats {
  margin-bottom: 30px;
}

.p-top__about-cta {
  display: flex;                   
  width: 167px;                    
  margin: 0 auto;                  
}

@media (min-width: 768px) {
  .p-top__about {
    width: min(var(--pc-content-width), 100% - var(--pc-content-gutter) * 2);
    margin-inline: auto;
    padding: 250px 0 0;            
    display: grid;
    grid-template-columns: 1fr 1fr;     
    grid-template-rows: auto auto 1fr;
    align-items: start;
  }
  .p-top__about-head {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 46px;           
  }
  .p-top__about-lead {
    grid-column: 1;
    grid-row: 2;
    margin: 0 0 40px;              
    font-size: 16px;               
    line-height: 2;
  }
  .p-top__about-lead .u-br-sp { display: none; }  
  .p-top__about-cta {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    justify-self: start;
    margin: 0;                     
    width: 200px;                  
  }
  .p-top__about-stats {
    grid-column: 2;
    grid-row: 1 / 4;
    margin: 0;
    align-self: start;
  }
}

/* News list */

.p-top__newslist {
  padding: 75px 17.5px 0;          
}

.p-top__newslist-head {
  margin-bottom: 20px;             
}

.p-top__newslist-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-top__newslist-item--new     { --cat-color: var(--color-cat-new); }
.p-top__newslist-item--mid     { --cat-color: var(--color-cat-mid); }
.p-top__newslist-item--teacher { --cat-color: var(--color-cat-teacher); }
.p-top__newslist-item--general { --cat-color: var(--color-cat-general); }

.p-top__newslist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;                   
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}
.p-top__newslist-item:hover { opacity: 0.6; }

.p-top__newslist-list > li { border-top: 1px solid #fff; }
.p-top__newslist-list > li:last-child { border-bottom: 1px solid #fff; }

.p-top__newslist-body {
  flex: 1;
  min-width: 0;
}

.p-top__newslist-meta {
  display: flex;
  align-items: center;
  gap: 8px;                        
  margin-bottom: 5px;              
}
.p-top__newslist-date {
  font-family: var(--ff-en);
  font-weight: 700;                
  font-size: 10px;                 
  letter-spacing: 0.05em;          
  color: var(--color-primary);
  white-space: nowrap;
}
.p-top__newslist-tags {
  display: flex;
  gap: 8px;
}

.c-news-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 2px;
  font-weight: 500;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
  background-color: var(--cat-color);
  color: var(--color-text-inverse);
}
.c-news-tag--genre {
  background-color: color-mix(in srgb, var(--cat-color) 40%, transparent);
  color: #454545;
}

.p-top__newslist-title {
  display: block;
  margin: 0;
  font-weight: 400;                
  font-size: 12px;                 
  line-height: 1.8;
  color: #000;
}

.p-top__newslist-arrow { display: none; }

.p-top__newslist-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 30px auto 0;             
  color: var(--color-primary);
  font-weight: 500;                
  font-size: 12px;                 
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.p-top__newslist-more:hover { opacity: 0.6; }
.p-top__newslist-more .c-arrow {
  --arrow-w: 40px;                 
}

@media (min-width: 768px) {
  .p-top__newslist {
    width: min(var(--pc-content-width), 100% - var(--pc-content-gutter) * 2);
    margin-inline: auto;
    padding: 250px 0 0;   
  }
  .p-top__newslist-head {
    margin-bottom: 80px;           
  }
  
  .p-top__newslist-item {
    padding: 20px 0;               
    gap: 20px;
  }
  
  .p-top__newslist-list > li {
    border-top: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
  .p-top__newslist-list > li:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);     
  }
  .p-top__newslist-meta {
    gap: 37px;                     
    margin-bottom: 6px;
  }
  .p-top__newslist-date { font-size: 14.7px; }
  .p-top__newslist-tags { gap: 7px; }              
  .c-news-tag {
    padding: 4px 7px;
    border-radius: 3px;
    font-size: 12px;
  }
  .p-top__newslist-title { font-size: 14px; }
  
  .p-top__newslist-arrow {
    display: block;
    box-sizing: border-box;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    margin-right: 4px;             
    border-top: 1px solid #5bb647;
    border-right: 1px solid #5bb647;
    transform: rotate(45deg);
  }
  .p-top__newslist-more {
    margin-top: 80px;              
    gap: 14px;
    font-size: 14px;
  }
  .p-top__newslist-more .c-arrow { 
    --arrow-w: 31px;
    --arrow-barb: 0.25;
  }   
}

