@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");
@font-face {
    font-family: 'KyoboHandwriting2021sjy';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2212@1.0/KyoboHandwriting2021sjy.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

:root {
  --bg: #f9f9f9;
  --surface: #ffffff;
  --text: #111111;
  --subtle: #666666;
  --primary: #111111;
  --border: #111111;
  --highlight: #f0f0f0;

  --panel-radius: 4px;
  --panel-border: 4px solid var(--border);
  --panel-shadow: 6px 6px 0px var(--border);
  --panel-shadow-hover: 3px 3px 0px var(--border);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'KyoboHandwriting2021sjy', "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.6;
  background-color: var(--bg);
  background-image: radial-gradient(#d0d0d0 20%, transparent 20%);
  background-size: 10px 10px;
}

.container { 
  width: min(1060px, 92vw); 
  margin: 0 auto; 
  padding-bottom: 40px;
}

/* Home Button */
.home-button {
  position: fixed;
  top: 10px;
  left: calc((100vw - min(1060px, 92vw)) / 2);
  z-index: 200;
  display: inline-block;
  padding: 8px 16px;
  border: 3px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0.5px;
  text-decoration: none;
  box-shadow: 4px 4px 0px var(--border);
  transition: all 0.1s ease;
  font-size: 0.95rem;
}
.home-button:hover { 
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--border); 
  background: var(--highlight);
}

/* CARDS (Manga Panels) */
.hero, .card {
  background: var(--surface);
  border: var(--panel-border);
  padding: 30px;
  box-shadow: var(--panel-shadow);
  margin-bottom: 24px;
  position: relative;
}
.hero { margin: 64px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 20px; align-items: start; }
.hero-main { min-width: 0; }

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-image {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 4px 4px 0px var(--border);
  filter: grayscale(100%) contrast(140%) brightness(1.1);
  background: #fff;
}

.hero h1 { margin: 12px 0; font-size: 2.2rem; font-weight: 900; letter-spacing: -1px; }
.hero p { margin: 0; font-size: 1.05rem; font-weight: 600; }

.side-project-button {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  border: 3px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 4px 4px 0px var(--border);
  transition: all 0.1s ease;
}
.side-project-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--border); 
  background: var(--highlight);
}

/* Secondary Panels */
.hero-career,
.hero-stack {
  margin: 0;
  background: var(--surface);
  border: 3px solid var(--border);
  padding: 18px;
  box-shadow: var(--panel-shadow);
  position: relative;
}
.hero-stack h2 { margin: 0 0 12px; font-weight: 900; border-bottom: 3px solid var(--border); padding-bottom: 6px; }

/* Badges */
.badge {
  display: inline-block;
  border: 2px solid var(--border);
  background: var(--text);
  color: var(--surface);
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 3px 3px 0px var(--subtle);
}

.career-title {
  margin: 0 0 12px;
  font-weight: 900;
  color: var(--text);
  border-bottom: 3px solid var(--border);
  padding-bottom: 6px;
}
.career-item {
  margin: 0;
  padding: 12px 0;
  border-bottom: 2px dashed var(--border);
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.career-item:last-child { border-bottom: none; }
.career-role { color: var(--text); }
.career-period { color: var(--subtle); font-size: 0.9rem; }

/* Layout Grid */
.layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 24px; padding-bottom: 24px; align-items: stretch; }
.song-card { grid-column: 1; grid-row: 1; margin-bottom: 0 !important; }
.post-card { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0 !important; }
.post-card .post-list { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-height: 0; }

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.post-header h2 { margin: 0; font-weight: 900; font-size: 1.6rem; }
.plus-link {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 3px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  font-size: 1.2rem;
  text-decoration: none;
  box-shadow: 3px 3px 0px var(--border);
  transition: all 0.1s ease;
}
.plus-link:hover { 
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--border); 
  background: var(--text);
  color: var(--surface);
}

