/* ==========================================================================
   Mayank (@Starz099) — Personal Portfolio & Blog
   Design System:
   - Clean, text-first minimalism with soft watercolor / paper accents
   - Top navbar with paperish wash and rough brush-masked bottom edge
   - Aras-style painted rough brush highlight for active navigation
   - Minimalist editorial sticky navigation for Blog timeline
   - Accessible native <dialog> modal for project demos & video streaming
   - Clean sans-serif typography with generous spacing and typographic hierarchy
   ========================================================================== */

:root {
  /* Surfaces & Paper Neutrals */
  --bg: #fbfaf8;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f1ec;
  --bg-hover: #ece8df;
  --fg: #1c1d1f;
  --fg-strong: #0d0e10;
  --muted: #57595c;
  --muted-light: #7c7e82;
  --line: #e3ded6;
  --line-subtle: #eeebe4;

  /* Accent Colors */
  --navbar-wash: #cbe1ef;
  --navbar-wash-border: #b3d1e6;
  --blue-dark1: #1461a8;
  --blue-dark2: #0e3d6d;
  --accent-warm: #fe7d62;

  /* Code & Tech Pills */
  --pill-bg: #ece9e2;
  --pill-fg: #353638;
  --pill-border: #dcd8cf;

  /* Typography */
  --font-sans: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: 500;
  color: var(--fg-strong);
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

h1 { font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }

p {
  margin: 0 0 1rem 0;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--blue-dark1);
  text-decoration: none;
  transition: color 0.12s linear;
}

a:hover {
  color: var(--blue-dark2);
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

svg {
  max-width: 100%;
  vertical-align: middle;
}

.btn-icon svg {
  width: 13px !important;
  height: 13px !important;
  max-width: 13px;
  max-height: 13px;
  display: inline-block;
  vertical-align: middle;
}

.homelogo-ico svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px;
  max-height: 20px;
  display: block;
}

.sns-links svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px;
  max-height: 18px;
  display: block;
}

