/* sifat.codes: "the portfolio is a repository" */
:root {
  --bg: #0a0e1a;
  --bg-2: #0f1424;
  --panel: #121a2e;
  --panel-2: #17203a;
  --line: #1f2a47;
  --line-2: #2b3962;
  --text: #e6ebf7;
  --muted: #8f9bbd;
  --dim: #5d6a8f;
  --accent: #5ef2c2;      /* mint */
  --accent-ink: #04261c;
  --violet: #a48bff;
  --amber: #ffc46b;
  --sky: #6cc6ff;
  --rose: #ff7a9a;
  --glow: rgba(94, 242, 194, .14);
  --grid: rgba(120, 140, 200, .06);
  --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #eceff7;
  --panel: #ffffff;
  --panel-2: #f6f8fd;
  --line: #dde2ef;
  --line-2: #c8d0e4;
  --text: #121729;
  --muted: #4f5b7c;
  --dim: #8a94b0;
  --accent: #0a9e74;
  --accent-ink: #ffffff;
  --violet: #6a4ee0;
  --amber: #b26b00;
  --sky: #1f7fc4;
  --rose: #c8325a;
  --glow: rgba(10, 158, 116, .10);
  --grid: rgba(40, 60, 120, .06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--glow), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--mono); font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 14px; letter-spacing: -1px; }
