/* Custom components (the compiled Tailwind file cannot be extended without a build step) */
:root {
    --hx-surface-from: var(--milkWhite);
    --hx-surface-to: var(--seashell);
    --hx-border: var(--flasWhite);
    --hx-text: var(--darkGray);
    --hx-muted: var(--smokeGray);
    --hx-chip: rgba(0, 0, 0, .04);
}
html.dark {
    --hx-surface-from: var(--metalBlack);
    --hx-surface-to: var(--oilBlack);
    --hx-border: var(--flasBlack);
    --hx-text: var(--pastelGrey);
    --hx-muted: #9aa0ab;
    --hx-chip: rgba(255, 255, 255, .06);
}

.hx-surface {
    background: linear-gradient(to bottom, var(--hx-surface-from), var(--hx-surface-to));
    border: 1px solid var(--hx-border);
    border-radius: 1rem;
}
.hx-title { color: var(--hx-text); font-weight: 600; }
.hx-muted { color: var(--hx-muted); }

.hx-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .65rem 1.5rem; border-radius: 9999px; font-weight: 600;
    color: var(--hx-text);
    background: linear-gradient(to bottom, var(--hx-surface-from), var(--hx-surface-to));
    border: 1px solid var(--hx-border);
    transition: background .2s, color .2s, transform .2s;
    cursor: pointer;
}
.hx-btn:hover { background: var(--hx-text); color: var(--hx-surface-from); }
.hx-btn-solid { background: var(--hx-text); color: var(--hx-surface-from); }
.hx-btn-solid:hover { opacity: .85; background: var(--hx-text); color: var(--hx-surface-from); }

.hx-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .25rem .8rem; border-radius: 9999px; font-size: .8rem;
    color: var(--hx-text); background: var(--hx-chip); border: 1px solid var(--hx-border);
}
.hx-chip-btn { cursor: pointer; transition: background .2s, color .2s; font-size: .9rem; padding: .4rem 1rem; }
.hx-chip-btn.is-active, .hx-chip-btn:hover { background: var(--hx-text); color: var(--hx-surface-from); }

.hx-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .hx-grid-2, .hx-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .hx-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.hx-grid-tools { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 480px) { .hx-grid-tools { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .hx-grid-tools.wide { grid-template-columns: repeat(3, 1fr); } }

.hx-tool {
    display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem;
    border-radius: .75rem; border: 1px solid var(--hx-border); color: var(--hx-text);
    background: linear-gradient(to bottom, var(--hx-surface-from), var(--hx-surface-to));
}
.hx-tool i { font-size: 1.4rem; width: 1.75rem; text-align: center; flex: none; }
.hx-tool small { display: block; color: var(--hx-muted); line-height: 1.25; }
.hx-tool strong { font-weight: 600; line-height: 1.25; }

/* Project cards */
.hx-card {
    display: flex; flex-direction: column; overflow: hidden; text-align: left; width: 100%;
    padding: .5rem; cursor: pointer; transition: transform .25s, box-shadow .25s;
}
.hx-card:hover, .hx-card:focus-visible { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0, 0, 0, .08); outline: none; }
.hx-card-media {
    position: relative; aspect-ratio: 16 / 10; border-radius: .75rem; overflow: hidden;
    display: grid; place-items: center; font-size: 3rem; color: var(--hx-muted);
    background: linear-gradient(135deg, var(--hx-chip), transparent), var(--hx-surface-to);
}
.hx-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hx-card:hover .hx-card-media img { transform: scale(1.06); }
.hx-card-body { padding: 1rem .75rem .75rem; display: flex; flex-direction: column; flex: 1; gap: .5rem; }
.hx-card-body h3 { font-size: 1.25rem; font-weight: 700; color: var(--hx-text); }
.hx-card-body p { color: var(--hx-muted); }
.hx-card-foot { margin-top: auto; padding-top: .5rem; display: flex; justify-content: space-between; align-items: center; color: var(--hx-text); font-weight: 600; }

/* Modal */
.hx-modal-backdrop {
    position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .6);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.hx-modal {
    width: 100%; max-width: 46rem; max-height: calc(100vh - 2rem); overflow-y: auto;
    position: relative; padding: .75rem;
    background: linear-gradient(to bottom, var(--hx-surface-from), var(--hx-surface-to));
    border: 1px solid var(--hx-border); border-radius: 1.25rem; box-shadow: 0 25px 60px rgba(0, 0, 0, .3);
}
.hx-modal-close {
    position: absolute; top: 1rem; right: 1rem; z-index: 2; width: 2.5rem; height: 2.5rem;
    border-radius: 9999px; display: grid; place-items: center; cursor: pointer;
    background: var(--hx-surface-from); color: var(--hx-text); border: 1px solid var(--hx-border);
}
.hx-modal-body { padding: 1.25rem 1rem 1rem; }
.hx-modal-body h2 { font-size: 1.75rem; font-weight: 700; color: var(--hx-text); }
.hx-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.hx-list li { position: relative; padding-left: 1.5rem; margin: .35rem 0; }
.hx-list li::before { content: "\f00c"; font-family: "Font Awesome 5 Pro"; font-weight: 300; position: absolute; left: 0; color: var(--hx-text); }