.dot {
  color: var(--muted-light);
  margin: 0 0.3rem;
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */

.container {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-main {
  flex: 1 0 auto;
  padding-top: 2.25rem;
  padding-bottom: 3.5rem;
}

/* ==========================================================================
   Top Navbar: Contained Width & Aras-Style Organic Brush Edge
   ========================================================================== */

.site-header {
  position: relative;
  background-color: var(--navbar-wash);
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  z-index: 20;
}

/* Organic sweeping brush bottom edge (Aras specification: 512px 24px) */
.site-header::after {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  height: 20px;
  pointer-events: none;
  background-color: var(--navbar-wash);
  -webkit-mask-image: url("../images/brush-mask-hor.png");
  mask-image: url("../images/brush-mask-hor.png");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  -webkit-mask-size: 512px 20px;
  mask-size: 512px 20px;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
  z-index: 2;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.65rem 1.25rem 0.05rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #12305a;
  text-decoration: none !important;
  cursor: pointer;
  z-index: 1;
}

.nav-item,
.nav-item:hover,
.nav-item:focus,
.nav-item:active,
.nav-item.is-active,
.nav-item .nav-label {
  text-decoration: none !important;
}

.nav-item .nav-label {
  position: relative;
  z-index: 3;
  transition: color 0.12s ease;
}

.nav-brush-bg {
  position: absolute;
  inset: 0;
  background-color: transparent;
  pointer-events: none;
  z-index: 1;
  transition: background-color 0.12s ease;
}

/* 4 Organic brush edge pseudo-elements */
.nav-item::before,
.nav-item::after,
.nav-brush-bg::before,
.nav-brush-bg::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 2;
}

/* Top brush edge: 3px overlap with central badge to eliminate seams */
.nav-item::before {
  top: -5px;
  left: -2px;
  right: -2px;
  height: 8px;
  -webkit-mask-image: url("../images/brush-mask-hor.png");
  mask-image: url("../images/brush-mask-hor.png");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 140px 8px;
  mask-size: 140px 8px;
  -webkit-mask-position: var(--nav-top-pos, 0 0);
  mask-position: var(--nav-top-pos, 0 0);
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
  transform: rotate(180deg);
}

/* Bottom brush edge: 3px overlap with central badge to eliminate seams */
.nav-item::after {
  bottom: -6px;
  left: -2px;
  right: -2px;
  height: 9px;
  -webkit-mask-image: url("../images/brush-mask-hor.png");
  mask-image: url("../images/brush-mask-hor.png");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 140px 9px;
  mask-size: 140px 9px;
  -webkit-mask-position: var(--nav-bot-pos, 0 0);
  mask-position: var(--nav-bot-pos, 0 0);
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
}

/* Left brush edge: 3px overlap with central badge to eliminate seams */
.nav-brush-bg::before {
  top: -2px;
  bottom: -2px;
  left: -5px;
  width: 8px;
  -webkit-mask-image: url("../images/brush-mask-ver.png");
  mask-image: url("../images/brush-mask-ver.png");
  -webkit-mask-repeat: repeat-y;
  mask-repeat: repeat-y;
  -webkit-mask-size: 8px 140px;
  mask-size: 8px 140px;
  -webkit-mask-position: var(--nav-lft-pos, 0 0);
  mask-position: var(--nav-lft-pos, 0 0);
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
}

/* Right brush edge: 3px overlap with central badge to eliminate seams */
.nav-brush-bg::after {
  top: -2px;
  bottom: -2px;
  right: -5px;
  width: 8px;
  -webkit-mask-image: url("../images/brush-mask-ver.png");
  mask-image: url("../images/brush-mask-ver.png");
  -webkit-mask-repeat: repeat-y;
  mask-repeat: repeat-y;
  -webkit-mask-size: 8px 140px;
  mask-size: 8px 140px;
  -webkit-mask-position: var(--nav-rgt-pos, 0 0);
  mask-position: var(--nav-rgt-pos, 0 0);
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
  transform: rotate(180deg);
}

/* Deterministic mask offsets by item index (organic variation per item) */
.nav-item:nth-child(4n + 1),
.nav-item[data-nav-index="0"] {
  --nav-top-pos: 0 0;
  --nav-bot-pos: -24px 0;
  --nav-lft-pos: 0 0;
  --nav-rgt-pos: 0 -42px;
}

.nav-item:nth-child(4n + 2),
.nav-item[data-nav-index="1"] {
  --nav-top-pos: -48px 0;
  --nav-bot-pos: -96px 0;
  --nav-lft-pos: 0 -58px;
  --nav-rgt-pos: 0 -18px;
}

.nav-item:nth-child(4n + 3),
.nav-item[data-nav-index="2"] {
  --nav-top-pos: -82px 0;
  --nav-bot-pos: -136px 0;
  --nav-lft-pos: 0 -114px;
  --nav-rgt-pos: 0 -84px;
}

.nav-item:nth-child(4n + 4),
.nav-item[data-nav-index="3"] {
  --nav-top-pos: -128px 0;
  --nav-bot-pos: -52px 0;
  --nav-lft-pos: 0 -36px;
  --nav-rgt-pos: 0 -126px;
}

/* Active Nav Tab: solid paint stroke badge */
.nav-item.is-active .nav-label {
  color: #ffffff !important;
  font-weight: 600;
}

.nav-item.is-active .nav-brush-bg {
  background-color: var(--blue-dark1);
}

.nav-item.is-active::before,
.nav-item.is-active::after,
.nav-item.is-active .nav-brush-bg::before,
.nav-item.is-active .nav-brush-bg::after {
  opacity: 1;
  background-color: var(--blue-dark1);
}

/* Hover Nav Tab: painted highlight with same organic brush edge */
.nav-item:hover .nav-label,
.nav-item.is-hover .nav-label {
  color: #ffffff !important;
}

.nav-item:hover:not(.is-active) .nav-brush-bg,
.nav-item.is-hover:not(.is-active) .nav-brush-bg {
  background-color: #1a6cb6;
}

.nav-item:hover:not(.is-active)::before,
.nav-item:hover:not(.is-active)::after,
.nav-item:hover:not(.is-active) .nav-brush-bg::before,
.nav-item:hover:not(.is-active) .nav-brush-bg::after,
.nav-item.is-hover:not(.is-active)::before,
.nav-item.is-hover:not(.is-active)::after,
.nav-item.is-hover:not(.is-active) .nav-brush-bg::before,
.nav-item.is-hover:not(.is-active) .nav-brush-bg::after {
  opacity: 1;
  background-color: #1a6cb6;
}

/* ==========================================================================
   Home Page: Bio Table & Snug Typography
   ========================================================================== */

.home-hero {
  margin-bottom: 2.5rem;
}

.bio-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-width: 720px;
}

