/* -------------- Tokens -------------- */
@property --h {
    syntax: '<number>';
    inherits: true;
    initial-value: 20;
}

@property --bg-gradient-1 {
    syntax: '<color>';
    inherits: true;
    initial-value: oklch(0.30 0.10 20);
}

@property --bg-gradient-2 {
    syntax: '<color>';
    inherits: true;
    initial-value: oklch(0.22 0.07 75);
}

@property --bg-gradient-3 {
    syntax: '<color>';
    inherits: true;
    initial-value: oklch(0.13 0.03 20);
}


/* NAMING SCHEME:

        -container: things that sit on the page (like the island)
        -high: container high, things sitting on top of containers (ligher)
        -var: variable, changes
        -fixed: constant

        -on: text or icons sitting on top of that surface

        -r: radius
        -t: time (timers)

        -xs, -sm, -md, -lg, -xl: taken from clothing sizes (naming)
        -full: as round as possible

    */
html[data-mode="dark"] {

    /* Surfaces */
    --surface: oklch(0.165 0.024 var(--h));
    --surface-container: oklch(0.205 0.026 var(--h));
    --surface-high: oklch(0.278 0.030 var(--h));

    /* Text */
    --on-surface: oklch(0.935 0.018 var(--h));
    --on-surface-var: oklch(0.780 0.030 var(--h));
    /* Freezes the hue. Animating this flickers in Chrome */
    --on-surface-fixed: oklch(0.935 0.020 20);

    /* Accent */
    --primary: oklch(0.820 0.100 var(--h));
    --on-primary: oklch(0.285 0.070 var(--h));
    --primary-container: oklch(0.415 0.085 var(--h));

    /* Lines */
    --outline: oklch(0.520 0.028 var(--h));

    /* Gradient bg */
    --bg-gradient-1: oklch(0.30 0.10 var(--h));
    --bg-gradient-2: oklch(0.22 0.07 calc(var(--h) + 55));
    --bg-gradient-3: oklch(0.13 0.03 var(--h));

    --added: oklch(0.74 0.14 150);
    --removed: oklch(0.66 0.15 25);
}

html[data-mode="light"] {
    --surface: oklch(0.968 0.014 var(--h));
    --surface-container: oklch(0.945 0.020 var(--h));
    --surface-high: oklch(0.898 0.030 var(--h));

    --on-surface: oklch(0.245 0.030 var(--h));
    --on-surface-var: oklch(0.430 0.038 var(--h));
    --on-surface-fixed: oklch(0.245 0.030 20);

    --primary: oklch(0.505 0.125 var(--h));
    --on-primary: oklch(0.995 0.010 var(--h));
    --primary-container: oklch(0.880 0.070 var(--h));

    --outline: oklch(0.600 0.032 var(--h));

    --bg-gradient-1: oklch(0.90 0.09 var(--h));
    --bg-gradient-2: oklch(0.93 0.07 calc(var(--h) + 55));
    --bg-gradient-3: oklch(0.97 0.03 var(--h));

    --added: oklch(0.58 0.14 150);
    --removed: oklch(0.56 0.17 25);
}

:root {
    --h: 20;

    /* Extra */
    --spring: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%,
            1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%,
            1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%,
            .98 57.1%, .997 69.8%, 1.003 76.9%, 1);

    --t-theme: 0ms;
    --t-hue: 0ms;
    --t-nav-indicator: 0ms;

    /* Radius */
    --r-xs: 10px;
    --r-sm: 16px;
    --r-md: 22px;
    --r-lg: 28px;
    --r-xl: 36px;
    --r-full: 999px;
}


/* -------------- Base -------------- */
/* Borders and padding add to an element's size unless width means the outer
   box. Keeps 36px meaning 36px whatever else is on the element. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;

    /* Required for the entire color system, changes the color by `--h` (hue) at `--t-hue` (780ms, changable below in html.ready). */
    /* Uses the @property registered --h to work. */
    transition: --h var(--t-hue) ease,
        --bg-gradient-1 var(--t-theme) ease,
        --bg-gradient-2 var(--t-theme) ease,
        --bg-gradient-3 var(--t-theme) ease;
    scrollbar-width: thin;
    scrollbar-color: var(--outline) var(--primary);
}

html.ready {
    --t-hue: 780ms;
    --t-nav-indicator: 320ms;
}

html.theming {
    --t-theme: 420ms;
}

