/* ===================================
   TaviNote Landing Page CSS
   Nature-inspired Premium Design
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Outfit:wght@400;600;700&display=swap');

:root {
    --primary: #7CB69D;
    --primary-dark: #5EA882;
    --primary-light: #E8F5EE;
    --secondary: #6FCF97; /* Changed from #E5A86E */
    --accent: #FFCC33;
    --bg-light: #FDF8F3;
    --bg-white: #FFFFFF;
    --text-main: #3E4E48; /* Changed from #3D3329 */
    --text-muted: #7A6E63;
    --border: #E8DFD5;
    --shadow: 0 10px 40px rgba(120, 100, 80, 0.1);
    --shadow-premium: 0 10px 30px rgba(124, 182, 157, 0.15); /* Changed from 0 20px 50px */
    --radius: 24px;
    --font-jp: 'Noto Sans JP', sans-serif;
    --font-en: 'Outfit', sans-serif;
}

/* --- Animations --- */
@keyframes sway {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  50% { transform: rotate(0.6deg) translateX(4px); }
}

.sway-soft {
  display: inline-block;
  animation: sway 7s ease-in-out infinite;
}

/* ===== Loader Style Removed (Inlined to index.html) ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-jp);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

h1,
h2,
h3 {
    font-family: var(--font-en), var(--font-jp);
    font-weight: 700;
}

/* ===== Layout ===== */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

section {
    padding: 100px 0;
}

/* ===== Navbar ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(253, 248, 243, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    z-index: 1000;
    border-bottom: 1px solid rgba(232, 223, 213, 0.5);
    transition: all 0.3s ease;
}

nav .container {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    font-family: var(--font-en);
}

.logo span {
    font-size: 30px;
    display: inline-block;
    animation: logo-pulse 3s infinite ease-in-out;
}

@keyframes logo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* ===== Hero Section ===== */
.hero {
    padding-top: 180px;
    padding-bottom: 100px;
    background: linear-gradient(180deg, var(--bg-light) 0%, #FFFFFF 100%);
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    animation: fadeInDown 0.8s backwards;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.2;
    margin-bottom: 24px;
    background: linear-gradient(90deg, #3D3329, #7CB69D);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.8s 0.2s backwards;
}

.hero p {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 40px;
    animation: fadeInUp 0.8s 0.4s backwards;
}

.store-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    animation: fadeInUp 0.8s 0.6s backwards;
}

.btn-store {
    background: #1A1A1A;
    color: #fff;
    padding: 12px 28px;
    border-radius: 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-store:hover {
    transform: translateY(-5px);
    background: #000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(124, 182, 157, 0.3);
    border-color: var(--primary);
}

.btn-store .btn-icon {
    font-size: 24px;
}

.btn-store .btn-text {
    text-align: left;
}

.btn-store .small-text {
    font-size: 10px;
    display: block;
    opacity: 0.7;
}

.btn-store .big-text {
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-en);
}

.hero-image {
    margin-top: 60px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    animation: fadeInUp 1.2s 0.8s cubic-bezier(0.2, 1, 0.3, 1) backwards;
    position: relative;
}

.hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-light), transparent);
    z-index: 2;
    pointer-events: none;
    opacity: 0.3;
}

/* Tree Growth Effect */
.hero-image img {
    width: 100%;
    display: block;
    transform-origin: bottom;
    animation: tree-reveal 1.5s 1.2s cubic-bezier(0.2, 1, 0.3, 1) backwards;
}

@keyframes tree-reveal {
    0% {
        clip-path: inset(100% 0 0 0);
        transform: scale(1.1);
    }
    100% {
        clip-path: inset(0 0 0 0);
        transform: scale(1);
    }
}

/* Floating Particles */
.particle {
    position: absolute;
    background: var(--primary);
    border-radius: 50% 0 50% 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
}

.hero-image .particle {
    animation: float-particle 4s infinite linear;
}

@keyframes float-particle {
    0% { transform: translate(0, 0) rotate(0); opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.6; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(360deg); opacity: 0; }
}

/* ===== Features ===== */
.features h2 {
    text-align: center;
    font-size: 40px;
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-premium);
    background: var(--bg-white);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 24px;
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 16px;
}

.feature-card p {
    color: var(--text-muted);
}

/* ===== Footer ===== */
footer {
    background: var(--bg-light);
    padding: 80px 0 40px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 60px;
}

.footer-info {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    font-family: var(--font-en);
    margin-bottom: 16px;
}

.footer-info p {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 80px;
}

.link-group h4 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.link-group ul {
    list-style: none;
}

.link-group ul li {
    margin-bottom: 12px;
}

.link-group ul li a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.3s;
}

.link-group ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== Legal Pages ===== */
.legal-content {
    padding: 140px 0 100px;
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h1 {
    font-size: 36px;
    margin-bottom: 40px;
}

.legal-text h2 {
    font-size: 24px;
    margin: 40px 0 20px;
}

.legal-text p {
    margin-bottom: 20px;
    color: var(--text-main);
}

.legal-text ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.legal-text li {
    margin-bottom: 10px;
}

/* --- Onsen Section & Marumado Window --- */
.onsen-section {
    padding: 100px 0;
    background: linear-gradient(180deg, #fdfbf7 0%, #f5f0e8 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.onsen-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    text-align: left;
    flex-wrap: wrap;
    padding: 0 20px;
}

.marumado-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 10px solid #fff;
    flex-shrink: 0;
}

.marumado-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Steam Effect Overlay */
.steam-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 30%, rgba(255, 255, 255, 0.1) 100%);
}

