/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */
@import url('https://api.fontshare.com/v2/css?f=satoshi@300,400,500,700,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:         #FAF8F5;
  --surface:    #F3ECE2;
  --surface-hv: #EBE3D7;
  --fg:         #1E1E1E;
  --muted:      #6B655F;
  --accent:     #B37D56;
  --accent-bg:  rgba(179,125,86,.09);
  --border:     #E6DDD2;
  --border-hv:  #D1C5B6;

  --f-head: 'Satoshi','Inter',sans-serif;
  --f-body: 'Inter',sans-serif;
  --f-mono: 'JetBrains Mono',monospace;

  --nav-h: 64px;
  --wrap:  860px;

  --t-fast:   150ms ease;
  --t-normal: 280ms ease;

  --sh: 0 4px 20px rgba(30,30,30,.05);
}

html[data-theme="dark"] {
  --bg:         #111110;
  --surface:    #1B1B19;
  --surface-hv: #262623;
  --fg:         #EBEAE6;
  --muted:      #9E9890;
  --accent:     #E0A070;
  --accent-bg:  rgba(224,160,112,.09);
  --border:     #2C2B29;
  --border-hv:  #3E3C39;
}
@media (prefers-color-scheme:dark) {
  html:not([data-theme="light"]) {
    --bg:         #111110; --surface:    #1B1B19; --surface-hv: #262623;
    --fg:         #EBEAE6; --muted:      #9E9890;
    --accent:     #E0A070; --accent-bg:  rgba(224,160,112,.09);
    --border:     #2C2B29; --border-hv:  #3E3C39;
  }
  html:not([data-theme="light"]) .nav { background: rgba(17,17,16,.9); }
}

/* ==========================================================================
   RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: clamp(.95rem, 2vw, 1.05rem);
  line-height: 1.7;
  transition: background var(--t-normal), color var(--t-normal);
}

/* ==========================================================================
   LAYOUT HELPERS
   ========================================================================== */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}
section:first-of-type { border-top: none; }

