diff --git a/sass/_article.scss b/sass/_article.scss new file mode 100644 index 0000000..b164bc0 --- /dev/null +++ b/sass/_article.scss @@ -0,0 +1,79 @@ +// Post Detail +.post-detail { + max-width: 800px; + margin: 0 auto; + padding-top: 4rem; +} + +.post-header { + margin-bottom: 4rem; +} + +.post-title { + margin-bottom: 1rem; +} + +.post-meta { + color: var(--text-muted); + font-size: 0.9rem; + font-style: italic; +} + +.post-toc { + background: var(--surface-color); + border: 1px solid var(--border-color); + padding: 1.5rem; + border-radius: 12px; + margin-bottom: 3rem; + + summary { + font-weight: 600; + cursor: pointer; + list-style: none; /* Hide default arrow */ + display: flex; + align-items: center; + gap: 0.5rem; + + &::before { + content: "↓"; + color: var(--accent-color); + transition: transform 0.2s ease; + } + } + + &[open] summary::before { + transform: rotate(180deg); + } + + ul { + margin-top: 1rem; + margin-bottom: 0; + list-style-type: none; + padding-left: 1rem; + } + + li { + margin-bottom: 0.5rem; + } + + a { + color: var(--text-muted); + font-size: 0.95em; + &:hover { color: var(--accent-color); } + } +} + +.post-tags { + display: flex; + gap: 0.5rem; + margin-top: 4rem; + + .tag { + background: var(--surface-color); + border: 1px solid var(--border-color); + padding: 0.25rem 0.75rem; + border-radius: 99px; + font-size: 0.85rem; + font-family: var(--font-mono); + } +} diff --git a/sass/_feed.scss b/sass/_feed.scss new file mode 100644 index 0000000..31fbf8e --- /dev/null +++ b/sass/_feed.scss @@ -0,0 +1,49 @@ +// Post Feed +.post-feed { + display: flex; + flex-direction: column; + gap: 3rem; + margin-top: 2rem; +} + +.feed-item { + display: block; +} + +.item-link { + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.item-date { + font-size: 0.85rem; + color: var(--text-muted); + font-variant-numeric: tabular-nums; + letter-spacing: 0.05em; + text-transform: uppercase; +} + +.item-title { + margin: 0; + font-size: clamp(1.5rem, 2vw, 2rem); + transition: color 0.2s ease; +} + +.item-link:hover .item-title { + color: var(--accent-color); +} + +.item-desc { + margin: 0; + color: var(--text-muted); +} + +// Pagination +.pagination { + display: flex; + justify-content: space-between; + margin-top: 5rem; + padding-top: 2rem; + border-top: 1px solid var(--border-color); +} diff --git a/sass/_footer.scss b/sass/_footer.scss new file mode 100644 index 0000000..790b9da --- /dev/null +++ b/sass/_footer.scss @@ -0,0 +1,9 @@ +// Footer +.site-footer { + padding: 3rem 0; + border-top: 1px solid var(--border-color); + color: var(--text-muted); + font-size: 0.9rem; + display: flex; + justify-content: space-between; +} diff --git a/sass/_header.scss b/sass/_header.scss new file mode 100644 index 0000000..e568b8e --- /dev/null +++ b/sass/_header.scss @@ -0,0 +1,132 @@ +// Component: Header +.site-header { + padding: 1.25rem 0; + position: sticky; + top: 0; + z-index: 50; + background-color: var(--bg-color); + backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); + border-bottom: 1px solid var(--border-color); +} + +.nav-container { + display: flex; + justify-content: space-between; + align-items: center; +} + +// Right side wrapper (links + controls) +.nav-right { + display: flex; + align-items: center; + gap: 1rem; +} + +// Always-visible icon controls +.nav-controls { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.search-toggle { + background: none; + border: none; + color: var(--text-color); + cursor: pointer; + padding: 0.35rem; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + transition: var(--transition-smooth); + &:hover { color: var(--accent-color); } +} + +// Hamburger button — hidden on desktop, shown on mobile +.nav-toggle { + display: none; + background: none; + border: none; + color: var(--text-color); + cursor: pointer; + padding: 0.25rem; + align-items: center; + justify-content: center; + + .close-icon { display: none; } + + &[aria-expanded="true"] { + .hamburger-icon { display: none; } + .close-icon { display: block; } + } +} + +@media (max-width: 640px) { + .nav-toggle { + display: flex; + } + + .nav-right { + flex-wrap: wrap; + justify-content: flex-end; + } + + .nav-links { + display: none !important; + flex-direction: column !important; + align-items: flex-start !important; + gap: 0 !important; + width: 100%; + order: 10; // push below nav-controls + padding: 1rem 0; + border-top: 1px solid var(--border-color); + margin-top: 0.5rem; + + &.is-open { + display: flex !important; + } + + .nav-item { + width: 100%; + padding: 0.75rem 0; + font-size: 1rem; + border-bottom: 1px solid var(--border-color); + &::after { display: none; } + } + } +} + +.brand-text { + font-weight: 700; + font-size: 1.2rem; + letter-spacing: -0.01em; +} + +.nav-links { + display: flex; + align-items: center; + gap: 1.5rem; +} + +.nav-item { + font-weight: 500; + font-size: 0.95rem; + position: relative; +} + +.nav-item::after { + content: ''; + position: absolute; + width: 0; + height: 2px; + bottom: -4px; + left: 0; + background-color: var(--accent-color); + transition: var(--transition-smooth); +} + +.nav-item:hover::after { + width: 100%; +} diff --git a/sass/_hero.scss b/sass/_hero.scss new file mode 100644 index 0000000..0105579 --- /dev/null +++ b/sass/_hero.scss @@ -0,0 +1,14 @@ +// Hero Section +.hero { + padding: 8rem 0 6rem 0; + max-width: 800px; +} + +.hero-title { + color: var(--text-color); +} + +.hero-subtitle { + font-size: clamp(1.1rem, 1.5vw, 1.3rem); + color: var(--text-muted); +} diff --git a/sass/_layout.scss b/sass/_layout.scss new file mode 100644 index 0000000..eec1b5e --- /dev/null +++ b/sass/_layout.scss @@ -0,0 +1,31 @@ +// Layout Constraints +.site-container { + width: 100%; + max-width: 1400px; + margin: 0 auto; + padding: 0 5vw; + display: flex; + flex-direction: column; + min-height: 100dvh; + box-sizing: border-box; +} + +// Constrain all media & tables to their container +img, video, iframe, table, svg { + max-width: 100%; +} + +table { + display: block; + overflow-x: auto; + @media (max-width: 640px) { + scrollbar-width: none; + &::-webkit-scrollbar { display: none; } + } +} + +// Main Content +.main-content { + flex-grow: 1; + padding-bottom: 5rem; +} diff --git a/sass/_reset.scss b/sass/_reset.scss new file mode 100644 index 0000000..21f2606 --- /dev/null +++ b/sass/_reset.scss @@ -0,0 +1,32 @@ +// Global Reset & Base +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html { + font-family: var(--font-sans); + font-size: 100%; + background-color: var(--bg-color); + color: var(--text-color); + scroll-behavior: smooth; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + transition: background-color 0.3s ease, color 0.3s ease; +} + +body { + line-height: 1.7; + min-height: 100dvh; + display: flex; + flex-direction: column; + overflow-wrap: break-word; // break long words instead of overflowing + word-break: break-word; +} + +a { + color: inherit; + text-decoration: none; + transition: var(--transition-smooth); +} diff --git a/sass/_theme.scss b/sass/_theme.scss new file mode 100644 index 0000000..e9d505e --- /dev/null +++ b/sass/_theme.scss @@ -0,0 +1,23 @@ +// Component: Theme Toggle +.theme-toggle { + background: none; + border: none; + color: var(--text-color); + cursor: pointer; + padding: 0.5rem; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + transition: var(--transition-smooth); + + svg { + width: 20px; + height: 20px; + } +} + +html.dark .sun-icon { display: block; } +html.dark .moon-icon { display: none; } +html:not(.dark) .sun-icon { display: none; } +html:not(.dark) .moon-icon { display: block; } diff --git a/sass/_typography.scss b/sass/_typography.scss new file mode 100644 index 0000000..9e5f152 --- /dev/null +++ b/sass/_typography.scss @@ -0,0 +1,56 @@ +// Typography Scale (Fluid) +h1, h2, h3, h4, h5, h6 { + font-weight: 700; + line-height: 1.1; + letter-spacing: -0.02em; + margin-bottom: 0.5em; + overflow-wrap: break-word; + word-break: break-word; +} + +h1 { font-size: clamp(1.75rem, 5vw, 4.5rem); } +h2 { font-size: clamp(1.35rem, 3vw, 2.5rem); } +h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); margin-top: 1.5em; } + +p, ul, ol, figure, blockquote { + margin-bottom: 1.5rem; +} + +p { + max-width: 65ch; // Optimal reading width +} + +code, pre { + font-family: var(--font-mono); + font-size: 0.9em; +} + +pre { + padding: 1.25rem; + border-radius: 8px; + overflow-x: auto; + max-width: 100%; + border: 1px solid var(--border-color); + background: #1e1e2e; + // Scrollbars visible on desktop, hidden on mobile + @media (max-width: 640px) { + scrollbar-width: none; + &::-webkit-scrollbar { display: none; } + font-size: 0.82em; + } +} + +code { + background: var(--surface-color); + padding: 0.2em 0.4em; + border-radius: 4px; + color: var(--accent-color); + border: 1px solid var(--border-color); +} + +pre code { + background: transparent; + color: inherit; + padding: 0; + border: none; +} diff --git a/sass/_utilities.scss b/sass/_utilities.scss new file mode 100644 index 0000000..89b82df --- /dev/null +++ b/sass/_utilities.scss @@ -0,0 +1,8 @@ +// Utilities / Interactions +.hover-scale { + transition: var(--transition-spring); + + &:active { + transform: scale(0.98); + } +} diff --git a/sass/_variables.scss b/sass/_variables.scss new file mode 100644 index 0000000..fe95f22 --- /dev/null +++ b/sass/_variables.scss @@ -0,0 +1,26 @@ +// Premium Design Variables +:root { + --bg-color: #f9fafb; + --text-color: #1a1a1a; + --text-muted: #6b7280; + --accent-color: #10b981; // Emerald + --surface-color: #ffffff; + --border-color: rgba(0, 0, 0, 0.05); + --shadow-color: rgba(0, 0, 0, 0.05); + + --font-sans: 'Outfit', sans-serif; + --font-mono: 'JetBrains Mono', monospace; + + --transition-spring: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); + --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); +} + +// Dark Mode Overrides +html.dark { + --bg-color: #0a0a0a; + --text-color: #f9fafb; + --text-muted: #a1a1aa; + --surface-color: #141414; + --border-color: rgba(255, 255, 255, 0.1); + --shadow-color: rgba(0, 0, 0, 0.5); +} diff --git a/sass/main.scss b/sass/main.scss index c02ca06..ae144df 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -1,441 +1,14 @@ -// Premium Design Variables -:root { - --bg-color: #f9fafb; - --text-color: #1a1a1a; - --text-muted: #6b7280; - --accent-color: #10b981; // Emerald - --surface-color: #ffffff; - --border-color: rgba(0, 0, 0, 0.05); - --shadow-color: rgba(0, 0, 0, 0.05); - - --font-sans: 'Outfit', sans-serif; - --font-mono: 'JetBrains Mono', monospace; - - --transition-spring: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); - --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); -} +// Main SCSS entry point +// Organized by feature and section for maintainability -// Dark Mode Overrides -html.dark { - --bg-color: #0a0a0a; - --text-color: #f9fafb; - --text-muted: #a1a1aa; - --surface-color: #141414; - --border-color: rgba(255, 255, 255, 0.1); - --shadow-color: rgba(0, 0, 0, 0.5); -} - -// Global Reset & Base -* { - box-sizing: border-box; - margin: 0; - padding: 0; -} - -html { - font-family: var(--font-sans); - font-size: 100%; // Starts fluid typography - background-color: var(--bg-color); - color: var(--text-color); - scroll-behavior: smooth; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - transition: background-color 0.3s ease, color 0.3s ease; -} - -body { - line-height: 1.7; - min-height: 100dvh; - display: flex; - flex-direction: column; -} - -a { - color: inherit; - text-decoration: none; - transition: var(--transition-smooth); -} - -// Typography Scale (Fluid) -h1, h2, h3, h4, h5, h6 { - font-weight: 700; - line-height: 1.1; - letter-spacing: -0.02em; - margin-bottom: 0.5em; -} - -h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); } -h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); } -h3 { font-size: clamp(1.4rem, 2vw, 1.8rem); margin-top: 1.5em; } - -p, ul, ol, figure, blockquote { - margin-bottom: 1.5rem; -} - -p { - max-width: 65ch; // Optimal reading width -} - -code, pre { - font-family: var(--font-mono); - font-size: 0.9em; -} - -pre { - padding: 1.25rem; - border-radius: 8px; - overflow-x: auto; - border: 1px solid var(--border-color); - background: #1e1e2e; // Match Catppuccin Mocha for code blocks -} - -code { - background: var(--surface-color); - padding: 0.2em 0.4em; - border-radius: 4px; - color: var(--accent-color); - border: 1px solid var(--border-color); -} -pre code { - background: transparent; - color: inherit; - padding: 0; - border: none; -} - -// Layout Constraints -.site-container { - max-width: 1400px; - margin: 0 auto; - padding: 0 5vw; - display: flex; - flex-direction: column; - min-height: 100dvh; -} - -// Component: Header -.site-header { - padding: 1.25rem 0; - position: sticky; - top: 0; - z-index: 50; - background-color: var(--bg-color); - backdrop-filter: blur(12px); - -webkit-backdrop-filter: blur(12px); - border-bottom: 1px solid var(--border-color); -} - -.nav-container { - display: flex; - justify-content: space-between; - align-items: center; -} - -// Right side wrapper (links + controls) -.nav-right { - display: flex; - align-items: center; - gap: 1rem; -} - -// Always-visible icon controls -.nav-controls { - display: flex; - align-items: center; - gap: 0.5rem; -} - -.search-toggle { - background: none; - border: none; - color: var(--text-color); - cursor: pointer; - padding: 0.35rem; - display: flex; - align-items: center; - justify-content: center; - border-radius: 50%; - transition: var(--transition-smooth); - &:hover { color: var(--accent-color); } -} - -// Hamburger button — hidden on desktop, shown on mobile -.nav-toggle { - display: none; - background: none; - border: none; - color: var(--text-color); - cursor: pointer; - padding: 0.25rem; - align-items: center; - justify-content: center; - - .close-icon { display: none; } - - &[aria-expanded="true"] { - .hamburger-icon { display: none; } - .close-icon { display: block; } - } -} - -@media (max-width: 640px) { - .nav-toggle { - display: flex; - } - - .nav-right { - flex-wrap: wrap; - justify-content: flex-end; - } - - .nav-links { - display: none !important; - flex-direction: column !important; - align-items: flex-start !important; - gap: 0 !important; - width: 100%; - order: 10; // push below nav-controls - padding: 1rem 0; - border-top: 1px solid var(--border-color); - margin-top: 0.5rem; - - &.is-open { - display: flex !important; - } - - .nav-item { - width: 100%; - padding: 0.75rem 0; - font-size: 1rem; - border-bottom: 1px solid var(--border-color); - &::after { display: none; } - } - } -} - -.brand-text { - font-weight: 700; - font-size: 1.2rem; - letter-spacing: -0.01em; -} - -.nav-links { - display: flex; - align-items: center; - gap: 1.5rem; -} - -.nav-item { - font-weight: 500; - font-size: 0.95rem; - position: relative; -} - -.nav-item::after { - content: ''; - position: absolute; - width: 0; - height: 2px; - bottom: -4px; - left: 0; - background-color: var(--accent-color); - transition: var(--transition-smooth); -} - -.nav-item:hover::after { - width: 100%; -} - -// Component: Theme Toggle -.theme-toggle { - background: none; - border: none; - color: var(--text-color); - cursor: pointer; - padding: 0.5rem; - display: flex; - align-items: center; - justify-content: center; - border-radius: 50%; - transition: var(--transition-smooth); - - svg { - width: 20px; - height: 20px; - } -} - -html.dark .sun-icon { display: block; } -html.dark .moon-icon { display: none; } -html:not(.dark) .sun-icon { display: none; } -html:not(.dark) .moon-icon { display: block; } - -// Main Content -.main-content { - flex-grow: 1; - padding-bottom: 5rem; -} - -// Hero Section -.hero { - padding: 8rem 0 6rem 0; - max-width: 800px; -} - -.hero-title { - color: var(--text-color); -} - -.hero-subtitle { - font-size: clamp(1.1rem, 1.5vw, 1.3rem); - color: var(--text-muted); -} - -// Post Feed -.post-feed { - display: flex; - flex-direction: column; - gap: 3rem; - margin-top: 2rem; -} - -.feed-item { - display: block; -} - -.item-link { - display: flex; - flex-direction: column; - gap: 0.5rem; -} - -.item-date { - font-size: 0.85rem; - color: var(--text-muted); - font-variant-numeric: tabular-nums; - letter-spacing: 0.05em; - text-transform: uppercase; -} - -.item-title { - margin: 0; - font-size: clamp(1.5rem, 2vw, 2rem); - transition: color 0.2s ease; -} - -.item-link:hover .item-title { - color: var(--accent-color); -} - -.item-desc { - margin: 0; - color: var(--text-muted); -} - -// Pagination -.pagination { - display: flex; - justify-content: space-between; - margin-top: 5rem; - padding-top: 2rem; - border-top: 1px solid var(--border-color); -} - -// Post Detail -.post-detail { - max-width: 800px; - margin: 0 auto; - padding-top: 4rem; -} - -.post-header { - margin-bottom: 4rem; -} - -.post-title { - margin-bottom: 1rem; -} - -.post-meta { - color: var(--text-muted); - font-size: 0.9rem; - font-style: italic; -} - -.post-toc { - background: var(--surface-color); - border: 1px solid var(--border-color); - padding: 1.5rem; - border-radius: 12px; - margin-bottom: 3rem; - - summary { - font-weight: 600; - cursor: pointer; - list-style: none; /* Hide default arrow */ - display: flex; - align-items: center; - gap: 0.5rem; - - &::before { - content: "↓"; - color: var(--accent-color); - transition: transform 0.2s ease; - } - } - - &[open] summary::before { - transform: rotate(180deg); - } - - ul { - margin-top: 1rem; - margin-bottom: 0; - list-style-type: none; - padding-left: 1rem; - } - - li { - margin-bottom: 0.5rem; - } - - a { - color: var(--text-muted); - font-size: 0.95em; - &:hover { color: var(--accent-color); } - } -} - -.post-tags { - display: flex; - gap: 0.5rem; - margin-top: 4rem; - - .tag { - background: var(--surface-color); - border: 1px solid var(--border-color); - padding: 0.25rem 0.75rem; - border-radius: 99px; - font-size: 0.85rem; - font-family: var(--font-mono); - } -} - -// Footer -.site-footer { - padding: 3rem 0; - border-top: 1px solid var(--border-color); - color: var(--text-muted); - font-size: 0.9rem; - display: flex; - justify-content: space-between; -} - -// Utilities / Interactions -.hover-scale { - transition: var(--transition-spring); - - &:active { - transform: scale(0.98); - } -} +@import 'variables'; +@import 'reset'; +@import 'typography'; +@import 'layout'; +@import 'header'; +@import 'theme'; +@import 'hero'; +@import 'feed'; +@import 'article'; +@import 'footer'; +@import 'utilities';