/* ===== Theme Variables ===== */
:root {
  --primary: #64B5F6;
  --primary-dark: #42A5F5;
  --font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --bg: #272B34;
  --bg-alt: #272B34;
  --text: #eee;
  --text-muted: #ababab;
  --border: #595959;
  --nav-bg: #232525;
  --nav-text: #eee;
  --code-color: #e2777a;
  --code-bg: #272B34;
  --kbd-color: #7ec699;
  --code-rendered: #ccc;
  --hr-color: #eee;
  --selection-text: #181818;
  --progress-color: #64B5F6;
  --error-color: #ef5350;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --bg-alt: #f0f0f0;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #ddd;
  --primary: #0969a8;
  --primary-dark: #075985;
  --nav-bg: #64B5F6;
  --nav-text: #181818;
  --code-color: #d63384;
  --code-bg: #f0f0f0;
  --kbd-color: #198754;
  --code-rendered: #333;
  --hr-color: #ddd;
  --selection-text: #fff;
  --progress-color: rgba(255, 255, 255, 0.85);
  --error-color: #d32f2f;
}

/* Reset */
*, *::before, *::after {
  border: 0;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  font-family: var(--font-family);
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s var(--ease-out-quart), color 0.3s var(--ease-out-quart);
}

::selection {
  background: var(--primary);
  color: var(--selection-text);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  line-height: 1.25;
  margin-bottom: 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: 1.8rem;
  line-height: 2.2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

h2 {
  font-size: 1.4rem;
  line-height: 1.7rem;
  margin-bottom: 1rem;
  font-style: italic;
  font-weight: 600;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.45rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

h4 {
  font-size: 1rem;
  line-height: 1.3rem;
  margin-bottom: 0.8rem;
  font-style: italic;
}

h5, h6 {
  font-size: 0.95rem;
  line-height: 1.3rem;
  margin-bottom: 0.8rem;
}

h6 {
  font-style: italic;
}

@media (min-width: 600px) {
  h1 {
    font-size: 2rem;
    line-height: 2.4rem;
    margin-bottom: 1rem;
  }
  h2 {
    font-size: 1.5rem;
    line-height: 1.8rem;
    margin-bottom: 1rem;
  }
  h3 {
    font-size: 1.25rem;
    line-height: 1.5rem;
    margin-bottom: 1rem;
  }
  h4 {
    font-size: 1.1rem;
    line-height: 1.4rem;
    margin-bottom: 0.8rem;
  }
  h5, h6 {
    font-size: 1rem;
    line-height: 1.3rem;
    margin-bottom: 0.8rem;
  }
  body, ol, p, pre, ul {
    font-size: 1.1rem;
    line-height: 1.6;
  }
  ol, p, pre, ul {
    margin-bottom: 1.496rem;
  }
}

@media (min-width: 1200px) {
  h1 {
    font-size: 2.2rem;
    line-height: 2.6rem;
    margin-bottom: 1rem;
  }
  h2 {
    font-size: 1.7rem;
    line-height: 2rem;
    margin-bottom: 1rem;
  }
  h3 {
    font-size: 1.4rem;
    line-height: 1.7rem;
    margin-bottom: 1rem;
  }
  h4 {
    font-size: 1.2rem;
    line-height: 1.5rem;
    margin-bottom: 0.8rem;
  }
  h5, h6 {
    font-size: 1.1rem;
    line-height: 1.4rem;
    margin-bottom: 0.8rem;
  }
  body, ol, p, pre, ul {
    font-size: 1.2rem;
    line-height: 1.6;
  }
  ol, p, pre, ul {
    margin-bottom: 1.632rem;
  }
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out-quart);
}

a:hover::after {
  transform: scaleX(1);
}

a:hover {
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: 0.5em;
  left: 0.5em;
  z-index: 1001;
  padding: 0.6em 0.9em;
  background: var(--bg);
  color: var(--text);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Paragraphs & Lists */
ol, p, pre, ul {
  margin-bottom: 1.36rem;
}

article p {
  text-wrap: pretty;
}

/* Native paragraph justification: keeps HTML semantics intact while letting
   Chromium distribute CJK character gaps and Latin word spaces per line. */
article > p:not(:last-child) {
  text-align: justify;
  text-justify: inter-character;
}

/* Optional Pretext/Knuth–Plass line wrappers. Native prose remains the fallback. */
article[data-optimal-justify] .optimal-justify-line {
  display: block;
  text-align: left;
  text-wrap: wrap;
  white-space: nowrap;
}

article[data-optimal-justify] .optimal-justify-active {
  text-wrap: wrap;
}

ol, ul {
  margin-top: 0;
}

li dl, li ol, li ul {
  margin-bottom: 0;
}

img, video {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

hr {
  border-bottom: 1px solid var(--hr-color);
}

small {
  color: var(--text-muted);
}

/* Code */
code, kbd {
  border-radius: 0.3em;
  color: var(--code-color);
  padding: 0 0.3em;
  font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
  font-size: 90%;
  background: var(--code-bg);
}

kbd {
  color: var(--kbd-color);
}

pre {
  font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
  background: var(--code-bg);
  padding: 1em;
  margin: 0.5em 0;
  overflow: auto;
  border-radius: 0.3em;
}

pre code {
  color: var(--code-rendered);
  padding: 0;
  overflow-x: scroll;
  background: none;
}

pre code:not([class]) {
  color: var(--code-rendered);
}

mark {
  background: var(--primary);
  color: var(--selection-text);
  padding: 0 0.3em;
}

/* Tables */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  display: table;
  width: 100%;
  border-collapse: collapse;
}

td, th {
  border-bottom: 1px solid var(--border);
  overflow: auto;
  padding: 0.75em;
  text-align: left;
  vertical-align: top;
}

thead th {
  border-bottom: 1px solid var(--primary);
}

th {
  font-weight: 600;
}

/* Blockquote */
blockquote {
  border-left: 1px solid var(--primary);
  padding: 0 1.5em;
  margin: 1.5em 0 1.5em 1.5em;
}

blockquote footer {
  background: none;
  display: block;
  color: var(--text-muted);
  padding: 0.75em 0;
  font-size: 90%;
  text-align: start;
}

/* Figure / Images */
figure {
  margin: 1.5em;
}

figure img {
  display: block;
}

figcaption {
  color: var(--text-muted);
  margin-top: 0.75em;
  font-size: 80%;
}

/* Definition list */
dl {
  display: inline-block;
  margin: 0 0 1.5em;
}

dt {
  font-weight: 600;
  padding-top: 0.75em;
  padding-left: 0.75em;
}

dd {
  padding-bottom: 0.75em;
  margin-left: 2.25em;
}

dd + dt {
  border-top: 1px solid var(--primary);
}

/* Header / Navigation */
header {
  padding: 4.5em 1.5em 1.5em;
  width: 55em;
  margin: 0 auto;
  text-align: center;
  max-width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
}

header p {
  margin-top: 0;
}

header nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  padding: 0.375em 1.5em;
  background: var(--nav-bg);
  font-weight: 200;
  z-index: 10;
  transition: background 0.3s var(--ease-out-quart);
}

.site-title {
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  margin-right: auto;
  font-weight: 700;
}

header nav a {
  font-weight: 700;
  text-decoration: none;
  font-family: var(--font-family);
  color: var(--nav-text);
}

header nav a::after {
  background: var(--nav-text);
}

header nav a:focus-visible,
header nav button:focus-visible {
  outline-color: var(--nav-text);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-left: auto;
}

.nav-controls a {
  margin-left: 0;
}

.lang-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 50%;
  transition: background 0.2s var(--ease-out-quart);
  color: var(--nav-text);
  position: relative;
}