/* Section label row */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: 2.5rem;
}
.sec-num {
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--accent);
  letter-spacing: .12em;
  flex-shrink: 0;
}
.sec-title {
  font-family: var(--f-head);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.sec-title-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  transition: color var(--t-fast);
}
.sec-title-link:hover {
  color: var(--accent);
}
.sec-title-arrow {
  color: var(--accent);
  font-size: 0.82em;
  transition: transform var(--t-fast);
  display: inline-block;
}
.sec-title-link:hover .sec-title-arrow {
  transform: translate(3px, -3px);
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  background: rgba(250,248,245,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background var(--t-normal), border-color var(--t-normal);
}
html[data-theme="dark"] .nav { background: rgba(17,17,16,.92); }

.nav-inner {
  max-width: 1200px; width: 100%; margin: 0 auto;
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo-svg {
  height: 26px;
  width: auto;
  display: block;
  fill: var(--accent);
  transition: fill var(--t-normal);
}

.nav-right { display: flex; align-items: center; gap: 1rem; }

/* Dropdown */
.dd { position: relative; }
.dd-trigger {
  background: none; border: 1px solid var(--border);
  border-radius: 4px; color: var(--fg);
  font-family: var(--f-body); font-size: .875rem; font-weight: 500;
  padding: .4rem .85rem; cursor: pointer;
  display: flex; align-items: center; gap: .4rem;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dd-trigger:hover { background: var(--surface); border-color: var(--border-hv); }
.dd-arrow { font-size: .6rem; color: var(--muted); transition: transform var(--t-fast); }
.dd.open .dd-arrow { transform: rotate(180deg); }

.dd-menu {
  position: absolute; top: calc(100% + .4rem); right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; box-shadow: var(--sh);
  list-style: none; padding: .3rem 0; min-width: 190px;
  z-index: 200; opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.dd.open .dd-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dd-item {
  display: block; padding: .5rem 1rem;
  color: var(--muted); font-size: .875rem; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.dd-item:hover  { background: var(--surface); color: var(--fg); }
.dd-item.active { color: var(--accent); font-weight: 600; background: var(--surface); }

/* Theme switcher */
.theme-sw {
  display: flex; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px; gap: 2px;
}
.theme-btn {
  background: none; border: none; color: var(--muted);
  padding: .33rem .48rem; border-radius: 2px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t-fast), background var(--t-fast);
}
.theme-btn:hover  { color: var(--fg); }
.theme-btn.active { background: var(--bg); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.theme-btn svg    { width: 14px; height: 14px; fill: currentColor; }

/* ==========================================================================
   HERO
   ========================================================================== */
#landing {
  border-top: none;
  padding: 7rem 0 5rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-photo {
  width: 100%; aspect-ratio: 4/5;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(15%);
  transition: filter 500ms, transform 500ms;
}
.hero-photo:hover img { filter: grayscale(0%); transform: scale(1.02); }

.hero-name {
  font-family: var(--f-head);
  font-size: clamp(2rem, 3vw, 4rem);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.05;
  margin-bottom: .35rem;
}
.hero-role {
  font-size: 1.05rem; font-weight: 500; color: var(--accent);
  margin-bottom: 1rem;
}
.hero-bio {
  color: var(--muted); max-width: 480px; line-height: 1.72;
  margin-bottom: 1.75rem;
}
.hero-links { display: flex; flex-flow: row wrap; gap: .75rem 1.5rem; align-items: center; }
.hero-link {
  display: flex; align-items: center; gap: .4rem;
  color: var(--muted); font-family: var(--f-mono); font-size: .85rem;
  transition: color var(--t-fast);
}
.hero-link:hover { color: var(--fg); }
.hero-link span { border-bottom: 1px solid transparent; transition: border-color var(--t-fast); }
.hero-link:hover span { border-bottom-color: currentColor; }
.hero-link svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--accent-bg);
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--t-fast), border-style var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.resume-btn:hover {
  background: var(--accent);
  color: var(--bg);
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(179, 125, 86, 0.15);
}
.resume-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}
.resume-wrap {
  display: inline-flex;
}
html[data-theme="dark"] .resume-btn:hover {
  box-shadow: 0 4px 12px rgba(224, 160, 112, 0.15);
}

/* ==========================================================================
   EXPERIENCE
   ========================================================================== */
.exp-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.timeline { display: flex; flex-direction: column; gap: 2rem; }
.tl-item {
  border-left: 2px solid var(--border);
  padding-left: 1rem; padding-bottom: .5rem;
  position: relative;
  transition: border-color var(--t-normal);
}
.tl-item::before {
  content: ''; position: absolute; left: -5px; top: 18px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: background var(--t-normal);
}
.tl-item:hover { border-color: var(--accent); }
.tl-item:hover::before { background: var(--accent); }
.tl-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.tl-icon {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: 4px; background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.tl-icon svg { width: 20px; height: 20px; }
.tl-item:hover .tl-icon { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.tl-meta { font-family: var(--f-mono); font-size: .72rem; color: var(--accent); margin-bottom: .1rem; }
.tl-role { font-family: var(--f-head); font-size: 1.05rem; font-weight: 700; }
.tl-org  { font-size: .875rem; color: var(--muted); margin-bottom: .35rem; }
.tl-desc { font-size: .875rem; color: var(--muted); line-height: 1.6; }

.skills { display: flex; flex-direction: column; gap: 1.25rem; }
.skill-group { display: flex; flex-direction: column; gap: .4rem; }
.skill-label {
  font-family: var(--f-mono); font-size: .72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border); padding-bottom: .2rem;
}
.tag-list { display: flex; flex-flow: row wrap; gap: .35rem; }
.tag {
  font-family: var(--f-mono); font-size: .83rem;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); padding: .18rem .5rem; border-radius: 4px;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.tag:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--fg); }

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.project-list { display: flex; flex-direction: column; }
.project {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--border);
  transition: border-color var(--t-normal);
}
.project:first-child { border-top: 1px solid var(--border); }
.project:hover { border-color: var(--accent); }
.proj-icon {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 4px; background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.proj-icon svg { width: 20px; height: 20px; }
.project:hover .proj-icon { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.proj-body { flex: 1; }
.proj-name {
  font-family: var(--f-head); font-size: 1.08rem; font-weight: 700;
  display: flex; align-items: center; gap: .4rem; margin-bottom: .15rem;
}
.proj-name svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.5;
  opacity: 0; transform: translate(-3px, 3px);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.project:hover .proj-name svg { opacity: .65; transform: translate(0, 0); }
.proj-desc { font-size: .875rem; color: var(--muted); line-height: 1.55; }
.proj-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.proj-tech { font-family: var(--f-mono); font-size: .83rem; color: var(--accent); white-space: nowrap; }
.proj-cat  { font-family: var(--f-mono); font-size: .72rem;  color: var(--muted); white-space: nowrap; }

/* ==========================================================================
   CREDENTIALS
   ========================================================================== */
.creds-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 3.5rem;
  align-items: start;
}
.creds-col { display: flex; flex-direction: column; gap: 1rem; }
.creds-sub {
  font-family: var(--f-head); font-size: 1.1rem; font-weight: 700;
  border-bottom: 1px solid var(--border); padding-bottom: .4rem; margin-bottom: .15rem;
}

.ach-list { display: flex; flex-direction: column; gap: 1.25rem; }
.ach-item {
  border-left: 2px solid var(--border); padding-left: 1rem; position: relative;
  transition: border-color var(--t-normal);
}
.ach-item::before {
  content: ''; position: absolute; left: -5px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--border);
}
.ach-item:hover { border-color: var(--accent); }
.ach-item:hover::before { background: var(--accent); }
.ach-label { font-family: var(--f-mono); font-size: .72rem; color: var(--accent); margin-bottom: .1rem; }
.ach-title { font-family: var(--f-head); font-size: .98rem; font-weight: 700; margin-bottom: .2rem; }
.ach-desc  { font-size: .875rem; color: var(--muted); line-height: 1.5; }

.cert-list { display: flex; flex-direction: column; gap: .5rem; }
.cert {
  display: flex; align-items: center; gap: .65rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: .6rem .8rem;
  position: relative;
  transition: border-color var(--t-fast);
}
.cert:hover { border-color: var(--accent); }

