:root {
    --bg-deep: #05070f;
    --bg-glow: #0b1230;
    --card: rgba(13, 18, 38, 0.6);
    --card-solid: #10162e;
    --border: rgba(124, 144, 255, 0.22);
    --border-strong: rgba(124, 144, 255, 0.45);
    --text: #eaf0fa;
    --muted: #93a0bd;
    --accent: #5b8cff;
    --accent-2: #7c5cff;
    --cyan: #22d3ee;
    --danger: #ff6b6b;
    --radius: 14px;
    --glow: 0 0 60px rgba(91, 140, 255, 0.18), 0 20px 60px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120vmax 80vmax at 50% -20%, var(--bg-glow) 0%, transparent 60%),
        radial-gradient(90vmax 70vmax at 85% 110%, #140a2e 0%, transparent 55%),
        var(--bg-deep);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
}

/* ---------- Yıldız alanı ve bulutsular ---------- */

#space {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.nebula {
    position: fixed;
    z-index: 0;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    pointer-events: none;
    animation: nebula-drift 26s ease-in-out infinite alternate;
}

.nebula-a {
    width: 44vmax;
    height: 34vmax;
    top: -12vmax;
    left: -10vmax;
    background: radial-gradient(circle at 40% 40%, rgba(91, 140, 255, 0.35), rgba(124, 92, 255, 0.12) 55%, transparent 75%);
}

.nebula-b {
    width: 38vmax;
    height: 30vmax;
    right: -12vmax;
    bottom: -10vmax;
    background: radial-gradient(circle at 60% 60%, rgba(34, 211, 238, 0.22), rgba(124, 92, 255, 0.1) 55%, transparent 75%);
    animation-delay: -13s;
}

@keyframes nebula-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(4vmax, 3vmax, 0) scale(1.15); }
}

/* ---------- Yüzen uzay ögeleri ---------- */

.scene {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.astronaut {
    position: absolute;
    left: clamp(1rem, 11vw, 14rem);
    top: 16%;
    animation: float-a 9s ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(91, 140, 255, 0.25));
}

@keyframes float-a {
    0%   { transform: translate3d(0, 0, 0) rotate(-8deg); }
    50%  { transform: translate3d(14px, -26px, 0) rotate(6deg); }
    100% { transform: translate3d(0, 0, 0) rotate(-8deg); }
}

.rocket {
    position: absolute;
    right: clamp(0.5rem, 10vw, 13rem);
    bottom: 14%;
    transform: rotate(18deg);
    animation: float-r 7s ease-in-out infinite;
    filter: drop-shadow(0 0 28px rgba(255, 150, 76, 0.25));
}

@keyframes float-r {
    0%   { transform: translate3d(0, 0, 0) rotate(18deg); }
    50%  { transform: translate3d(-10px, -22px, 0) rotate(14deg); }
    100% { transform: translate3d(0, 0, 0) rotate(18deg); }
}

.rocket .flame {
    transform-origin: 50px 126px;
    animation: flame-flicker 0.18s ease-in-out infinite alternate;
}

@keyframes flame-flicker {
    from { transform: scaleY(0.85) scaleX(0.95); opacity: 0.9; }
    to   { transform: scaleY(1.15) scaleX(1.05); opacity: 1; }
}

/* Kısaltma başarılı olunca roket fırlar */
.rocket.launching {
    animation: launch 1.6s cubic-bezier(0.5, -0.2, 0.8, 0.6) forwards;
}

@keyframes launch {
    0%   { transform: translate3d(0, 0, 0) rotate(18deg); }
    15%  { transform: translate3d(-4px, 8px, 0) rotate(16deg); }
    100% { transform: translate3d(30vw, -120vh, 0) rotate(22deg); opacity: 0.9; }
}

.satellite {
    position: absolute;
    top: 8%;
    left: -8rem;
    animation: orbit 70s linear infinite;
    opacity: 0.8;
}

@keyframes orbit {
    from { transform: translateX(0) rotate(-12deg); }
    to   { transform: translateX(calc(100vw + 16rem)) rotate(10deg); }
}

