/* git-shark design system — warm canvas, deep-teal accent, Space Grotesk + JetBrains Mono */

:root {
    /* surfaces */
    --canvas: oklch(0.985 0.004 80);
    --surface: #ffffff;

    /* ink */
    --ink: oklch(0.24 0.018 205);
    --muted: oklch(0.53 0.018 210);
    --faint: oklch(0.66 0.012 210);

    /* lines */
    --border: oklch(0.9 0.01 205);
    --border-soft: oklch(0.945 0.007 205);
    --border-strong: oklch(0.82 0.012 205);

    /* accent — deep teal */
    --accent: oklch(0.55 0.11 195);
    --accent-deep: oklch(0.46 0.1 198);
    --accent-soft: oklch(0.96 0.028 195);
    --accent-bright: oklch(0.72 0.12 195);

    /* status */
    --coral: oklch(0.63 0.13 35);
    --success: oklch(0.55 0.12 150);
    --success-deep: oklch(0.47 0.11 150);
    --danger: oklch(0.55 0.17 27);
    --danger-bg: oklch(0.965 0.02 27);
    --danger-border: oklch(0.85 0.08 27);
    --attention: oklch(0.58 0.1 75);
    --attention-bg: oklch(0.965 0.035 85);
    --attention-border: oklch(0.84 0.09 80);

    /* shape */
    --radius: 12px;
    --radius-sm: 8px;

    /* spacing (4px base) */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 32px;

    /* type */
    --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* base */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 19px;
    font-weight: 600;
}

h3 {
    font-size: 15px;
    font-weight: 600;
}

a {
    color: var(--accent-deep);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

small {
    color: var(--muted);
    font: 500 12px/1 var(--mono);
}

.mono {
    font-family: var(--mono);
}

.muted {
    color: var(--muted);
}

.error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-sm);
    padding: var(--s2) var(--s3);
    font-size: 13px;
}

/* header */

header.site {
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding: var(--s3) var(--s5);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

header.site .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font: 700 17px/1 var(--font);
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}

header.site .brand:hover {
    text-decoration: none;
}

header.site .brand .bmark {
    display: block;
    flex: none;
}

header.site .brand .g {
    color: var(--ink);
}

header.site .brand .s {
    color: var(--accent);
}

header.site nav {
    display: flex;
    align-items: center;
    gap: var(--s4);
    margin-left: auto;
}

header.site nav a {
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
}

header.site nav a:hover {
    color: var(--accent-deep);
    text-decoration: none;
}

header.site nav a.btn-primary {
    color: #fff;
}

header.site nav a.btn-secondary {
    color: var(--ink);
}

header.site nav a.btn-secondary:hover {
    color: var(--accent-deep);
}

main {
    max-width: 1120px;
    margin: var(--s6) auto;
    padding: 0 var(--s5);
}

/* in-app repo hero */

.hero {
    display: flex;
    gap: var(--s4);
    align-items: center;
    margin-bottom: var(--s6);
}

.hero .hero-mark {
    flex: none;
}

.hero h1 {
    margin: 0 0 var(--s1);
}

.hero .tagline {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.hero .tagline::before {
    content: "$ ";
    color: var(--accent);
}

/* landing page */

/* animated glowing symbol backdrop — sits behind all content */
.ascii-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    font-family: var(--mono);
    color: var(--accent);
    -webkit-user-select: none;
    user-select: none;
}

.ascii-bg .ascii-row {
    margin: 0;
    border: none;
    padding: 0;
    background: none;
    white-space: nowrap;
    font-size: clamp(1.1rem, 2.6vw, 1.9rem);
    letter-spacing: 0.15em;
    opacity: 0.14;
    animation: ascii-glow 7s ease-in-out infinite, ascii-drift 48s linear infinite alternate;
    will-change: transform, opacity, text-shadow;
}

.ascii-bg .ascii-row:nth-child(2) { animation-delay: -1.4s, -6s;  font-size: clamp(1rem, 2.2vw, 1.6rem); }
.ascii-bg .ascii-row:nth-child(3) { animation-delay: -2.8s, -12s; }
.ascii-bg .ascii-row:nth-child(4) { animation-delay: -4.2s, -18s; font-size: clamp(1rem, 2.2vw, 1.6rem); }
.ascii-bg .ascii-row:nth-child(5) { animation-delay: -5.6s, -24s; }
.ascii-bg .ascii-row:nth-child(6) { animation-delay: -7s, -30s;   font-size: clamp(1rem, 2.2vw, 1.6rem); }