/* Timeline entries */
.hx-entry { display: flex; gap: 1.25rem; }
.hx-entry + .hx-entry { margin-top: 2rem; }
.hx-entry-icon {
    flex: none; width: 4rem; height: 4rem; border-radius: 9999px; display: grid; place-items: center;
    font-size: 1.4rem; color: var(--hx-text); border: 1px solid var(--hx-border);
    background: linear-gradient(to bottom, var(--hx-surface-from), var(--hx-surface-to));
}

/* Service rows & misc */
.hx-service { scroll-margin-top: 9rem; padding: 1.5rem; }
@media (min-width: 1024px) { .hx-service { padding: 2.5rem; } }
.hx-service-icon { font-size: 2rem; color: var(--hx-text); }
.hx-anchor { scroll-margin-top: 8rem; }
.hx-footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; }
.hx-footer-nav a { color: var(--hx-text); }
.hx-footer-nav a:hover { text-decoration: underline; }
.hx-empty { padding: 2rem; text-align: center; color: var(--hx-muted); }
[x-cloak] { display: none !important; }
.hx-thumb { width: 100%; aspect-ratio: 1200 / 627; object-fit: cover; border-radius: .75rem; background: var(--hx-chip); }

/* Home: services mini-grid */
.hx-svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.hx-svc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; text-align: center; padding: 1.5rem .5rem; color: var(--hx-text); transition: background .2s; }
.hx-svc i { font-size: 2rem; }
.hx-svc:hover { background: var(--hx-chip); }
.hx-svc:nth-of-type(n+3) { border-top: 1px solid var(--hx-border); }
.hx-svc:nth-of-type(even) { border-left: 1px solid var(--hx-border); }
.hx-svc:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }
a.hx-tool { transition: background .2s, transform .2s; }
a.hx-tool:hover { background: var(--hx-chip); }
.hx-card-body > .hx-chip { align-self: flex-start; }
.hx-card-body > .flex { width: 100%; }

/* Home: tools tiles (icon above name) */
.hx-tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.hx-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .75rem; text-align: center; padding: 1rem .25rem; border-radius: .75rem; color: var(--hx-text); transition: background .2s; }
.hx-tile:hover { background: var(--hx-chip); }
.hx-tile i { font-size: 2.75rem; height: 3rem; line-height: 3rem; }
.hx-tile p { font-size: .85rem; line-height: 1.25; }

