/* ==========================================================
   Hacker Smacker — Profile Pages
   A warm, bookish ledger of friends and foes.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --hs-parchment:     #E5DFCC;
    --hs-parchment-dk:  #D8D0B8;
    --hs-cream:         #F7F5EF;
    --hs-linen:         #FAFAF6;
    --hs-ink:           #2C2416;
    --hs-ink-light:     #5C5444;
    --hs-ink-muted:     #8A8272;
    --hs-rule:          #DDD8C8;
    --hs-rule-light:    #EEEADE;

    --hs-friend:        #4F934D;
    --hs-friend-light:  #54AB54;
    --hs-friend-bg:     #F0F7EF;
    --hs-friend-border: #7FBB7D;
    --hs-friend-glow:   rgba(79, 147, 77, 0.08);

    --hs-foe:           #AC473B;
    --hs-foe-light:     #C2483B;
    --hs-foe-bg:        #FBF3F2;
    --hs-foe-border:    #D4918A;
    --hs-foe-glow:      rgba(172, 71, 59, 0.06);

    --hs-link:          #96592A;
    --hs-link-hover:    #7A4520;

    --radius-sm:        3px;
    --radius-md:        5px;
}

/* ---- Reset ---- */

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* ---- Page background ---- */

body {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    color: var(--hs-ink);
    line-height: 1.55;
    background-color: var(--hs-cream);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(229, 223, 204, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(229, 223, 204, 0.25) 0%, transparent 50%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--hs-link);
    text-decoration: none;
    border-bottom: 1px solid rgba(150, 89, 42, 0.3);
    transition: color 0.15s, border-color 0.15s;
}
a:hover {
    color: var(--hs-link-hover);
    border-bottom-color: var(--hs-link-hover);
}

/* ---- Site header (shared with landing) ---- */

.HS-top {
    background-color: var(--hs-parchment);
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 40%),
        linear-gradient(0deg, rgba(0,0,0,0.03) 0%, transparent 20%);
    padding: 36px 24px 28px;
    text-align: center;
    position: relative;
}

.HS-top::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--hs-parchment-dk);
}

.HS-top a {
    border-bottom: none;
}

.HS-logo {
    max-width: 360px;
    margin: 0 auto;
}

.HS-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--hs-ink-light);
    margin-top: 10px;
}

/* ---- Profile container ---- */

.HS-profile {
    max-width: 680px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

/* ---- Profile header ---- */

.HS-profile-header {
    padding-bottom: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--hs-rule);
}

.HS-profile-header h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2em;
    font-weight: 500;
    color: var(--hs-ink);
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    line-height: 1.2;
}

.HS-profile-meta {
    font-size: 0.88em;
    color: var(--hs-ink-muted);
    margin: 0;
}

/* ---- Owner controls ---- */

.HS-profile-controls {
    margin-top: 14px;
}

.HS-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82em;
    color: var(--hs-ink-light);
    padding: 5px 10px;
    background: var(--hs-linen);
    border: 1px solid var(--hs-rule);
    border-radius: var(--radius-md);
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.HS-toggle-label:hover {
    background: var(--hs-cream);
    border-color: var(--hs-parchment-dk);
}

.HS-toggle-label input[type="checkbox"] {
    accent-color: var(--hs-friend);
    width: 14px;
    height: 14px;
    margin: 0;
}

/* ---- Section titles ---- */

.HS-profile-section {
    margin-bottom: 32px;
}

.HS-section-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.15em;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hs-rule-light);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.HS-friends-title {
    color: var(--hs-friend);
}

.HS-foes-title {
    color: var(--hs-foe);
}

.HS-count {
    font-weight: 300;
    font-size: 0.82em;
    color: var(--hs-ink-muted);
}

/* ---- Pill orbs (matching the extension) ---- */

.HS-rating-orb {
    display: inline-block;
    width: 18px;
    height: 8px;
    border-radius: 9px;
    border: 1px solid #8A8B7C;
    flex-shrink: 0;
}

