/* ===================================================
   HENs TAIL - Landing Page Styles
   Color Palette:
     - BG Dark:     #0f0f0f, #1a1a1a
     - Surface:     #222222, #2a2a2a
     - Text:        #ffffff, #b0b0b0, #888888
     - Accent Red:  #e63946
     - Accent Glow: #ff4d5a
   =================================================== */

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

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-surface: #222222;
    --bg-surface-light: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --accent: #e63946;
    --accent-hover: #ff4d5a;
    --accent-glow: rgba(230, 57, 70, 0.3);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --card-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(15, 15, 15, 0.8);
    --header-bg-scrolled: rgba(15, 15, 15, 0.95);
    --logo-invert: 0;
    --tag-bg: rgba(255, 255, 255, 0.05);
    --work-category-bg: rgba(0, 0, 0, 0.6);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Montserrat', 'Noto Sans JP', sans-serif;
    --font-body: 'Noto Sans JP', 'Montserrat', sans-serif;
}

/* ---- LIGHT THEME ---- */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #eaeaec;
    --bg-surface: #ffffff;
    --bg-surface-light: #f0f0f2;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #999999;
    --accent: #d42f3c;
    --accent-hover: #e63946;
    --accent-glow: rgba(212, 47, 60, 0.2);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --card-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
    --header-bg: rgba(245, 245, 247, 0.85);
    --header-bg-scrolled: rgba(245, 245, 247, 0.95);
    --logo-invert: 1;
    --tag-bg: rgba(0, 0, 0, 0.05);
    --work-category-bg: rgba(255, 255, 255, 0.85);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-accent {
    color: var(--accent);
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 30px rgba(230, 57, 70, 0.45);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-hover);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

/* ---- HEADER / NAV ---- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

#header.scrolled {
    border-bottom-color: var(--border);
    background: var(--header-bg-scrolled);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo img {
    height: 36px;
    width: auto;
    filter: invert(var(--logo-invert));
    transition: filter var(--transition);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-links a {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    position: relative;
    transition: color var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    background: var(--accent) !important;
    color: #fff !important;
    padding: 8px 22px;
    border-radius: 50px;
    font-weight: 600 !important;
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    background: var(--accent-hover) !important;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.08);
}

.theme-toggle i {
    position: absolute;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme (default): show sun icon, hide moon */
#themeIconLight {
    color: #f5c542;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

#themeIconDark {
    color: var(--text-secondary);
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Light theme: show moon icon, hide sun */
[data-theme="light"] #themeIconLight {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] #themeIconDark {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #555;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- HERO ---- */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 120px 24px 80px;
}

.hero-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-logo-wrap {
    margin-bottom: 40px;
}

.hero-logo {
    max-width: 420px;
    margin: 0 auto;
    filter: drop-shadow(0 0 40px rgba(230, 57, 70, 0.15)) invert(var(--logo-invert));
    transition: filter var(--transition);
}

.hero-tagline {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
    line-height: 1.4;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    font-weight: 400;
    margin-bottom: 48px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Scroll hint */
.hero-scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.hero-scroll-hint span {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ---- SECTIONS COMMON ---- */
.section {
    padding: 120px 0;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-label {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ---- ABOUT ---- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.about-lead {
    font-size: 1.15rem;
    line-height: 1.9;
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 2;
}

.about-text p strong {
    color: var(--text-primary);
}

.about-stats {
    display: flex;
    gap: 24px;
    margin-top: 32px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.stat-item i {
    color: var(--accent);
    font-size: 1.1rem;
}

.stat-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.about-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 36px;
    text-align: center;
    transition: all var(--transition);
}

.about-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 40px rgba(230, 57, 70, 0.1);
    transform: translateY(-4px);
}

.about-card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(230, 57, 70, 0.1);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--accent);
}

.about-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.9;
}

/* ---- SERVICES ---- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 28px 32px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}

.service-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: var(--card-shadow);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(230, 57, 70, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 1.4rem;
    color: var(--accent);
    transition: all var(--transition);
}

.service-card:hover .service-icon {
    background: var(--accent);
    color: #fff;
}

.service-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.service-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.9;
    margin-bottom: 20px;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-tags li {
    padding: 4px 12px;
    background: var(--tag-bg);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    letter-spacing: 0.03em;
}

/* ---- WORKS ---- */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.work-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

.work-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: var(--card-shadow);
}

.work-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-surface-light);
    overflow: hidden;
}

.work-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted);
}

.work-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
}

.work-category {
    padding: 4px 12px;
    background: var(--work-category-bg);
    backdrop-filter: blur(4px);
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.work-info {
    padding: 20px 24px;
}

.work-info h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.work-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.works-note {
    text-align: center;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.works-note i {
    color: var(--accent);
    margin-right: 6px;
}

/* ---- WORKFLOW ---- */
.workflow-timeline {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.workflow-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 32px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent), var(--border));
}

.workflow-step {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 24px 0;
    position: relative;
}

.step-number {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 2px solid var(--accent);
    border-radius: 50%;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
    z-index: 1;
}

.step-content {
    padding-top: 8px;
}

.step-content h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ---- CONTACT ---- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.contact-lead {
    font-size: 1.05rem;
    line-height: 2;
    margin-bottom: 36px;
    color: var(--text-secondary);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.contact-method:hover {
    border-color: var(--accent);
}

.contact-method i {
    font-size: 1.2rem;
    color: var(--accent);
    width: 24px;
    text-align: center;
}

.method-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.method-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Contact Form */
.contact-form {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.required {
    color: var(--accent);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-success {
    text-align: center;
    padding: 40px;
}

.form-success i {
    font-size: 3rem;
    color: #4caf50;
    margin-bottom: 16px;
}

.form-success h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.form-success p {
    color: var(--text-secondary);
}

/* ---- FOOTER ---- */
#footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.footer-logo {
    height: 32px;
    width: auto;
    margin-bottom: 8px;
    filter: invert(var(--logo-invert));
    transition: filter var(--transition);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ---- ANIMATIONS ---- */
[data-anim] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-anim].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .about-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .services-grid,
    .works-grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-stats {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 100px 40px 40px;
        gap: 24px;
        transition: right var(--transition);
        border-left: 1px solid var(--border);
    }

    .nav-links.open {
        right: 0;
    }

    .hamburger {
        display: flex;
    }

    .hero-logo {
        max-width: 300px;
    }

    .hero-tagline {
        font-size: 1.5rem;
    }

    .section {
        padding: 80px 0;
    }

    .services-grid,
    .works-grid {
        grid-template-columns: 1fr;
    }

    .workflow-timeline::before {
        left: 28px;
    }

    .step-number {
        width: 56px;
        height: 56px;
        font-size: 1rem;
    }

    .contact-form {
        padding: 24px;
    }

    .footer-content {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-logo {
        max-width: 240px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .about-stats {
        flex-direction: column;
    }

    .stat-item {
        justify-content: center;
    }
}