html.theming * {
    transition: background-color var(--t-theme) ease,
        border-color var(--t-theme) ease;
}

.bg-gradient {
    transition: none;
}

#credit,
.nav a,
.icon-btn,
.btn,
.handle,
.bio,
.card .stack,
.card .blurb,
.card-preview #card-preview-stack,
.card-preview #card-preview-blurb,
.profile,
.detail-value,
.link,
.link-handle,
.link .material-symbols-rounded,
.steam-panel h4,
.wishlist-amount,
.wishlist-amount::after,
.wishlist-on-sale,
.achievement-rarity,
.achievement.rare .achievement-name,
.achievement.rare .achievement-rarity,
.stars-empty,
.stars-full,
.commit-name,
.commit-age,
.github-fetch-amount,
.github-fetched-last,
.language-labels,
.commits-month {
    transition: color var(--t-theme) ease;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    background-color: var(--surface);
    color: var(--on-surface);
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--t-theme) ease, color var(--t-theme) ease;
    overflow-x: clip;
}

body.is-locked {
    overflow: hidden;
}

section {
    min-height: 80vh;
    padding: 100px 24px;
    /* This is the nav bar height. */
    scroll-margin-top: 70px;
}


/* -------------- Typography -------------- */
h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1;
    letter-spacing: -0.04em;
    margin: 0;
}

h2 {
    font-size: clamp(1.6rem, 4vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

#credit {
    text-align: center;
    padding: 0 32px 22px;
    font-size: 0.85rem;
    color: var(--on-surface-var);
}

.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: 300;
    font-style: normal;
    font-size: inherit;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
}


/* -------------- Layout -------------- */
.shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 22px;
}

.grid {
    align-items: start;
    display: grid;
    gap: 12px;
    /* `290px` is the minimum card width, this number decides how many columns are allowed. Lowering it means more columns (Feel free to change it). */
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

/* -------------- Gradient Bg -------------- */

.bg-gradient {
    z-index: -1;
    position: fixed;
    inset: -20%;
    background:
        radial-gradient(90% 80% at 10% 0%, var(--bg-gradient-1) 0%, transparent 70%),
        radial-gradient(80% 90% at 95% 25%, var(--bg-gradient-2) 0%, transparent 72%),
        radial-gradient(140% 110% at 50% 100%, var(--bg-gradient-1) 0%, transparent 85%),
        var(--bg-gradient-3);
}


/* -------------- Top Bar -------------- */
.bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    padding: 12px 22px;
    gap: 10px;
    align-items: center;
}

.island {
    background: color-mix(in oklab, var(--surface-container) 72%, transparent);
    backdrop-filter: blur(26px) saturate(1.6);
    border-radius: var(--r-full);
    padding: 6px;
}

.controls {
    position: absolute;
    top: 18px;
    right: 22px;
    display: flex;
    gap: 6px;
}

@media (max-width: 490px) {
    .controls {
        position: static;
    }
}


/* -------------- Navigation -------------- */
.nav {
    /* Makes .nav the reference point for the .nav-indicator's `position: absolute`. */
    position: relative;
    display: flex;
}

.nav a {
    padding: 8px 16px;
    border-radius: var(--r-full);
    position: relative;
    z-index: 1;
    color: var(--on-surface-fixed);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-indicator {
    position: absolute;
    inset-block: 0px;
    left: 0;
    z-index: 0;
    border-radius: var(--r-full);
    background: var(--primary-container);
    transition: transform var(--t-nav-indicator) var(--spring), width var(--t-nav-indicator) var(--spring);
}


/* -------------- Buttons -------------- */
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    border: 0;
    color: var(--on-surface);
    cursor: pointer;
    font-size: 24px;
    background: color-mix(in oklab, var(--surface-high) 40%, transparent);
    display: grid;
    place-items: center;

    transition: background 180ms ease;

    touch-action: manipulation;
    -webkit-touch-callout: none;

    align-items: center;
}

.icon-btn span {
    -webkit-user-select: none;
    user-select: none;
}

.icon-btn:hover {
    background: var(--surface-high);
}

.icon-btn:active {
    transform: scale(0.88);
    border-radius: var(--r-xs);
}

.btn {
    padding: 11px 21px;
    border-radius: var(--r-full);
    text-decoration: none;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.btn:active {
    transform: scale(0.94);
}

.btn[hidden] {
    display: none;
}


/* -------------- About -------------- */


#top {
    min-height: 500px;
    padding: 50px;
}