.HS-orb-friend {
    background: linear-gradient(to top, #4F934D 16%, #54AB54 84%);
}

.HS-orb-foe {
    background: linear-gradient(to top, #AC473B 16%, #C2483B 84%);
}

/* ---- Rating cards ---- */

.HS-rating-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.HS-rating-card {
    padding: 10px 14px;
    border-left: 3px solid var(--hs-rule);
    background: var(--hs-linen);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transition: background 0.15s, box-shadow 0.2s;
}

.HS-rating-card:hover {
    box-shadow: 0 1px 4px rgba(44, 36, 22, 0.06);
}

.HS-rating-card.HS-rating-friend {
    border-left-color: var(--hs-friend-border);
    background: var(--hs-friend-bg);
}

.HS-rating-card.HS-rating-friend:hover {
    box-shadow: 0 1px 4px var(--hs-friend-glow);
}

.HS-rating-card.HS-rating-foe {
    border-left-color: var(--hs-foe-border);
    background: var(--hs-foe-bg);
}

.HS-rating-card.HS-rating-foe:hover {
    box-shadow: 0 1px 4px var(--hs-foe-glow);
}

.HS-rating-card.HS-no-context {
    opacity: 0.7;
}

.HS-rating-card.HS-no-context:hover {
    opacity: 0.85;
}

/* ---- Card header ---- */

.HS-rating-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.HS-rated-user {
    font-family: 'JetBrains Mono', 'Menlo', monospace;
    font-size: 0.88em;
    font-weight: 500;
    color: var(--hs-ink);
    border-bottom: none;
    letter-spacing: -0.01em;
}

.HS-rated-user:hover {
    color: var(--hs-link-hover);
    border-bottom: none;
}

.HS-profile-link {
    font-size: 0.75em;
    color: var(--hs-ink-muted);
    border-bottom: none;
}

.HS-profile-link:hover {
    color: var(--hs-link);
    border-bottom: none;
}

.HS-rating-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72em;
    color: var(--hs-ink-muted);
    margin-left: auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---- Rating context ---- */

.HS-rating-context {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--hs-rule-light);
}

.HS-rating-thread {
    font-size: 0.82em;
    color: var(--hs-ink-muted);
    margin-bottom: 6px;
}

.HS-rating-thread a {
    color: var(--hs-ink-light);
    border-bottom: 1px solid var(--hs-rule);
}

.HS-rating-thread a:hover {
    color: var(--hs-link);
    border-bottom-color: var(--hs-link);
}

.HS-rating-comment {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.88em;
    font-style: italic;
    line-height: 1.55;
    color: var(--hs-ink-light);
    margin: 6px 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-left: 2px solid var(--hs-parchment-dk);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    max-height: 80px;
    overflow: hidden;
    position: relative;
}

/* Fade-out for truncated comments */
.HS-rating-comment::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(250, 250, 246, 0.85) 100%);
    pointer-events: none;
}

.HS-rating-friend .HS-rating-comment::after {
    background: linear-gradient(to bottom, rgba(240, 247, 239, 0) 0%, rgba(240, 247, 239, 0.9) 100%);
}

.HS-rating-foe .HS-rating-comment::after {
    background: linear-gradient(to bottom, rgba(251, 243, 242, 0) 0%, rgba(251, 243, 242, 0.9) 100%);
}

.HS-rating-permalink {
    font-size: 0.78em;
    color: var(--hs-ink-muted);
    border-bottom: none;
    transition: color 0.15s;
}

.HS-rating-permalink:hover {
    color: var(--hs-link);
    border-bottom: none;
}

/* ---- Private message ---- */

.HS-private-message {
    text-align: center;
    padding: 48px 24px;
    color: var(--hs-ink-muted);
}

.HS-private-message h3 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--hs-ink);
    margin: 0 0 10px;
}

.HS-private-message p {
    font-size: 0.92em;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---- Empty state ---- */

.HS-empty {
    font-style: italic;
    color: var(--hs-ink-muted);
    padding: 12px 0;
    font-size: 0.88em;
}

/* ---- Footer ---- */

.HS-footer {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 24px;
    border-top: 1px solid var(--hs-rule);
    font-size: 0.82em;
    color: var(--hs-ink-muted);
}

.HS-footer p {
    margin: 0;
}

/* ---- Floating pixel doodles ---- */

.HS-doodle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.HS-doodle-sprite {
    position: absolute;
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Content sits above doodles */
.HS-top,
.HS-profile,
.HS-footer {
    position: relative;
    z-index: 1;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .HS-top {
        padding: 28px 20px 22px;
    }

    .HS-logo {
        max-width: 260px;
    }

    .HS-profile {
        padding: 20px 16px 36px;
    }

    .HS-profile-header h2 {
        font-size: 1.6em;
    }

    .HS-rating-card {
        padding: 8px 12px;
    }

    .HS-rating-card-header {
        gap: 6px;
    }

    .HS-rating-time {
        margin-left: 0;
        width: 100%;
        order: 99;
        margin-top: 2px;
    }

    .HS-rating-comment {
        font-size: 0.84em;
    }
}