.steam-cloud {
    position: absolute;
    bottom: -20px;
    left: 20%;
    width: 150px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    filter: blur(20px);
    opacity: 0;
    animation: steam 8s infinite ease-out;
}

.steam-cloud:nth-child(2) {
    left: 50%;
    animation-delay: 2s;
    width: 180px;
}

.steam-cloud:nth-child(3) {
    left: 70%;
    animation-delay: 5s;
    width: 130px;
}

@keyframes steam {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    20% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-300px) scale(2);
        opacity: 0;
    }
}

.onsen-text {
    flex: 1;
}

.onsen-text h2 {
    font-size: 2.8rem;
    margin-bottom: 24px;
    color: var(--primary);
}

.onsen-text p {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-light);
}

.lang-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* Warm Language Switch (Navbar Version) */
.nav-links .lang-switch-warm {
    position: relative;
    display: flex;
    background: rgba(255, 255, 255, 0.5);
    padding: 3px;
    border-radius: 30px;
    width: 90px;
    height: 32px;
    cursor: pointer;
    border: 1px solid var(--border);
    margin: 0;
    flex-shrink: 0;
}

.nav-links .lang-switch-warm-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    z-index: 2;
    transition: color 0.3s ease;
}

.nav-links .lang-switch-warm-option.active {
    color: #fff;
}

.nav-links .lang-switch-warm-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: linear-gradient(135deg, #FFB347, #FFCC33);
    border-radius: 25px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.nav-links .lang-switch-warm[data-lang="en"] .lang-switch-warm-slider {
    transform: translateX(100%);
}

/* Music Controls */
.music-toggle {
    position: fixed;
    top: 15px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1100;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.music-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.music-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.music-toggle.muted svg {
    fill: var(--text-light);
}

/* ===== App Story Section ===== */
.showcase-section {
    padding: 100px 0;
    background: #fdfdfd;
    overflow: hidden;
    position: relative;
}

.showcase-header {
    text-align: center;
    margin-bottom: 80px;
}

.story-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 150px;
    padding: 0 20px;
}

.story-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.story-step.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== App Story Section ===== */
.showcase-section {
    padding: 100px 0;
    background: #fdfdfd;
    overflow: hidden;
    position: relative;
}

.showcase-header {
    text-align: center;
    margin-bottom: 80px;
    padding: 0 20px;
}

.story-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 120px;
    padding: 0 20px;
}

.story-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.2, 1, 0.3, 1);
}

.story-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.story-step:nth-child(even) {
    flex-direction: row-reverse;
}

.story-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 300px;
}

.story-text {
    flex: 1;
    max-width: 450px;
}

.story-text h3 {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 18px;
    position: relative;
    display: inline-block;
}

.story-text h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 35px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.story-text p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-muted);
}

.smartphone-frame {
    width: 260px !important;
    /* Force width to prevent huge scaling */
    max-width: 260px !important;
    aspect-ratio: 9 / 19.4;
    background: #222;
    border-radius: 38px;
    padding: 10px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 6px solid #1a1a1a;
}

.smartphone-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 18px;
    background: #1a1a1a;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
}

.smartphone-screen {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-radius: 28px;
    overflow: hidden;
    position: relative;
}

.smartphone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .story-container {
        gap: 80px;
    }

    .story-step,
    .story-step:nth-child(even) {
        flex-direction: column !important;
        text-align: center;
        gap: 30px;
    }

    .story-text {
        max-width: 100%;
    }

    .story-text h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .smartphone-frame {
        width: 240px !important;
        max-width: 240px !important;
    }
}

/* --- Background Growing Tree --- */
.tree-bg-container {
  position: fixed;
  top: 0;
  right: -50px;
  width: 400px;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  opacity: 0.12;
}

.tree-path {
  fill: none;
  stroke: #7CB69D;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 0.1s ease-out;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content,
.feature-card,
.footer-content,
.onsen-container {
    animation: fadeInUp 1s ease-out forwards;
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 40px;
    }
}

@media (max-width: 767px) {
    nav .container {
        height: 70px;
        padding: 0 15px;
    }

    .logo {
        font-size: 18px;
    }

    .logo span {
        font-size: 24px;
    }

    .nav-links {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .nav-links a {
        display: none;
    }

    .nav-links .lang-switch-warm {
        width: 76px;
        height: 30px;
    }

    .nav-links .lang-switch-warm-option {
        font-size: 10px;
    }

    .music-toggle {
        bottom: 20px;
        right: 20px;
        top: auto;
        width: 48px;
        height: 48px;
        position: fixed;
    }

    .hero {
        padding-top: 140px;
        padding-bottom: 60px;
    }

    .hero h1 {
        font-size: 26px;
        line-height: 1.2;
    }

    .hero p {
        font-size: 16px;
    }

    .features-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .feature-card {
        padding: 30px 20px;
    }

    .onsen-section {
        padding: 60px 0;
    }

    .onsen-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding: 0 20px;
    }

    .marumado-wrapper {
        width: 280px;
        height: 280px;
        border-width: 8px;
        display: block !important;
        margin: 0 auto;
    }

    .onsen-text h2 {
        font-size: 1.8rem;
        margin-bottom: 16px;
    }

    .onsen-text p {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}