.bio-header {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.bio-avatar {
  width: 60px;
  height: 60px;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.bio-lead {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg);
}

.bio-name {
  color: var(--fg-strong);
  font-weight: 700;
}

.bio-handle {
  color: var(--muted);
  font-weight: 400;
}

.bio-lines {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bio-line {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg);
  margin: 0;
}

.bio-line a,
.link-inline {
  display: inline;
  white-space: nowrap;
  font-weight: 600;
  color: var(--blue-dark1);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.bio-line a:hover,
.link-inline:hover {
  color: var(--blue-dark2);
  text-decoration-color: var(--blue-dark2);
}

.link-icon-only {
  text-decoration: none !important;
  padding: 0 0.05em;
  vertical-align: middle;
}

.link-icon-only:hover {
  text-decoration: none !important;
  opacity: 0.75;
}

.inline-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-right: 0.28em;
  line-height: 1;
  color: #000000 !important;
  flex-shrink: 0;
}

.link-icon-only .inline-ico {
  margin-right: 0;
}

.inline-ico svg {
  width: 17.5px;
  height: 17.5px;
  max-width: 17.5px;
  max-height: 17.5px;
  display: block;
  color: #000000 !important;
}

/* Legacy table support */
.bio-table {
  border-collapse: collapse;
  width: 100%;
}

.bio-table td {
  padding: 5px 8px;
  vertical-align: middle;
  border: 0;
}

.bio-table tr:first-child td {
  padding-top: 0;
  padding-bottom: 10px;
}

.bio-table td.logocol {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  padding: 5px 14px 5px 0;
  text-align: center;
}

.homelogo-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #1a1a1a;
}

.homelogo-ico svg {
  width: 20px;
  height: 20px;
}

.bio-cell {
  font-size: 1rem;
  color: var(--fg);
}

.bio-cell a {
  font-weight: 600;
}

/* ==========================================================================
   Section Headers & Cards
   ========================================================================== */

.home-section {
  margin-top: 2.75rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--fg-strong);
}

.section-more {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--blue-dark1);
}

.section-lead {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Project Cards & Action Buttons
   ========================================================================== */

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.15rem 1.25rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  border-color: #cac5ba;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.project-title-group {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.project-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg-strong);
}

.project-index {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--blue-dark1);
  margin-right: 0.2rem;
  letter-spacing: -0.02em;
}

.project-year {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tech-pill {
  display: inline-block;
  padding: 2px 7px;
  background-color: var(--pill-bg);
  color: var(--pill-fg);
  border: 1px solid var(--pill-border);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.95rem;
  color: #383a3d;
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: #222;
  background-color: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s ease;
}

.btn-action:hover {
  background-color: var(--bg-hover);
  border-color: #c4beaf;
  color: #000;
  text-decoration: none;
}

.btn-action--primary {
  background-color: var(--blue-dark1);
  border-color: var(--blue-dark1);
  color: #ffffff !important;
}

.btn-action--primary:hover {
  background-color: var(--blue-dark2);
  border-color: var(--blue-dark2);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  display: block;
}

/* ==========================================================================
   Writing Items (Home Page)
   ========================================================================== */

.writing-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.writing-item {
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line-subtle);
}

.writing-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.writing-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

.writing-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.writing-title a {
  color: var(--fg-strong);
}

.writing-title a:hover {
  color: var(--blue-dark1);
}

.writing-desc {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ==========================================================================
   Editorial Blog Sticky Header Navigation
   ========================================================================== */

.blog-nav-bar {
  position: sticky;
  top: 0;
  z-index: 25;
  background-color: var(--bg);
  border-bottom: 1px solid var(--line);
  margin: 0 0 2.25rem 0;
  padding: 0.55rem 0;
}

.blog-nav-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.blog-nav-label {
  font-weight: 600;
  color: var(--fg-strong);
  font-size: 0.92rem;
}

.blog-nav-sep {
  color: var(--muted-light);
  user-select: none;
}

.blog-nav-dropdown {
  position: relative;
  min-width: 0;
}

.blog-nav-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.2rem 0.55rem;
  margin-left: -0.45rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--blue-dark1);
  cursor: pointer;
  max-width: 520px;
  transition: all 0.12s ease;
}