.banner {
    position: relative;
    width: 100%;
    margin: 0;
    /* Pulls up past the section's 80px padding and the ~72px bar. */
    margin-top: calc(-80px - 72px);
    height: 600px;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Which slice of the photo survives the crop. Higher = more of the
       bottom. */
    object-position: center 70%;
    display: block;
}

.identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 22px;
    /* How far the avatar rides up onto the banner. */
    margin-top: -110px;

    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;

}

.identity h1 {
    margin: 18px 0 0;
}

.avatar {
    width: 300px;
    height: 300px;
    z-index: 0;
    overflow: hidden;
    border-radius: var(--r-full);
    border: 6px solid var(--primary);
    background: white;
}

.avatar-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.3) translateY(13.5%);
}

.handle {
    margin: 4px 0 0;
    color: var(--on-surface-var);
    font-size: 0.95rem;
}

.bio {
    margin: 14px 0 0;
    max-width: 77ch;
    color: var(--on-surface-var);
    white-space: pre-line;

    background: var(--surface-container);
    border-radius: var(--r-lg);
    padding: 20px 28px;
}


/* -------------- Cards -------------- */
.card {
    background: var(--surface-container);
    border: 0;
    padding: 11px;
    border-radius: var(--r-lg);
    color: inherit;
    cursor: pointer;
    text-align: left;

    transition: transform 320ms var(--spring);
    font: inherit;
}

.card:hover {
    transform: translateY(-3px);
}

.card:active {
    transform: translateY(-5px) scale(0.975);
}

.card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 16px 0 4px;
}

.card .stack {
    font-size: 0.8rem;
    color: var(--on-surface-var);
}

.card .blurb {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--on-surface-var);
    margin: 12px 0 5px;
}

.card-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--surface-high);
    border-radius: var(--r-md);
    background-size: cover;
    background-position: center;
}


/* -------------- Card Preview -------------- */
.card-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: oklch(0.1 0.015 var(--h) / 0.62);
    backdrop-filter: blur(7px);

    opacity: 0;
    transition: opacity 320ms ease;
}

.card-preview-overlay.on {
    opacity: 1;
}

.card-preview {
    position: fixed;

    left: 50%;
    top: 50%;

    z-index: 100;

    width: min(540px, calc(100vw - 32px));
    max-height: 84vh;
    overflow: auto;

    padding: 11px;
    border-radius: var(--r-xl);
    background: var(--surface-container);

    opacity: 0;
    transform: translate(-50%, calc(-50% + 1000px)) scale(0.9);
    transition: transform 520ms var(--spring), opacity 320ms ease;
}

.card-preview.on {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.card-preview .icon-btn {
    background: color-mix(in oklab, var(--surface) 60%, transparent);

    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
}

.card-preview .icon-btn:hover {
    background: color-mix(in oklab, var(--surface) 80%, transparent);
}

.card-preview .icon-btn:active {
    border-radius: var(--r-full);
}

.card-preview h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 0.7;
}

.card-preview #card-preview-stack {
    font-size: 0.85rem;
    color: var(--on-surface-var);
}

.card-preview #card-preview-blurb {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--on-surface-var);
    margin: 10px 0 4px;
}

.card-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-preview-header h2 {
    margin-right: auto;
}

/* -------------- Board -------------- */

.board {
    align-items: start;
    display: grid;
    gap: 12px;
    /* `380px` is the minimum card width, this number decides how many columns are allowed. Lowering it means more columns (Feel free to change it).
    `min` is for windows smaller than 380px, it auto sets it to 100% of that width (+padding) so it doesn't create overflow. */
    grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
}

.widget {
    background: var(--surface-container);
    border-radius: var(--r-lg);
    padding: 24px;
}

.widget h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;

}

.stats {
    margin-top: 10px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid color-mix(in oklab, var(--outline) 25%, transparent);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.2;
}

.stat:last-child {
    border-bottom: 0;
}

.notes {
    margin-top: 10px;
}

.profile {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in oklab, var(--outline) 25%, transparent);
    color: var(--on-surface-var);
    font-size: 13.5px;
}

.detail {
    display: flex;
    gap: 4px;
}

.detail-value {
    color: var(--on-surface);
    font-weight: 500;
}

.detail:not(:last-child)::after {
    content: "|";
    margin-left: 14px;
    opacity: 0.5;
    font-weight: 600;
}

