/* ==========================================================================
   Cloud India Hub — theme (v2)
   File: public/frontend/css/cih-theme.css
   Load BEFORE hero-search.css.

   THE IDEA
   --------
   Every TLD owns a hue, and that hue follows it everywhere: hero rail,
   search results, cart line items, dashboard. .com is always indigo,
   .shop is always amber. Colour carries information instead of decorating.

   Green is reserved for one meaning only — "this name is available" — and
   appears nowhere else. That is why no CTA is green.

   Scoped to `cih-` classes. Nothing here changes existing markup.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300..800&family=JetBrains+Mono:wght@400;700&display=swap');

[class*="cih-"],
[class*="cih-"]::before,
[class*="cih-"]::after {
    box-sizing: border-box;
}

:root {
    /* --- Type ---------------------------------------------------------
       Bricolage Grotesque is a variable family with optical sizing, so one
       face covers display and body while staying distinct at each size.
       JetBrains Mono is used ONLY for actual domain strings — the subject
       matter is literally typed text, so the monospace is content here,
       not a decorative label style. */
    --cih-font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --cih-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    /* --- Ground -------------------------------------------------------- */
    --cih-ink: #150e2e;
    --cih-muted: #5f5680;
    --cih-faint: #767093;
    --cih-paper: #ffffff;
    --cih-paper-2: #f7f4ff;
    --cih-line: #e2dcf4;

    /* --- Brand --------------------------------------------------------- */
    --cih-brand: #6d28d9;
    --cih-brand-deep: #4c1d95;
    --cih-brand-lift: #8b5cf6;
    --cih-brand-wash: #ede9fe;

    /* --- TLD hues. Assigned once, used site-wide.
           Every one clears 4.5:1 against white (WCAG AA, normal text).
           #ea580c and #0891b2 were the first picks and measured 3.56 and
           3.68 — both failed, so both were darkened. ---------------------- */
    --cih-tld-com: #4338ca;   /* indigo */
    --cih-tld-in: #c81e6b;    /* rose   */
    --cih-tld-coin: #7c3aed;  /* violet */
    --cih-tld-shop: #ea580c;  /* amber  */
    --cih-tld-xyz: #0e7490;   /* cyan   */
    --cih-tld-org: #4f46e5;   /* indigo */

    /* --- Status. Green means available. Nothing else. ------------------ */
    --cih-open: #15803d;
    --cih-open-wash: #dcfce7;
    --cih-taken: #be123c;
    --cih-taken-wash: #ffe4e6;
    --cih-premium: #b45309;
    --cih-premium-wash: #fef3c7;

    --cih-ring: rgba(109, 40, 217, 0.3);
}