.blog-nav-jump:hover {
  background-color: rgba(20, 97, 168, 0.08);
  border-color: rgba(20, 97, 168, 0.15);
  color: var(--blue-dark2);
}

.blog-nav-current {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.blog-nav-chevron {
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.blog-nav-jump[aria-expanded="true"] .blog-nav-chevron {
  transform: rotate(180deg);
}

.blog-nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 340px;
  max-width: 460px;
  max-height: 420px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 0.4rem;
  z-index: 50;
  flex-direction: column;
  gap: 0.2rem;
}

.blog-nav-menu.is-open {
  display: flex;
}

.blog-nav-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--fg);
  transition: background-color 0.1s ease, color 0.1s ease;
}

.blog-nav-item:hover,
.blog-nav-item.is-active {
  background-color: var(--bg-subtle);
  color: var(--blue-dark1);
  text-decoration: none;
}

.blog-nav-date {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--muted);
  flex-shrink: 0;
  min-width: 65px;
}

.blog-nav-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* ==========================================================================
   Continuous Timeline Stream (Blog)
   ========================================================================== */

.timeline-stream {
  display: flex;
  flex-direction: column;
}

.timeline-article {
  padding-top: 1rem;
  scroll-margin-top: 100px;
}

.timeline-header {
  margin-bottom: 1.75rem;
}

.timeline-meta {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.timeline-title {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.timeline-title a {
  color: var(--fg-strong);
}

.timeline-title a:hover {
  color: var(--blue-dark1);
}

.timeline-lead {
  font-size: 1.05rem;
  color: #404245;
  line-height: 1.55;
  font-style: italic;
}

.timeline-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line), transparent);
  margin: 3.5rem 0;
}

.timeline-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.timeline-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

/* ==========================================================================
   Floating Back-to-Top Toast Button (with Aras Organic Brush Boundary)
   ========================================================================== */

.back-to-top-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  background-color: var(--blue-dark1);
  color: #ffffff;
  border: none;
  border-radius: 0;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  filter: drop-shadow(0 4px 10px rgba(14, 61, 109, 0.25));
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s, filter 0.15s ease;
}

.back-to-top-toast.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.toast-brush-bg {
  position: absolute;
  inset: 0;
  background-color: var(--blue-dark1);
  pointer-events: none;
  z-index: 1;
  transition: background-color 0.12s ease;
}

.toast-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #ffffff;
  z-index: 3;
}

/* 4 Organic brush edge pseudo-elements matching nav links */
.back-to-top-toast::before,
.back-to-top-toast::after,
.toast-brush-bg::before,
.toast-brush-bg::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background-color: var(--blue-dark1);
  transition: background-color 0.12s ease;
  z-index: 2;
}

/* Top brush edge: 3px overlap with central badge to eliminate seams */
.back-to-top-toast::before {
  top: -5px;
  left: -2px;
  right: -2px;
  height: 8px;
  -webkit-mask-image: url("../images/brush-mask-hor.png");
  mask-image: url("../images/brush-mask-hor.png");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 140px 8px;
  mask-size: 140px 8px;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
  transform: rotate(180deg);
}

/* Bottom brush edge: 3px overlap with central badge to eliminate seams */
.back-to-top-toast::after {
  bottom: -6px;
  left: -2px;
  right: -2px;
  height: 9px;
  -webkit-mask-image: url("../images/brush-mask-hor.png");
  mask-image: url("../images/brush-mask-hor.png");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: 140px 9px;
  mask-size: 140px 9px;
  -webkit-mask-position: -24px 0;
  mask-position: -24px 0;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
}

/* Left brush edge: 3px overlap with central badge to eliminate seams */
.toast-brush-bg::before {
  top: -2px;
  bottom: -2px;
  left: -5px;
  width: 8px;
  -webkit-mask-image: url("../images/brush-mask-ver.png");
  mask-image: url("../images/brush-mask-ver.png");
  -webkit-mask-repeat: repeat-y;
  mask-repeat: repeat-y;
  -webkit-mask-size: 8px 140px;
  mask-size: 8px 140px;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
}

