/* ==========================================================================
   mtsaga.net theme layer — loaded after style.css (and blog.css) and sets the look.
   Tokens live in style.css :root. Structure and behavior live in style.css.
   ========================================================================== */

html { scroll-behavior: smooth; background: var(--dark-bg); }
body {
  font-family: var(--font-body);
  background: var(--dark-bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .logo, .btn, .prompt, .cred-group-title, .taskbar-name, .filter-btn {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
h2, h3 { font-weight: 700; }
::selection { background: rgba(56,189,248,.35); }

/* ---------- Header ---------- */
.header {
  background: rgba(10,13,20,.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  height: 60px;
}
.nav a { color: var(--muted); font-weight: 500; font-size: .92rem; transition: color .2s; }
.nav a:hover { color: var(--fg); }
.logo {
  font-weight: 600; letter-spacing: -0.02em; text-transform: none; font-size: 1.05rem; color: var(--fg);
}
.header-icon-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; }
.header-icon-btn:hover { color: var(--fg); border-color: var(--line-strong); background: rgba(255,255,255,.04); }
.header-cta {
  background: transparent; color: var(--fg); border: 1px solid var(--line-strong); border-radius: 8px;
  font-weight: 600; font-size: .85rem; font-family: var(--font-body);
}
.header-cta:hover { background: rgba(255,255,255,.06); border-color: rgba(56,189,248,.5); color: #fff; }
.header-search-input { border-color: var(--line); }

/* ---------- Buttons ---------- */
.btn {
  font-weight: 600; font-size: .9rem; border-radius: 10px; padding: .7rem 1.2rem;
  background: var(--accent); color: #06111a; transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
}
.btn:hover { opacity: 1; transform: translateY(-1px); box-shadow: var(--glow); }
.btn-primary { background: var(--accent); color: #06111a; }
.btn i { margin-right: .4rem; }

/* ---------- Hero ---------- */
.hero {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto minmax(460px, 1fr);
  gap: 2rem 2.5rem; padding: 4.5rem 2rem 2rem; align-items: stretch;
}
.hero-head {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 2.5rem; row-gap: .4rem;
  padding-bottom: .75rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem;
}
.hero-title {
  grid-column: 1; grid-row: 1 / 3; margin: 0;
  font-family: var(--font-display); font-weight: 500; font-size: clamp(3rem, 6.5vw, 5.2rem);
  line-height: .98; letter-spacing: -0.035em; color: #fff; font-optical-sizing: auto;
}
.hero-eyebrow {
  grid-column: 2; grid-row: 1; justify-self: end; text-align: right; margin: 0;
  font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.hero-tag {
  grid-column: 2; grid-row: 2; justify-self: end; text-align: right; margin: 0; max-width: 30ch;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem); font-weight: 400; color: var(--muted); line-height: 1.3; letter-spacing: -0.01em;
}

.hero-left { position: relative; }
.hero-left img.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.9);
}
.hero-right { display: flex; }
.desktop-preview-window { width: 100%; display: flex; flex-direction: column; }
.desktop-preview-window .desktop-iframe { flex: 1; min-height: 0; aspect-ratio: auto; height: 100%; }

/* Desktop preview keeps its window chrome, now glassy with a glow */
.desktop-preview-window {
  background: var(--glass); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.9);
}
.mac-header { background: rgba(255,255,255,.04); border-bottom: 1px solid var(--line); padding: 10px 12px; }
.terminal-expand-btn {
  background: rgba(56,189,248,.12); color: var(--accent); border: 1px solid rgba(56,189,248,.35); border-radius: 6px;
  font-family: var(--font-body); font-weight: 600; font-size: .75rem;
}
.terminal-expand-btn:hover { background: rgba(56,189,248,.22); }

/* Ticker */
.logo-ticker-container { width: 100%; max-width: 1200px; margin-top: 3rem; padding: 1.25rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.logo-ticker-container::before, .logo-ticker-container::after { background: linear-gradient(90deg, var(--dark-bg), transparent); }
.logo-ticker-container::after { background: linear-gradient(270deg, var(--dark-bg), transparent); }
.logo-ticker-track img { filter: grayscale(1) brightness(1.6) opacity(.55); transition: filter .25s; }
.logo-ticker-track img:hover { filter: none; }
.ticker-pause { background: rgba(10,13,20,.85); border-color: var(--line-strong); }

/* ---------- Sections ---------- */
.section { padding: 5.5rem 2rem; }
.bg-alt, #projects, #certifications, .competitions-section { background: transparent; }
.competitions-section, #certifications { padding: 5.5rem 2rem; }
.section h2, .competitions-section h2, #certifications h2, #projects h2 {
  font-family: var(--font-display); font-size: clamp(2.1rem, 4vw, 3rem); font-weight: 500; letter-spacing: -0.03em; color: var(--fg); margin-bottom: .75rem;
}
.subtitle, .projects-subheader { color: var(--muted); }
.indiana-tech-logo { filter: grayscale(1) brightness(1.5) opacity(.8); max-width: 220px; }

/* Glass card primitive */
.service-card, .cred-card, .recent-post-item {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 50px -30px rgba(0,0,0,.8);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.service-card:hover, .cred-card:hover, .recent-post-item:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,.45);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, var(--glow);
}

/* Specialty */
.services.cards { gap: 1.25rem; flex-wrap: wrap; max-width: 1240px; margin: 0 auto; }
.service-card { width: 280px; padding: 1.75rem 1.5rem; text-align: left; }
.service-icon { height: 40px; width: auto; max-width: 120px; object-fit: contain; margin-bottom: 1rem; }
.service-card h3 { font-size: 1.1rem; }
.service-card p { color: var(--muted); font-size: .92rem; }
.service-card .btn { background: rgba(255,255,255,.05); color: var(--fg); border: 1px solid var(--line-strong); padding: .55rem 1rem; font-size: .85rem; }
.service-card .btn:hover { border-color: rgba(56,189,248,.5); box-shadow: none; }

/* Competitions */

/* About */
/* LinkedIn embed: its card is a fixed header and footer (about 250px) plus a 3:2 image, so the frame height follows its width */
.about-left { container-type: inline-size; }
.about-left iframe { display: block; border: 0; border-radius: var(--radius); background: transparent; height: calc(66.7cqw + 250px); }
.recent-post-item { border-left: 3px solid var(--accent); }
.recent-post-item .post-date { color: var(--muted-2); font-size: .75rem; }

/* Projects */
.projects { max-width: none; }
.projects > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.phead { text-align: center; margin-bottom: 2.5rem; }
.phead h2, .phead h1 { margin-bottom: .5rem; }
.projects-subheader { color: var(--muted); margin: 0; }

/* filters */
.pfilters { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 0 0 2rem; }
.filter-btn {
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); border-radius: 999px;
  font-size: .85rem; font-weight: 600; padding: .55rem 1.1rem; box-shadow: none; text-transform: none; cursor: pointer;
  font-family: var(--font-body);
}
.filter-btn:hover { color: var(--fg); border-color: var(--line-strong); background: rgba(255,255,255,.07); transform: none; box-shadow: none; }
.filter-btn.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(56,189,248,.45); box-shadow: none; }

