:root {
    --bg: #f7f8ff;
    --bg-soft: #fff9fb;
    --panel: rgba(255, 255, 255, 0.64);
    --panel-strong: rgba(255, 255, 255, 0.82);
    --panel-soft: rgba(255, 255, 255, 0.46);
    --line: rgba(170, 167, 255, 0.24);
    --line-strong: rgba(150, 146, 255, 0.34);
    --text: #4d4a76;
    --heading: #57539a;
    --muted: #7f7bab;
    --accent: #8fdcff;
    --accent-strong: #b6a7ff;
    --accent-pink: #f5b0dc;
    --accent-peach: #ffd6bb;
    --success: #59be9a;
    --success-soft: rgba(89, 190, 154, 0.15);
    --error: #de7ba8;
    --error-soft: rgba(222, 123, 168, 0.16);
    --shadow: 0 20px 60px rgba(165, 162, 224, 0.18);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Inter", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.58)),
        url('bg.png') center center / cover fixed no-repeat,
        linear-gradient(135deg, #eef7ff 0%, #f3eeff 33%, #fff0f7 68%, #fff5ea 100%);
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background:
        radial-gradient(circle at 10% 16%, rgba(142, 219, 255, 0.34), transparent 28%),
        radial-gradient(circle at 86% 14%, rgba(255, 194, 234, 0.32), transparent 30%),
        radial-gradient(circle at 25% 82%, rgba(205, 194, 255, 0.24), transparent 26%),
        radial-gradient(circle at 82% 72%, rgba(255, 221, 190, 0.28), transparent 26%);
}

body::after {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255, 201, 235, 0.5) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(158, 223, 255, 0.52) 0 1px, transparent 1.5px);
    background-size: 190px 190px, 260px 260px, 320px 320px;
    background-position: 0 0, 90px 40px, 150px 110px;
    opacity: 0.5;
}

img {
    max-width: 100%;
}

button,
a,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: #7f72e9;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.hero-card,
.panel {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border-radius: 36px;
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: auto -8% -30% auto;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 201, 235, 0.32), transparent 64%);
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: -24% auto auto -10%;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(143, 220, 255, 0.28), transparent 66%);
}

.hero-brand,
.hero-badge,
.panel {
    position: relative;
    z-index: 1;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.hero-logo {
    width: 108px;
    height: 108px;
    object-fit: contain;
    border-radius: 28px;
    background:
        radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.72) 0 10%, transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(255, 204, 232, 0.34) 0 16%, transparent 40%),
        radial-gradient(circle at 20% 78%, rgba(148, 224, 255, 0.30) 0 18%, transparent 42%),
        linear-gradient(135deg, rgba(159, 230, 255, 0.52) 0%, rgba(198, 189, 255, 0.48) 34%, rgba(255, 193, 227, 0.50) 68%, rgba(255, 223, 192, 0.52) 100%);
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow:
        0 14px 32px rgba(186, 181, 255, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.18) inset,
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.hero-kicker {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7bb8ee;
}

.hero-card h1 {
    margin: 0;
    color: var(--heading);
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.08;
}

.hero-text {
    margin: 12px 0 0;
    max-width: 720px;
    color: var(--muted);
    line-height: 1.7;
}

.hero-badge {
    flex-shrink: 0;
    padding: 12px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(144, 220, 255, 0.26), rgba(255, 201, 235, 0.26));
    border: 1px solid rgba(255, 255, 255, 0.78);
    color: #7b73bc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.panel {
    border-radius: var(--radius-lg);
    padding: 24px;
}

.panel-head {
    margin-bottom: 18px;
}

.panel-head-inline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel h2 {
    margin: 0;
    color: var(--heading);
    font-size: 24px;
    line-height: 1.2;
}

.panel p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.shortener-form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
}

.field > span,
.meta-label {
    font-size: 14px;
    font-weight: 800;
    color: #716ba5;
}

.text-input,
.textarea-input {
    width: 100%;
    border: 1px solid rgba(169, 163, 255, 0.24);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68));
    color: var(--text);
    padding: 14px 16px;
    outline: 0;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.text-input::placeholder,