.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
.post-item { list-style: none; display: flex; flex: 1; min-height: 0; }
.post-item a { color: var(--text); text-decoration: none; display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 0; overflow: hidden; }
.post-item time { color: var(--subtle); font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.post-item-link {
  border: 3px solid var(--border);
  padding: 8px 16px;
  background: var(--surface);
  box-shadow: 6px 6px 0px rgba(0,0,0,0.1); /* Screentone style shadow */
  transition: all 0.1s ease;
  position: relative;
  background-image: linear-gradient(45deg, transparent 48%, rgba(0,0,0,0.05) 50%, transparent 52%);
  background-size: 4px 4px; /* subtle hatching effect */
}
.post-item-link::after {
  content: "";
  position: absolute; inset: 0; background: var(--surface); z-index: -1;
}
.post-item-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0px var(--border);
  background-color: var(--surface);
}
.post-item-link strong { color: var(--text); font-size: 1.15rem; font-weight: 900; display: block; margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-project-card h2 { margin: 0; }
.project-list-title {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 900;
  border-bottom: 3px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
  margin-top: 0;
}
.side-project-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.side-project-item { list-style: none; }
.side-project-item-link {
  display: block;
  border: 4px solid var(--border);
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 4px 4px 0px var(--border);
  transition: all 0.1s;
}
.side-project-item-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--border);
  background: var(--text);
  color: var(--surface);
}

.floating-side-projects {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 1000;
}
.floating-side-projects summary {
  list-style: none;
  cursor: pointer;
  border: 4px solid var(--border);
  background: var(--text);
  color: var(--surface);
  font-weight: 900;
  font-size: 1.2rem;
  padding: 12px 24px;
  border-radius: 99px;
  box-shadow: 6px 6px 0px var(--border);
  transition: all 0.1s ease;
  display: flex; align-items: center; gap: 8px;
}
.floating-side-projects summary:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0px var(--border);
}
.floating-side-projects summary::-webkit-details-marker { display: none; }

.floating-side-projects-body {
  position: absolute;
  bottom: calc(100% + 16px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 64px);
  background: var(--surface);
  border: 4px solid var(--border);
  padding: 20px;
  box-shadow: 8px 8px 0px var(--border);
  max-height: 60vh;
  overflow-y: auto;
}


.notion-link-card {
  margin-top: 16px; display: block; text-decoration: none;
  border: 3px solid var(--border);
  background: var(--surface);
  padding: 18px; color: var(--text);
  box-shadow: 5px 5px 0px var(--border);
  transition: all 0.1s ease;
  font-weight: 900;
}
.notion-link-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0px var(--border);
  background: var(--text);
  color: var(--surface);
}
.study-card { margin-bottom: 56px; }

.stack-list { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.stack-item { 
  font-size: .85rem; 
  padding: 6px 12px; 
  border: 2px solid var(--border); 
  font-weight: 800; 
  background: var(--surface); 
  box-shadow: 2px 2px 0px var(--border);
  color: var(--text);
}

.fx-hongik, .fx-cpp, .fx-er, .fx-lostark, .fx-mabinogi, .fx-discord, .fx-kakao { 
  font-weight: 900; 
  color: var(--text);
  border-bottom: 2px solid var(--border);
  display: inline-block;
  line-height: 1.2;
}
.fx-kakao {
  border: 2px solid var(--border);
  padding: 2px 8px;
  box-shadow: 2px 2px 0px var(--border);
}

.posts-page { margin: 56px 0; }
.posts-page h1 { margin-top: 0; font-size: 2.5rem; font-weight: 900; text-transform: uppercase; border-bottom: 5px solid var(--border); padding-bottom: 12px;}
.back-link { display: inline-block; margin-top: 14px; color: var(--text); text-decoration: underline; font-weight: 900; }

@media (max-width:860px){
  .layout{ grid-template-columns:1fr; }
  .hero-grid{ grid-template-columns:1fr; }
  .profile-image{ width:64px; height:64px; }
}

.post-type-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .5px;
  border: 2px solid var(--border);
  background: var(--text);
  color: var(--surface);
  text-transform: uppercase;
}
.post-type-badge.diary { background: var(--surface); color: var(--text); box-shadow: 2px 2px 0px var(--border); }
.post-type-badge.info { background: var(--text); color: var(--surface); box-shadow: 2px 2px 0px var(--border); }
.post-type-badge.other { background: var(--subtle); color: var(--surface); box-shadow: 2px 2px 0px var(--border); }


.song-card h2 { margin: 0 0 16px; font-weight: 900; font-size: 1.6rem; border-bottom: 4px solid var(--border); padding-bottom: 10px; }
.song-player-wrap {
  overflow: hidden;
  border: 4px solid var(--border);
  background: var(--text);
  box-shadow: 6px 6px 0px var(--border);
}
.song-player-wrap iframe {
  display: block;
  width: 100%;
  min-height: 340px;
  aspect-ratio: 16 / 10;
  border: 0;
  filter: grayscale(100%);
}