@keyframes ascii-glow {
    0%, 100% { opacity: 0.06; text-shadow: 0 0 4px var(--accent-bright); }
    50%      { opacity: 0.26; text-shadow: 0 0 10px var(--accent), 0 0 22px var(--accent-bright); }
}

@keyframes ascii-drift {
    from { transform: translateX(0); }
    to   { transform: translateX(-14%); }
}

@media (prefers-reduced-motion: reduce) {
    .ascii-bg .ascii-row { animation: none; opacity: 0.1; }
}

/* keep header and content above the backdrop */
header.site, main { position: relative; z-index: 1; }

/* centered landing hero distinct from the in-app repo hero */
.landing {
    text-align: center;
    max-width: 44rem;
    margin: var(--s6) auto 0;
    padding: var(--s6) var(--s4) 0;
    background: radial-gradient(1200px 260px at 50% -40px, oklch(0.55 0.11 195 / .12), transparent);
}

.landing .landing-mark {
    display: block;
    margin: 0 auto var(--s4);
}

.landing h1 {
    font-size: 38px;
    margin: 0 0 var(--s3);
}

.landing h1 .g { color: var(--ink); }
.landing h1 .s { color: var(--accent); }

.landing .tagline {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 var(--s5);
}

.landing .tagline::before {
    content: "$ ";
    color: var(--accent);
}

.landing-cta {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

ul.values {
    list-style: none;
    padding: 0 var(--s4);
    margin: var(--s6) auto;
    max-width: 900px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s4);
    text-align: left;
}

ul.values li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

ul.values li strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ink);
    font-weight: 600;
}

@media (max-width: 640px) {
    ul.values { grid-template-columns: 1fr; }
}

/* buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: 600 14px/1 var(--font);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s, border-color .12s, box-shadow .12s;
}

.btn:hover {
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-deep);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-deep);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border);
    box-shadow: 0 1px 0 rgba(20, 32, 30, .03);
}

.btn-secondary:hover {
    background: var(--canvas);
    border-color: var(--border-strong);
    color: var(--accent-deep);
}

.btn-ghost {
    background: transparent;
    color: var(--accent-deep);
}

.btn-ghost:hover {
    background: var(--accent-soft);
}

.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border-color: var(--danger-border);
}

.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn[disabled], .btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }

/* tabs */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s4);
}

.tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 14px;
    font-weight: 500;
}

.tab:hover {
    color: var(--accent-deep);
    text-decoration: none;
}

.tab.active {
    font-weight: 600;
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.tab .ct {
    font: 500 11px/1 var(--mono);
    color: var(--faint);
    background: var(--border-soft);
    border-radius: 999px;
    padding: 2px 7px;
}

.tab.active .ct {
    color: var(--accent-deep);
    background: var(--accent-soft);
}

/* panels & tables */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

table {
    border-collapse: collapse;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

td, th {
    border-bottom: 1px solid var(--border-soft);
    padding: var(--s3) var(--s4);
    text-align: left;
}

th {
    background: var(--accent-soft);
    color: var(--accent-deep);
    font: 600 11px/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: .06em;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover, table tr:hover td {
    background: var(--accent-soft);
}

/* forms */

label {
    display: block;
    color: var(--ink);
    font: 600 13px/1.4 var(--font);
    margin-bottom: 7px;
}

input, textarea, select {
    width: 100%;
    font: 14px/1.4 var(--font);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-top: var(--s1);
    transition: border-color .12s, box-shadow .12s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
    font-family: var(--mono);
    font-size: 13px;
    min-height: 64px;
    resize: vertical;
}

form.inline {
    display: inline;
}

/* code */

code, pre {
    font-family: var(--mono);
    font-size: 13px;
}

code {
    background: var(--accent-soft);
    color: var(--accent-deep);
    padding: 2px 7px;
    border-radius: 6px;
}

pre {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    line-height: 1.6;
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: none;
    color: inherit;
}

/* badges */

.badge {
    display: inline-block;
    font: 500 11px/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
}

.badge-public {
    color: var(--accent-deep);
    border-color: transparent;
    background: var(--accent-soft);
}

.badge-private {
    color: var(--attention);
    border-color: var(--attention-border);
    background: var(--attention-bg);
}

.badge-default {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

/* dashboard */

.dashboard-section {
    margin-bottom: var(--s5);
}

.dashboard-section h2 {
    margin-bottom: var(--s2);
}

.empty-state {
    padding: var(--s3);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

td.actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

td.actions .btn {
    font-size: 0.8rem;
}

/* icon-only action button (e.g. pin/unpin) */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--s1);
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius);
    line-height: 0;
}

.btn-icon:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-icon.pinned {
    color: var(--accent);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* hotkey help dialog */

dialog#hotkey-help {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s5);
    min-width: 20rem;
    background: var(--surface);
    color: var(--ink);
}

dialog#hotkey-help::backdrop {
    background: oklch(0.24 0.018 205 / .4);
}

dialog#hotkey-help kbd {
    font: 11px/1 var(--mono);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 6px;
}

