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

:root {
    --bg: #ffffff;
    --text: #0a0a0a;
    --muted: #71717a;
    --border: #e7e7ea;
    --surface: #f5f5f7;
    --radius: 20px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.bg { display: none; }

/* ============ Topbar ============ */
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 0 clamp(20px, 4vw, 40px);
    height: 68px;
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px;
    background: #0a0a0a; color: #fff;
    font-size: 12px; font-weight: 800; letter-spacing: 0;
}
.brand-name { font-size: 15px; }
.top-nav { display: flex; align-items: center; gap: 26px; }
.top-nav a { font-size: 14px; font-weight: 500; color: var(--muted); transition: color 0.15s; }
.top-nav a:hover { color: var(--text); }
.design-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 100px;
    background: #0a0a0a; color: #fff;
    font-size: 13.5px; font-weight: 600;
    transition: opacity 0.15s, transform 0.15s;
}
.design-toggle:hover { opacity: 0.82; transform: translateY(-1px); }

/* ============ Layout ============ */
.view { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 40px) 80px; }
.view-enter { animation: fadeUp 0.35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 32px;
    transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

.section-title { font-size: clamp(30px, 4.5vw, 44px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; }
.section-sub { color: var(--muted); font-size: 16px; margin-bottom: 44px; }

/* ============ Home ============ */
.hero { text-align: center; padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero h1 {
    font-size: clamp(40px, 7vw, 76px);
    font-weight: 800; letter-spacing: -0.045em; line-height: 1.03;
    max-width: 820px; margin: 0 auto;
}
.hero h1 .muted { color: #b3b3bc; }
.hero p { color: var(--muted); font-size: clamp(16px, 2vw, 19px); margin: 22px auto 0; max-width: 600px; line-height: 1.6; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 26px; border-radius: 100px;
    background: #0a0a0a; color: #fff;
    font-size: 15px; font-weight: 600;
    transition: opacity 0.15s, transform 0.15s;
}
.pill:hover { opacity: 0.82; transform: translateY(-1px); }
.pill-outline {
    background: #fff; color: var(--text);
    border: 1px solid var(--border);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.pill-outline:hover { opacity: 1; background: var(--surface); border-color: #d4d4d8; }

/* ============ Cards (shared) ============ */
.card {
    display: flex; flex-direction: column;
    border-radius: var(--radius); overflow: hidden;
    background: #fff; border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08); border-color: #d9d9de; }
.card-preview {
    position: relative; height: 230px; overflow: hidden;
    background: var(--surface);
    display: flex; align-items: flex-end; justify-content: center;
    border-bottom: 1px solid var(--border);
}
.preview-phones { display: flex; gap: 14px; align-items: flex-end; height: 100%; padding-top: 26px; }
.preview-phones img {
    width: 110px; border-radius: 16px 16px 0 0;
    border: 4px solid #17171b; border-bottom: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    display: block;
}
.preview-mac { width: 100%; height: 100%; }
.preview-mac img { width: 88%; margin: 26px auto 0; display: block; border-radius: 10px 10px 0 0; border: 1px solid var(--border); border-bottom: none; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12); }
.preview-icon-only { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.preview-icon-only .big-icon {
    width: 88px; height: 88px; border-radius: 22px; overflow: hidden;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 30px; color: #fff;
}
.preview-icon-only .big-icon img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-app-icon {
    width: 42px; height: 42px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px; color: #fff;
}
.card-app-icon img { width: 100%; height: 100%; object-fit: cover; }
.card-body h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body .card-sub { color: var(--muted); font-size: 13.5px; }
.card-cta { margin-top: auto; padding-top: 14px; font-size: 14px; font-weight: 600; }

/* ============ Home nav cards ============ */
.nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.preview-icons { display: grid; grid-template-columns: repeat(2, 62px); gap: 14px; align-content: center; height: 100%; }
.preview-icons .mini {
    width: 62px; height: 62px; border-radius: 15px; overflow: hidden;
    border: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.preview-icons .mini img { width: 100%; height: 100%; object-fit: cover; }
.nav-card-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.nav-card-desc { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 6px; }

/* ============ Apps grid ============ */
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.platforms { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.platform-chip {
    font-size: 11.5px; font-weight: 500; color: var(--muted);
    padding: 4px 10px; border-radius: 100px;
    background: var(--surface); border: 1px solid var(--border);
}
.badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 3px 9px; border-radius: 100px;
    background: #0a0a0a; color: #fff;
}

/* ============ App detail ============ */
.detail { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } .detail-device { order: 2; } }

.detail-head { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.detail-icon {
    width: 84px; height: 84px; border-radius: 20px; overflow: hidden; flex-shrink: 0;
    border: 1px solid var(--border);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 26px; color: #fff;
}
.detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.detail-head h1 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -0.03em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .tagline { color: var(--muted); font-size: 16px; margin-top: 4px; }
.detail-desc { font-size: 15.5px; line-height: 1.7; color: #3f3f46; margin-bottom: 26px; }

.feature-list { list-style: none; margin-bottom: 28px; }
.feature-list li {
    position: relative; padding-left: 28px; margin-bottom: 11px;
    color: #3f3f46; font-size: 14.5px; line-height: 1.55;
}
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--text); font-weight: 700; }

.store-buttons { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.store-buttons img { height: 46px; width: auto; display: block; transition: transform 0.15s; }
.store-buttons a:hover img { transform: scale(1.04); }
.link-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px; border-radius: 100px;
    background: #fff; border: 1px solid var(--border);
    color: var(--text); font-size: 14px; font-weight: 600;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.link-btn:hover { background: var(--surface); border-color: #d4d4d8; transform: translateY(-1px); }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
    font-size: 12.5px; font-weight: 500; color: var(--muted);
    padding: 6px 13px; border-radius: 100px;
    background: var(--surface); border: 1px solid var(--border);
}

/* ============ iPhone mockup ============ */
.detail-device { display: flex; flex-direction: column; align-items: center; gap: 20px; position: sticky; top: 100px; }
@media (max-width: 860px) { .detail-device { position: static; } }

.iphone-mock {
    width: min(300px, 78vw); aspect-ratio: 9 / 19.5;
    background: #000; border-radius: 48px;
    border: 3px solid #3a3a3f;
    box-shadow: 0 0 0 8px #17171b, 0 28px 60px rgba(0, 0, 0, 0.25);
    position: relative; overflow: hidden;
    touch-action: pan-y;
}
.iphone-island {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    width: 32%; height: 26px; background: #000; border-radius: 20px; z-index: 5;
}
.mock-screen { position: absolute; inset: 0; border-radius: 45px; overflow: hidden; background: var(--surface); }

/* ============ Mac window mockup ============ */
.mac-mock {
    width: 100%; max-width: 580px;
    background: #fff; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.16);
    touch-action: pan-y;
}
.mac-titlebar { display: flex; gap: 7px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.mac-dot { width: 11px; height: 11px; border-radius: 50%; }
.mac-dot.r { background: #ff5f57; } .mac-dot.y { background: #febc2e; } .mac-dot.g { background: #28c840; }
.mac-mock .mock-screen { position: relative; aspect-ratio: 16 / 10; background: var(--surface); overflow: hidden; border-radius: 0; }

/* ============ Carousel ============ */
.carousel-track { display: flex; height: 100%; width: 100%; will-change: transform; }
.carousel-track.animate { transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.35, 1); }
.carousel-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.carousel-slide img {
    width: 100%; height: 100%; object-fit: cover; object-position: top center;
    -webkit-user-drag: none; user-select: none; pointer-events: none;
}
.mac-mock .carousel-slide img { object-fit: contain; background: var(--surface); }
.placeholder-slide { flex-direction: column; gap: 16px; text-align: center; padding: 30px; background: var(--surface); }
.placeholder-slide .ph-icon {
    width: 90px; height: 90px; border-radius: 22px; overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 30px; color: #fff;
}
.placeholder-slide .ph-icon img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-slide p { color: var(--muted); font-size: 13px; }

.carousel-controls { display: flex; align-items: center; gap: 16px; }
.carousel-arrow {
    width: 38px; height: 38px; border-radius: 50%;
    background: #fff; border: 1px solid var(--border); color: var(--text);
    font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.carousel-arrow:hover { background: var(--surface); border-color: #d4d4d8; }
.carousel-arrow:disabled { opacity: 0.3; cursor: default; }
.carousel-dots { display: flex; gap: 8px; }
.carousel-dot {
    width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
    background: #d9d9de; transition: background 0.15s, transform 0.15s;
}
.carousel-dot.active { background: #0a0a0a; transform: scale(1.25); }
.device-hint { color: var(--muted); font-size: 12.5px; }

/* ============ Mac screenshots secondary section ============ */
.mac-section { margin-top: 48px; }
.mac-section h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 18px; }
.mac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.mac-shot { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.mac-shot img { width: 100%; display: block; }

/* ============ Portfolio ============ */
.work-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.work-card { padding: 24px; cursor: default; }
.work-card:hover { transform: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06); }
.work-card .card-app-icon { color: #fff; font-weight: 800; font-size: 18px; }
.work-desc { color: #3f3f46; font-size: 14px; line-height: 1.65; margin: 14px 0 16px; }
.work-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.text-link { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

/* ============ Profile ============ */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.panel { padding: 30px; border-radius: var(--radius); background: #fff; border: 1px solid var(--border); }
.panel h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 16px; }
.panel p { color: #3f3f46; font-size: 14.5px; line-height: 1.7; margin-bottom: 12px; }
.panel p:last-child { margin-bottom: 0; }
.panel .quote { color: var(--muted); font-style: italic; }
.panel.wide { grid-column: 1 / -1; }
.timeline { list-style: none; }
.timeline li { display: flex; gap: 14px; margin-bottom: 14px; font-size: 14px; color: #3f3f46; line-height: 1.5; }
.timeline .tl-year { color: var(--text); font-weight: 700; flex-shrink: 0; min-width: 86px; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chip {
    font-size: 13px; font-weight: 500; color: #3f3f46;
    padding: 7px 14px; border-radius: 100px;
    background: var(--surface); border: 1px solid var(--border);
}

/* ============ Contact ============ */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-bottom: 28px; }
.contact-card {
    display: flex; align-items: center; gap: 16px;
    padding: 26px; border-radius: var(--radius);
    background: #fff; border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.contact-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08); border-color: #d9d9de; }
.contact-icon {
    width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: #0a0a0a;
}
.contact-card h3 { font-size: 15.5px; font-weight: 700; }
.contact-card p { color: var(--muted); font-size: 13px; margin-top: 3px; word-break: break-all; }

.legal-details { border-radius: var(--radius); background: #fff; border: 1px solid var(--border); overflow: hidden; }
.legal-details summary {
    padding: 20px 26px; cursor: pointer; font-weight: 700; font-size: 15px;
    list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.legal-details summary::-webkit-details-marker { display: none; }
.legal-details summary::after { content: "+"; font-size: 20px; color: var(--muted); transition: transform 0.2s; }
.legal-details[open] summary::after { transform: rotate(45deg); }
.legal-body { padding: 0 26px 26px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.legal-body strong { color: var(--text); }

/* ============ Footer ============ */
.footer {
    display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
    padding: 28px 20px; color: var(--muted); font-size: 13px;
    border-top: 1px solid var(--border);
}
.footer a { color: var(--muted); transition: color 0.15s; }
.footer a:hover { color: var(--text); }
.footer-sep { opacity: 0.5; }

@media (max-width: 640px) {
    .brand-name { display: none; }
    .top-nav { gap: 16px; }
    .design-toggle span { display: none; }
    .design-toggle { padding: 9px 12px; }
}