.link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    border-radius: var(--r-xs);
    text-decoration: none;
    color: var(--on-surface);
    position: relative;
}

.link:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 1px;
    background: color-mix(in oklab, var(--outline) 18%, transparent);
}

.link:hover {
    background: var(--surface-high);
}

.link-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.link-handle {
    margin-left: auto;
    color: var(--on-surface-var);
    font-size: 0.85rem;
}

.link .material-symbols-rounded {
    font-size: 16px;
    color: var(--on-surface-var);
    opacity: 0.5;
}

#widget-steam {
    padding: 0;
    overflow: hidden;
    position: relative;
}

#widget-steam h3 {
    padding: 24px 24px 0;
    position: absolute;
}

.steam-panels {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
}

.steam-panel {
    display: flex;
    flex-direction: column;
    padding: 72px 20px 20px;
}

.steam-panel:first-child {
    background: color-mix(in oklab, var(--surface-high) 60%, transparent);
}

.steam-panel:not(:last-child) {
    border-right: 1px solid color-mix(in oklab, var(--outline) 25%, transparent);
}

.steam-panel h4 {
    font-size: 0.8rem;
    color: var(--on-surface-var);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    margin-bottom: 2px;
}

.wishlist {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.wishlist-game-image {
    display: block;
    width: 100%;
    aspect-ratio: 92/43;
    background: var(--surface-high);
    border-radius: var(--r-md);
    background-size: cover;
    background-position: center;
}

.wishlist-rating {
    line-height: 1;
    font-size: 1.4rem;
    position: relative;
}

.stars-full {
    font-size: 1.41rem;
    top: 0;
    left: 0;
    position: absolute;
    overflow: hidden;
    white-space: nowrap;
    color: var(--primary);
}

.stars-empty {
    color: var(--on-surface-var);
    opacity: 0.35;
}

.wishlist-game-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.wishlist-amount {
    line-height: 1.2;
    letter-spacing: -0.04em;
    font-size: 3.125rem;
    color: var(--primary);
}

.wishlist-amount::after {
    margin-left: 5px;
    content: "games wishlisted";
    letter-spacing: normal;
    font-size: 0.8rem;
    color: var(--on-surface-var);
}

.wishlist-game-title {
    font-weight: 400;
    font-size: 1.3rem;
}

.wishlist-game-sale::after {
    content: "|";
    margin-left: 7px;
    opacity: 0.5;
    font-weight: 600;
}

.wishlist-game-price {
    margin-left: 0;
}

.wishlist-game-sale:empty {
    display: none;
}

.wishlist-on-sale {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--on-surface-var);
}

.achievement {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 2px 12px;
}

.achievement-img {
    grid-row: span 2;
    background: var(--surface-high);
    border-radius: var(--r-xs);
    aspect-ratio: 1;
    align-self: center;
    background-size: cover;
}

.achievements {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.achievement-rarity {
    font-size: 0.8rem;
    color: var(--on-surface-var);
}

.achievement.rare .achievement-name {
    color: var(--primary);
}


.achievement.rare .achievement-rarity {
    color: color-mix(in oklab, var(--primary) 65%, transparent)
}

#widget-github {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.summary-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.commit-changes {
    display: flex;
    gap: 5px;
}

.commit-added,
.commit-removed {
    height: 6px;
    border-radius: var(--r-xl);
}

.commit-added {
    background-color: var(--added);
}

.commit-removed {
    background-color: var(--removed);
}

.commit-line,
.github-fetch-line,
.summary-row {
    display: flex;
    gap: 7px;
    align-items: baseline;
}

.commit-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.github-fetch-amount,
.github-fetched-last {
    font-size: 0.8rem;
    color: var(--on-surface-var);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    margin-bottom: 2px;
}

.commit-age,
.github-fetched-last {
    margin-left: auto;
}

.commit-name {
    color: var(--primary);
    flex-shrink: 0;
    white-space: nowrap;
}

.commit-age {
    color: var(--on-surface-var);
    font-size: 0.9rem;
}

.commit-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.language-bar {
    display: flex;
    height: 10px;
    border-radius: var(--r-xl);
    overflow: hidden;
}

.commits-month {
    margin-left: auto;
}

.commits-month,
.language-labels {
    color: var(--on-surface-var);
    font-size: 0.8rem;
    white-space: nowrap;
}

.summary-row {
    flex-wrap: wrap;
}