/* ============================================================
   Portfolio — LoveIt-inspired stylesheet (plain CSS, no build)
   Palette & feel adapted from the LoveIt Hugo theme:
   blue links, pink hover, Lato type, profile home, post list.
   Edit the variables below to re-theme the whole site.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --text: #2b2b2b;
  --text-soft: #8c8c8c;
  --heading: #161209;
  --border: #eaeaea;
  --header-bg: #f8f8f8;
  --link: #2d96bd;
  --link-hover: #ef3982;
  --code-bg: #f5f5f5;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --max-width: 800px;
  --radius: 10px;
  --font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Fira Code", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #292a2d;
  --bg-soft: #34363b;
  --text: #a9a9b3;
  --text-soft: #767676;
  --heading: #d6d6db;
  --border: #3a3d42;
  --header-bg: #252627;
  --link: #4ba3c3;
  --link-hover: #ef3982;
  --code-bg: #34363b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

a { color: var(--link); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- Header (LoveIt-style top bar) ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--header-bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--heading);
}
.brand:hover { color: var(--link); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--link);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--link); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--link); }

.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease, transform 0.4s ease;
}
.theme-toggle:hover { color: var(--link); transform: rotate(20deg); }

/* ---------- Profile home (LoveIt signature) ---------- */
.profile {
  min-height: calc(100vh - 62px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 60px;
}
/* Used on the About page so the bio sits right under the profile (no full-screen). */
.profile.compact { min-height: auto; padding: 80px 24px 20px; }
.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  transition: transform 0.8s ease;
}
.avatar:hover { transform: rotate(360deg); }
.profile h1 {
  margin: 26px 0 6px;
  font-size: 2rem;
  font-weight: 700;
}
.profile .subtitle {
  color: var(--text-soft);
  font-size: 1.1rem;
  min-height: 1.6em;
  margin: 0 0 22px;
}
.cursor { display: inline-block; margin-left: 2px; color: var(--link); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.socials { display: flex; gap: 18px; justify-content: center; margin-top: 4px; }
.socials a {
  color: var(--text-soft);
  font-size: 1.35rem;
  transition: color 0.2s ease, transform 0.2s ease;
}
.socials a:hover { color: var(--link); transform: translateY(-3px); }

.scroll-hint {
  margin-top: 46px;
  color: var(--text-soft);
  font-size: 1.4rem;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- Content sections ---------- */
section { padding: 44px 0; }
.section-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--link);
  margin: 0 0 6px;
}
section h2 { font-size: 1.6rem; margin: 0 0 18px; letter-spacing: -0.01em; }
.about p + p { margin-top: 14px; }

.skills { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: 0.85rem;
  padding: 5px 13px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
}

.timeline { border-left: 2px solid var(--border); padding-left: 22px; }
.timeline .item { margin-bottom: 24px; }
.timeline .item h3 { margin: 0 0 2px; font-size: 1.1rem; }
.timeline .item .meta { font-family: var(--mono); font-size: 0.8rem; color: var(--text-soft); margin: 0 0 6px; }
.timeline .item p { margin: 0; color: var(--text-soft); }

/* Focus areas (What I do) */
.focus { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.focus .item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-soft);
}
.focus .item .ficon { color: var(--link); font-size: 1.2rem; margin-bottom: 8px; }
.focus .item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.focus .item p { margin: 0; color: var(--text-soft); font-size: 0.93rem; }

/* Grouped skills */
.skill-group { margin-bottom: 18px; }
.skill-group h3 { font-size: 0.98rem; margin: 0 0 8px; color: var(--text); }
@media (max-width: 620px) { .focus { grid-template-columns: 1fr; } }

/* ---------- Projects: LoveIt post-list ---------- */
.page-head { padding: 84px 0 8px; }
.page-head h1 { font-size: 2.2rem; margin: 0 0 6px; }
.page-head p { color: var(--text-soft); margin: 0; }