/* card */
.pcard {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .25s ease, border-color .25s ease;
}
.pcard:hover { transform: translateY(-4px); border-color: rgba(56,189,248,.45); }
.pcard[hidden] { display: none; }
.pthumb { position: relative; aspect-ratio: 16 / 10; background: #0b0f16; border-bottom: 1px solid var(--line); overflow: hidden; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.pthumb-empty { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted-2); font-weight: 600; font-size: 2rem; letter-spacing: -0.03em;
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.025) 14px 15px); }
.pthumb-engine { height: 100%; padding: .9rem 1rem; font-family: 'Source Code Pro', ui-monospace, monospace; font-size: .72rem; color: #e6e9f0; background: #000; }
.pthumb-engine .pe-title { text-align: center; font-style: italic; color: #9aa3b5; margin-bottom: .6rem; }
.pthumb-engine table { width: 100%; border-collapse: collapse; }
.pthumb-engine th, .pthumb-engine td { border: 1px solid #333; padding: .32rem .45rem; text-align: left; }
.pbody { display: flex; flex-direction: column; gap: .55rem; padding: 1rem 1.1rem 1.1rem; }
.ptitle { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.ptitle a { color: var(--fg); text-decoration: none; }
.ptitle a:hover { color: var(--accent); }
.psummary { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ptags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .25rem; }
.ptag { font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .18rem .5rem; }
.ptag-cybersecurity { color: var(--accent); border-color: rgba(56,189,248,.35); }

/* grids */
.pgrid { display: grid; gap: 1.25rem; }
.pgrid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* A: index list */
.pindex-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 3rem 0 1rem; }
.pindex-head h3 { margin: 0; font-size: 1.1rem; font-weight: 600; color: var(--muted); }
.pindex-head .pfilters { margin: 0; justify-content: flex-end; }
.pindex { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card-bg); }
.prow { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto 32px; align-items: center; gap: 1rem; padding: .8rem 1rem; border-top: 1px solid var(--line); transition: background .15s; }
.prow:first-child { border-top: 0; }
.prow:hover { background: rgba(255,255,255,.03); }
.prow[hidden] { display: none; }
.prow-thumb { width: 72px; height: 45px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); background: #0b0f16; display: block; }
.prow-thumb-empty { background: repeating-linear-gradient(135deg, #0b0f16 0 10px, #10151f 10px 11px); }
.prow-main { display: flex; flex-direction: column; min-width: 0; gap: .15rem; }
.prow-title { font-weight: 600; font-size: .98rem; letter-spacing: -0.01em; }
.prow-title a { color: var(--fg); text-decoration: none; } .prow-title a:hover { color: var(--accent); }
.prow-summary { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow-tags { display: flex; gap: .35rem; flex-wrap: nowrap; }
.prow-arrow { color: var(--muted); text-decoration: none; font-size: 1.1rem; text-align: center; }
.prow-arrow:hover { color: var(--accent); }


/* Credentials */
.cred-card { background: var(--card-bg); }
.cred-mono { background: var(--accent-soft); color: var(--accent); border-radius: 10px; font-family: var(--font-display); font-weight: 800; }
.cred-name { font-weight: 600; }
.cred-group-title { color: var(--muted-2); letter-spacing: .12em; }
.cred-link { color: var(--accent); }

/* Contact */
.contact { background: transparent; padding: 5.5rem 2rem; text-align: left; }
.contact-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 3rem; align-items: start; }
.contact-intro h2 { text-align: left; margin-bottom: .75rem; }
.contact-intro p { color: var(--muted); max-width: 38ch; margin-bottom: 1.5rem; }
.contact-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.contact-links a { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--fg); font-size: .9rem; font-weight: 500; text-decoration: none; }
.contact-links a:hover { border-color: rgba(56,189,248,.5); color: var(--accent); }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; max-width: none; margin: 0; }
.contact-form .field { display: flex; flex-direction: column; gap: .4rem; }
.contact-form .field-full { grid-column: 1 / -1; }
.contact-form label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: left; }
.contact-form input, .contact-form textarea { width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--fg); border-radius: 10px; padding: .75rem .9rem; font: inherit; font-size: .95rem; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: rgba(56,189,248,.6); box-shadow: 0 0 0 3px rgba(56,189,248,.15); }
.contact-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .25rem; }
.contact-form .btn { margin: 0; grid-column: auto; }
.contact-form .btn:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.contact-status { margin: 0; font-size: .9rem; color: var(--muted); min-height: 1.4em; }
.contact-status.is-ok { color: #4ade80; }
.contact-status.is-err { color: #f87171; }
@media (max-width: 860px) {
  .contact-inner { grid-template-columns: 1fr; gap: 2rem; }
  .contact-form { grid-template-columns: 1fr; }
}

/* ---------- Footer / taskbar ---------- */
.taskbar-footer { background: var(--footer-bg); border-top: 1px solid var(--line); }
.taskbar-name { font-weight: 800; letter-spacing: -0.01em; text-transform: none; }
.taskbar { background: rgba(10,13,20,.85); border-top: 1px solid var(--line); }
.tb-btn { background: rgba(255,255,255,.03); border: 1px solid transparent; border-radius: 10px; }
.tb-btn:hover { background: rgba(56,189,248,.10); border-color: rgba(56,189,248,.35); color: var(--accent); }
.tb-btn::after { background: var(--accent); }

/* Misc */
#scrollToTopBtn { background: var(--accent); color: #06111a; box-shadow: var(--glow); }
.cursor-trail { background: var(--accent); }
.skip-link { background: var(--accent); color: #06111a; font-family: var(--font-body); font-weight: 600; }
:focus-visible { outline-color: var(--accent); }

/* ---------- Blog ---------- */
.blog-header { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 1rem 0 2.5rem; margin-bottom: 3rem; text-align: left; }
.blog-header h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.6rem, 5vw, 4rem); letter-spacing: -0.035em; color: #fff; margin-bottom: .75rem; }
.blog-header p { margin: 0; max-width: 60ch; font-size: 1.05rem; }

.blog-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; transition: transform .25s ease, border-color .25s ease; }
.blog-card:hover { transform: translateY(-4px); border-color: rgba(56,189,248,.45); box-shadow: none; }
.blog-card-image { height: 190px; border-bottom: 1px solid var(--line); background: #0b0f16; }
.blog-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em; }
.blog-card-category, .blog-post-meta .blog-card-category { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(56,189,248,.35); border-radius: 999px; padding: .2rem .65rem; font-size: .68rem; letter-spacing: .05em; }
.blog-tag, .tag-cloud-item { background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--fg); border-radius: 999px; padding: .25rem .7rem; font-size: .76rem; }
.blog-tag:hover, .tag-cloud-item:hover { background: var(--accent-soft); color: var(--accent); border-color: rgba(56,189,248,.45); }
.read-more { color: var(--accent); }

