:root {
	--ink: #252a24;
	--muted: #74776f;
	--paper: #f4f0e7;
	--paper-deep: #ebe4d7;
	--card: #fffdf8;
	--line: #d9d1c3;
	--sage: #667b62;
	--sage-dark: #41503e;
	--gold: #b98a42;
	--red: #a64e3e;
	--shadow: 0 18px 60px rgb(55 48 34 / 9%);
	--serif: Georgia, "Times New Roman", "Noto Serif KR", serif;
	--sans: Pretendard, "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	color: var(--ink);
	background:
		radial-gradient(circle at 8% 5%, rgb(185 138 66 / 8%), transparent 26rem),
		linear-gradient(180deg, #f8f5ee 0, var(--paper) 38rem);
	font-family: var(--sans);
	-webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 76px;
	padding: 12px clamp(20px, 6vw, 88px);
	border-bottom: 1px solid rgb(37 42 36 / 9%);
	background: rgb(248 245 238 / 86%);
	backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 700; }
.brand-mark {
	display: inline-grid;
	place-items: center;
	width: 35px;
	height: 35px;
	border-radius: 50% 50% 46% 54%;
	color: #fffdf8;
	background: var(--sage-dark);
	font-family: var(--serif);
	font-size: 17px;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.user-greeting { margin-right: 8px; color: var(--muted); font-size: 14px; }
.button {
	min-height: 42px;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	font-weight: 650;
	cursor: pointer;
	transition: transform .2s, background .2s, border-color .2s, opacity .2s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button-ghost { border-color: var(--line); background: rgb(255 253 248 / 35%); }
.button-dark { color: white; background: var(--ink); }
.button-accent { color: white; background: var(--sage); }

.hero {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 590px;
	padding: clamp(72px, 10vw, 126px) 20px 84px;
	text-align: center;
	overflow: hidden;
}
.hero::before, .hero::after {
	position: absolute;
	content: "";
	border: 1px solid rgb(102 123 98 / 13%);
	border-radius: 50%;
	pointer-events: none;
}
.hero::before { width: 460px; height: 460px; top: -210px; right: -190px; }
.hero::after { width: 300px; height: 300px; bottom: -160px; left: -130px; }
.eyebrow, .section-kicker {
	margin: 0 0 17px;
	color: var(--sage);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .18em;
	text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow span { width: 23px; height: 1px; background: var(--sage); }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(48px, 7.5vw, 92px); font-weight: 500; line-height: .99; letter-spacing: -.055em; }
h1 em { color: var(--sage); font-weight: 400; }
.hero-copy { max-width: 560px; margin: 28px auto 0; color: var(--muted); font-size: clamp(15px, 2vw, 18px); line-height: 1.8; }
.question-box {
	width: min(760px, 100%);
	margin-top: 46px;
	padding: 18px 20px 13px;
	border: 1px solid rgb(102 123 98 / 35%);
	border-radius: 22px;
	background: rgb(255 253 248 / 80%);
	box-shadow: var(--shadow);
	text-align: left;
}
.question-box label { display: block; margin: 0 2px 8px; color: var(--sage-dark); font-size: 12px; font-weight: 800; }
.question-row { display: flex; align-items: stretch; gap: 12px; }
.question-row textarea { flex: 1; min-height: 60px; padding: 9px 2px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 18px; line-height: 1.55; }
.question-row textarea::placeholder { color: #aaa79f; }
.ask-button { display: flex; align-items: center; gap: 18px; align-self: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; color: white; background: var(--sage-dark); font-weight: 750; cursor: pointer; }
.question-note { margin: 8px 2px 0; color: #9a978f; font-size: 11px; }
.guest-cta { display: flex; align-items: center; gap: 18px; margin-top: 42px; padding: 12px 12px 12px 22px; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 253 248 / 75%); }
.guest-cta p { margin: 0; color: var(--muted); font-size: 14px; }

.answer-section { padding: 74px 20px; background: var(--sage-dark); text-align: center; }
.answer-section .section-kicker { color: #d8c498; }
.answer-card { width: min(720px, 100%); margin: 0 auto; color: #fff; }
.answer-question { margin: 0 0 28px; color: rgb(255 255 255 / 66%); font-size: 15px; }
.answer-verse { margin: 0; font-family: var(--serif); font-size: clamp(28px, 5vw, 45px); line-height: 1.5; word-break: keep-all; }
.verse-reference { margin: 18px 0 30px; color: #d8c498; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.answer-actions { display: flex; justify-content: center; gap: 10px; }
.answer-actions .button { border-color: rgb(255 255 255 / 25%); color: white; }
.answer-actions .primary { color: var(--sage-dark); background: #f3ead7; }

.feed-section { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 92px 0 110px; }
.feed-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.feed-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); font-weight: 500; letter-spacing: -.035em; }
.sort-tabs { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 253 248 / 50%); }
.sort-tab { min-width: 72px; padding: 9px 15px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.sort-tab.active { color: white; background: var(--ink); }
.posts { display: grid; gap: 17px; }
.post-card {
	position: relative;
	padding: clamp(24px, 4vw, 38px);
	border: 1px solid var(--line);
	border-radius: 24px;
	background: rgb(255 253 248 / 82%);
	box-shadow: 0 8px 35px rgb(55 48 34 / 4%);
	transition: border-color .2s, transform .2s;
}
.post-card:hover { transform: translateY(-2px); border-color: #c2b7a5; }
.post-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.author { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 750; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: white; background: var(--sage); font-family: var(--serif); }
.post-question { margin: 25px 0 16px; color: var(--muted); font-size: 14px; }
.post-question::before { content: "Q. "; color: var(--gold); font-weight: 850; }
.post-verse { margin: 0; font-family: var(--serif); font-size: clamp(21px, 3.2vw, 29px); line-height: 1.55; word-break: keep-all; }
.post-reference { margin: 11px 0 0; color: var(--sage); font-size: 12px; font-weight: 800; }
.post-actions { display: flex; align-items: center; gap: 8px; margin-top: 25px; padding-top: 20px; border-top: 1px solid #ebe5da; }
.action-button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.action-button:hover { background: var(--paper); }
.action-button.reacted { color: var(--red); background: #f7eae6; }
.share-action { margin-left: auto; }
.replies { margin-top: 22px; padding-top: 20px; border-top: 1px solid #ebe5da; }
.reply { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 11px 0; }
.reply-body { margin: 2px 0 4px; color: #555950; font-size: 14px; line-height: 1.6; }
.reply-meta { color: #99968f; font-size: 11px; }
.reply-form { display: flex; gap: 8px; margin-top: 15px; }
.reply-form input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: white; }
.reply-form input:focus { border-color: var(--sage); }
.reply-form button { padding-inline: 15px; border: 0; border-radius: 12px; color: white; background: var(--sage); cursor: pointer; font-weight: 700; }
.route-back { margin: -8px 0 24px; }
.route-back a { color: var(--sage); font-size: 13px; font-weight: 750; }
.empty-state { padding: 70px 20px; border: 1px dashed var(--line); border-radius: 24px; text-align: center; }
.empty-state span { color: var(--gold); font-size: 28px; }
.empty-state h3 { margin: 14px 0 8px; font-family: var(--serif); font-size: 24px; }
.empty-state p { margin: 0; color: var(--muted); }
.load-more { display: block; margin: 28px auto 0; border-color: var(--line); background: var(--card); }
.skeleton { height: 260px; overflow: hidden; background: #eee8dc; }
.skeleton::after { display: block; width: 45%; height: 100%; content: ""; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 50%), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { transform: translateX(-110%); } to { transform: translateX(250%); } }

footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 38px clamp(20px, 6vw, 88px); border-top: 1px solid var(--line); color: var(--muted); }
.footer-brand { color: var(--ink); }
footer p { margin: 0; font-size: 13px; }

.auth-dialog { width: min(440px, calc(100% - 28px)); padding: 36px; border: 1px solid var(--line); border-radius: 25px; background: var(--card); box-shadow: 0 35px 100px rgb(20 25 18 / 30%); }
.auth-dialog::backdrop { background: rgb(31 35 30 / 58%); backdrop-filter: blur(6px); }
.dialog-close { position: absolute; top: 15px; right: 17px; border: 0; color: var(--muted); background: transparent; font-size: 26px; cursor: pointer; }
.auth-heading { text-align: center; }
.auth-heading .brand-mark { margin: 0 auto 18px; }
.auth-heading p { margin: 0 0 5px; color: var(--sage); font-size: 12px; font-weight: 800; }
.auth-heading h2 { margin: 0 0 28px; font-family: var(--serif); font-size: 35px; }
.field { margin-bottom: 15px; }
.field label { display: block; margin: 0 0 7px; font-size: 12px; font-weight: 800; }
.field input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: #fff; }
.field input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgb(102 123 98 / 10%); }
.auth-submit { width: 100%; margin-top: 5px; }
.auth-switch { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.auth-switch button { padding: 0; border: 0; color: var(--sage); background: transparent; cursor: pointer; font-weight: 800; }
.form-error { margin: 0 0 10px; color: var(--red); font-size: 12px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; max-width: calc(100% - 28px); padding: 12px 18px; border-radius: 999px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: .25s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 680px) {
	.site-header { min-height: 66px; }
	.header-actions .button { min-height: 38px; padding: 0 13px; font-size: 12px; }
	.user-greeting { display: none; }
	.hero { min-height: 560px; padding-top: 72px; }
	.question-row { flex-direction: column; }
	.ask-button { justify-content: space-between; align-self: stretch; }
	.guest-cta { flex-direction: column; border-radius: 20px; padding: 16px; }
	.feed-heading { align-items: flex-start; flex-direction: column; }
	.post-card { border-radius: 19px; }
	footer { align-items: flex-start; flex-direction: column; }
	.auth-dialog { padding: 32px 22px; }
}

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