/* =============================================
   longin.io — Global Styles
   Inspired by Brittany Chiang's minimal dark aesthetic
   ============================================= */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: .5rem 1rem;
  font-weight: 600;
  z-index: 1000;
  border-radius: 0 0 4px 0;
}
.skip-link:focus {
  left: 0;
}

:root {
  --bg:         #0a0f1e;
  --bg-card:    #111827;
  --bg-hover:   #1a2235;
  --border:     #1e2d45;
  --accent:     #64ffda;
  --accent-dim: rgba(100, 255, 218, 0.1);
  --text:       #ccd6f6;
  --text-muted: #8892b0;
  --text-light: #a8b2d8;
  --white:      #e6f1ff;
  --font-sans:  'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:  'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  --nav-height: 70px;
  --max-width:  900px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1, h2, h3, h4 { color: var(--white); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p  { color: var(--text-light); }
a  { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }
code, pre { font-family: var(--font-mono); }

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 6rem 0;
}

/* ---- Navigation ---- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(10, 15, 30, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

nav .nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-light);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  transition: color .2s;
}

.nav-links a:hover { color: var(--accent); opacity: 1; }

.nav-links a .num {
  color: var(--accent);
  margin-right: 4px;
  font-size: 0.8rem;
}

/* ---- Hero ---- */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
}

.hero-greeting {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 1.2rem;
  display: block;
}

.hero-name {
  display: block;
  margin-bottom: 0.3rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 2.5rem;
  color: var(--text-light);
}

.open-to-work {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  margin-bottom: 2rem;
}

.open-to-work::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(1.3); }
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  transition: all .2s;
  cursor: pointer;
}

.btn-primary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dim);
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

/* ---- Section headers ---- */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
}

.section-header h2 {
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 300px;
}

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
  align-items: start;
}

.about-text p { margin-bottom: 1rem; }

.tech-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
  list-style: none;
  margin-top: 1.2rem;
}

.tech-list li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tech-list li::before {
  content: '▸';
  color: var(--accent);
  font-size: 0.7rem;
}

.about-photo-wrap {
  position: relative;
  max-width: 260px;
  justify-self: center;
}

.about-photo-wrap img {
  width: 100%;
  border-radius: 4px;
  filter: grayscale(20%);
  display: block;
  position: relative;
  z-index: 1;
  transition: filter .3s;
}

.about-photo-wrap:hover img { filter: none; }



/* ---- Experience ---- */
.exp-tabs {
  display: flex;
  flex-direction: row;
  gap: 0;
}

.exp-tab-list {
  list-style: none;
  min-width: 160px;
  border-left: 2px solid var(--border);
}

.exp-tab-list li button {
  display: block;
  width: 100%;
  padding: 0.8rem 1.2rem;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.exp-tab-list li button:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.exp-tab-list li button.active {
  border-left-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.exp-panel {
  display: none;
  padding: 0 2rem;
  flex: 1;
}

.exp-panel.active { display: block; }

.exp-panel h3 { margin-bottom: 0.3rem; }

.exp-panel .exp-company {
  color: var(--accent);
}

.exp-panel .exp-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  display: block;
}

.exp-panel ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.exp-panel ul li {
  color: var(--text-light);
  font-size: 0.95rem;
  display: flex;
  gap: 0.6rem;
}

.exp-panel ul li::before {
  content: '▸';
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 0.75rem;
}

/* ---- Writing / Blog previews ---- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.8rem;
  transition: transform .2s, border-color .2s, background .2s;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--bg-hover);
}

.post-card a { color: inherit; }
.post-card a:hover { opacity: 1; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.post-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
}

.post-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.section-footer {
  margin-top: 2.5rem;
  text-align: center;
}

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); opacity: 1; }

/* ---- Blog list page ---- */
.blog-header {
  padding-top: calc(var(--nav-height) + 4rem);
  padding-bottom: 2rem;
}

.blog-header h1 {
  margin-bottom: 0.5rem;
}

.blog-header p {
  max-width: 540px;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 3rem;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all .2s;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.post-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.6rem 1.8rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 2rem;
  align-items: start;
  transition: border-color .2s, background .2s, transform .2s;
  text-decoration: none;
}

.post-list-item:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateX(4px);
  opacity: 1;
}

.post-list-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.3rem;
}

.post-list-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.post-list-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

/* ---- Blog post page ---- */
.post-page {
  padding-top: calc(var(--nav-height) + 4rem);
  max-width: 720px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 6rem;
}

.post-page-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.post-page-header .post-tags { margin-bottom: 1rem; }

.post-page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.post-page-meta {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- Prose styles (blog content) ---- */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-light);
}

.prose h2 {
  font-size: 1.45rem;
  margin: 2.5rem 0 1rem;
  color: var(--white);
}

.prose h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.8rem;
  color: var(--white);
}

.prose p { margin-bottom: 1.2rem; }

.prose a { color: var(--accent); border-bottom: 1px solid transparent; }
.prose a:hover { border-bottom-color: var(--accent); opacity: 1; }

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.prose li { margin-bottom: 0.4rem; color: var(--text-light); }

.prose code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15em 0.4em;
  font-size: 0.87em;
  color: var(--accent);
}

.prose pre {
  background: #0d1526;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.4rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.87rem;
  line-height: 1.7;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.5rem 1.2rem;
  background: var(--accent-dim);
  border-radius: 0 4px 4px 0;
}

.prose blockquote p { color: var(--text-light); margin: 0; }

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ---- Back link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  transition: color .2s;
}

.back-link:hover { color: var(--accent); opacity: 1; }

/* ---- Syntax highlight (simple, no lib) ---- */
.token-keyword   { color: #c792ea; }
.token-string    { color: #c3e88d; }
.token-comment   { color: #546e7a; font-style: italic; }
.token-type      { color: #ffcb6b; }
.token-number    { color: #f78c6c; }
.token-annotation{ color: #89ddff; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo-wrap { order: -1; max-width: 200px; margin: 0 auto 2rem; }
  .exp-tabs { flex-direction: column; }
  .exp-tab-list { border-left: none; border-bottom: 2px solid var(--border); display: flex; overflow-x: auto; min-width: unset; }
  .exp-tab-list li button { border-left: none; border-bottom: 2px solid transparent; margin-left: 0; margin-bottom: -2px; }
  .exp-tab-list li button.active { border-left: none; border-bottom-color: var(--accent); }
  .exp-panel { padding: 1.5rem 0 0; }
  .nav-links { gap: 1.2rem; }
  .post-list-item { grid-template-columns: 1fr; }
  .post-list-meta { flex-direction: row; align-items: center; text-align: left; }

  /* Blog post page */
  .post-page { padding-left: 1.2rem; padding-right: 1.2rem; }
  .post-page-meta { flex-wrap: wrap; gap: .6rem; }

  /* Prevent code blocks overflowing viewport */
  .prose pre { font-size: .8rem; padding: 1rem; }
  .prose pre code { white-space: pre; word-break: normal; }

  /* Support section: stack coffee + newsletter on mobile */
  #support .container > div { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .nav-links { display: none; }
  section { padding: 4rem 0; }

  /* Tighter hero on small phones */
  .hero-description { font-size: .95rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { text-align: center; }

  /* Blog filters wrap cleanly */
  .blog-filters { gap: .4rem; }
  .filter-btn { font-size: .72rem; padding: .25rem .7rem; }

  /* Post page: smaller heading on tiny screens */
  .post-page-header h1 { font-size: 1.55rem; }

  /* Share buttons wrap to 2 per row */
  .prose + div [style*="display:flex"] { flex-wrap: wrap; }
}