/* Right brush edge: 3px overlap with central badge to eliminate seams */
.toast-brush-bg::after {
  top: -2px;
  bottom: -2px;
  right: -5px;
  width: 8px;
  -webkit-mask-image: url("../images/brush-mask-ver.png");
  mask-image: url("../images/brush-mask-ver.png");
  -webkit-mask-repeat: repeat-y;
  mask-repeat: repeat-y;
  -webkit-mask-size: 8px 140px;
  mask-size: 8px 140px;
  -webkit-mask-position: 0 -42px;
  mask-position: 0 -42px;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
  transform: rotate(180deg);
}

.back-to-top-toast:hover,
.back-to-top-toast:focus-visible {
  filter: drop-shadow(0 6px 14px rgba(14, 61, 109, 0.38));
}

.back-to-top-toast:hover .toast-brush-bg,
.back-to-top-toast:hover::before,
.back-to-top-toast:hover::after,
.back-to-top-toast:hover .toast-brush-bg::before,
.back-to-top-toast:hover .toast-brush-bg::after {
  background-color: #1a6cb6;
}

.back-to-top-toast svg {
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.15s ease;
}

.back-to-top-toast:hover svg {
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .back-to-top-toast {
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 0.3rem 0.75rem;
  }
}

/* Prose Typography */
.prose {
  font-size: 1.05rem;
  line-height: 1.68;
  color: #242629;
}

.prose h2 {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 2.25rem 0 0.85rem;
  border-bottom: 1px solid var(--line-subtle);
  padding-bottom: 0.35rem;
}

.prose h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.75rem 0 0.65rem;
}

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose pre {
  background: #f3f0e8;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 1.25rem 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #ede9df;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.prose pre code {
  background: transparent;
  padding: 0;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem 0.5rem 1.25rem;
  border-left: 3px solid var(--blue-dark1);
  background: #f4f6f8;
  color: #383a3d;
  font-style: italic;
}

/* ==========================================================================
   Projects Page Catalogue
   ========================================================================== */

.page-intro {
  margin-bottom: 2.5rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.page-desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.55;
}

.project-group {
  margin-bottom: 3rem;
}

.group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem;
  margin-bottom: 1.25rem;
}

.group-title {
  font-size: 1.35rem;
  font-weight: 600;
}

.group-count {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Project Preview / Demo Dialog Modal (<dialog>)
   ========================================================================== */

dialog.project-modal {
  border: none;
  border-radius: 8px;
  padding: 0;
  width: 92%;
  max-width: 740px;
  background: var(--bg-surface);
  color: var(--fg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

dialog.project-modal::backdrop {
  background-color: rgba(18, 30, 48, 0.55);
  backdrop-filter: blur(4px);
}

.dialog-box {
  display: flex;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}

.dialog-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.dialog-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.dialog-year {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.dialog-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.12s;
}

.dialog-close-btn:hover {
  background: #e4dfd4;
  color: #000;
}

.dialog-media {
  background: #000000;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dialog-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.dialog-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dialog-desc {
  font-size: 0.98rem;
  line-height: 1.55;
  color: #333;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line-subtle);
}

/* ==========================================================================
   Resume Page
   ========================================================================== */

.resume-page {
  display: flex;
  flex-direction: column;
}

.resume-intro-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.resume-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.resume-frame-container {
  width: 100%;
  height: 82vh;
  min-height: 580px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.resume-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.resume-footer-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.85rem;
  text-align: center;
}

/* ==========================================================================
   Site Footer: SNS Links
   ========================================================================== */

.site-footer {
  width: 100%;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background-color: transparent;
  padding: 1.5rem 0 2.25rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.sns-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sns-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #3a3b3d;
  background-color: transparent;
  transition: all 0.15s ease;
}

.sns-links a:hover {
  background-color: #e5e0d4;
  color: #000000;
  transform: translateY(-1px);
}

.sns-links svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 640px) {
  .bio-header {
    align-items: flex-start;
  }

  .site-main {
    padding-top: 1.5rem;
  }

  .header-inner {
    justify-content: flex-start;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-item {
    padding: 0.25rem 0.55rem;
    font-size: 0.9rem;
  }

  .blog-nav-bar {
    margin: 0 0 1.5rem 0;
  }

  .blog-nav-jump {
    max-width: 230px;
  }

  .blog-nav-menu {
    max-width: calc(100vw - 2.5rem);
    min-width: 260px;
  }

  .timeline-title {
    font-size: 1.5rem;
  }

  .dialog-media {
    aspect-ratio: 16 / 10;
  }
}
