/* ===== Gruvbox terminal theme — shared styles ===== */

:root {
    /* --- Gruvbox Palette --- */
    --bg: #282828; --fg: #ebdbb2; --fg-dim: #a89984;
    --border: #504945; --border-light: #665c54;
    --red: #cc241d; --green: #98971a; --yellow: #d79921;
    --blue: #458588; --purple: #b16286; --aqua: #689d6a;
    --orange: #d65d0e; --gray: #928374;

    /* --- UI Config --- */
    --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
    --radius: 8px;
    --term-shadow: 0 20px 50px -10px rgba(0,0,0,0.5);
}

/*noinspection CssUnusedSymbol*/
html.light-mode {
    --bg: #fbf1c7; --fg: #3c3836; --fg-dim: #665c54;
    --border: #bdae93; --border-light: #d5c4a1;
    /* Gruvbox-light accents — the dark-theme ones wash out on cream */
    --red: #9d0006; --green: #79740e; --yellow: #b57614;
    --blue: #076678; --purple: #8f3f71; --aqua: #427b58;
    --orange: #af3a03; --gray: #7c6f64;
    --term-shadow: 0 20px 50px -10px rgba(0,0,0,0.25);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0; min-height: 100svh;
    font-family: var(--font-mono), monospace; font-size: clamp(0.9rem, 2vw, 1.05rem);
    background-color: var(--bg); color: var(--fg);
    display: grid; place-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--fg) 8%, transparent) 1px, transparent 0);
    background-size: 3px 3px;
    opacity: 0.09;
    pointer-events: none;
    z-index: 0;
}

/* --- Layout --- */
.container {
    width: min(92%, 850px);
    display: flex; flex-direction: column; gap: 1.5rem;
    z-index: 1; transform: translateY(-2vh);
    padding-bottom: 3rem;
}

/* --- Entrance Animation --- */
@keyframes boot {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.terminal { animation: boot 0.5s ease-out both; }

/* --- Header --- */
header { display: flex; justify-content: flex-start; align-items: center; height: 40px; padding: 0 2rem; }
.logo { font-weight: 800; color: var(--yellow); text-decoration: none; font-size: 1.2rem; transition: color 0.2s ease; }
.logo:hover { color: var(--orange); }

.theme-toggle {
    background: color-mix(in srgb, var(--border) 60%, transparent); border: 1px solid var(--border-light); color: var(--fg-dim);
    padding: 0.2rem 0.55rem; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; gap: 0.5rem; font-family: inherit; font-size: 0.85rem;
    transition: all 0.2s ease;
}
.theme-toggle:hover { border-color: var(--fg-dim); color: var(--fg); background: var(--border); }
.icon-sun { display: none; }
html.dark-mode .icon-sun { display: block; } html.dark-mode .icon-moon { display: none; }
html.light-mode .icon-sun { display: none; } html.light-mode .icon-moon { display: block; }

/* --- Terminal Window --- */
.terminal {
    background: color-mix(in srgb, var(--bg) 95%, black);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--term-shadow); overflow: hidden;
    display: flex; flex-direction: column;
}

.term-bar {
    background: var(--border); padding: 0.5rem 1rem;
    display: flex; align-items: center; gap: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}
.ctrl { width: 12px; height: 12px; border-radius: 50%; display: inline-block; transition: transform 0.1s; }
.ctrl:hover { transform: scale(1.1); cursor: help; }
.ctrl.red { background-color: var(--red); }
.ctrl.yellow { background-color: var(--yellow); }
.ctrl.green { background-color: var(--green); }
a.ctrl { text-decoration: none; cursor: pointer; }
a.ctrl:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.term-title { margin-left: 0.5rem; color: color-mix(in srgb, var(--fg) 70%, transparent); font-size: 0.8rem; }

.term-content { padding: 2rem; min-height: 300px; }

/* --- Typography --- */
h1 { margin: 0 0 1.5rem 0; font-size: 1.4rem; color: var(--green); font-weight: 700; }
p { line-height: 1.6; margin-bottom: 1.2rem; color: var(--fg); max-width: 65ch; }
a { color: var(--orange); text-decoration: none; transition: all 0.2s; }

