/* ============================================================
   HOTEL TOMAS SERIES — Luxury Modern Design
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Japanese text: prevent awkward mid-sentence breaks */
.hotel-name-ja,
.hotel-desc,
.about-heading,
.about-body,
.footer-brand p {
  overflow-wrap: break-word;
  line-break: strict;
}
/* English hotel names: allow break anywhere to prevent overflow */
.hotel-name-en {
  overflow-wrap: break-word;
  word-break: break-all;
}

/* --- Design Tokens --- */
:root {
  --navy:        #060F22;
  --navy-mid:    #0C1C3A;
  --blue:        #0E4899;
  --blue-h:      #1A60C8;
  --white:       #FFFFFF;
  --off-white:   #F4F7FC;
  --gold:        #AA8020;
  --text:        #0B1830;
  --text-mid:    #354D70;
  --text-muted:  #7A90AE;
  --border:      #C4D5EA;
  --border-light:#E6EDF7;

  --serif:  'Cormorant Garamond', 'Times New Roman', serif;
  --sans:   'Montserrat', sans-serif;
  --jp:     'Noto Sans JP', sans-serif;

  --ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:cubic-bezier(0, 0, 0.2, 1);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 900;
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.header.scrolled {
  background: rgba(6, 15, 34, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 52px;
  height: 76px;
}

.nav-logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: opacity 0.3s;
}
.nav-logo:hover img { opacity: 0.7; }

/* Desktop navigation links */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}

/* Nav link base (desktop) */
.nav-link {
  display: block;
  padding: 8px 14px;
  font-family: var(--jp);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.78);
  position: relative;
  transition: color 0.3s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 14px; right: 14px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.38s var(--ease);
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { transform: scaleX(1); }

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: #fff;
  transition: transform 0.38s var(--ease), opacity 0.25s;
}

/* -------------------------------------------------------
   Mobile drawer: <header>の外に配置してSafariバグを回避
   backdrop-filter を持つ親の内側にfixed子があると
   Safariでは親のbounding boxに収まってしまう問題への対処
   ------------------------------------------------------- */
.nav-drawer {
  position: fixed;
  inset: 0;
  background: var(--navy-mid);
  z-index: 950;          /* header(900)より上 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  /* visibilityで即時非表示、opacityでフェード */
  transition: opacity 0.38s var(--ease), visibility 0s linear 0.38s;
}
.nav-drawer.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.38s var(--ease), visibility 0s linear 0s;
}

/* Close button */
.nav-drawer-close {
  position: absolute;
  top: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.7);
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition: border-color 0.3s, color 0.3s;
}
.nav-drawer-close:hover {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}

/* Mobile nav links (inside drawer) */
.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.nav-menu .nav-link {
  font-size: 1.1rem;
  padding: 13px 36px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.nav-menu .nav-link::after { display: none; }
.nav-menu .nav-link:hover  { color: #fff; }

/* Area label shown below hotel name in drawer */
.nav-link-area {
  font-family: var(--jp);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--gold);
  opacity: 0.75;
  transition: opacity 0.3s;
}
.nav-menu .nav-link:hover .nav-link-area { opacity: 1; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; }
.hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.07);
  transition: transform 10s var(--ease-out);
  will-change: transform;
}
.hero.loaded .hero-img { transform: scale(1); }

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    168deg,
    rgba(6, 15, 34, 0.80) 0%,
    rgba(14, 72, 153, 0.38) 50%,
    rgba(6, 15, 34, 0.72) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 32px;
}

.hero-logo-wrap { margin-bottom: 32px; }
.hero-logo {
  height: 88px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s 0.3s var(--ease), transform 1s 0.3s var(--ease);
}
.hero.loaded .hero-logo { opacity: 1; transform: translateY(0); }

.hero-line {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 24px;
  opacity: 0;
  transition: opacity 1s 0.7s var(--ease);
}
.hero.loaded .hero-line { opacity: 1; }

.hero-tagline {
  font-family: var(--jp);
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  font-weight: 300;
  letter-spacing: 0.24em;
  color: rgba(255,255,255,0.82);
  margin-bottom: 16px;
  opacity: 0;
  transition: opacity 1s 0.9s var(--ease);
}
.hero.loaded .hero-tagline { opacity: 1; }