/* ==========================================================================
   Primitives
   ========================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.cih-shell {
    width: min(1240px, calc(100% - 2.5rem));
    margin-inline: auto;
}

.cih-section {
    font-family: var(--cih-font);
    padding: clamp(3rem, 7vw, 6rem) 0;
    background: var(--cih-paper);
}

.cih-section--paper2 {
    background: var(--cih-paper-2);
}

/* Deep ground so the TLD hues carry at full saturation. */
.cih-section--deep {
    background:
        radial-gradient(70rem 34rem at 78% -8%, #3a2470 0%, rgba(58, 36, 112, 0) 60%),
        radial-gradient(52rem 28rem at 4% 104%, #2a1a58 0%, rgba(42, 26, 88, 0) 58%),
        var(--cih-ink);
    color: #efeaff;
}

.cih-section--deep .cih-h2 { color: #fff; }
.cih-section--deep .cih-lead,
.cih-section--deep .cih-muted { color: #b8adde; }

/* ==========================================================================
   Type
   ========================================================================== */

.cih-h1,
.cih-h2,
.cih-h3 {
    font-family: var(--cih-font);
    color: var(--cih-ink);
    margin: 0;
    text-wrap: balance;
}

.cih-h1 {
    font-size: clamp(2.5rem, 6.4vw, 4.7rem);
    line-height: 0.97;
    letter-spacing: -0.038em;
    font-weight: 800;
    font-variation-settings: 'opsz' 96;
}

.cih-h2 {
    font-size: clamp(1.8rem, 4vw, 2.9rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 700;
    font-variation-settings: 'opsz' 48;
}

.cih-h3 {
    font-size: clamp(1.05rem, 1.9vw, 1.2rem);
    line-height: 1.25;
    letter-spacing: -0.012em;
    font-weight: 700;
}

.cih-lead {
    font-family: var(--cih-font);
    margin: 1.1rem 0 0;
    max-width: 40ch;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.55;
    font-weight: 400;
    color: var(--cih-muted);
}

.cih-muted { color: var(--cih-muted); }

/* Domain strings. Mono because the subject matter is typed text. */
.cih-domain {
    font-family: var(--cih-mono);
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* Section marker: hue dot plus sentence-case text. Replaces the tracked-out
   all-caps eyebrow, which carries no information and shows up on every
   generated page. */
.cih-marker {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--cih-muted);
}

.cih-marker::before {
    content: '';
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--cih-hue, var(--cih-brand));
    transform: translateY(-0.05em);
}

.cih-section--deep .cih-marker { color: #b8adde; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.cih-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--cih-font);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.012em;
    line-height: 1;
    padding: 1rem 1.75rem;
    min-height: 48px;
    border: 2px solid transparent;
    border-radius: 0.7rem;
    background: var(--cih-hue, var(--cih-brand));
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.12s ease;
}

.cih-btn:hover { filter: brightness(1.1); color: #fff; }
.cih-btn:active { transform: translateY(1px); }
.cih-btn:focus-visible { outline: 3px solid var(--cih-ring); outline-offset: 3px; }

.cih-btn--outline {
    background: transparent;
    border-color: currentColor;
    color: var(--cih-hue, var(--cih-brand));
}

.cih-btn--outline:hover {
    background: var(--cih-hue, var(--cih-brand));
    color: #fff;
    filter: none;
}

.cih-btn--block { width: 100%; align-self: stretch; }

.cih-btn--sm {
    padding: 0.7rem 1.15rem;
    font-size: 0.9375rem;
    min-height: 44px;
}

.cih-btn[aria-busy="true"] { pointer-events: none; opacity: 0.72; }

.cih-btn__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cih-spin 0.7s linear infinite;
}

.cih-btn[aria-busy="true"] .cih-btn__spinner { display: block; }
.cih-btn[aria-busy="true"] .cih-btn__label { display: none; }

@keyframes cih-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   TLD rail — the signature element.
   Flat saturated blocks. No shadow, no matching-radius card kit.
   ========================================================================== */

.cih-rail {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.cih-rail > li { display: flex; }

.cih-tld {
    position: relative;
    /* Fill the grid cell so every tile is the same height and the renewal
       lines align across the row. */
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.4rem 1.3rem 1.3rem;
    border-radius: 0.9rem;
    background: var(--cih-hue);
    color: #fff;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.16s ease;
}

.cih-tld:hover { transform: translateY(-4px); color: #fff; }
.cih-tld:focus-visible { outline: 3px solid var(--cih-ink); outline-offset: 3px; }

/* Oversized ghost extension bled off the corner. Gives each tile its own
   character without stacking on another decorative layer. */
.cih-tld::after {
    content: attr(data-ext);
    position: absolute;
    right: -0.3em;
    bottom: -0.4em;
    font-family: var(--cih-mono);
    font-size: 3.1rem;
    font-weight: 700;
    letter-spacing: -0.06em;
    color: rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.cih-tld__ext {
    font-family: var(--cih-mono);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.045em;
}

.cih-tld__use {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin: 0.1rem 0 0.75rem;
}

.cih-tld__price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
}

.cih-tld__was {
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: line-through;
}

/* Renewal and term conditions. Structural, not optional: a headline promo
   price with the term hidden until checkout is the "drip pricing" pattern
   named in the CCPA dark-patterns guidelines. */
.cih-tld__terms {
    /* Pushes terms to the bottom so the renewal line sits on one baseline
       across the whole rail. */
    margin: auto 0 0;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.24);
    font-size: 0.75rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
}

.cih-tld__renewal { display: block; font-weight: 700; color: #fff; }

.cih-tld__flag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #fff;
    color: var(--cih-hue);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 0.35rem;
}

/* ==========================================================================
   Result rows — ruled rows, deliberately not another card kit.
   ========================================================================== */

.cih-results {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    border-top: 2px solid var(--cih-ink);
}

.cih-result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.25rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--cih-line);
}

.cih-result__name {
    font-family: var(--cih-mono);
    font-size: clamp(1.05rem, 2.4vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    color: var(--cih-ink);
}

.cih-result__price {
    margin-left: auto;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cih-ink);
    white-space: nowrap;
}

.cih-result__note {
    flex: 1 0 100%;
    font-size: 0.8125rem;
    color: var(--cih-muted);
}

.cih-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 0.35rem;
}

.cih-tag--open { background: var(--cih-open-wash); color: var(--cih-open); }
.cih-tag--taken { background: var(--cih-taken-wash); color: var(--cih-taken); }
.cih-tag--premium { background: var(--cih-premium-wash); color: var(--cih-premium); }

/* ==========================================================================
   Feature list — a coloured rule, no box, no shadow. A different treatment
   from the TLD tiles because it is a different kind of content.
   ========================================================================== */

.cih-features {
    display: grid;
    gap: 2rem 2.5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    list-style: none;
    margin: 2.75rem 0 0;
    padding: 0;
}

.cih-feature {
    padding-top: 1.1rem;
    border-top: 3px solid var(--cih-hue, var(--cih-brand));
}

.cih-feature__title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.018em;
    color: inherit;
    margin: 0 0 0.4rem;
}

.cih-feature__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--cih-muted);
    max-width: 34ch;
}

.cih-section--deep .cih-feature__text { color: #b8adde; }

/* ==========================================================================
   Price table (used on the deep section)
   ========================================================================== */

.cih-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 2rem;
}

.cih-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 34rem;
    font-family: var(--cih-font);
}

.cih-table th,
.cih-table td {
    padding: 1rem 1.1rem;
    text-align: left;
    font-size: 0.9375rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.cih-table th {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #b8adde;
    border-bottom-color: rgba(255, 255, 255, 0.24);
}

.cih-table td { color: #efeaff; font-weight: 500; }
.cih-table .cih-domain { color: #fff; font-size: 1rem; }

/* Hue dot ties each row back to its TLD. */
.cih-table__ext { display: inline-flex; align-items: center; gap: 0.6rem; }

.cih-table__ext::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--cih-hue);
    flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
    .cih-tld,
    .cih-btn { transition: none; }
    .cih-tld:hover,
    .cih-btn:active { transform: none; }
    .cih-btn__spinner { animation: none; }
}