.lang-toggle::before,
#theme-toggle::before {
  content: '';
  position: absolute;
  inset: -7px;
}

.lang-toggle svg {
  width: 18px;
  height: 18px;
  stroke: var(--nav-text);
  stroke-width: 2;
  fill: none;
}

.lang-toggle:hover {
  background: rgba(128, 128, 128, 0.15);
}

.lang-toggle svg {
  stroke: var(--nav-text);
  stroke-width: 2;
  fill: none;
}

header aside {
  font-style: italic;
}

.post-meta span:last-child {
  font-style: italic;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.post-meta .view-count {
  font-style: normal;
  transition: opacity 0.4s var(--ease-out-quart);
}

.view-count-loading {
  animation: view-count-pulse 1.8s ease-in-out infinite;
}

@keyframes view-count-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.view-count-loading .num {
  display: inline-block;
  transition: transform 0.5s var(--ease-out-quart), opacity 0.5s var(--ease-out-quart);
}

.view-count-final .num {
  animation: view-count-pop 0.35s var(--ease-out-quart);
}

@keyframes view-count-pop {
  0% { transform: translateY(4px); opacity: 0.4; }
  100% { transform: translateY(0); opacity: 1; }
}


/* Main content */
main {
  max-width: 70rem;
  margin: 0 auto;
  border-top: 0.5px solid var(--border);
}

article {
  max-width: 100%;
  padding: 1.5em;
  width: min(1111px, 100%);
  margin: 0 auto;
}

/* Section (for homepage) */
section {
  margin-left: auto;
  margin-right: auto;
  width: 900px;
  max-width: 100%;
  padding: 0 1.5em;
}

.home-section {
  padding: 1.5em 0;
  border-bottom: 1px solid var(--border);
}

.home-section:last-child {
  border-bottom: none;
}

.home-section h2 {
  margin-top: 0;
}

/* Posts list */
#posts li {
  margin-bottom: 0.5em;
}