.post-group-title {
  margin: 32px 0 16px;
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--text);
  display: inline-block;
  position: relative;
  z-index: 1;
}
.post-group-title::after {
  content: "";
  position: absolute;
  left: -8px; right: -20px; bottom: 2px;
  height: 12px;
  background: url('data:image/svg+xml;utf8,<svg width="10" height="10" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><circle cx="5" cy="5" r="3" fill="black"/></svg>') repeat;
  z-index: -1;
  opacity: 0.3;
}

.post-detail { margin: 56px 0; }
.post-detail-header { border-bottom: 4px solid var(--border); padding-bottom: 16px; margin-bottom: 24px; }
.post-detail-header h1 { margin: 12px 0; font-size: 2.2rem; font-weight: 900; }
.post-content { margin-top: 16px; font-size: 1.1rem; }
.post-nav { margin-top: 32px; display: flex; gap: 12px; border-top: 4px solid var(--border); padding-top: 24px; }

.post-back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: 4px 4px 0px var(--border);
  transition: all 0.1s ease;
}
.post-back-arrow:hover { 
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--border);
  background: var(--text);
  color: var(--surface);
}

/* ----------------------------------------------------
   DIARY LOCK MODAL (Manga Style)
   ---------------------------------------------------- */
.diary-protected .home-button { z-index: 560; }
.diary-content-locked { visibility: hidden; }
.diary-unlocked .diary-content-locked { visibility: visible; }

/* The layout modal */
.diary-page-lock {
  position: fixed;
  inset: 0;
  z-index: 550;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
  background-image: radial-gradient(#666 20%, transparent 20%);
  background-size: 12px 12px;
}

/* The posts list modal (was leaking at bottom) */
.diary-lock-modal {
  display: none; /* INITIALLY HIDDEN to fix the bug */
}
.diary-lock-modal.is-open {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 550;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
  background-image: radial-gradient(#666 20%, transparent 20%);
  background-size: 12px 12px;
}

/* Shared Card style */
.diary-page-lock-card,
.diary-lock-card {
  width: min(420px, 100%);
  border: 5px solid var(--text);
  background: var(--surface);
  box-shadow: 12px 12px 0px var(--text); /* Manga panel pop-out */
  padding: 30px;
  position: relative;
  transform: rotate(-1deg);
}
.diary-page-lock-card::before,
.diary-lock-card::before {
  content: "TOP SECRET";
  position: absolute;
  top: -16px; left: 24px;
  background: var(--text);
  color: var(--surface);
  padding: 4px 12px;
  font-family: "Pretendard", sans-serif;
}

.diary-page-lock-card h2,
.diary-lock-card h3 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 900;
  border-bottom: 3px solid var(--text);
  padding-bottom: 8px;
}

.diary-page-lock-copy,
.diary-lock-copy {
  margin: 0 0 20px;
  color: var(--subtle);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.diary-page-lock-form input,
.diary-lock-form input {
  width: 100%;
  margin-bottom: 12px;
  border: 3px solid var(--text);
  background: var(--highlight);
  color: var(--text);
  padding: 12px 14px;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 4px;
  box-shadow: inset 4px 4px 0px rgba(0,0,0,0.1);
}
.diary-page-lock-form input:focus,
.diary-lock-form input:focus {
  outline: none;
  background: var(--surface);
}

.diary-page-lock-hint,
.diary-lock-hint {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
}

.diary-page-lock-form button,
.diary-lock-actions button {
  width: 100%;
  border: 3px solid var(--text);
  background: var(--text);
  color: var(--surface);
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 12px 14px;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
  transition: all 0.1s;
}
.diary-lock-actions {
  display: flex;
  gap: 12px;
}
.diary-lock-actions button[type="button"] { /* Cancel button */
  background: var(--surface);
  color: var(--text);
}

.diary-page-lock-form button:hover,
.diary-lock-actions button:focus,
.diary-lock-actions button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}

.diary-page-lock-message,
.diary-lock-message {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
}
.diary-page-lock-message.error,
.diary-lock-message.error {
  color: #d00;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: #d00;
}