.planet {
    position: absolute;
    left: -4rem;
    bottom: -6rem;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #3f57a6 0%, #232e63 45%, #10163a 80%);
    box-shadow: inset -24px -18px 60px rgba(0, 0, 0, 0.6), 0 0 80px rgba(91, 140, 255, 0.18);
    animation: planet-spin 40s ease-in-out infinite alternate;
}

@keyframes planet-spin {
    from { transform: translateY(0) rotate(0deg); }
    to   { transform: translateY(-14px) rotate(6deg); }
}

.planet-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 150%;
    height: 44%;
    border: 3px solid rgba(143, 164, 200, 0.35);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(-16deg);
    border-top-color: transparent;
}

.moon {
    position: absolute;
    right: 12%;
    top: 10%;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #d9e2f1 0%, #9aa8c4 55%, #5d6b8c 100%);
    box-shadow: inset -10px -8px 22px rgba(0, 0, 0, 0.45), 0 0 40px rgba(217, 226, 241, 0.15);
    animation: float-m 12s ease-in-out infinite;
}

@keyframes float-m {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-18px); }
}

/* ---------- Ana kart ---------- */

main {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.25rem 2rem;
}

.hero-card {
    width: 100%;
    max-width: 34rem;
    padding: 2.5rem 2.25rem 2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--glow);
    text-align: center;
    animation: rise 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.hero-card:focus-within {
    border-color: var(--border-strong);
    box-shadow: 0 0 90px rgba(91, 140, 255, 0.3), 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 3.25rem);
    letter-spacing: -0.03em;
    text-shadow: 0 0 40px rgba(91, 140, 255, 0.4);
}

