/* ==========================================================================
   Japanese Digital Clock Widget - Stylesheet
   ========================================================================== */

/* Typography & Google Fonts import for Japanese Noto Sans */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

/* Local Font Definitions for Retro-Digital Font styles */
@font-face {
  font-family: 'Orbitron';
  src: url('assets/fonts/Orbitron.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ShareTechMono';
  src: url('assets/fonts/ShareTechMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Design Tokens & Theme Variables */
:root {
  --color-navy: #1B2335;
  --color-wood: #5D4037;
  --color-dark-brown: #3E2723;
  --color-orange-glow: #FFB300;
  --color-soft-orange: #E6A100;
  --color-warm-white: #FFF5E6;
  --color-bg-dark: #090e18;
}

/* Reset and Core layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-dark);
  overflow: hidden;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-warm-white);
}

/* 
   16:9 Clock Widget Container
   Designed to scale dynamically within Notion Embed iframe without overflows.
*/
.clock-widget {
  position: relative;
  width: 100vw;
  height: 56.25vw; /* Strict 16:9 Aspect Ratio */
  max-height: 100vh;
  max-width: 177.78vh; /* Cap width to retain 16:9 when viewport is tall */
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 4% 3% 5% 3%;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 179, 0, 0.08);
  background-color: var(--color-navy);
  user-select: none;
}

/* Background Illustration Layer */
.widget-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/background.webp');
  background-size: cover;
  background-position: center;
  z-index: 1;
  pointer-events: none;
}

/* Ambient Shop Breathing Light Overlay */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 179, 0, 0.09) 0%, rgba(27, 35, 53, 0) 75%);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  animation: ambientBreathing 9s ease-in-out infinite alternate;
}

@keyframes ambientBreathing {
  0% {
    opacity: 0.35;
    filter: brightness(0.9);
  }
  100% {
    opacity: 0.95;
    filter: brightness(1.15);
  }
}

/* Floating Dust Particles Container */
.dust-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

/* Dust Particle Base Styling */
.dust-particle {
  position: absolute;
  width: clamp(2px, 0.25vw, 6px);
  height: clamp(2px, 0.25vw, 6px);
  background-color: var(--color-orange-glow);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 6px var(--color-orange-glow);
  will-change: transform, opacity;
  animation: dustDrift 12s linear infinite;
}

@keyframes dustDrift {
  0% {
    transform: translateY(110%) translateX(0);
    opacity: 0;
  }
  20% {
    opacity: var(--max-opacity, 0.65);
  }
  80% {
    opacity: var(--max-opacity, 0.65);
  }
  100% {
    transform: translateY(-20%) translateX(var(--drift-x, 50px));
    opacity: 0;
  }
}

/* Hanging Lanterns Styling */
.lantern-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.lantern {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
  animation: lanternSwing 6s ease-in-out infinite alternate;
}

.lantern-left {
  left: 9%;
  animation-delay: -2s;
}

.lantern-right {
  right: 9%;
  animation-delay: -0.5s;
}

@keyframes lanternSwing {
  0% {
    transform: rotate(-2.5deg);
  }
  100% {
    transform: rotate(2.5deg);
  }
}

.lantern-wire {
  width: clamp(1px, 0.15vw, 3px);
  height: clamp(20px, 3.5vw, 55px);
  background-color: #1a1512;
}

.lantern-cap {
  width: clamp(22px, 3.2vw, 42px);
  height: clamp(6px, 0.8vw, 11px);
  background: var(--color-dark-brown);
  border-radius: 2px;
  border: 1px solid #1a1512;
}

.lantern-body {
  position: relative;
  width: clamp(34px, 4.8vw, 62px);
  height: clamp(52px, 7.5vw, 98px);
  background: radial-gradient(circle at 50% 40%, #FFF5E6 0%, #FFB300 45%, #E6A100 80%, #9E5B00 100%);
  border-radius: clamp(12px, 1.8vw, 24px) / clamp(20px, 3vw, 42px);
  border: 2px solid #2A1713;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 10px 25px rgba(255, 179, 0, 0.4),
    inset 0 0 10px rgba(255, 255, 255, 0.25),
    inset 0 -10px 20px rgba(0, 0, 0, 0.15);
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.lantern-text {
  font-size: clamp(7.5px, 1.1vw, 13px);
  font-weight: 700;
  color: #1a1512;
  opacity: 0.9;
  letter-spacing: clamp(1px, 0.2vw, 3px);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

.lantern-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 245, 230, 0.85) 0%, rgba(255, 179, 0, 0) 65%);
  opacity: 0.65;
  pointer-events: none;
  animation: lanternGlowPulse 4s ease-in-out infinite alternate;
}