.prompt { color: var(--blue); font-weight: bold; margin-right: 0.5rem; }

.ls-header { color: var(--fg-dim); font-size: 0.85rem; margin-bottom: 0.25rem; }
.prompt-line { margin-top: 2rem; color: var(--fg-dim); font-size: 0.9rem; }

.footer-link { margin-top: 2.5rem; border-top: 1px dashed var(--border); padding-top: 1rem; font-size: 0.8rem; }
.footer-link a {
    color: var(--orange);
    border-bottom: 1px solid color-mix(in srgb, var(--orange) 70%, transparent);
    text-decoration: none;
    padding: 0.05rem 0.12rem;
    border-radius: 3px;
}
.footer-link a:hover {
    color: var(--fg);
    background: color-mix(in srgb, var(--orange) 25%, transparent);
    border-bottom-color: var(--orange);
}

/* --- Project List --- */
.project-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }

@keyframes typeIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.project-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0.4rem 1.5rem;
    padding: 0.75rem 0.75rem 0.75rem 1rem;
    border-radius: 4px;
    border-left: 2px solid var(--border);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    animation: typeIn 0.4s ease-out both;
}
.project-item:nth-child(1) { animation-delay: 0.1s; }
.project-item:nth-child(2) { animation-delay: 0.2s; }
.project-item:nth-child(3) { animation-delay: 0.3s; }
.project-item:nth-child(4) { animation-delay: 0.4s; }

.project-item:hover {
    background: color-mix(in srgb, var(--fg) 5%, transparent);
    border-left-color: var(--green);
    transform: translateX(4px);
}

.proj-perms { grid-column: 1; font-size: 0.75em; color: var(--fg-dim); letter-spacing: 0.02em; margin-bottom: -0.2rem; }
.proj-name { grid-column: 1; font-weight: bold; }
.proj-name a { color: var(--green); text-decoration: none; display: block; transition: color 0.2s ease; }
.proj-name a:hover { color: var(--fg); }

.proj-stack { grid-column: 1; display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.15rem; }
.proj-tag {
    font-size: 0.7em; padding: 0.15rem 0.45rem; border-radius: 3px;
    background: color-mix(in srgb, var(--border) 70%, transparent);
    color: var(--fg-dim); border: 1px solid var(--border);
    transition: all 0.2s ease;
}
.proj-tag.t-orange { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.proj-tag.t-blue { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.proj-tag.t-yellow { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 40%, transparent); }
.proj-tag.t-purple { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 40%, transparent); }
.proj-tag.t-green { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.proj-tag.t-aqua { color: var(--aqua); border-color: color-mix(in srgb, var(--aqua) 40%, transparent); }

.proj-desc { grid-column: 2; grid-row: 1 / span 3; color: var(--fg-dim); line-height: 1.6; align-self: center; }

/* --- Cursor --- */
.cursor {
    display: inline-block; width: 0.6em; height: 1.1em;
    background-color: var(--fg); vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- Status Bar --- */
.status-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    border-top: 1px solid var(--border);
    padding: 0.4rem 1rem; font-size: 0.75rem; color: var(--gray);
    display: flex; justify-content: space-between; align-items: center;
    -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); z-index: 10;
}
.status-group { display: flex; gap: 1rem; align-items: center; }
.branch { color: var(--purple); font-weight: bold; display: flex; align-items: center; gap: 0.3rem; }
#clock { line-height: 1; }
.status-bar .theme-toggle {
    height: 1.45rem;
    padding: 0 0.48rem;
    font-size: 0.75rem;
    line-height: 1;
}

@media (max-width: 600px) {
    .container { width: 100%; padding: 0 1rem; transform: none; }
    header { padding: 0 1.5rem; }
    .term-content { padding: 1.5rem; }
    .project-item { grid-template-columns: 1fr; gap: 0.2rem; padding: 0.8rem 0.5rem 0.8rem 0.75rem; }
    .proj-perms { display: none; }
    .proj-desc { grid-column: 1; grid-row: auto; margin-top: 0.5rem; }
    .hide-mobile { display: none; }
    .theme-toggle .theme-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .terminal, .project-item { animation: none; }
    .cursor { animation: none; opacity: 1; }
}
