/* ===========================================================
   3S Studio — Dark App Store-inspired theme
   =========================================================== */

:root {
    --bg: #0a0a0c;
    --bg-elevated: #131318;
    --bg-card: #17171c;
    --bg-card-hover: #1c1c22;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #f5f5f7;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;

    --accent: #ff453a;        /* Apple-ish red accent */
    --accent-soft: #ff453a22;
    --accent-2: #5e5ce6;      /* Indigo for variety */

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --font-display: 'Instrument Serif', 'Times New Roman', serif;
    --font-body: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;

    --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -20px rgba(0,0,0,0.6);
    --shadow-elevated: 0 20px 60px -20px rgba(255, 69, 58, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ====== Ambient background ====== */
.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
}

.ambient-glow-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    animation: drift1 22s ease-in-out infinite;
}

.ambient-glow-2 {
    bottom: -20%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
    opacity: 0.25;
    animation: drift2 28s ease-in-out infinite;
}

.ambient-grain {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 80px) scale(1.15); }
}

@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-80px, -50px) scale(1.1); }
}

/* ====== Layout helpers ====== */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ====== Header ====== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(10, 10, 12, 0.7);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    padding-bottom: 16px;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.05em;
    align-self: center;
}

.logo-text {
    font-size: 19px;
    font-weight: 600;
}

.site-nav {
    display: flex;
    gap: 28px;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* ====== Hero ====== */
.hero {
    padding: 120px 0 100px;
    position: relative;
}

.hero-eyebrow {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(56px, 9vw, 120px);
    line-height: 0.95;
    letter-spacing: -0.03em;
    font-weight: 400;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeUp 0.9s 0.1s ease forwards;
}

.hero-title em {
    font-style: italic;
    color: var(--accent);
}

.hero-subtitle {
    font-size: 22px;
    color: var(--text-muted);
    max-width: 560px;
    margin-bottom: 40px;
    line-height: 1.5;
    opacity: 0;
    animation: fadeUp 1s 0.2s ease forwards;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 1.1s 0.3s ease forwards;
}

/* Hero app-icon row — quick nav to each featured app */
.hero-apps {
    list-style: none;
    margin: 36px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    opacity: 0;
    animation: fadeUp 1.2s 0.4s ease forwards;
}

.hero-app {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
    position: relative;
    text-decoration: none;
}

.hero-app:hover,
.hero-app:focus-visible {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.7);
    border-color: var(--border-strong);
    outline: none;
}

.hero-app img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-app::after {
    content: attr(aria-label);
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-app:hover::after,
.hero-app:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(245, 245, 247, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text);
}

.btn-app-store {
    background: var(--text);
    color: var(--bg);
    padding: 12px 22px;
    font-size: 14px;
}

.btn-app-store:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(245, 245, 247, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-color: var(--border);
    padding: 12px 22px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-strong);
}

/* ====== Section headers ====== */
.section-header {
    margin-bottom: 56px;
}

.section-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 400;
    max-width: 700px;
}

/* ====== Apps section ====== */
.apps-section {
    padding: 80px 0 120px;
}

.apps-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: 1fr;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    scroll-margin-top: 90px;
}

.app-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,69,58,0.06) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.app-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
}

.app-card:hover::before {
    opacity: 1;
}

.app-card-header {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
    align-items: flex-start;
}

.app-icon {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-fallback {
    position: absolute;
    color: white;
    font-weight: 800;
    font-size: 32px;
    letter-spacing: -0.05em;
    display: none;
}

.app-icon.placeholder .icon-fallback {
    display: block;
}

.app-card-meta {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 6px;
}

.app-tagline {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 14px;
    line-height: 1.4;
}

.app-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.app-description {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 32px;
    max-width: 720px;
}

/* ====== Screenshots ====== */
.app-screenshots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.screenshot {
    aspect-ratio: 9 / 19.5;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, #1f1f26 0%, #2a2a32 100%);
    border: 1px solid var(--border);
    position: relative;
    transition: transform 0.3s ease;
}

.screenshot:hover {
    transform: scale(1.03);
}

.screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.screenshot.placeholder::before {
    content: 'Screenshot';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.screenshot.placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,69,58,0.15) 0%, transparent 40%),
        radial-gradient(circle at 70% 80%, rgba(94,92,230,0.15) 0%, transparent 40%);
    pointer-events: none;
}