.hero-sub {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.38em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 1s 1.1s var(--ease);
}
.hero.loaded .hero-sub { opacity: 1; }

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 48px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.45);
  z-index: 2;
  opacity: 0;
  transition: opacity 1s 1.4s;
}
.hero.loaded .hero-scroll { opacity: 1; }
.hero-scroll span {
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
}
.hero-scroll-line {
  width: 1px;
  height: 52px;
  overflow: hidden;
}
.hero-scroll-line::after {
  content: '';
  display: block;
  width: 1px;
  height: 100%;
  background: rgba(255,255,255,0.45);
  animation: scrollDrop 2.2s ease infinite;
}
@keyframes scrollDrop {
  0%   { transform: translateY(-100%); opacity: 0; }
  30%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateY(200%); opacity: 0; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  background: var(--navy);
  padding: 130px 32px;
  text-align: center;
}
.about-inner { max-width: 640px; margin: 0 auto; }

.label {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.about-heading {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 32px;
}
.about-divider {
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 32px;
}
.about-body {
  font-family: var(--jp);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 2.4;
  color: rgba(255,255,255,0.62);
  letter-spacing: 0.05em;
}

/* ============================================================
   HOTEL SECTIONS
   ============================================================ */
.hotels { background: var(--off-white); }

.hotel-section {
  padding: 128px 0;
  border-top: 1px solid var(--border-light);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.hotel-section.visible { opacity: 1; transform: translateY(0); }
.hotel-section:nth-child(even) { background: var(--white); }

.hotel-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 72px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}

/* Even sections: flip order */
.hotel-section:nth-child(even) .hotel-gallery { order: 2; }
.hotel-section:nth-child(even) .hotel-info   { order: 1; }

/* --- Gallery --- */
.hotel-gallery {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 6px;
  height: 480px;
  /* Subtle depth */
  filter: drop-shadow(0 16px 48px rgba(6,15,34,0.14));
}

.gallery-main { grid-row: 1 / 3; overflow: hidden; }
.gallery-main img,
.gallery-sub-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.85s var(--ease);
}
.gallery-main:hover img,
.gallery-sub-item:hover img { transform: scale(1.048); }

.gallery-sub { display: flex; flex-direction: column; gap: 6px; }
.gallery-sub-item { flex: 1; overflow: hidden; }

/* --- Hotel Info --- */
.hotel-info { padding: 8px 0; }

.hotel-num {
  display: block;
  font-family: var(--serif);
  font-size: 5.5rem;
  font-weight: 300;
  color: var(--border-light);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
  user-select: none;
  /* Subtle text stroke for luxury feel */
  -webkit-text-stroke: 1px var(--border);
  color: transparent;
}

.hotel-name-ja {
  font-family: var(--jp);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.08em;
  line-height: 1.5;
  margin-bottom: 10px;
}
.hotel-name-en {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hotel-line {
  width: 32px;
  height: 1px;
  background: var(--gold);
  margin-bottom: 24px;
}

.hotel-desc {
  font-family: var(--jp);
  font-size: 0.86rem;
  font-weight: 300;
  line-height: 2.2;
  color: var(--text-mid);
  margin-bottom: 28px;
  letter-spacing: 0.03em;
}

.hotel-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-light);
}
.hotel-location,
.hotel-phone {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--jp);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.hotel-location svg,
.hotel-phone svg { color: var(--blue); flex-shrink: 0; }

/* Booking CTA — outlined style, fill on hover */
.btn-booking {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--blue);
  color: var(--blue);
  background: transparent;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  padding: 15px 36px;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background  0.4s var(--ease),
    color       0.4s var(--ease),
    border-color 0.4s var(--ease),
    box-shadow  0.35s var(--ease);
}
.btn-booking svg {
  flex-shrink: 0;
  transition: transform 0.35s var(--ease);
}
.btn-booking:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 8px 32px rgba(14,72,153,0.26);
}
.btn-booking:hover svg { transform: translateX(5px); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--navy);
  padding: 80px 52px 48px;
}
.footer-inner { max-width: 1260px; margin: 0 auto; }

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 60px;
  padding-bottom: 52px;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.85;
  margin-bottom: 16px;
}
.footer-brand p {
  font-family: var(--jp);
  font-size: 0.76rem;
  font-weight: 300;
  color: rgba(255,255,255,0.32);
  letter-spacing: 0.06em;
}

