/* ================================
   pamuk.app
   ================================ */

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

/* --- Custom Properties --- */
:root {
    --bg: #F5F0EB;
    --text: #2D3047;
    --text-muted: rgba(45, 48, 71, 0.6);
    --accent: #E8845C;
    --accent-glow: rgba(232, 132, 92, 0.12);
    --secondary: #8B9474;
    --surface: #FFFFFF;
    --border: rgba(45, 48, 71, 0.08);
    --border-strong: rgba(45, 48, 71, 0.14);
    --notify-bg: rgba(232, 132, 92, 0.04);
    --font: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(45, 48, 71, 0.04), 0 4px 16px rgba(45, 48, 71, 0.04);
    --shadow-hover: 0 4px 8px rgba(45, 48, 71, 0.06), 0 12px 40px rgba(45, 48, 71, 0.08);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1E1D2B;
        --text: #E8E4DF;
        --text-muted: rgba(232, 228, 223, 0.5);
        --accent: #E8845C;
        --accent-glow: rgba(232, 132, 92, 0.1);
        --secondary: #A3B18A;
        --surface: #2A2938;
        --border: rgba(255, 255, 255, 0.06);
        --border-strong: rgba(255, 255, 255, 0.12);
        --notify-bg: rgba(232, 132, 92, 0.04);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.12);
        --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2);
    }
}

/* --- Base --- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
}

/* Subtle grain texture */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.025;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

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

/* --- Scroll Progress --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent);
    z-index: 10000;
    transition: width 0.05s linear;
}

/* --- Layout --- */
.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0;
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem 1.5rem;
    overflow: hidden;
}

/* Animated gradient blobs */
.hero-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.hero-blob--1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: blob-drift-1 12s ease-in-out infinite;
}

.hero-blob--2 {
    width: 350px;
    height: 350px;
    background: var(--secondary);
    top: 55%;
    left: 45%;
    transform: translate(-50%, -50%);
    animation: blob-drift-2 15s ease-in-out infinite;
}

@keyframes blob-drift-1 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    33% { transform: translate(-45%, -55%) scale(1.05); }
    66% { transform: translate(-55%, -48%) scale(0.95); }
}

@keyframes blob-drift-2 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    33% { transform: translate(-55%, -45%) scale(1.08); }
    66% { transform: translate(-42%, -52%) scale(0.92); }
}

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

.logomark {
    width: 64px;
    height: auto;
    color: var(--accent);
    margin-bottom: 1.75rem;
    display: inline-block;
    filter: drop-shadow(0 4px 24px var(--accent-glow));
    transition: transform 0.4s var(--ease);
}

.logomark:hover {
    transform: rotate(-6deg) scale(1.08);
}

.wordmark {
    font-family: var(--font);
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.25rem;
    color: var(--secondary);
    font-weight: 400;
    letter-spacing: 0.005em;
}

/* Scroll indicator */
.scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.scroll-hint-text {
    font-family: var(--mono);
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    color: var(--secondary);
    opacity: 0.4;
}

.scroll-chevron {
    color: var(--secondary);
    opacity: 0.3;
    animation: bounce-down 2s ease-in-out infinite;
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(4px); opacity: 0.15; }
}

/* --- Section Label --- */
.section-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--secondary);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 80px;
}

/* --- App Grid --- */
.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* App Card */
.app-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

.app-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: var(--accent-glow);
}

/* Featured card */
.app-card--featured {
    padding: 2.5rem;
}

.app-card--featured .app-header {
    margin-bottom: 1.25rem;
}

.app-card--featured .app-icon img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
}