@keyframes lanternGlowPulse {
  0% {
    opacity: 0.45;
  }
  100% {
    opacity: 0.85;
  }
}


/* Top Wooden Sign Header (Illuminated sign) */
.header-sign {
  position: relative;
  z-index: 10;
  margin-top: 1.5%;
  padding: clamp(6px, 1vw, 14px) clamp(16px, 2.5vw, 38px);
  border-radius: clamp(6px, 0.9vw, 11px);
  border: 3px solid #271612;
  /* Faux wood panel gradients */
  background: repeating-linear-gradient(
    90deg,
    #5D4037,
    #5D4037 18px,
    #4E342E 18px,
    #4E342E 36px
  );
  box-shadow: 
    0 5px 12px rgba(0, 0, 0, 0.5),
    inset 0 0 12px rgba(0, 0, 0, 0.65),
    0 0 20px rgba(255, 179, 0, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.sign-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: clamp(5px, 0.8vw, 14px);
}

.sign-label {
  font-size: clamp(9.5px, 1.4vw, 17px);
  color: var(--color-warm-white);
  font-weight: 700;
  opacity: 0.9;
  letter-spacing: 0.5px;
  text-shadow: 0 0 5px rgba(255, 245, 230, 0.4);
}

.sign-time {
  font-family: 'Orbitron', monospace;
  font-size: clamp(11.5px, 1.7vw, 22px);
  font-weight: 700;
  color: var(--color-orange-glow);
  letter-spacing: 0.5px;
  text-shadow: 
    0 0 5px rgba(255, 179, 0, 0.85),
    0 0 12px rgba(255, 179, 0, 0.4);
}

.sign-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 245, 230, 0.12) 0%, rgba(0, 0, 0, 0.25) 100%);
  pointer-events: none;
  z-index: 1;
}


/* Center Hero Digital Clock Area */
.clock-display-area {
  z-index: 10;
  width: 76%;
  max-width: 820px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.clock-led-screen {
  position: relative;
  width: 100%;
  padding: clamp(14px, 2.4vw, 34px) clamp(22px, 3.8vw, 55px);
  background-color: var(--color-dark-brown);
  border-radius: clamp(12px, 1.8vw, 22px);
  border: clamp(3px, 0.5vw, 6px) solid #281714;
  box-shadow: 
    0 16px 36px rgba(0, 0, 0, 0.7),
    inset 0 0 28px rgba(0, 0, 0, 0.85),
    0 0 30px rgba(255, 179, 0, 0.12);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Retro CRT/LED scanline filter overlay */
.led-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(16, 9, 8, 0) 50%, 
    rgba(16, 9, 8, 0.28) 50%
  ), linear-gradient(
    90deg,
    rgba(16, 9, 8, 0) 50%,
    rgba(16, 9, 8, 0.28) 50%
  );
  background-size: 3.5px 3.5px;
  pointer-events: none;
  z-index: 3;
}