.brand {
    background: linear-gradient(92deg, #7cc0ff 0%, var(--accent) 45%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.byline {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

.byline a {
    color: var(--muted);
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
}

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

.tagline {
    margin: 1rem 0 1.75rem;
    color: var(--muted);
    font-size: 1.0625rem;
}

/* ---------- Kısaltma formu ---------- */

.field {
    display: flex;
    gap: 0.5rem;
    padding: 0.375rem;
    background: rgba(5, 8, 18, 0.55);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15), 0 0 30px rgba(91, 140, 255, 0.2);
}

input[type="url"] {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1.125rem;
    background: transparent;
    color: var(--text);
    border: 0;
    font-size: 1rem;
}

input[type="url"]:focus {
    outline: none;
}

input::placeholder {
    color: #5c6a8a;
}

input[type="url"]:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.field input[type="url"]:focus-visible {
    outline: none; /* odak vurgusu .field üzerinde gösteriliyor */
}

button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(92deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    border: 0;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 24px rgba(91, 140, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 10px 32px rgba(91, 140, 255, 0.45);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: progress;
}

.error {
    margin: 0.875rem 0 0;
    color: var(--danger);
    font-size: 0.9rem;
}

/* ---------- Sonuç ---------- */

.result {
    margin-top: 1.5rem;
    padding: 1.125rem 1.25rem;
    background: rgba(5, 8, 18, 0.55);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    text-align: left;
    animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

@keyframes pop {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.result-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.short-link {
    flex: 1;
    min-width: 12rem;
    color: var(--cyan);
    font-size: 1.125rem;
    font-weight: 600;
    word-break: break-all;
    text-shadow: 0 0 24px rgba(34, 211, 238, 0.4);
}

.copy {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
    box-shadow: none;
}

.copy:hover:not(:disabled) {
    background: rgba(91, 140, 255, 0.12);
    box-shadow: none;
}

.notice {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
}

/* ---------- API çağrı butonu ---------- */

.api-cta-row {
    margin-top: 1.75rem;
}

.api-cta {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(91, 140, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-align: left;
    font-weight: 400;
    box-shadow: none;
}

.api-cta:hover:not(:disabled) {
    background: rgba(91, 140, 255, 0.15);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(91, 140, 255, 0.2);
    filter: none;
}

.api-cta-icon {
    font-size: 1.5rem;
}

.api-cta span:nth-child(2) {
    flex: 1;
}

.api-cta strong {
    display: block;
    font-size: 0.9375rem;
}

.api-cta small {
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
}

.api-cta-arrow {
    font-size: 1.25rem;
    color: var(--accent);
    transition: transform 0.2s ease;
}

.api-cta:hover .api-cta-arrow {
    transform: translateX(4px);
}

/* ---------- Modal ---------- */

/* display:flex/grid tanımlı öğelerde hidden özniteliği her koşulda kazansın. */
[hidden] {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(4, 6, 14, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.open {
    opacity: 1;
}

.modal {
    width: 100%;
    max-width: 38rem;
    max-height: min(88vh, 52rem);
    overflow-y: auto;
    position: relative;
    padding: 2.25rem 2rem 2rem;
    background: var(--card-solid);
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    box-shadow: 0 0 120px rgba(91, 140, 255, 0.25), 0 30px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(36px) scale(0.94);
    opacity: 0;
    transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.15), opacity 0.3s ease;
}

.modal-backdrop.open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal:focus {
    outline: none;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: grid;
    place-items: center;
    background: rgba(91, 140, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 1rem;
    box-shadow: none;
}

.modal-close:hover:not(:disabled) {
    color: var(--text);
    background: rgba(91, 140, 255, 0.2);
    transform: none;
    filter: none;
    box-shadow: none;
}

h2 {
    margin: 0 1.5rem 0.5rem 0;
    font-size: 1.375rem;
    letter-spacing: -0.01em;
}

.lead {
    margin: 0 0 1.5rem;
    color: var(--muted);
}

.steps {
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.step-num {
    flex: 0 0 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 0 18px rgba(91, 140, 255, 0.4);
}

.steps strong {
    display: block;
    font-size: 0.9375rem;
}

.steps p {
    margin: 0.125rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.preview {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.preview summary {
    padding: 0.75rem 1rem;
    background: rgba(5, 8, 18, 0.55);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.preview pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    background: rgba(5, 8, 18, 0.75);
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    line-height: 1.55;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.control {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
    text-align: left;
}

.control label {
    font-size: 0.875rem;
    font-weight: 600;
}

.control input {
    padding: 0.75rem 0.875rem;
    background: rgba(5, 8, 18, 0.55);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.control input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15);
}

button.wide {
    width: 100%;
    border-radius: var(--radius);
}

.success {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.4);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.fineprint {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.8125rem;
}

/* ---------- Alt bilgi ---------- */

.site-footer {
    position: relative;
    z-index: 2;
    padding: 0.5rem 1rem 1.25rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.8125rem;
}

.site-footer p {
    margin: 0;
}

.footer-brand strong {
    color: var(--text);
}

.footer-links {
    margin-top: 0.375rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--muted);
    text-underline-offset: 2px;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Küçük ekranlar ---------- */

@media (max-width: 860px) {
    .astronaut,
    .rocket {
        opacity: 0.55;
    }

    .astronaut svg { width: 72px; height: 90px; }
    .rocket svg { width: 58px; height: 98px; }

    .astronaut { left: 0.25rem; top: 6%; }
    .rocket { right: 0.25rem; bottom: 4%; }
    .planet { width: 11rem; height: 11rem; left: -5rem; bottom: -5rem; }
    .moon { width: 3rem; height: 3rem; }
}

@media (max-width: 560px) {
    .field {
        flex-direction: column;
        border-radius: var(--radius);
        padding: 0.5rem;
    }

    .field button {
        border-radius: var(--radius);
    }

    .hero-card {
        padding: 2rem 1.375rem 1.5rem;
    }
}

/* ---------- Hareket azaltma tercihi ---------- */

@media (prefers-reduced-motion: reduce) {
    .nebula,
    .astronaut,
    .rocket,
    .rocket .flame,
    .satellite,
    .planet,
    .moon,
    .hero-card,
    .result {
        animation: none;
    }

    .modal,
    .modal-backdrop,
    button,
    .api-cta-arrow {
        transition: none;
    }
}
