/* =====================================================
   Ehm Versicherungen · Hub
   Modern green link-hub design
   ===================================================== */

/* ---------- Tokens ---------- */
:root {
    --green-50:  #ecfdf5;
    --green-100: #d1fae5;
    --green-200: #a7f3d0;
    --green-300: #6ee7b7;
    --green-400: #34d399;
    --green-500: #10b981;
    --green-600: #059669;
    --green-700: #047857;
    --green-800: #065f46;
    --green-900: #064e3b;

    --bg:        #f3faf6;
    --bg-deep:   #e7f5ee;
    --surface:   rgba(255, 255, 255, .65);
    --surface-2: rgba(255, 255, 255, .85);
    --border:    rgba(6, 95, 70, .10);
    --border-2:  rgba(6, 95, 70, .18);

    --ink:       #04221a;
    --ink-soft:  #2c4a3e;
    --ink-mute:  #5d7368;

    --shadow-card: 0 1px 2px rgba(6, 95, 70, .04),
                   0 8px 24px -12px rgba(6, 95, 70, .15),
                   0 2px 6px -2px rgba(6, 95, 70, .08);
    --shadow-hover: 0 30px 60px -20px rgba(6, 95, 70, .35),
                    0 12px 24px -12px rgba(6, 95, 70, .2);

    --grad-primary: linear-gradient(135deg, #10b981 0%, #059669 50%, #064e3b 100%);
    --grad-text:    linear-gradient(135deg, #047857, #10b981, #34d399);

    --radius-sm: 12px;
    --radius:    18px;
    --radius-lg: 26px;
    --radius-xl: 34px;

    --ease: cubic-bezier(.16, 1, .3, 1);
}

[data-theme="dark"] {
    --bg:        #04140e;
    --bg-deep:   #061a13;
    --surface:   rgba(15, 32, 24, .65);
    --surface-2: rgba(20, 40, 30, .8);
    --border:    rgba(110, 231, 183, .08);
    --border-2:  rgba(110, 231, 183, .18);

    --ink:       #e8f5ee;
    --ink-soft:  #b0c8bc;
    --ink-mute:  #7c948a;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, .4),
                   0 12px 30px -10px rgba(0, 0, 0, .6);
    --shadow-hover: 0 30px 60px -20px rgba(0, 0, 0, .7),
                    0 0 0 1px rgba(110, 231, 183, .15);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -.005em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font-family: inherit; }
svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Animated mesh background ---------- */
.mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(800px 600px at 100% 0%, rgba(110, 231, 183, .25), transparent 60%),
        radial-gradient(900px 700px at 0% 100%, rgba(16, 185, 129, .18), transparent 60%),
        var(--bg);
}
.mesh .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
    will-change: transform;
}
.orb-a {
    width: 540px; height: 540px;
    background: radial-gradient(circle, #34d399 0%, transparent 70%);
    top: -120px; left: -100px;
    animation: float-a 22s ease-in-out infinite;
}
.orb-b {
    width: 460px; height: 460px;
    background: radial-gradient(circle, #6ee7b7 0%, transparent 70%);
    bottom: -160px; right: -80px;
    animation: float-b 28s ease-in-out infinite;
}
.orb-c {
    width: 380px; height: 380px;
    background: radial-gradient(circle, #10b981 0%, transparent 70%);
    top: 40%; left: 55%;
    opacity: .25;
    animation: float-c 26s ease-in-out infinite;
}
@keyframes float-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, 80px) scale(1.08); }
    66% { transform: translate(-40px, 40px) scale(.95); }
}
@keyframes float-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-80px, -60px) scale(1.1); }
}
@keyframes float-c {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-100px, 80px); }
}
[data-theme="dark"] .mesh {
    background:
        radial-gradient(800px 600px at 100% 0%, rgba(16, 185, 129, .14), transparent 60%),
        radial-gradient(900px 700px at 0% 100%, rgba(4, 120, 87, .18), transparent 60%),
        var(--bg);
}
[data-theme="dark"] .mesh .orb { opacity: .25; }

.grain {
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: .035;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* ---------- Shell ---------- */
.shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 32px 60px;
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 60px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--grad-primary);
    color: white;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 24px -10px rgba(16, 185, 129, .65),
                inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.02em;
}
.brand-text em {
    font-style: normal;
    font-size: 11.5px;
    color: var(--ink-mute);
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    transition: all .25s var(--ease);
}
.theme-toggle:hover {
    color: var(--green-600);
    transform: translateY(-1px);
    border-color: var(--green-300);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun  { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
[data-theme="dark"] .theme-toggle:hover { color: var(--green-300); }

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    margin-bottom: 56px;
    animation: rise .9s var(--ease);
}
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 12px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 999px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-soft);
    letter-spacing: .01em;
    margin-bottom: 24px;
}
.kicker .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .18);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); }
    50%      { box-shadow: 0 0 0 8px rgba(16, 185, 129, .05); }
}