.app-card--featured .app-name {
    font-size: 1.375rem;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-icon svg,
.app-icon img {
    width: 56px;
    height: 56px;
    display: block;
    flex-shrink: 0;
    border-radius: 12px;
}

.app-name {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.app-tag {
    font-family: var(--mono);
    font-size: 0.6875rem;
    color: var(--secondary);
    letter-spacing: 0.03em;
}

.app-rating {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 0.3rem 0.625rem;
    border-radius: 20px;
    flex-shrink: 0;
}

.app-desc {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 520px;
}

/* Store links */
.store-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.store-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.store-link svg {
    transition: transform 0.2s var(--ease);
}

.store-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.store-link:hover svg {
    transform: translate(1px, -1px);
}

/* Coming soon card */
.app-card--soon {
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
    position: relative;
    border: none;
    padding: 2rem;
}

/* Animated gradient border */
.app-card--soon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1.5px;
    background: conic-gradient(from var(--border-angle, 0deg), var(--border) 0%, var(--accent-glow) 25%, var(--border) 50%, var(--secondary) 75%, var(--border) 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    animation: rotate-border 8s linear infinite;
}

@property --border-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@keyframes rotate-border {
    to { --border-angle: 360deg; }
}

.app-card--soon:hover {
    box-shadow: none;
    transform: none;
}

.soon-content {
    position: relative;
}

.soon-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: 0.75rem;
    animation: spin-slow 16s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.soon-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.soon-label {
    font-family: var(--mono);
    font-size: 0.6875rem;
    color: var(--secondary);
    opacity: 0.5;
    letter-spacing: 0.03em;
}

/* --- About --- */
.about-text {
    font-size: 1.25rem;
    line-height: 1.8;
    max-width: 560px;
    color: var(--text-muted);
}

.about-footnote {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--accent);
    font-style: italic;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-cat {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

/* --- Jobs --- */
.jobs-empty {
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    max-width: 480px;
}

.jobs-text {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.jobs-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    transition: gap 0.25s var(--ease);
}

.jobs-link:hover {
    gap: 0.875rem;
    color: var(--accent);
}

/* --- Notify --- */
.section--notify {
    padding: 4rem 0 5rem;
    background: var(--notify-bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.notify-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.notify-container .section-label {
    justify-content: center;
}

.notify-container .section-label::after {
    display: none;
}

.notify-text {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.notify-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    width: 100%;
}

.notify-input {
    flex: 1;
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.notify-input::placeholder {
    color: var(--text-muted);
}

.notify-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.notify-btn {
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.notify-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.notify-btn:active {
    transform: translateY(0);
}

.notify-done {
    font-size: 0.9375rem;
    color: var(--secondary);
    font-weight: 500;
    padding: 0.75rem 0;
}

/* --- Footer --- */
.footer {
    padding: 3rem 0;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.footer-mark {
    width: 18px;
    height: auto;
    color: var(--accent);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-dot {
    opacity: 0.3;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.footer-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-social a {
    color: var(--text-muted);
    transition: color 0.2s var(--ease), transform 0.2s var(--ease);
    display: flex;
}

.footer-social a:hover {
    color: var(--accent);
    transform: scale(1.15);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-copy {
    opacity: 0.4;
    font-size: 0.75rem;
}

/* ================================
   Animations
   ================================ */

/* Hero entrance */
.hero-animate {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.8s var(--ease-out) var(--delay, 0s),
        transform 0.8s var(--ease-out) var(--delay, 0s);
}

body.loaded .hero-animate {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered grid children */
.app-grid .reveal:nth-child(1) { transition-delay: 0s; }
.app-grid .reveal:nth-child(2) { transition-delay: 0.15s; }

/* ================================
   Reduced Motion
   ================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-blob { display: none; }
    .scroll-progress { display: none; }

    .hero-animate,
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ================================
   Responsive
   ================================ */

/* Tablet */
@media (max-width: 900px) and (min-width: 641px) {
    .hero-blob--1 { width: 400px; height: 400px; }
    .hero-blob--2 { width: 280px; height: 280px; }

    .wordmark {
        font-size: 3.25rem;
    }

    .section {
        padding: 5rem 0;
    }

    .app-card--featured {
        padding: 2rem;
    }

    .app-card--featured .app-icon img {
        width: 56px;
        height: 56px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .hero-blob--1 { width: 300px; height: 300px; }
    .hero-blob--2 { width: 200px; height: 200px; }

    .section {
        padding: 4rem 0;
    }

    .wordmark {
        font-size: 2.75rem;
    }

    .tagline {
        font-size: 1.0625rem;
    }

    .logomark {
        width: 48px;
        margin-bottom: 1.25rem;
    }

    .app-card {
        padding: 1.5rem;
    }

    .app-card--featured {
        padding: 1.5rem;
    }

    .app-card--featured .app-icon img {
        width: 56px;
        height: 56px;
        border-radius: 12px;
    }

    .app-card--featured .app-name {
        font-size: 1.25rem;
    }

    .app-rating {
        display: none;
    }

    .section-label {
        margin-bottom: 1.5rem;
    }

    .about-text {
        font-size: 1.0625rem;
    }

    .notify-form {
        flex-direction: column;
    }

    .section--notify {
        text-align: left;
    }

    .notify-container {
        align-items: flex-start;
        text-align: left;
    }

    .notify-container .section-label {
        justify-content: flex-start;
    }

    .footer-top,
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .footer-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