/* Glowing check mark badge */
.glowing-check {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  background: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
  border: 1.5px solid var(--bg);
  animation: pulse-green 1.8s infinite alternate ease-in-out;
}
.glowing-check svg {
  width: 25px;
  height: 25px;
  fill: #fff;
  display: block;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.55);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.85), 0 0 4px rgba(16, 185, 129, 0.55);
    transform: scale(1.04);
  }
}
.cert-icon {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: 4px; background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cert-icon svg { width: 18px; height: 18px; }
.cert-name   { font-family: var(--f-head); font-weight: 700; font-size: .88rem; line-height: 1.3; }
.cert-issuer { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); margin-top: .1rem; }

.article-list { display: flex; flex-direction: column; }
.article {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
  transition: border-color var(--t-normal);
}
.article:first-child { border-top: 1px solid var(--border); }
.article:hover { border-color: var(--accent); }
.article-title { font-size: .95rem; transition: color var(--t-fast); }
.article:hover .article-title { color: var(--accent); }
.article-time  { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* ==========================================================================
   BLOGS SECTION
   ========================================================================== */
#blogs {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.blog-window {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  padding: 0.5rem;
  transition: border-color var(--t-normal);
}

.blog-list-container {
  max-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.5rem;
}

/* Custom minimal scrollbar */
.blog-list-container::-webkit-scrollbar {
  width: 4px;
}
.blog-list-container::-webkit-scrollbar-track {
  background: transparent;
}
.blog-list-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.blog-list-container::-webkit-scrollbar-thumb:hover {
  background: var(--border-hv);
}

/* Card */
.blog-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: background var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
}
.blog-card:last-child {
  border-bottom: none;
}
.blog-card:hover {
  background: var(--surface);
  transform: translateY(-2px);
  border-bottom-color: var(--border-hv);
}

.blog-card-left {
  flex: 1;
}

.blog-card-cat {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  display: block;
}

.blog-card-title {
  font-family: var(--f-head);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  margin-bottom: 0.4rem;
  transition: color var(--t-fast);
}
.blog-card:hover .blog-card-title {
  color: var(--accent);
}

.blog-card-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.blog-card-sep {
  color: var(--border);
}

.blog-card-right {
  flex-shrink: 0;
}

.blog-card-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
  transition: border-color var(--t-fast);
  background: var(--surface);
}
.blog-card:hover .blog-card-thumb {
  border-color: var(--accent);
}

@media (max-width: 720px) {
  #blogs {
    min-height: auto;
    padding: 3.5rem 0;
  }
  .blog-card {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 1rem;
    padding: 1.25rem 0.5rem;
  }
  .blog-card-right {
    margin-bottom: 0.5rem;
  }
  .blog-card-thumb {
    width: 100%;
    height: 120px;
  }
}

/* ==========================================================================
   THANKS / FOOTER
   ========================================================================== */
#thanks {
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 4rem 0;
}
.thanks-num   { font-family: var(--f-mono); font-size: .72rem; color: var(--accent); margin-bottom: .5rem; display: block; }
.thanks-head  { font-family: var(--f-head); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -.022em; margin-bottom: 1rem; }
.thanks-sub   { color: var(--muted); max-width: 500px; margin: 0 auto 2rem; line-height: 1.75; }
.thanks-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--f-mono); font-size: .875rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--fg); padding: .75rem 1.75rem; border-radius: 8px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.thanks-btn:hover { background: var(--surface-hv); border-color: var(--border-hv); }
.thanks-btn svg { width: 14px; height: 14px; fill: currentColor; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: .75rem;
  font-family: var(--f-mono); font-size: .72rem; color: var(--muted);
  max-width: 1200px; margin: 0 auto;
}
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a:hover { color: var(--accent); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 720px) {
  .wrap { padding: 0 1.25rem; }
  section { padding: 3.5rem 0; }
  #landing { padding: 4rem 0 3rem; }

  .hero-grid { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .hero-photo { max-width: 140px; border-radius: 50%; aspect-ratio: 1; margin: 0 auto; }
  .hero-links { justify-content: center; }
  .resume-wrap { flex-basis: 100%; justify-content: center; margin-top: .75rem; display: flex; }
  .hero-bio { margin-left: auto; margin-right: auto; }

  .exp-grid    { grid-template-columns: 1fr; gap: 2.5rem; }
  .creds-grid  { grid-template-columns: 1fr; gap: 2.5rem; }
  .project { flex-direction: column; gap: .65rem; }
  .proj-meta { flex-direction: row; gap: .5rem; }

  .site-footer { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }

  .nav-inner { padding: 0 1.25rem; }

  /* Mobile theme switcher: only active visible by default */
  .theme-sw:not(.open) .theme-btn:not(.active) {
    display: none;
  }
}

@media (max-width: 480px) {
  .dd-trigger { padding: .35rem .6rem; font-size: .8rem; }
  .theme-btn  { padding: .3rem .38rem; }
  .theme-btn svg { width: 12px; height: 12px; }
}