.textarea-input::placeholder {
    color: rgba(108, 104, 149, 0.44);
}

.text-input:focus,
.textarea-input:focus {
    border-color: rgba(168, 142, 255, 0.7);
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 0 0 4px rgba(196, 184, 255, 0.18),
        0 12px 26px rgba(208, 199, 255, 0.18);
    transform: translateY(-1px);
}

.textarea-input {
    resize: vertical;
    min-height: 124px;
    line-height: 1.6;
}

.input-prefix {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid rgba(169, 163, 255, 0.24);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.68));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.input-prefix .prefix {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    color: rgba(104, 100, 146, 0.8);
    background: linear-gradient(135deg, rgba(143, 220, 255, 0.14), rgba(255, 214, 187, 0.16));
    border-right: 1px solid rgba(169, 163, 255, 0.18);
    white-space: nowrap;
}

.input-prefix .text-input {
    border: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.primary-button,
.secondary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.bookmarklet-card:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.primary-button {
    justify-self: start;
    color: #5e568c;
    background: linear-gradient(135deg, #a8ebff 0%, #c4b8ff 38%, #f6b5df 72%, #ffdcb7 100%);
    box-shadow:
        0 14px 28px rgba(201, 187, 255, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.secondary-button {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.7));
    color: var(--heading);
    border: 1px solid rgba(169, 163, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.ghost-button {
    color: var(--heading);
    border: 1px solid rgba(169, 163, 255, 0.22);
    background: linear-gradient(135deg, rgba(143, 220, 255, 0.12), rgba(255, 201, 235, 0.12));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.copy-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.meta-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.meta-list > div {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.56));
    border: 1px solid rgba(169, 163, 255, 0.16);
    word-break: break-all;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.char-count {
    flex-shrink: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(143, 220, 255, 0.16), rgba(255, 201, 235, 0.16));
    border: 1px solid rgba(169, 163, 255, 0.22);
    color: #786fb2;
    font-size: 14px;
    font-weight: 800;
}

.char-count.is-negative {
    color: #c76492;
    border-color: rgba(222, 123, 168, 0.28);
    background: rgba(222, 123, 168, 0.12);
}

.status-panel {
    border-width: 1px;
}

.status-panel.is-success {
    background: linear-gradient(180deg, rgba(89, 190, 154, 0.18), rgba(255, 255, 255, 0.7));
    border-color: rgba(89, 190, 154, 0.28);
}

.status-panel.is-error {
    background: linear-gradient(180deg, rgba(222, 123, 168, 0.18), rgba(255, 255, 255, 0.72));
    border-color: rgba(222, 123, 168, 0.24);
}

.bookmarklet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bookmarklet-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 250, 253, 0.62));
    border: 1px solid rgba(169, 163, 255, 0.16);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.bookmarklet-card strong {
    font-size: 16px;
    color: var(--heading);
}

.bookmarklet-card span {
    color: var(--muted);
    line-height: 1.6;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translate(-50%, 20px);
    min-width: 180px;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(95, 90, 148, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #fff;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 16px 32px rgba(133, 125, 189, 0.26);
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 860px) {
    .hero-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-head-inline {
        flex-direction: column;
    }

    .bookmarklet-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 20px;
        padding-bottom: 28px;
    }

    .hero-card,
    .panel {
        padding: 18px;
        border-radius: 24px;
    }

    .hero-logo {
        width: 92px;
        height: 92px;
        border-radius: 24px;
    }

    .copy-row {
        grid-template-columns: 1fr;
    }

    .primary-button,
    .secondary-button,
    .ghost-button {
        width: 100%;
    }

    .share-actions {
        flex-direction: column;
    }

    .input-prefix {
        grid-template-columns: 1fr;
    }

    .input-prefix .prefix {
        border-right: 0;
        border-bottom: 1px solid rgba(169, 163, 255, 0.18);
        padding: 12px 14px 10px;
    }
}


/* Centering adjustments */
.shortener-form .primary-button {
    justify-self: center;
}

.note-panel {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
    padding-block: 10px;
}

.note-panel h2,
.note-panel p {
    text-align: center;
}