/* Phone mockup (project cards and modal) */
.hx-card-media.is-phone { align-items: flex-start; padding-top: 1.25rem; background: linear-gradient(135deg, #e6efff, #f3ecff); }
html.dark .hx-card-media.is-phone { background: linear-gradient(135deg, #1b2440, #271d3d); }
.hx-phone { width: 34%; max-width: 11rem; flex: none; background: #0b0b0f; padding: .35rem; border-radius: 1.5rem 1.5rem 0 0; box-shadow: 0 18px 40px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .12); position: relative; }
.hx-phone::before { content: ""; position: absolute; top: .5rem; left: 50%; transform: translateX(-50%); width: 28%; height: .3rem; border-radius: 9999px; background: #0b0b0f; z-index: 2; }
.hx-phone-screen { aspect-ratio: 448 / 921; overflow: hidden; border-radius: 1.2rem 1.2rem 0 0; background: #fff; }
.hx-phone-screen img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transform: none !important; }
.hx-card-media.is-phone.is-modal { padding-top: 1.5rem; aspect-ratio: 16 / 9 !important; }
.hx-card-media.is-phone.is-modal .hx-phone { width: 24%; max-width: 12rem; }
.hx-card-media.is-phone img { transition: none; }

/* Confidential work cards (not clickable) */
.hx-work { align-items: flex-start; padding: 1.1rem 1.25rem; cursor: default; }
.hx-work i { font-size: 1.6rem; }
.hx-work small { margin-top: .25rem; }

/* Browser window frame for projects that have a live link */
.hx-browser { border: 1px solid var(--hx-border); border-radius: .75rem; overflow: hidden; background: var(--hx-surface-to); }
.hx-browser-bar { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; background: var(--hx-chip); border-bottom: 1px solid var(--hx-border); }
.hx-dots { display: inline-flex; gap: .3rem; flex: none; }
.hx-dots i { width: .6rem; height: .6rem; border-radius: 9999px; background: #ff5f57; display: block; }
.hx-dots i:nth-child(2) { background: #febc2e; }
.hx-dots i:nth-child(3) { background: #28c840; }
.hx-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .2rem .75rem; border-radius: 9999px; font-size: .75rem; line-height: 1.3; color: var(--hx-muted); background: var(--hx-surface-from); border: 1px solid var(--hx-border); }
.hx-go { flex: none; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 9999px; font-size: .8rem; color: var(--hx-text); background: var(--hx-surface-from); border: 1px solid var(--hx-border); transition: background .2s, color .2s; }
.hx-go:hover { background: var(--hx-text); color: var(--hx-surface-from); }
.hx-browser .hx-card-media { border-radius: 0; }
.hx-count { font-size: .7rem; opacity: .65; }
.hx-chip-btn.is-active .hx-count { opacity: .8; }
.hx-card[role="button"] { text-align: left; }

/* Modal: keep the close button clear of the browser bar */
.hx-modal { padding-top: 3.5rem; }
.hx-modal-close { top: .6rem; right: .75rem; }

/* GitHub contribution calendar */
.hx-cal { --c0: #ebedf0; --c1: #9be9a8; --c2: #40c463; --c3: #30a14e; --c4: #216e39; --gap: 3px; }
html.dark .hx-cal { --c0: #2b2f33; --c1: #0e4429; --c2: #006d32; --c3: #26a641; --c4: #39d353; }
.hx-cal-status { padding: 2rem 0; text-align: center; color: var(--hx-muted); }
.hx-cal-status a { text-decoration: underline; }
.hx-cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.hx-cal-summary { color: var(--hx-muted); font-size: 1rem; }
.hx-cal-summary strong { color: var(--hx-text); font-size: 1.75rem; font-weight: 700; margin-right: .15rem; }
.hx-cal-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.hx-cal-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
@media (min-width: 768px) { .hx-cal-stats { grid-template-columns: repeat(4, 1fr); } }
.hx-cal-stat { padding: .75rem 1rem; border-radius: .75rem; border: 1px solid var(--hx-border); background: var(--hx-chip); }
.hx-cal-stat span { display: block; font-size: .75rem; color: var(--hx-muted); }
.hx-cal-stat strong { display: block; color: var(--hx-text); font-weight: 600; font-size: .95rem; line-height: 1.3; margin-top: .15rem; }
.hx-cal-scroll { overflow-x: auto; padding: .25rem 0 .75rem; }
.hx-cal-wrap { min-width: calc(var(--weeks) * 14px + 3rem); }
.hx-cal-body { display: flex; gap: .5rem; }
.hx-cal-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: var(--gap); margin-top: 1.5rem; font-size: .7rem; color: var(--hx-muted); width: 2rem; flex: none; }
.hx-cal-days span { display: flex; align-items: center; }
.hx-cal-right { flex: 1; min-width: 0; }
.hx-cal-months { display: grid; grid-template-columns: repeat(var(--weeks), minmax(11px, 1fr)); gap: var(--gap); height: 1.5rem; font-size: .75rem; color: var(--hx-muted); }
.hx-cal-months span { white-space: nowrap; }
.hx-cal-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-template-columns: repeat(var(--weeks), minmax(11px, 1fr)); gap: var(--gap); }
.hx-cal-cell { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--c0); }
.hx-cal-cell.l1 { background: var(--c1); }
.hx-cal-cell.l2 { background: var(--c2); }
.hx-cal-cell.l3 { background: var(--c3); }
.hx-cal-cell.l4 { background: var(--c4); }
.hx-cal-cell.empty { background: transparent; }
.hx-cal-grid .hx-cal-cell:not(.empty):hover { outline: 2px solid var(--hx-text); outline-offset: -1px; }
.hx-cal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .75rem; font-size: .8rem; color: var(--hx-muted); }
.hx-cal-legend { display: flex; align-items: center; gap: 4px; }
.hx-cal-legend .hx-cal-cell { width: 12px; height: 12px; aspect-ratio: auto; }
.hx-cal-legend span:first-child { margin-right: .25rem; }
.hx-cal-legend span:last-child { margin-left: .25rem; }
.hx-cal-link { color: var(--hx-text); font-weight: 600; }
.hx-cal-link:hover { text-decoration: underline; }
.hx-cal-tip { position: fixed; z-index: 100000; pointer-events: none; opacity: 0; transform: translate(-50%, -100%); padding: .35rem .65rem; border-radius: .5rem; background: #1f2328; color: #fff; font-size: .75rem; white-space: nowrap; transition: opacity .12s; }