.footer-links-title {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.36em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 12px 32px;
  justify-content: start;
}
.footer-links a {
  font-family: var(--jp);
  font-size: 0.80rem;
  font-weight: 300;
  color: rgba(255,255,255,0.50);
  letter-spacing: 0.04em;
  transition: color 0.3s;
  white-space: nowrap;
  position: relative;
  padding-left: 14px;
}
.footer-links a::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 1px;
  background: var(--gold);
  opacity: 0.6;
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  text-align: center;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.22);
  text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1100px) {
  .hotel-inner { padding: 0 44px; gap: 52px; }
  .hotel-gallery { height: 400px; }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 860px) {
  .nav { padding: 0 28px; height: 68px; }
  .nav-desktop { display: none; }   /* デスクトップメニューを非表示 */
  .nav-toggle  { display: flex; }   /* ハンバーガーを表示 */

  /* Hotel sections */
  .hotel-inner {
    grid-template-columns: 1fr;
    padding: 0 28px;
    gap: 36px;
  }
  .hotel-section:nth-child(even) .hotel-gallery { order: 0; }
  .hotel-section:nth-child(even) .hotel-info   { order: 0; }
  .hotel-gallery { height: 300px; }
  .hotel-section { padding: 88px 0; }
  .hotel-num { font-size: 4rem; }

  /* Footer */
  .footer { padding: 64px 28px 40px; }
  .footer-top { flex-direction: column; gap: 36px; }
  .footer-links { grid-template-columns: repeat(2, auto); }
}

@media (max-width: 480px) {
  /* Hero: ロゴ左右に十分な余白を確保 */
  .hero-content { padding: 0 36px; }
  .hero-logo    { height: 72px; }
  .hero-tagline { font-size: 0.78rem; letter-spacing: 0.15em; }
  .hero-sub     { font-size: 0.58rem; letter-spacing: 0.26em; }

  /* Hotel sections */
  .hotel-inner    { padding: 0 20px; gap: 28px; }
  .hotel-gallery  { height: 240px; }
  .hotel-section  { padding: 72px 0; }
  .hotel-num      { font-size: 3.2rem; }
  .hotel-name-ja  { font-size: 1.1rem; line-height: 1.7; }
  .hotel-name-en  { font-size: 0.58rem; letter-spacing: 0.18em; }
  .hotel-desc     { font-size: 0.82rem; line-height: 2.0; }

  /* About */
  .about          { padding: 88px 24px; }
  .about-heading  { font-size: 1.5rem; letter-spacing: 0.04em; }
  .about-body     { font-size: 0.84rem; line-height: 2.2; }

  /* Footer */
  .footer-links { grid-template-columns: 1fr 1fr; gap: 10px 24px; }
}

/* ============================================================
   ANIMATIONS & STAGGERED REVEALS
   ============================================================ */

/* Keyframes */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0);     }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0);    }
}
@keyframes drawLine {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}
@keyframes numberFade {
  from { opacity: 0; letter-spacing: 0.08em; }
  to   { opacity: 1; letter-spacing: -0.03em; }
}

/* Hotel section: section itself fades in place;
   movement delegated to children for richer layering */
.hotel-section {
  transform: none;
  transition: opacity 0.55s var(--ease);
}

/* Gallery: slides in from its visual side */
.hotel-section.visible .hotel-gallery {
  animation: slideInLeft 0.95s 0.25s var(--ease) both;
}
.hotel-section:nth-child(even).visible .hotel-gallery {
  animation: slideInRight 0.95s 0.25s var(--ease) both;
}

/* Hotel info: staggered fade-up */
.hotel-section.visible .hotel-num {
  animation: numberFade 0.8s 0.38s ease both;
}
.hotel-section.visible .hotel-name-ja {
  animation: fadeUp 0.75s 0.50s var(--ease) both;
}
.hotel-section.visible .hotel-name-en {
  animation: fadeUp 0.65s 0.60s var(--ease) both;
}
.hotel-section.visible .hotel-line {
  transform-origin: left center;
  animation: drawLine 0.7s 0.70s var(--ease) both;
}
.hotel-section.visible .hotel-desc {
  animation: fadeUp 0.75s 0.80s var(--ease) both;
}
.hotel-section.visible .hotel-meta {
  animation: fadeUp 0.65s 0.92s var(--ease) both;
}
.hotel-section.visible .btn-booking {
  animation: fadeUp 0.65s 1.02s var(--ease) both;
}

/* About section: stagger children */
.about .label,
.about .about-heading,
.about .about-divider,
.about .about-body { opacity: 0; }

.about.visible .label         { animation: fadeUp   0.7s  0.10s var(--ease) both; }
.about.visible .about-heading { animation: fadeUp   0.9s  0.24s var(--ease) both; }
.about.visible .about-divider { animation: drawLine 0.65s 0.46s var(--ease) both; }
.about.visible .about-body    { animation: fadeUp   0.8s  0.60s var(--ease) both; }

/* Footer: gentle rise */
.footer {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.footer.visible { opacity: 1; transform: translateY(0); }

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:   0.001ms !important;
    animation-delay:      0ms     !important;
    transition-duration:  0.001ms !important;
    transition-delay:     0ms     !important;
    scroll-behavior: auto !important;
  }
}