.title {
    font-size: clamp(42px, 6.4vw, 78px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.02;
    margin: 0 0 22px;
}
.title .line { display: block; }
.title .serif {
    font-family: 'Instrument Serif', 'Times New Roman', serif;
    font-weight: 400;
    font-style: italic;
    letter-spacing: -.01em;
}
.title .grad {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.lede {
    font-size: 17px;
    color: var(--ink-mute);
    margin: 0 auto;
    max-width: 540px;
}

/* ---------- Bento Grid ---------- */
.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
    margin-bottom: 60px;
}
.card {
    grid-column: span 2;
    position: relative;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform .4s var(--ease),
                box-shadow .4s var(--ease),
                border-color .3s var(--ease);
    isolation: isolate;
}
.card-wide { grid-column: span 3; }
.card:nth-child(1), .card:nth-child(2) { grid-column: span 3; }

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--card-glow, radial-gradient(600px 300px at 0% 0%, rgba(16, 185, 129, .14), transparent 60%));
    opacity: 0;
    transition: opacity .5s var(--ease);
    pointer-events: none;
    z-index: -1;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--green-300);
}
.card:hover::before { opacity: 1; }

.card-inner {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 28px 28px 24px;
    height: 100%;
    min-height: 230px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--icon-bg, var(--grad-primary));
    color: white;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 24px -10px rgba(16, 185, 129, .55),
                inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .5s var(--ease);
}
.card-icon svg { width: 22px; height: 22px; }
.card:hover .card-icon { transform: rotate(-8deg) scale(1.06); }

.card-host {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-mute);
    padding: 5px 10px;
    border: 1px dashed var(--border-2);
    border-radius: 999px;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.card-body { flex: 1; }
.card-body h3 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 6px;
    line-height: 1.15;
}
.card-wide .card-body h3 { font-size: 26px; }
.card-body p {
    font-size: 14.5px;
    color: var(--ink-mute);
    margin: 0;
    line-height: 1.55;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
}
.open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--green-700);
    transition: gap .3s var(--ease);
}
.open svg { width: 14px; height: 14px; }
.card:hover .open { gap: 12px; }
[data-theme="dark"] .open { color: var(--green-300); }

.badge-featured {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 6px 14px -6px rgba(16, 185, 129, .55);
}

/* Card-specific accent gradients */
.card-mp { --icon-bg: linear-gradient(135deg, #10b981, #047857); --card-glow: radial-gradient(700px 320px at 100% 0%, rgba(16, 185, 129, .18), transparent 60%); }
.card-wv { --icon-bg: linear-gradient(135deg, #34d399, #059669); --card-glow: radial-gradient(700px 320px at 0% 0%, rgba(52, 211, 153, .18), transparent 60%); }
.card-cl {
    --icon-bg: linear-gradient(135deg, #047857, #064e3b);
    --card-glow: radial-gradient(900px 400px at 50% 0%, rgba(4, 120, 87, .22), transparent 60%);
    background: linear-gradient(135deg, var(--surface-2), rgba(16, 185, 129, .08));
}
.card-rs { --icon-bg: linear-gradient(135deg, #14b8a6, #0f766e); --card-glow: radial-gradient(700px 320px at 100% 100%, rgba(20, 184, 166, .18), transparent 60%); }
.card-gc { --icon-bg: linear-gradient(135deg, #84cc16, #4d7c0f); --card-glow: radial-gradient(700px 320px at 0% 100%, rgba(132, 204, 22, .18), transparent 60%); }

/* ---------- Footer ---------- */
.foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--ink-mute);
    font-size: 12.5px;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.dot-sep {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--ink-mute);
    opacity: .5;
}

/* ---------- Animations ---------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card { animation: cardIn .7s var(--ease) backwards; }
.card:nth-child(1) { animation-delay: .05s; }
.card:nth-child(2) { animation-delay: .12s; }
.card:nth-child(3) { animation-delay: .19s; }
.card:nth-child(4) { animation-delay: .26s; }
.card:nth-child(5) { animation-delay: .33s; }
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .bento { grid-template-columns: repeat(2, 1fr); }
    .card, .card-wide { grid-column: span 1; }
    .card:nth-child(1), .card:nth-child(2) { grid-column: span 1; }
    .card-cl { grid-column: span 2; }
}
@media (max-width: 640px) {
    .shell { padding: 20px 18px 40px; }
    .topbar { margin-bottom: 36px; }
    .hero { margin-bottom: 40px; }
    .title { font-size: clamp(34px, 9vw, 50px); }
    .bento { grid-template-columns: 1fr; gap: 14px; }
    .card, .card-wide, .card-cl { grid-column: span 1; }
    .card-inner { padding: 22px; min-height: 200px; }
    .card-body h3, .card-wide .card-body h3 { font-size: 20px; }
    .card-host { max-width: 50%; font-size: 11px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .orb { animation: none !important; }
}