.post-list { padding-top: 12px; }
.post {
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.post h2 { font-size: 1.4rem; margin: 0 0 8px; }
.post h2 a { color: var(--heading); }
.post h2 a:hover { color: var(--link); }
.post .post-meta {
  font-size: 0.85rem;
  color: var(--text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}
.post .post-meta i { margin-right: 5px; color: var(--link); }
.post p.summary { margin: 0 0 14px; color: var(--text); }
.read-more { font-weight: 700; font-size: 0.92rem; }
.read-more i { margin-left: 4px; font-size: 0.8rem; }

/* ---------- Projects: two-column layout with sticky left rail ---------- */
.wrap.wide { max-width: 1180px; }

.projects-layout {
  display: grid;
  grid-template-columns: 208px 1fr;
  gap: 44px;
  align-items: start;
}

.rail { position: sticky; top: 86px; }
.rail-group { margin-bottom: 26px; }
.rail-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}

/* vertical filter list */
.filter-bar { display: flex; flex-direction: column; gap: 2px; }
.filter-btn {
  font-size: 0.9rem;
  text-align: left;
  padding: 7px 10px;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.filter-btn:hover { color: var(--text); background: var(--bg-soft); }
.filter-btn.active {
  color: var(--link);
  font-weight: 700;
  border-left-color: var(--link);
  background: var(--bg-soft);
}

/* status jump links with counts */
.rail-status { display: flex; flex-direction: column; gap: 2px; }
.rail-status a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-soft);
  transition: color 0.18s ease, background 0.18s ease;
}
.rail-status a:hover { color: var(--text); background: var(--bg-soft); }
.rail-status a i { width: 15px; text-align: center; font-size: 0.85em; }
.rail-status .n {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
}
.rail-status a.dim { opacity: 0.45; }
.st-done i    { color: #2e9e6b; }
.st-brewing i { color: #d98a2b; }
.st-idea i    { color: var(--link); }

@media (max-width: 900px) {
  .projects-layout { grid-template-columns: 1fr; gap: 0; }
  .rail { position: static; margin-bottom: 26px; }
  .rail-group { margin-bottom: 16px; }
  .filter-bar { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .filter-btn {
    border: 1px solid var(--border); border-left-width: 1px;
    border-radius: 999px; padding: 5px 13px; font-size: 0.82rem;
  }
  .filter-btn.active { background: var(--link); border-color: var(--link); color: #fff; }
  .rail-status { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .rail-status a { border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 0.82rem; }
  .rail-status .n { background: none; border: none; padding: 0 0 0 2px; }
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pcard {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: cardin 0.35s ease both;
}
.pcard:hover { transform: translateY(-4px); border-color: var(--link); box-shadow: var(--shadow); }
.pcard-cover {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c1, #2d96bd), var(--c2, #ef3982));
  color: #fff;
  font-size: 2rem;
}
.pcard-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-body { padding: 15px 17px; }
.pcard-body h3 { margin: 0 0 9px; font-size: 1.05rem; }
.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard-tags span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--link);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 999px;
}
.pcard.hide { display: none; }
@keyframes cardin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

@media (max-width: 820px) { .pgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .pgrid { grid-template-columns: 1fr; } }

/* ---------- Status sections (done / brewing / ideas) ---------- */
.status-section { margin-bottom: 34px; scroll-margin-top: 84px; }
.status-section.hide { display: none; }
.status-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.status-head h2 {
  font-size: 0.78rem;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0;
  font-weight: 700;
}
.status-head h2 i { margin-right: 7px; font-size: 1.05em; }
.status-section[data-status="done"]    .status-head h2 i { color: #2e9e6b; }
.status-section[data-status="brewing"] .status-head h2 i { color: #d98a2b; }
.status-section[data-status="idea"]    .status-head h2 i { color: var(--link); }
.status-blurb { color: var(--text-soft); font-size: 0.82rem; opacity: 0.75; }

.pcard-desc { color: var(--text-soft); font-size: 0.9rem; margin: 0 0 10px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.status-badge i { font-size: 0.9em; }
.status-done    { color: #2e9e6b; border-color: color-mix(in srgb, #2e9e6b 45%, var(--border)); }
.status-brewing { color: #d98a2b; border-color: color-mix(in srgb, #d98a2b 45%, var(--border)); }
.status-idea    { color: var(--link); border-color: color-mix(in srgb, var(--link) 45%, var(--border)); }

.gh-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.85rem; }

/* Loading + rendered README */
.loading { color: var(--text-soft); font-family: var(--mono); font-size: 0.9rem; padding: 20px 0; }

/* Live embedded app (renders a repo's index.html) */
.live-embed { margin: 8px 0 28px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.live-embed .live-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-soft);
}
.live-embed .live-bar .dot { color: #2e9e6b; }
.live-embed .live-bar a { font-weight: 700; text-transform: none; letter-spacing: 0; }
.live-embed iframe { width: 100%; height: 900px; border: 0; display: block; background: #17181b; }
.readme-heading { font-size: 1.3rem; margin: 30px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Rendered article (README) */
.readme { font-size: 1.02rem; }
.readme > p:first-of-type { font-size: 1.12rem; color: var(--heading); }
.readme table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.95rem; }
.readme th, .readme td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.readme th { background: var(--bg-soft); font-size: 0.85rem; letter-spacing: 0.04em; }
/* image tables become a clean gallery grid */
.readme table.img-table { border-collapse: separate; border-spacing: 12px 12px; }
.readme table.img-table th { border: none; background: none; padding: 0 0 0 2px; color: var(--text-soft); font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; }
.readme table.img-table td { border: none; padding: 0; width: 50%; }
.readme table.img-table img {
  width: 100%; margin: 0; display: block;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.readme > p > img:only-child { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 620px) { .readme table.img-table { border-spacing: 6px 8px; } }

/* Before / after gallery */
.gallery { margin: 6px 0 10px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ba { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.ba .pair { display: grid; grid-template-columns: 1fr 1fr; }
.ba figure { margin: 0; position: relative; }
.ba img { width: 100%; aspect-ratio: 400 / 600; object-fit: cover; display: block; }
.ba figure:first-child img { border-right: 1px solid var(--border); }
.ba .lbl {
  position: absolute; bottom: 7px; left: 7px;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.04em;
  background: rgba(0,0,0,0.62); color: #fff; padding: 2px 7px; border-radius: 4px;
}
.gallery-note { color: var(--text-soft); font-size: 0.9rem; margin: 0 0 14px; }
@media (max-width: 620px) { .live-embed iframe { height: 760px; } }

/* ---------- Single project (LoveIt single-post) ---------- */
.single-head { padding: 84px 0 6px; }
.single-head .back { font-size: 0.9rem; color: var(--text-soft); }
.single-head .back:hover { color: var(--link); }
.single-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 16px 0 12px; letter-spacing: -0.02em; }
.single-meta {
  font-size: 0.85rem;
  color: var(--text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 6px;
}
.single-meta i { margin-right: 5px; color: var(--link); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
}
.tag::before { content: "#"; color: var(--link); }

.article { padding-top: 14px; }
.article h2 { font-size: 1.4rem; margin: 34px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.article h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.article p { margin: 0 0 14px; }
.article ul { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin: 16px 0; }
.article pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
}
.article code { font-family: var(--mono); }
.figure-placeholder {
  display: grid;
  place-items: center;
  height: 220px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.85rem;
  margin: 16px 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.btn-primary { background: var(--link); color: #fff; }
.btn-primary:hover { background: var(--link-hover); color: #fff; transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); margin-left: 8px; }
.btn-ghost:hover { border-color: var(--link); color: var(--link); }

/* ---------- Footer (LoveIt-style, centered) ---------- */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding: 30px 0 40px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.88rem;
}
footer.site .socials { margin-bottom: 14px; font-size: 1.1rem; }
footer.site a { color: var(--text-soft); }
footer.site a:hover { color: var(--link); }
footer.site .heart { color: var(--link-hover); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.show { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .nav-links { gap: 16px; }
  .profile h1 { font-size: 1.6rem; }
  .avatar { width: 116px; height: 116px; }
}