.app-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ====== Gallery (hero image + thumbnails) ====== */
.app-gallery {
    --gallery-aspect: 16 / 10;
    --gallery-max-width: 100%;
    margin-bottom: 32px;
}

/* Portrait apps (iPhone / iPad screenshots) */
.app-gallery--portrait {
    --gallery-aspect: 3 / 4;
    --gallery-max-width: 420px;
}

.gallery-main {
    display: block;
    width: 100%;
    max-width: var(--gallery-max-width);
    aspect-ratio: var(--gallery-aspect);
    border-radius: 14px;
    overflow: hidden;
    background: #0a0a0c;
    border: 1px solid var(--border);
    cursor: zoom-in;
    padding: 0;
    margin: 0 auto 14px;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-main:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.gallery-zoom-hint {
    position: absolute;
    bottom: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(10, 10, 12, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.gallery-main:hover .gallery-zoom-hint,
.gallery-main:focus-visible .gallery-zoom-hint {
    opacity: 1;
    transform: translateY(0);
}

.gallery-thumbs {
    --thumb-gap: 12px;
    display: flex;
    gap: var(--thumb-gap);
    max-width: var(--gallery-max-width);
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.gallery-thumbs::-webkit-scrollbar { height: 6px; }
.gallery-thumbs::-webkit-scrollbar-track { background: transparent; }
.gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
}
.gallery-thumbs::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

.thumb {
    display: block;
    flex: 0 0 calc((100% - 2 * var(--thumb-gap)) / 3);
    aspect-ratio: var(--gallery-aspect);
    scroll-snap-align: start;
    border-radius: 10px;
    overflow: hidden;
    background: #0a0a0c;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.thumb:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.thumb.is-active {
    opacity: 1;
    border-color: var(--accent);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ====== Lightbox ====== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    animation: lightboxFade 0.18s ease;
    padding: 24px;
}

.lightbox[hidden] { display: none; }

@keyframes lightboxFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
    background: #0a0a0c;
}

.lightbox-caption {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    max-width: 720px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.05);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.05);
}

.lightbox-close {
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

@media (max-width: 768px) {
    .lightbox { padding: 12px; }
    .lightbox-img { max-width: 96vw; max-height: 78vh; }
    .lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }
    .lightbox-prev, .lightbox-next { width: 40px; height: 40px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

/* ====== About section ====== */
.about-section {
    padding: 100px 0;
    border-top: 1px solid var(--border);
}

.about-intro {
    max-width: 720px;
    margin-bottom: 64px;
}

.about-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin-bottom: 24px;
}

.about-title em {
    color: var(--accent);
    font-style: italic;
}

.about-body {
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1.6;
    max-width: 540px;
}

.about-roles-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.about-roles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.role-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.role-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.role-icon--blue   { background: #3b82f6; }
.role-icon--green  { background: #22c55e; }
.role-icon--orange { background: #f59e0b; }

.role-text {
    flex: 1;
    min-width: 0;
}

.role-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.role-desc {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.55;
}

/* ====== Contact section ====== */
.contact-section {
    padding: 100px 0 120px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin: 16px auto 40px;
    max-width: 800px;
}

.contact-title em {
    color: var(--accent);
    font-style: italic;
}

.contact-email {
    display: inline-block;
    font-size: 28px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 4px;
    transition: color 0.2s ease;
}

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

/* ====== Footer ====== */
.site-footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 14px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

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

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ====== Responsive ====== */
@media (max-width: 768px) {
    .site-nav { gap: 18px; }
    .site-nav a { font-size: 14px; }

    .hero { padding: 80px 0 60px; }
    .hero-subtitle { font-size: 18px; }

    .app-card { padding: 24px; }

    .app-card-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .app-icon {
        width: 80px;
        height: 80px;
        border-radius: 18px;
    }

    .app-name { font-size: 28px; }

    .app-screenshots {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .gallery-thumbs {
        --thumb-gap: 8px;
    }

    .about-roles {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .about-intro { margin-bottom: 48px; }

    .contact-email { font-size: 22px; }

    .footer-inner { flex-direction: column; }
}

@media (max-width: 480px) {
    .site-nav { display: none; }
    .hero { padding: 60px 0 40px; }
}
