:root {
    --ink: #0c1f2e;
    --ink-soft: #1a3a4f;
    --muted: #5a7a8c;
    --surface: #ffffff;
    --surface-2: #f3f8fa;
    --border: #d5e4ec;
    --accent: #0d9488;
    --accent-deep: #0f766e;
    --accent-soft: #ccfbf1;
    --coral: #e85d4c;
    --danger: #c2410c;
    --shadow: 0 8px 32px rgba(12, 31, 46, 0.08);
    --radius: 14px;
    --font-display: "Sora", sans-serif;
    --font: "IBM Plex Sans", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
    background: var(--surface-2);
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Home hero ─── */
.page-home {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(13, 148, 136, 0.18), transparent 55%),
        radial-gradient(ellipse 50% 40% at 90% 80%, rgba(232, 93, 76, 0.08), transparent 50%),
        radial-gradient(ellipse 40% 50% at 5% 70%, rgba(14, 116, 144, 0.1), transparent 50%),
        linear-gradient(165deg, #e8f4f6 0%, #f5fafb 40%, #eef6f8 100%);
    position: relative;
    overflow: hidden;
}

.page-home::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(12, 31, 46, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(12, 31, 46, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 75%);
    pointer-events: none;
    animation: gridDrift 28s linear infinite;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    opacity: 0.55;
}

.orb-1 {
    width: 320px;
    height: 320px;
    background: #5eead4;
    top: 8%;
    left: -5%;
    animation: floatOrb 12s ease-in-out infinite;
}

.orb-2 {
    width: 260px;
    height: 260px;
    background: #7dd3fc;
    bottom: 12%;
    right: -4%;
    animation: floatOrb 15s ease-in-out infinite reverse;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(18px, -22px); }
}

@keyframes gridDrift {
    from { background-position: 0 0; }
    to { background-position: 48px 48px; }
}

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

.home-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 3rem;
    position: relative;
    z-index: 1;
    text-align: center;
    animation: fadeUp 0.7s ease-out both;
}

.home-brand {
    margin-bottom: 1.75rem;
}

.home-brand .mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.1rem;
    border-radius: 16px;
    background: linear-gradient(145deg, #0d9488, #0e7490);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(13, 148, 136, 0.35);
    animation: fadeUp 0.6s ease-out 0.05s both;
}

.home-brand .mark svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-brand h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.85rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--ink);
    animation: fadeUp 0.6s ease-out 0.12s both;
}

.home-brand h1 span {
    color: var(--accent);
}

.home-brand .tagline {
    margin: 0.65rem 0 0;
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 28rem;
    margin-inline: auto;
    animation: fadeUp 0.6s ease-out 0.2s both;
}

.home-search {
    width: 100%;
    max-width: 560px;
    animation: fadeUp 0.65s ease-out 0.28s both;
}

.home-search .search-form {
    display: flex;
    gap: 0.45rem;
    background: var(--surface);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 16px;
    padding: 0.45rem;
    box-shadow:
        0 1px 2px rgba(12, 31, 46, 0.04),
        0 16px 40px rgba(12, 31, 46, 0.1);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.home-search .search-form:focus-within {
    border-color: var(--accent);
    box-shadow:
        0 0 0 4px rgba(13, 148, 136, 0.15),
        0 20px 48px rgba(12, 31, 46, 0.12);
    transform: translateY(-2px);
}

.home-search .search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem 1.1rem;
    font-size: 1.05rem;
    font-family: var(--font);
    color: var(--ink);
    background: transparent;
    min-width: 0;
}

.home-search .search-input::placeholder {
    color: #8aa8b8;
}

.home-search .search-btn {
    background: linear-gradient(145deg, #0d9488, #0f766e);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s, transform 0.15s;
}

.home-search .search-btn:hover {
    filter: brightness(1.06);
    transform: scale(1.02);
}

.home-search .search-btn:active {
    transform: scale(0.98);
}

.search-examples {
    margin: 1rem 0 0;
    font-size: 0.88rem;
    color: var(--muted);
    animation: fadeUp 0.6s ease-out 0.4s both;
}

.search-examples a {
    color: var(--accent-deep);
    font-family: var(--mono);
    font-size: 0.82rem;
    margin: 0 0.15rem;
}

.my-ip {
    margin: 1.15rem 0 0;
    font-size: 0.92rem;
    color: var(--muted);
    animation: fadeUp 0.6s ease-out 0.35s both;
}

.my-ip-btn {
    display: inline;
    border: none;
    background: none;
    padding: 0;
    margin: 0 0.15rem;
    font-family: var(--mono);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--accent-deep);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(15, 118, 110, 0.35);
    transition: color 0.15s, text-decoration-color 0.15s;
}