.post-list {
  list-style: none;
  padding-left: 0;
}

.post-list li {
  margin-bottom: 0.5em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.post-list li a {
  flex: 1;
}

.post-list time {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-left: 1em;
  white-space: nowrap;
}

/* Footer */
footer {
  background: var(--bg-alt);
  color: var(--text);
  padding: 2em 1.5em;
  text-align: center;
  transition: background 0.3s var(--ease-out-quart);
}

footer > * {
  margin: 0.5em 0;
}

footer nav, footer p {
  font-size: 90%;
  color: var(--text-muted);
}

footer nav a img {
  vertical-align: middle;
}

/* Nav z-index for progress bar layering */
#nav {
  z-index: 100;
  position: relative;
  display: flex;
  align-items: center;
}

/* Reading progress bar */
#reading-progress {
  z-index: 1;
  background-color: var(--progress-color);
  width: 100vw;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  transform: translate(-100vw, 0);
  will-change: transform;
  pointer-events: none;
}

/* Prism.js theme */
code[class*="language-"],
pre[class*="language-"] {
  color: var(--code-rendered);
  background: none;
  font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  tab-size: 4;
  hyphens: none;
}

code[class*="language-"] {
  padding: 0;
}

pre[class*="language-"] {
  padding: 1em;
  margin: 0.5em 0;
  overflow: auto;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
  background: var(--code-bg);
}

:not(pre) > code[class*="language-"] {
  padding: 0.1em;
  border-radius: 0.3em;
  white-space: normal;
}

