/**
 * SAIBON SOFT — Custom CSS
 * Supplementary styles that extend Tailwind CSS utilities.
 * Keep this file minimal — prefer Tailwind utilities where possible.
 */

/* ── Base Reset & Globals ───────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Focus Styles (Accessibility) ──────────────────────────────────────────── */

:focus-visible {
    outline: 2px solid #15803d;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Navigation Height CSS Variable ─────────────────────────────────────────── */

:root {
    --nav-height: 4rem; /* 64px = h-16 */
}

@media (min-width: 1024px) {
    :root {
        --nav-height: 4.5rem; /* ~72px ≈ h-18 */
    }
}

/* ── Scroll Reveal Animation ─────────────────────────────────────────────────── */

[data-animate] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

[data-animate-delay="100"] { transition-delay: 0.1s; }
[data-animate-delay="200"] { transition-delay: 0.2s; }
[data-animate-delay="300"] { transition-delay: 0.3s; }
[data-animate-delay="400"] { transition-delay: 0.4s; }
[data-animate-delay="500"] { transition-delay: 0.5s; }

/* ── Dropdown Transitions ──────────────────────────────────────────────────── */

[data-dropdown-panel] {
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

/* ── Custom Section Divider ─────────────────────────────────────────────────── */

.section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 0;
}

/* ── Gradient Text ──────────────────────────────────────────────────────────── */

.gradient-text {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 50%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Card Hover Lift ─────────────────────────────────────────────────────────── */

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}

/* ── Hero Background Pattern ─────────────────────────────────────────────────── */

.hero-pattern {
    background-image: radial-gradient(circle at 1px 1px, #e5e7eb 1px, transparent 0);
    background-size: 40px 40px;
}

/* ── Stat Counter Text ───────────────────────────────────────────────────────── */

.stat-number {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ── Process Step Line ───────────────────────────────────────────────────────── */

.process-connector {
    position: relative;
}

.process-connector::after {
    content: '';
    position: absolute;
    top: 24px;
    left: calc(100% + 8px);
    width: calc(100% - 16px);
    height: 2px;
    background: linear-gradient(90deg, #16a34a, #bbf7d0);
}

@media (max-width: 1023px) {
    .process-connector::after {
        display: none;
    }
}

/* ── Mobile Menu Transition ──────────────────────────────────────────────────── */

#mobile-menu {
    transition: opacity 0.2s ease;
}

/* ── Form Inputs ─────────────────────────────────────────────────────────────── */

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

/* ── Badge ───────────────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.badge-green {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-navy {
    background-color: #e0e7ff;
    color: #1e3a5f;
}

/* ── Image Placeholder ───────────────────────────────────────────────────────── */

.img-placeholder {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86efac;
}

/* ── Section Spacing ─────────────────────────────────────────────────────────── */

.section-py {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 1024px) {
    .section-py {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* ── Truncate long text ─────────────────────────────────────────────────────── */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Visual System (see docs/IMAGE_USAGE_PLAN.md) ────────────────────────────
   One treatment for every image: rounded-2xl, 1px ring, soft navy shadow.   */

.visual-frame,
.app-frame {
    position: relative;
    margin: 0;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(15, 30, 51, 0.08), 0 24px 48px -20px rgba(15, 30, 51, 0.28);
}

.visual-frame img,
.app-frame img {
    display: block;
    width: 100%;
    height: auto;
}

/* Dark sections: lighter ring so the frame edge stays visible */
.visual-frame--on-dark {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 30px 60px -24px rgba(0, 0, 0, 0.6);
}

/* Transparent compositions (homepage hero) — no frame, just the artwork */
.visual-frame--bare {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

/* Browser-window chrome around product screens */
.app-frame__bar {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    background: #eef1f5;
    border-bottom: 1px solid #e3e8ef;
}

.app-frame__bar span {
    width: 9px;
    height: 9px;
    border-radius: 9999px;
    background: #f87171;
}

.app-frame__bar span:nth-child(2) { background: #fbbf24; }
.app-frame__bar span:nth-child(3) { background: #4ade80; }

.app-frame--compact .app-frame__bar { height: 20px; padding: 0 9px; gap: 5px; }
.app-frame--compact .app-frame__bar span { width: 7px; height: 7px; }

.app-frame__screen {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f4f6f9;
}

.app-frame__screen img {
    height: 100%;
    object-fit: cover;
    object-position: left top;
}

/* "Illustrative preview" tag — honest labelling of mockups */
.preview-tag {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    background: rgba(15, 30, 51, 0.78);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* Subtle hover for linked image cards only */
.img-zoom img {
    transition: transform 0.45s ease;
}

.img-zoom:hover img,
.img-zoom:focus-visible img {
    transform: scale(1.03);
}

/* ── Portfolio media (16:10) ──────────────────────────────────────────────── */

.portfolio-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f4f6f9;
    border-bottom: 1px solid #eef2f6;
}

.portfolio-media > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left top;
    transition: transform 0.45s ease;
}

article:hover .portfolio-media > img {
    transform: scale(1.03);
}

/* ── Client logo slots ────────────────────────────────────────────────────── */

.logo-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    aspect-ratio: 5 / 3;
    padding: 1rem;
    border: 1px dashed #d7dde6;
    border-radius: 0.875rem;
    background: #fafbfc;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #a3adbb;
}

.logo-slot--filled {
    border-style: solid;
    border-color: #eef2f6;
    background: #fff;
    filter: grayscale(1);
    opacity: 0.8;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.logo-slot--filled:hover {
    filter: none;
    opacity: 1;
}

/* Captioned client logo (clients page grid) */
.logo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
    padding: 1.25rem 0.75rem 1rem;
    border: 1px solid #eef2f6;
    border-radius: 0.875rem;
    background: #fff;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.logo-card:hover {
    border-color: #bbf7d0;
    box-shadow: 0 10px 20px -8px rgba(15, 30, 51, 0.12);
    transform: translateY(-2px);
}

.logo-card__img {
    width: auto;
    height: 5.5rem;
    max-width: 100%;
    object-fit: contain;
}

.logo-card figcaption {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: #334155;
}

.logo-card[hidden] { display: none; }

.client-filter { border-color: #e2e8f0; background: #fff; color: #475569; }
.client-filter:hover { border-color: #86efac; color: #15803d; }
.client-filter[aria-pressed="true"] { border-color: #15803d; background: #15803d; color: #fff; }

/* Scrolling "trusted by" logo band */
.client-marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.client-marquee__track {
    display: flex;
    width: max-content;
    animation: client-marquee 100s linear infinite;
}

.client-marquee__track--reverse { animation-direction: reverse; }

.client-marquee:hover .client-marquee__track { animation-play-state: paused; }

.client-marquee__row {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding-right: 2.5rem;
}

.client-marquee__logo {
    width: auto;
    height: 4.5rem;
    max-width: 7.5rem;
    object-fit: contain;
}

@media (min-width: 640px) {
    .client-marquee__row { gap: 3.5rem; padding-right: 3.5rem; }
    .client-marquee__logo { height: 6rem; max-width: 10rem; }
}

@keyframes client-marquee {
    to { transform: translateX(-50%); }
}

/* ── Subtle CTA background ────────────────────────────────────────────────── */

.cta-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.14) 1px, transparent 0);
    background-size: 28px 28px;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    [data-animate] { opacity: 1; transform: none; transition: none; }
    .img-zoom img, .portfolio-media > img, .card-hover { transition: none; }
    .img-zoom:hover img, article:hover .portfolio-media > img, .card-hover:hover { transform: none; }
    .client-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
    .client-marquee__track { animation: none; }
    .client-marquee__row[aria-hidden] { display: none; }
    .logo-card, .logo-card:hover { transition: none; transform: none; }
}

/* ── Print Styles ────────────────────────────────────────────────────────────── */

@media print {
    #site-header,
    #mobile-menu-btn,
    .no-print {
        display: none !important;
    }
}