.brand-name { font-size: 15px; }
.dot { color: var(--accent); }
.branch { display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--mono); color: var(--muted); border: 1px solid var(--line-2); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.tabs { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { font: 500 13px var(--mono); color: var(--muted); text-decoration: none; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.tabs a:hover { color: var(--text); background: var(--panel-2); }
.theme { flex: none; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 16px; cursor: pointer; }
.theme:hover { border-color: var(--accent); }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 90px); }
.path { font: 500 13px var(--mono); color: var(--accent); margin: 0 0 18px; }
.path span { color: var(--dim); }
h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 22px; font-weight: 700; }
.hl-line { display: block; opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 120ms); }
.hl-line:last-child { background: linear-gradient(90deg, var(--accent), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes rise { to { opacity: 1; transform: none; } }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 34em; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 10px; border: 1px solid var(--line-2); text-decoration: none; font: 500 14px var(--mono); background: var(--panel); transition: transform .15s, border-color .15s; }
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts div { padding: 12px 16px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.facts dd { margin: 2px 0 0; font-weight: 500; font-size: 15px; }

/* editor */
.editor { margin: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0,0,0,.55), 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent); }
.editor-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); font: 500 12px var(--mono); color: var(--muted); }
.lights { display: flex; gap: 6px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.lights i:nth-child(1) { background: var(--rose); } .lights i:nth-child(2) { background: var(--amber); } .lights i:nth-child(3) { background: var(--accent); }
.file { color: var(--text); padding: 3px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.lang { margin-left: auto; color: var(--dim); }
.code { margin: 0; padding: 18px 0; font: 400 13.5px/1.75 var(--mono); overflow-x: auto; }
.code code { display: block; min-width: max-content; }
.ln { display: block; padding: 0 20px 0 0; opacity: 0; animation: type .35s ease forwards; animation-delay: calc(400ms + var(--d) * 70ms); }
.num { display: inline-block; width: 44px; padding-right: 16px; text-align: right; color: var(--dim); user-select: none; }
@keyframes type { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.tk-k { color: var(--violet); } .tk-v { color: var(--sky); } .tk-p { color: var(--text); } .tk-s { color: var(--accent); } .tk-n { color: var(--amber); } .tk-c { color: var(--dim); font-style: italic; }
.caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: -2px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- blocks ---------- */
.block { padding: clamp(48px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.block-head { margin-bottom: 32px; }
.kicker { font: 500 13px var(--mono); color: var(--accent); margin: 0 0 8px; }
h2 { font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.025em; line-height: 1.1; margin: 0 0 10px; }
.sub { color: var(--muted); margin: 0 0 18px; max-width: 46em; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 13px var(--mono); color: var(--muted); background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-n { font-size: 11px; opacity: .7; }

/* repo cards */
.repos { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.repo { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, transform .2s; animation: rise .6s ease both; animation-delay: calc(var(--i) * 60ms); }
.repo:hover { border-color: var(--line-2); transform: translateY(-3px); }
.repo[hidden] { display: none; }
.repo::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; border-radius: var(--radius) var(--radius) 0 0; background: var(--stage, var(--line-2)); opacity: .8; }
.repo[data-stage="live"] { --stage: var(--accent); }
.repo[data-stage="beta"] { --stage: var(--sky); }
.repo[data-stage="building"] { --stage: var(--amber); }
.repo[data-stage="research"] { --stage: var(--violet); }
.preview { display: block; margin: -22px -22px 4px; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16 / 9; background: var(--panel-2); }
.preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s; }
.repo:hover .preview img { transform: scale(1.03); }
.repo-head { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.logo img, .mono-logo { width: 44px; height: 44px; border-radius: 11px; }
.mono-logo { display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); font: 700 15px var(--mono); }
.repo-path { margin: 0; font: 400 12px var(--mono); color: var(--dim); overflow-wrap: anywhere; }
.repo-path strong { color: var(--muted); font-weight: 500; }
.repo h3 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.badge { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--mono); padding: 3px 10px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--stage) 45%, transparent); color: var(--stage); background: color-mix(in srgb, var(--stage) 10%, transparent); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cat { margin: 0; font: 500 11px var(--mono); letter-spacing: .1em; color: var(--dim); }
.caption { margin: 0; font-size: 17px; font-weight: 500; }
.diff { list-style: none; margin: 0; padding: 10px 0; font: 400 13px/1.7 var(--mono); background: color-mix(in srgb, var(--accent) 5%, var(--bg-2)); border: 1px solid var(--line); border-radius: 10px; }
.diff li { display: flex; gap: 10px; padding: 0 14px; color: var(--text); }
.plus { color: var(--accent); font-weight: 700; }
.desc { font-size: 14.5px; color: var(--muted); border-left: 2px solid var(--stage, var(--line-2)); padding-left: 14px; }
.desc p { margin: 0; }
.repo-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tags span { font: 400 12px var(--mono); color: var(--muted); padding: 2px 8px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; border-top: 1px dashed var(--line-2); padding-top: 12px; }
.more { background: none; border: 0; padding: 0; color: var(--muted); font: 500 13px var(--mono); cursor: pointer; }
.more:hover { color: var(--text); }
.lnk { font: 500 13px var(--mono); color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.lnk:hover { text-decoration: underline; }

/* git log */
.log { list-style: none; margin: 0; padding: 0; max-width: 880px; }
.commit { position: relative; display: grid; grid-template-columns: 26px auto 1fr; gap: 6px 14px; align-items: baseline; padding: 14px 0; }
.graph { position: relative; align-self: stretch; }
.graph::before { content: ""; position: absolute; left: 7px; top: -14px; bottom: -14px; width: 2px; background: var(--line-2); }
.commit:first-child .graph::before { top: 14px; }
.commit.root .graph::before { bottom: calc(100% - 22px); }
.graph i { position: absolute; left: 1px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.commit:first-child .graph i { background: var(--accent); box-shadow: 0 0 0 5px var(--glow); }
.sha { font: 500 13px var(--mono); color: var(--amber); }
.ref { grid-column: 3; justify-self: start; font: 500 11px var(--mono); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 999px; padding: 1px 8px; }
.msg { grid-column: 3; font-size: 16.5px; }
.commit .ref + .msg { grid-row: 2; }
.commit:not(:has(.ref)) .msg { grid-row: 1; }

/* stack */
.stack { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: start; }
.tree { margin: 0; padding: 22px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font: 400 14.5px/1.9 var(--mono); overflow-x: auto; columns: 2; column-gap: 32px; }
.tk-dir { color: var(--violet); font-weight: 700; }
.tk-pkg { color: var(--text); }
.stack-note { padding: 22px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); }
.stack-note p { margin: 0 0 12px; }
.count { font: 400 13px var(--mono); }
.count strong { color: var(--accent); font-size: 18px; }

/* deployments */
.deploys { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.deploys a { display: grid; gap: 4px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color .2s; height: 100%; }
.deploys a:hover { border-color: var(--accent); }
.host { font: 700 15px var(--mono); overflow-wrap: anywhere; }
.proj { font-size: 14px; color: var(--muted); }
.state { justify-self: start; margin-top: 6px; display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--mono); color: var(--dim); }
.state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state.checking i { animation: blink 1s steps(1) infinite; }
.state.up { color: var(--accent); }
.state.soon { color: var(--amber); }

/* contact */
.big-mail { display: inline-block; font-size: clamp(30px, 6vw, 68px); font-weight: 700; letter-spacing: -.03em; text-decoration: none; margin-bottom: 30px; background: linear-gradient(90deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; overflow-wrap: anywhere; }
.big-mail:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.remotes { list-style: none; margin: 0; padding: 18px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font: 400 14px/2 var(--mono); max-width: 760px; }
.remotes li { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; }
.r-name { color: var(--violet); }
.remotes a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.remotes a:hover { color: var(--accent); }

.foot { max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 48px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; }
.foot p { margin: 0; }
.foot a { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .stack { grid-template-columns: 1fr; }
  .tabs a:nth-child(n+4) { display: none; }
}
@media (max-width: 640px) {
  .branch { display: none; }
  .tabs { display: none; }
  .theme { margin-left: auto; }
  .repos { grid-template-columns: 1fr; }
  .tree { columns: 1; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div { border-bottom: 1px solid var(--line); }
  .remotes li { grid-template-columns: 84px 1fr; }
  .r-kind { display: none; }
  .code { font-size: 12.5px; }
  .num { width: 34px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hl-line, .ln, .repo { opacity: 1; transform: none; }
}