.token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata {
  color: #999;
}
.token.punctuation { color: #ccc; }
.token.tag, .token.attr-name, .token.namespace, .token.deleted { color: #e2777a; }
.token.function-name { color: #6196cc; }
.token.boolean, .token.number, .token.function { color: #f08d49; }
.token.property, .token.class-name, .token.constant, .token.symbol { color: #f8c555; }
.token.selector, .token.important, .token.atrule, .token.keyword, .token.builtin { color: #cc99cd; }
.token.string, .token.char, .token.attr-value, .token.regex, .token.variable { color: #7ec699; }
.token.operator, .token.entity, .token.url { color: #67cdcc; }
.token.bold, .token.important { font-weight: 700; }
.token.italic { font-style: italic; }
.token.entity { cursor: help; }
.token.inserted { color: green; }

[data-theme="light"] .token.comment, [data-theme="light"] .token.block-comment,
[data-theme="light"] .token.prolog, [data-theme="light"] .token.doctype, [data-theme="light"] .token.cdata { color: #6a737d; }
[data-theme="light"] .token.punctuation { color: #24292e; }
[data-theme="light"] .token.tag, [data-theme="light"] .token.attr-name,
[data-theme="light"] .token.namespace, [data-theme="light"] .token.deleted { color: #d63384; }
[data-theme="light"] .token.function-name { color: #6f42c1; }
[data-theme="light"] .token.boolean, [data-theme="light"] .token.number,
[data-theme="light"] .token.function { color: #e36209; }
[data-theme="light"] .token.property, [data-theme="light"] .token.class-name,
[data-theme="light"] .token.constant, [data-theme="light"] .token.symbol { color: #005cc5; }
[data-theme="light"] .token.selector, [data-theme="light"] .token.important,
[data-theme="light"] .token.atrule, [data-theme="light"] .token.keyword,
[data-theme="light"] .token.builtin { color: #d73a49; }
[data-theme="light"] .token.string, [data-theme="light"] .token.char,
[data-theme="light"] .token.attr-value, [data-theme="light"] .token.regex,
[data-theme="light"] .token.variable { color: #22863a; }
[data-theme="light"] .token.operator, [data-theme="light"] .token.entity,
[data-theme="light"] .token.url { color: #005cc5; }

/* Form elements */
button, input, select, textarea {
  border-radius: 0.3em;
  display: inline-block;
  padding: 0.75em;
  max-width: 100%;
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

button, input[type="reset"], input[type="submit"] {
  background: var(--primary);
  color: var(--selection-text);
  cursor: pointer;
  display: inline-block;
  padding: 0.75em 1.5em;
  text-align: center;
  margin: 0 0.75em 1.5em 0;
}

button:focus-visible, input[type="submit"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:hover, input[type="submit"]:hover {
  background: var(--primary-dark);
  color: var(--selection-text);
}

/* Scrollbar */
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ===== Theme Toggle ===== */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 50%;
  transition: background 0.2s var(--ease-out-quart);
  position: relative;
}

#theme-toggle:hover {
  background: rgba(128, 128, 128, 0.15);
}

#theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: var(--nav-text);
  stroke-width: 2;
  fill: none;
  transition: transform 0.4s var(--ease-out-quart), stroke 0.3s var(--ease-out-quart);
}

#theme-toggle:active svg {
  transform: rotate(30deg);
}

#theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] #theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] #theme-toggle .icon-moon {
  display: block;
}

/* ===== About Page ===== */

.about-page {
  max-width: 100%;
}

.about-intro {
  font-size: 1.15rem;
  line-height: 1.8;
}

.about-section {
  margin-top: 2.5em;
}

.about-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3em;
  font-style: normal;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2em;
}

.about-card {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2em;
  transition: border-color 0.25s var(--ease-out-quart), transform 0.25s var(--ease-out-quart);
}

.about-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.about-card h4 {
  font-size: 0.95rem;
  margin: 0 0 0.5em 0;
  font-style: normal;
  color: var(--primary);
}

.about-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.skills-tags span {
  padding: 0.35em 0.8em;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  transition: border-color 0.2s var(--ease-out-quart), color 0.2s var(--ease-out-quart);
}

.skills-tags span:hover {
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 600px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Homepage Modules ===== */

.motto {
  text-align: center;
  border: none;
  border-left: none;
  padding: 1em 0;
  margin: 0 0 1em 0;
  opacity: 0.7;
}

.motto p {
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 0.8em;
}

.motto footer {
  background: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0;
  font-style: normal;
}

.two-col {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.two-col h2 {
  margin-top: 0;
  margin-bottom: 0.8em;
}

/* ===== Animations & Interactions ===== */

/* Reading progress bar glow */
#reading-progress {
  box-shadow: 0 0 8px var(--progress-color), 0 0 2px var(--progress-color);
  height: 3px;
}

/* Content remains visible by default. The class only plays an enhancement
   when IntersectionObserver successfully marks an item as visible. */
.fade-in {
  opacity: 1;
  transform: none;
}

.fade-in.visible {
  animation: fade-in-up 0.6s var(--ease-out-quart) both;
}

/* Staggered list items */
.fade-in li {
  opacity: 1;
  transform: none;
}

.fade-in.visible li {
  animation: fade-in-item 0.4s var(--ease-out-quart) both;
}

.fade-in.visible li:nth-child(1) { animation-delay: 0.1s; }
.fade-in.visible li:nth-child(2) { animation-delay: 0.2s; }
.fade-in.visible li:nth-child(3) { animation-delay: 0.3s; }
.fade-in.visible li:nth-child(4) { animation-delay: 0.4s; }
.fade-in.visible li:nth-child(5) { animation-delay: 0.5s; }
.fade-in.visible li:nth-child(6) { animation-delay: 0.6s; }
.fade-in.visible li:nth-child(7) { animation-delay: 0.7s; }
.fade-in.visible li:nth-child(8) { animation-delay: 0.8s; }

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-item {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Post list hover */
#posts li {
  transition: transform 0.25s var(--ease-out-quart);
  padding-left: 0;
}

#posts li:hover {
  transform: translateX(8px);
  padding-left: 0;
}

#posts time {
  transition: color 0.2s var(--ease-out-quart);
}

#posts li:hover time {
  color: var(--primary);
}

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Section headings hover */
article h2 {
  transition: color 0.3s var(--ease-out-quart);
}

article h2:hover {
  color: var(--primary);
}

/* Hero title handwriting animation */
#hero-title-container {
  text-align: center;
  min-height: 120px;
  padding: 0 1.5em;
  outline: none;
  border-radius: 8px;
}

#hero-title-container:focus-visible {
  box-shadow: 0 0 0 2px var(--primary);
}

.hero-title-svg {
  width: 100%;
  max-width: 700px;
  height: auto;
  margin: 0 auto;
  display: block;
  overflow: visible;
}

.hero-title-svg path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-title {
  font-family: 'Caveat', cursive;
  letter-spacing: 0.02em;
  font-weight: 400;
}

/* Responsive */
@media (max-width: 767px) {
  header {
    padding: 3em 1em 2em;
  }

  article {
    padding: 1em;
  }

  section {
    padding: 0 1em;
  }
}

/* ===== Hero Long-Press Feedback ===== */

.hero-pressing {
  filter: drop-shadow(0 0 12px rgba(100, 181, 246, 0.5));
  transition: filter 0.3s var(--ease-out-quart);
}

/* ===== Auth Modal ===== */

.auth-modal {
  position: fixed;
  inset: 0;
  width: min(100% - 2em, 420px);
  max-width: none;
  max-height: none;
  padding: 0;
  margin: auto;
  background: transparent;
  z-index: 1000;
}

.auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.auth-modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2em 2.5em;
  text-align: center;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.auth-hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1em;
}

.auth-modal-content input[type="password"] {
  background: var(--code-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6em 1em;
  font-size: 1rem;
  width: 100%;
  text-align: center;
  outline: none;
  transition: border-color 0.2s var(--ease-out-quart);
}

.auth-modal-content input[type="password"]:focus {
  border-color: var(--primary);
}

#auth-submit {
  display: block;
  width: 100%;
  margin-top: 0.8em;
  padding: 0.5em;
  background: var(--primary);
  color: var(--selection-text);
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s var(--ease-out-quart);
}

#auth-submit:hover {
  background: var(--primary-dark);
}

#auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-error {
  color: var(--error-color);
  font-size: 0.85rem;
  margin: 0.8em 0 0;
}

/* Shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease;
}

/* ===== Reduced Motion ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  .fade-in li {
    opacity: 1;
    transform: none;
  }

  .typing-cursor {
    animation: none;
    opacity: 1;
  }

  #posts li:hover {
    transform: none;
  }

  .about-card:hover {
    transform: none;
  }

  .hero-pressing {
    filter: none;
  }
}
html.frame-blocked {
  display: none !important;
}