.my-ip-btn:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.my-ip-hint {
    font-size: 0.8rem;
    color: #8aa8b8;
}

.search-wrap {
    position: relative;
    width: 100%;
}

.home-search .search-wrap {
    max-width: 560px;
    margin: 0 auto;
}

.search-history {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(12, 31, 46, 0.12);
    z-index: 200;
    overflow: hidden;
    text-align: left;
}

.results-bar .search-wrap {
    flex: 1;
    min-width: 0;
    max-width: 640px;
}

.results-bar .search-form {
    max-width: none;
}

.search-history-label {
    padding: 0.55rem 1rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.search-history-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    border: none;
    background: none;
    padding: 0.65rem 1rem;
    font-family: var(--font);
    font-size: 0.92rem;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}

.search-history-item:hover,
.search-history-item:focus {
    background: var(--accent-soft);
    outline: none;
}

.search-history-type {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-deep);
    background: var(--accent-soft);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.search-history-value {
    font-family: var(--mono);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.home-footer a { color: var(--muted); }

/* ─── Results layout ─── */
.page-results {
    background:
        radial-gradient(ellipse 60% 30% at 50% 0%, rgba(13, 148, 136, 0.08), transparent 60%),
        var(--surface-2);
}

.results-bar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.results-bar-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.03em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.results-brand:hover {
    color: var(--accent);
    text-decoration: none;
}

.results-brand span { color: var(--accent); }

.results-bar .search-form {
    flex: 1;
    display: flex;
    gap: 0.4rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.3rem;
    max-width: 640px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.results-bar .search-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
    background: #fff;
}

.results-bar .search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    font-family: var(--font);
    color: var(--ink);
    background: transparent;
    min-width: 0;
}

.results-bar .search-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 0.65rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.results-bar .search-btn:hover { background: var(--accent-deep); }

.main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
    animation: fadeUp 0.45s ease-out both;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.cards-grid .card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.cards-grid .card-body {
    flex: 1;
}

.cards-grid .data-table th {
    width: 36%;
}

.card-map,
.card-full {
    margin-top: 1rem;
}

.card-map .map-container {
    height: 220px;
    border-top: none;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.alert-error {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: var(--danger);
}

/* Result header */
.result-header {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.result-header h2 {
    margin: 0.35rem 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    word-break: break-all;
    color: var(--ink);
}

.result-type {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-deep);
    background: var(--accent-soft);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
}

.result-header .subtitle {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Section panels */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card-title {
    margin: 0;
    padding: 0.9rem 1.35rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: linear-gradient(180deg, #f8fcfd, #f0f7f9);
    border-bottom: 1px solid var(--border);
}

.card-body { padding: 0; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table tr:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.data-table th,
.data-table td {
    padding: 0.8rem 1.35rem;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    width: 34%;
    font-weight: 500;
    color: var(--muted);
    font-size: 0.9rem;
}

.data-table td {
    font-size: 0.95rem;
    word-break: break-word;
}

.data-table td.mono {
    font-family: var(--mono);
    font-size: 0.88rem;
}

.map-container {
    height: 280px;
    width: 100%;
    border-top: 1px solid var(--border);
}

.map-attribution {
    padding: 0.5rem 1.35rem;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--surface-2);
    border-top: 1px solid var(--border);
}

.whois-raw {
    margin: 0;
    padding: 1.25rem 1.35rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--ink);
    color: #c8dde8;
    max-height: 520px;
    overflow-y: auto;
}

.whois-meta {
    padding: 0.75rem 1.35rem;
    font-size: 0.85rem;
    color: var(--muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
    font-family: var(--mono);
}

.tag-status {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer p { margin: 0.25rem 0; }

@media (max-width: 800px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .cards-grid .card {
        margin-bottom: 0;
    }
}

@media (max-width: 640px) {
    .results-bar-inner { flex-direction: column; align-items: stretch; gap: 0.65rem; }
    .home-search .search-form,
    .results-bar .search-form { flex-direction: column; }
    .home-search .search-btn,
    .results-bar .search-btn { width: 100%; }
    .data-table th,
    .data-table td {
        display: block;
        width: 100%;
        padding: 0.5rem 1.25rem;
    }
    .data-table th { padding-bottom: 0; font-size: 0.8rem; }
    .data-table td { padding-top: 0.15rem; padding-bottom: 0.75rem; }
}