.clock-numbers {
  font-family: 'Orbitron', 'ShareTechMono', monospace;
  font-size: clamp(32px, 9vw, 136px);
  font-weight: 700;
  color: var(--color-orange-glow);
  letter-spacing: clamp(2px, 0.6vw, 7px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-shadow: 
    0 0 7px rgba(255, 179, 0, 0.85),
    0 0 17px rgba(255, 179, 0, 0.55),
    0 0 28px rgba(255, 179, 0, 0.35);
  animation: clockGlowPulse 4s ease-in-out infinite alternate;
}

.colon-separator {
  animation: colonBlink 1s step-end infinite;
  display: inline-block;
  margin: 0 clamp(-3px, -0.3vw, -8px);
}

@keyframes colonBlink {
  50% {
    opacity: 0.18;
    text-shadow: none;
  }
}

.seconds-container {
  font-size: clamp(20px, 5.8vw, 84px);
  margin-left: clamp(4px, 1vw, 14px);
  align-self: flex-end;
  margin-bottom: clamp(4px, 0.7vw, 13px);
  opacity: 0.95;
}

@keyframes clockGlowPulse {
  0% {
    text-shadow: 
      0 0 5px rgba(255, 179, 0, 0.8),
      0 0 14px rgba(255, 179, 0, 0.5),
      0 0 24px rgba(255, 179, 0, 0.3);
  }
  100% {
    text-shadow: 
      0 0 9px rgba(255, 179, 0, 0.95),
      0 0 22px rgba(255, 179, 0, 0.65),
      0 0 35px rgba(255, 179, 0, 0.45);
  }
}


/* Bottom Date Area */
.date-area {
  z-index: 10;
  margin-bottom: 1.5%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.date-text {
  font-size: clamp(12.5px, 2.3vw, 34px);
  font-weight: 700;
  color: var(--color-soft-orange);
  letter-spacing: clamp(1px, 0.15vw, 3px);
  text-shadow: 
    0 0 5px rgba(230, 161, 0, 0.75),
    0 0 12px rgba(230, 161, 0, 0.35);
  background: rgba(27, 35, 53, 0.65);
  padding: clamp(5px, 0.8vw, 11px) clamp(15px, 2vw, 30px);
  border-radius: clamp(4px, 0.5vw, 8px);
  border: 1px solid rgba(255, 179, 0, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.45),
    inset 0 0 6px rgba(255, 179, 0, 0.05);
}


/* Ramen Counter, Bowls, and Steam Animation Layer */
.ramen-counter {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 14%;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding-bottom: clamp(6px, 1.2vw, 18px);
  pointer-events: none;
  z-index: 4;
}

.ramen-bowl {
  position: relative;
  left: 15%;
  width: clamp(38px, 6.5vw, 95px);
  height: clamp(19px, 3.25vw, 47px);
  background: #D32F2F; /* Ramen bowl red */
  border-radius: 0 0 clamp(19px, 3.25vw, 47px) clamp(19px, 3.25vw, 47px);
  border: 2px solid #2B1B17;
  border-top: clamp(4px, 0.7vw, 9px) solid var(--color-warm-white); /* Soup surface */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.ramen-bowl::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 25%;
  width: 50%;
  height: clamp(2px, 0.35vw, 5px);
  background: #2B1B17;
  border-radius: 1px;
}

.ramen-bowl-small {
  position: relative;
  right: 15%;
  width: clamp(28px, 4.8vw, 68px);
  height: clamp(14px, 2.4vw, 34px);
  background: #1976D2; /* Blue bowl */
  border-radius: 0 0 clamp(14px, 2.4vw, 34px) clamp(14px, 2.4vw, 34px);
  border: 2px solid #2B1B17;
  border-top: clamp(3px, 0.5vw, 7px) solid var(--color-warm-white);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.ramen-bowl-small::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 25%;
  width: 50%;
  height: clamp(2px, 0.3vw, 4px);
  background: #2B1B17;
  border-radius: 1px;
}

.steam-nozzle {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 2px;
}

/* Steam particles rising from nozzles */
.steam-particle {
  position: absolute;
  bottom: 0;
  width: clamp(15px, 3.5vw, 48px);
  height: clamp(25px, 5.5vw, 75px);
  background-image: url('assets/smoke.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(1.5px);
  will-change: transform, opacity;
  animation: steamRise 5.2s linear infinite;
}

@keyframes steamRise {
  0% {
    transform: translateY(0) scaleX(0.7) scaleY(0.7) translateX(0);
    opacity: 0;
  }
  15% {
    opacity: 0.6;
  }
  50% {
    transform: translateY(-42%) scaleX(1.15) scaleY(1.05) translateX(var(--drift-mid, 12px));
    opacity: 0.4;
  }
  100% {
    transform: translateY(-110%) scaleX(1.4) scaleY(1.35) translateX(var(--drift-end, -8px));
    opacity: 0;
  }
}


/* Accessibility - reduced motion media query */
@media (prefers-reduced-motion: reduce) {
  .lantern, 
  .ambient-glow, 
  .clock-numbers,
  .lantern-glow,
  .colon-separator,
  .steam-particle,
  .dust-particle {
    animation: none !important;
    transform: none !important;
  }
  .colon-separator {
    opacity: 1 !important;
  }
  .lantern-glow {
    opacity: 0.6 !important;
  }
  .dust-particle {
    display: none !important;
  }
}