/* post */
.blog-post-header { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 1rem 0 2rem; text-align: left; }
.blog-post-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; line-height: 1.1; color: #fff; }
.blog-post-meta { justify-content: flex-start; color: var(--muted); }
.blog-post-content { font-size: 1.02rem; line-height: 1.75; }
.blog-post-content h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; letter-spacing: -0.025em; color: #fff; border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin-top: 3rem; }
.blog-post-content h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; color: #fff; border: 0; margin-top: 2.25rem; }
.blog-post-content h4 { color: var(--fg); font-weight: 600; }
.blog-post-content a { color: var(--accent); }
.blog-post-content hr { border: 0; border-top: 1px solid var(--line); }
.blog-post-content code { background: rgba(255,255,255,.06); color: var(--accent); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; font-size: .9em; }
.blog-post-content pre, .highlight { background: #0b0f16; border: 1px solid var(--line); border-radius: 12px; }
.blog-post-content pre code { background: transparent; border: 0; color: #e6e9f0; }
.highlight pre, .blog-post-content .highlight pre { background: transparent; border: 0; margin: 0; border-radius: 0; }
.blog-post-content blockquote { background: var(--card-bg); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; color: var(--muted); }
.blog-post-content img { border-radius: 12px; border: 1px solid var(--line); }
.blog-post-content table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
.blog-post-content th { background: rgba(255,255,255,.04); color: var(--fg); font-weight: 600; border-bottom: 1px solid var(--line-strong); }
.blog-post-content td { border-bottom: 1px solid var(--line); }
.blog-post-content tr:last-child td { border-bottom: 0; }
.toc-container { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.toc-container h2 { color: var(--fg); font-weight: 600; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; border: 0; }
.toc-container li a { color: var(--muted); }
.toc-container li a:hover { color: var(--accent); }
.back-to-blog { color: var(--muted); }
.back-to-blog:hover { color: var(--accent); }

/* reading progress + copy buttons */
.read-progress { position: fixed; top: 60px; left: 0; right: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; z-index: 999; pointer-events: none; }
.has-copy { position: relative; }
.code-copy { position: absolute; top: .55rem; right: .55rem; padding: .3rem .65rem; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(10,13,20,.85); color: var(--muted); font: 600 .72rem var(--font-body); cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, border-color .15s; }
.has-copy:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--fg); border-color: rgba(56,189,248,.5); }
.code-copy.ok { color: #4ade80; border-color: rgba(74,222,128,.5); opacity: 1; }
@media (hover: none) { .code-copy { opacity: 1; } }
@media print { .read-progress, .code-copy { display: none; } }

/* sidebar */
.sidebar-widget { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.sidebar-widget h3 { color: var(--fg); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--line); }
.sidebar-widget h3 i { color: var(--accent); }
.sidebar-widget li a { color: var(--muted); }
.sidebar-widget li a:hover { color: var(--fg); }
.post-count { background: var(--accent-soft); color: var(--accent); border-radius: 999px; }
.recent-post-title { color: var(--fg); font-weight: 500; }
.recent-post-date { color: var(--muted-2); }
.pagination a, .pagination span { background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; }
.pagination a:hover { border-color: rgba(56,189,248,.5); color: var(--fg); background: rgba(255,255,255,.06); }
.pagination .current { background: var(--accent-soft); color: var(--accent); border-color: rgba(56,189,248,.45); }

/* search */
mark { background: rgba(56,189,248,.3); color: inherit; border-radius: 3px; padding: 0 .15em; }
.search-result-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Resume ---------- */
.resume-wrapper { padding-top: 6rem; }
.resume-paper { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.resume-toolbar a { border-radius: 10px; font-family: var(--font-body); font-weight: 600; }
.btn-download { background: var(--accent); color: #06111a; }
.btn-print { background: rgba(255,255,255,.04); color: var(--fg); border: 1px solid var(--line-strong); }
.res-header { border-bottom: 1px solid var(--line); }
.res-section h2 { color: var(--accent); font-family: var(--font-body); font-weight: 600; letter-spacing: .1em; border-color: var(--line); }
.res-entry:hover { border-left-color: var(--accent); }
.res-entry-head h3 { font-family: var(--font-body); font-weight: 600; }
.res-entry-org, .res-contact a, .res-entry-head h3 a { color: var(--accent); }
.res-entry-date { color: var(--muted-2); font-family: var(--font-body); }
.res-tag { background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--fg); border-radius: 999px; }
.res-tag:hover { background: var(--accent-soft); border-color: rgba(56,189,248,.45); color: var(--accent); }


.logos { display: flex; gap: 3rem; justify-content: center; align-items: center; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; }
.logos img { max-height: 80px; width: auto; object-fit: contain; transition: transform .25s; }
.logos a:hover img { transform: scale(1.04); }
.cstats { list-style: none; padding: 2.5rem 0 0; margin: 2.5rem auto 0; max-width: 1240px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.5rem; border-top: 1px solid var(--line); text-align: center; }
.cstats b { display: block; font-size: 2.4rem; font-weight: 500; letter-spacing: -.04em; color: #fff; line-height: 1; }
.cstats span { display: block; margin-top: .5rem; font-size: .92rem; font-weight: 600; }
.cstats em { display: block; font-style: normal; color: var(--muted); font-size: .78rem; margin-top: .15rem; }
@media (max-width: 900px) { .cstats { grid-template-columns: repeat(3, 1fr); } .logos { gap: 1.75rem; } .logos img { max-height: 54px; } }
@media (max-width: 520px) { .cstats { grid-template-columns: repeat(2, 1fr); } }
/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; gap: 2rem; padding-top: 3rem; }
  .hero-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .hero-eyebrow, .hero-tag { text-align: center; }
  .hero-left img.hero-photo { position: static; max-width: 420px; margin: 0 auto; display: block; aspect-ratio: 1/1; height: auto; }
}
@media (max-width: 1024px) {
  .pgrid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .pindex-head { margin-top: 2rem; }
  .pindex-head .pfilters { justify-content: flex-start; }
  .prow { grid-template-columns: 56px minmax(0, 1fr) 24px; gap: .75rem; padding: .7rem .8rem; }
  .prow-thumb { width: 56px; height: 35px; }
  .prow-tags { display: none; }
  .contact-form { padding: 1.1rem; }
}
@media (max-width: 768px) {
  .hero-title { font-size: clamp(2.6rem, 12vw, 4rem); }
  .section { padding: 4rem 1.25rem; }
  .service-card { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .service-card:hover, .cred-card:hover, .pcard:hover, .recent-post-item:hover { transform: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 1024px) {
  /* header: fixed 60px bar, menu opens as a full-screen sheet below it */
  .header { height: 60px; min-height: 0; flex-wrap: wrap; align-content: flex-start; padding: 0 1.25rem; }
  .logo { height: 59px; display: flex; align-items: center; padding: 0; }
  .hamburger { height: 59px; justify-content: center; padding: 0 2px; }
  .header:has(.nav-open) { background: #0a0d14; }
  .header:has(.nav-open)::after { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 100vh; height: 100dvh; background: #0a0d14; z-index: -1; }
  .nav { border-top: 0; gap: 0; padding: .25rem 0 0; align-items: stretch; }
  .nav a { text-align: left; padding: 1rem 0; font-size: 1.5rem; font-weight: 500; letter-spacing: -.025em; color: var(--fg); border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav.nav-open ~ .header-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: 1.25rem 0 0; }
  .header-search-form { grid-column: 1 / -1; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 .4rem; background: rgba(255,255,255,.03); }
  .header-search-input, .header-search-form.expanded .header-search-input { opacity: 1; padding: .8rem .5rem; margin: 0; border: 0; background: transparent; box-shadow: none; font-size: 1rem; }
  .header-cta { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .85rem 1rem; font-size: .95rem; border-radius: 10px; }
  .header-social { grid-column: 1 / -1; order: 5; justify-content: flex-start; gap: .6rem; padding-top: .4rem; }
  .header-social .header-icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; font-size: 1.05rem; }
}
@media (max-width: 768px) {
  /* hero: tighter, and the desktop preview renders as a scaled-down desktop instead of reflowing */
  .hero { padding: 2.25rem 1.25rem 1rem; gap: 1.5rem; }
  .hero-left img.hero-photo { max-width: 100%; aspect-ratio: 4 / 5; }
  .desktop-preview-window { position: relative; display: block; aspect-ratio: 16 / 11.6; overflow: hidden; }
  .desktop-preview-window .mac-header { position: relative; z-index: 2; height: 40px; display: flex; align-items: center; background: rgba(16,22,36,.96); }
  .desktop-preview-window .desktop-iframe { position: absolute; left: 0; top: 40px; width: 250%; height: calc((100% - 40px) * 2.5); flex: none; aspect-ratio: auto; transform: scale(.4); transform-origin: 0 0; pointer-events: none; }
  .section h2, .competitions-section h2, #certifications h2, #projects h2 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .competitions-section, #certifications { padding: 4rem 1.25rem; }
  .service-card { width: 100%; }
  .logos { gap: 1.25rem 2rem; }
  .logos img { max-height: 48px; }
  .cstats { gap: 1.75rem 1rem; padding-top: 2rem; margin-top: 2rem; }
  .cstats b { font-size: 2.1rem; }
  /* project index filters: one swipeable row */
  .pindex-head { display: block; }
  .pindex-head h3 { margin-bottom: .75rem; }
  .pindex-head .pfilters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem .25rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pindex-head .pfilters::-webkit-scrollbar { display: none; }
  .pindex-head .filter-btn { flex: none; white-space: nowrap; }
  /* blog */
  .blog-header { padding: 0 0 1.75rem; margin-bottom: 1.75rem; }
  .blog-header h1 { font-size: clamp(2.2rem, 10vw, 2.8rem); }
  .blog-card-meta { flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
  .blog-card-date { white-space: nowrap; }
  .blog-post-content { background: none; border: 0; border-radius: 0; padding: 0; }
  .blog-post-content h2 { font-size: 1.45rem; margin-top: 2.25rem; }
  .blog-post-content h3 { font-size: 1.15rem; }
  .blog-post-content pre, .highlight { margin-left: -1.25rem; margin-right: -1.25rem; border-radius: 0; border-left: 0; border-right: 0; }
  .highlight pre { margin: 0; }
  .blog-post-content pre { font-size: .82rem; }
  .blog-post-content ul, .blog-post-content ol { padding-left: 1.2rem; }
  .toc-container { padding: 0; }
  .toc-container > summary { padding: 1rem 1.1rem; }
  .toc-container > ul { padding: 0 1.1rem 1rem; }
  #scrollToTopBtn { right: 14px; bottom: 72px; width: 40px; height: 40px; padding: 0; font-size: 15px; }
  .blog-post-header .blog-card-tags, .blog-post-tags { justify-content: flex-start; }
}
@media (max-width: 600px) {
  /* featured projects: swipeable row with the next card peeking */
  .pgrid-3 { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: .9rem; margin: 0 -1.25rem; padding: 0 1.25rem .5rem; scroll-padding: 0 1.25rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pgrid-3::-webkit-scrollbar { display: none; }
  .pgrid-3 > * { flex: 0 0 84%; scroll-snap-align: start; opacity: 1 !important; transform: none !important; }
}
.sidebar-widget, .recent-posts-list li a { text-align: left; }
/* table of contents is a disclosure: open on desktop, closed on phones (post.js) */
.toc-container > summary { cursor: pointer; list-style: none; color: var(--fg); font-family: var(--font-display); font-weight: 600; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; display: flex; justify-content: space-between; align-items: center; }
.toc-container > summary::-webkit-details-marker { display: none; }
.toc-container > summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.toc-container[open] > summary::after { content: '\2212'; }
.toc-container[open] > summary { margin-bottom: 1rem; }

/* mobile menu animation */
@media (max-width: 1024px) {
  .header:has(.nav-open)::after { animation: menu-sheet .28s ease both; }
  .nav.nav-open a, .nav.nav-open ~ .header-actions > * { animation: menu-item .42s cubic-bezier(.2,.8,.2,1) both; }
  .nav.nav-open a:nth-child(1) { animation-delay: .04s; }
  .nav.nav-open a:nth-child(2) { animation-delay: .08s; }
  .nav.nav-open a:nth-child(3) { animation-delay: .12s; }
  .nav.nav-open a:nth-child(4) { animation-delay: .16s; }
  .nav.nav-open ~ .header-actions > :nth-child(1) { animation-delay: .22s; }
  .nav.nav-open ~ .header-actions > :nth-child(3) { animation-delay: .27s; }
  .nav.nav-open ~ .header-actions > :nth-child(4) { animation-delay: .31s; }
  .nav.nav-open ~ .header-actions > :nth-child(2) { animation-delay: .36s; }
  .header.nav-closing::after, .header.nav-closing .nav a, .header.nav-closing .header-actions > * { animation: menu-out .2s ease both; animation-delay: 0s !important; }
  .hamburger span { transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .2s ease; }
}
@keyframes menu-sheet { from { opacity: 0; } to { opacity: 1; } }
@keyframes menu-item { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes menu-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .header::after, .nav a, .header-actions > * { animation: none !important; }
}

/* ---------- Motion (assets/scripts/motion.js adds html.motion; nothing here hides content without it) ---------- */
.motion .rv { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.motion .rv.rv-in { opacity: 1; transform: none; }
.motion .section > h2.rv, .motion .competitions-section > h2.rv { transform: translateY(10px); }

/* home hero entrance, released when the signature loader leaves */
.motion .hero-title, .motion .hero-eyebrow, .motion .hero-tag, .motion .hero-photo, .motion .hero .desktop-preview-window { opacity: 0; }
.motion.hero-go .hero-title { animation: rise .8s cubic-bezier(.2,.7,.2,1) .05s both; }
.motion.hero-go .hero-eyebrow { animation: rise .7s cubic-bezier(.2,.7,.2,1) .2s both; }
.motion.hero-go .hero-tag { animation: rise .7s cubic-bezier(.2,.7,.2,1) .3s both; }
.motion.hero-go .hero-photo { animation: settle .9s cubic-bezier(.2,.7,.2,1) .4s both; }
.motion.hero-go .hero .desktop-preview-window { animation: settle .9s cubic-bezier(.2,.7,.2,1) .52s both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }

/* inner pages ease in */
.motion main#main { animation: page-in .45s ease both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* project index: rows ease in when the filter changes */
.pf-anim .prow:not([hidden]) { animation: row-in .32s ease both; }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* hover and press details */
@media (hover: hover) {
  .nav a { position: relative; }
  .nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1.5px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .28s cubic-bezier(.2,.7,.2,1); }
  .nav a:hover::after { transform: scaleX(1); }
  .pthumb img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
  .pcard:hover .pthumb img { transform: scale(1.035); }
  .blog-card { overflow: hidden; }
  img.blog-card-image { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
  .blog-card:hover img.blog-card-image { transform: scale(1.035); }
  .read-more i, .prow-arrow, .back-to-blog i { display: inline-block; transition: transform .25s ease; }
  .read-more:hover i, .blog-card:hover .read-more i { transform: translateX(4px); }
  .prow:hover .prow-arrow { transform: translate(2px, -2px); color: var(--accent); }
  .back-to-blog:hover i { transform: translateX(-4px); }
  .cstats li b { transition: color .25s ease, transform .25s ease; display: block; }
  .cstats li:hover b { color: var(--accent); transform: translateY(-2px); }
}
.btn:active, .header-cta:active, .filter-btn:active { transform: scale(.97); }
.filter-btn { transition: background .2s ease, color .2s ease, border-color .2s ease, transform .12s ease; }
@media (max-width: 1024px) { .nav a::after { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .pf-anim .prow { animation: none; }
}

/* ---------- Post contents rail (desktop) ---------- */
.post-rail { display: none; }
@media (min-width: 1280px) {
  .blog-layout-with-sidebar.has-rail { grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 2.5rem; max-width: 1480px; }
  .has-rail details.toc-container { display: none; }
  .has-rail .post-rail { display: block; position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: none; padding: .25rem 0 1rem; }
  .post-rail::-webkit-scrollbar { display: none; }
  .post-rail-title { color: var(--muted); font-weight: 600; font-size: .95rem; padding: 0 0 .75rem 1rem; }
  .post-rail ul { list-style: none; margin: 0; padding: 0; }
  .post-rail > ul { border-left: 1px solid var(--line); }
  .post-rail li { margin: 0; }
  .post-rail a { display: block; margin-left: -1px; padding: .42rem 0 .42rem 1rem; border-left: 2px solid transparent; color: var(--muted-2); font-size: .9rem; line-height: 1.35; text-decoration: none; transition: color .2s ease, border-color .2s ease; }
  .post-rail a:hover { color: var(--fg); }
  .post-rail a.on { color: var(--accent); border-left-color: var(--accent); }
  .post-rail li.open > a { color: var(--fg); }
  .post-rail li.open > a.on { color: var(--accent); }
  /* sub-headings show only for the section being read */
  .post-rail ul ul { display: none; }
  .post-rail li.open > ul, .post-rail li.open ul ul { display: block; animation: row-in .28s ease both; }
  .post-rail ul ul a { padding: .3rem 0 .3rem 1.9rem; font-size: .84rem; }
  .post-rail ul ul ul a { padding-left: 2.7rem; }
}
.blog-post-content :is(h2, h3, h4, h5, h6)[id] { scroll-margin-top: 84px; }

/* desktop preview fades in once its deferred frame has loaded */
.desktop-iframe[data-src] { opacity: 0; transition: opacity .5s ease; }
.desktop-iframe.is-loaded { opacity: 1; }

/* Tables in posts stay inside the column: long inline code wraps instead of pushing the table wider */
.blog-post-content table { width: 100%; max-width: 100%; }
.blog-post-content td, .blog-post-content th { overflow-wrap: anywhere; vertical-align: top; }
.blog-post-content td code { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
/* Long inline code (template tags, paths) wraps instead of pushing the page wider on phones. */
.blog-post-content :not(pre) > code { overflow-wrap: anywhere; }
.blog-post-content td:first-child, .blog-post-content th:first-child { min-width: 7.5rem; }

/* ---------- Post share row ---------- */
.post-share { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.share-btn { display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); font: 500 .82rem var(--font-body); text-decoration: none; cursor: pointer; transition: color .2s, border-color .2s, background .2s, transform .12s; }
.share-btn:hover { color: var(--fg); border-color: var(--line-strong); background: rgba(255,255,255,.06); }
.share-btn:active { transform: scale(.97); }
.share-btn i { font-size: .9rem; }
.share-copy { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .78rem; }
.share-copy.is-done { color: var(--accent); border-color: rgba(56,189,248,.5); }
.share-btn[hidden] { display: none; }
@media (max-width: 600px) { .post-share a.share-btn span { display: none; } .post-share a.share-btn { width: 34px; padding: 0; justify-content: center; } }