/* repo overview — two-column sidebar + main */

.repo-layout {
    display: grid;
    grid-template-columns: 256px 1fr;
    gap: 40px;
}

.repo-side .owner {
    font: 500 13px/1 var(--mono);
    color: var(--muted);
}

.repo-side .repo-name {
    margin: 6px 0 12px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--ink);
}

.repo-side .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 500 11px/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent-deep);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 5px 10px;
}

.repo-side .tag .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.repo-side .tag.tag-private {
    color: var(--attention);
    background: var(--attention-bg);
}

.repo-side .tag.tag-private .dot {
    background: var(--attention);
}

.repo-side .desc {
    margin: 16px 0 14px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
}

.repo-side .rule {
    height: 1px;
    background: var(--border-soft);
    margin: 18px 0;
}

.repo-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.repo-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    position: relative;
    transition: background .12s, color .12s;
}

.repo-nav a:hover {
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

.repo-nav a .g {
    width: 18px;
    text-align: center;
    color: var(--faint);
    font-size: 15px;
}

.repo-nav a .ct {
    margin-left: auto;
    font: 500 12px/1 var(--mono);
    color: var(--faint);
}

.repo-nav a.active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--border);
}

.repo-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.repo-nav a.active .g {
    color: var(--accent);
}

.repo-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.repo-actions .btn {
    flex: 1;
    justify-content: center;
}

.btn-clone {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 600 13px/1 var(--font);
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 9px 14px;
    cursor: pointer;
}

.btn-clone:hover {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
}

.btn-clone .g {
    font: 500 14px/1 var(--mono);
}

/* clone dialog */

.clone-dialog {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    padding: var(--s4);
    width: min(440px, 92vw);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.clone-dialog::backdrop {
    background: rgba(0, 0, 0, .45);
}

.clone-dialog h2 {
    margin: 0 0 var(--s3);
    font-size: 18px;
}

.clone-close {
    float: right;
    margin: -4px -4px 0 0;
}

.clone-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: var(--s2);
}

.clone-dialog > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.clone-tabs label {
    font: 600 12px/1 var(--mono);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 16px;
    cursor: pointer;
}

#clone-https:checked ~ .clone-tabs label[for="clone-https"],
#clone-ssh:checked ~ .clone-tabs label[for="clone-ssh"] {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.clone-url {
    display: none;
    overflow-x: auto;
    white-space: nowrap;
    font: 500 12.5px/1.4 var(--mono);
    background: var(--canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}

#clone-https:checked ~ .url-https,
#clone-ssh:checked ~ .url-ssh {
    display: block;
}

/* main column */

.branchbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.branchsel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 600 14px/1 var(--font);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 14px;
}

.branchsel:hover {
    text-decoration: none;
    border-color: var(--border-strong);
}

.branchsel .g {
    color: var(--accent);
}

.branchsel .car {
    color: var(--faint);
    font-size: 11px;
}

.branchbar .meta {
    font: 500 13px/1 var(--mono);
    color: var(--muted);
}

.branchbar .meta b {
    color: var(--ink);
    font-weight: 600;
}

.commitrow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border);
    color: var(--ink);
}

.commitrow:hover {
    text-decoration: none;
}

.commitrow .av {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 12px/1 var(--font);
    text-transform: uppercase;
    flex: none;
}

.commitrow .who {
    font-weight: 600;
}

.commitrow .msg {
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commitrow .hash {
    margin-left: auto;
    font: 500 12.5px/1 var(--mono);
    color: var(--muted);
    white-space: nowrap;
}

.files {
    display: flex;
    flex-direction: column;
}

.frow {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-soft);
    color: inherit;
    transition: background .1s;
}

.frow:last-child {
    border-bottom: none;
}

.frow:hover {
    background: var(--accent-soft);
    text-decoration: none;
}

.frow .fname {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.frow .fname .g {
    width: 18px;
    text-align: center;
    font-size: 15px;
    color: var(--faint);
    flex: none;
}

.frow .fname .g.dir {
    color: var(--accent);
}

.frow .fname .n {
    font: 500 14px/1 var(--mono);
    color: var(--ink);
    white-space: nowrap;
}

.frow:hover .fname .n {
    color: var(--accent-deep);
}

.danger-zone {
    margin-top: var(--s6);
}

@media (max-width: 760px) {
    .repo-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}
