:root {
  color-scheme: light;
  --canvas: #f4f1ea;
  --paper: #fffdf8;
  --ink: #182019;
  --muted: #626b62;
  --line: #d8d8ce;
  --accent: #b93b20;
  --accent-dark: #9f2f18;
  --forest: #173f32;
  --forest-light: #dfece5;
  --starbucks-green: #00754a;
  --danger: #a53324;
  --shadow: 0 18px 50px rgba(32, 43, 35, 0.08);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Noto Sans KR", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(233, 90, 53, 0.08), transparent 25rem),
    radial-gradient(circle at 96% 12%, rgba(23, 63, 50, 0.08), transparent 26rem),
    var(--canvas);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--forest);
  border-radius: 0.35rem;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 0.72rem;
  align-items: center;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 25px;
  height: 25px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 4px;
  background: var(--forest);
  border-radius: 50%;
}

.brand-mark span {
  display: block;
  background: var(--canvas);
  border-radius: 50%;
}

.storage-badge {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.storage-dot {
  width: 7px;
  height: 7px;
  background: #38a36f;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(56, 163, 111, 0.12);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.7fr);
  gap: 3rem;
  align-items: end;
  padding: 72px 0 62px;
}

.section-label,
.panel-kicker {
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.intro h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 1.03;
}

.intro h1 span {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.055em;
}

.intro-copy {
  max-width: 390px;
  margin: 0 0 0.35rem;
  padding-top: 1.4rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
  line-height: 1.78;
  word-break: keep-all;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(0, 1.22fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 72px;
}

.board-layout:focus,
.feed-heading h2:focus {
  outline: none;
}

.composer-panel,
.feed-panel {
  border-radius: 22px;
}

.composer-panel {
  position: sticky;
  top: 24px;
  overflow: hidden;
  padding: 32px;
  color: #f9f7f0;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(330deg, rgba(0, 45, 30, 0.18), transparent 44%),
    var(--starbucks-green);
  box-shadow: var(--shadow);
}

.panel-heading,
.feed-heading,
.post-card-topline,
.post-meta,
.field-heading,
.form-footer,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading {
  align-items: flex-start;
  margin-bottom: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.panel-kicker {
  margin-bottom: 0.55rem;
  color: #d6e9e2;
}

.panel-heading h2,
.feed-heading h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.panel-number {
  color: rgba(255, 255, 255, 0.32);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  font-style: italic;
}

.field-group + .field-group {
  margin-top: 24px;
}

.field-heading {
  margin-bottom: 0.65rem;
}

.field-heading label {
  font-size: 0.82rem;
  font-weight: 750;
}

.character-count {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

input,
textarea {
  display: block;
  width: 100%;
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  outline: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input {
  height: 50px;
  padding: 0 15px;
}

textarea {
  min-height: 188px;
  padding: 14px 15px;
  line-height: 1.65;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.84);
}

input:hover,
textarea:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.32);
}

input:focus,
textarea:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: #f2a48f;
  box-shadow: 0 0 0 3px rgba(242, 164, 143, 0.14);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #ff9a80;
}

.field-error {
  min-height: 1.1rem;
  margin: 0.4rem 0 0;
  color: #fff0eb;
  font-size: 0.72rem;
}

.form-footer {
  gap: 1rem;
  margin-top: 25px;
}

.save-hint {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.68rem;
}

.save-hint span {
  color: #76c89e;
  font-size: 0.55rem;
}

.submit-button {
  display: inline-flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px 0 21px;
  color: #fff;
  background: var(--accent);
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 750;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.submit-button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button:focus-visible,
.delete-button:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(233, 90, 53, 0.38);
  outline-offset: 3px;
}

.button-arrow {
  font-size: 1.1rem;
}

.form-status {
  min-height: 1.2rem;
  margin: 0.85rem 0 0;
  color: #ffffff;
  font-size: 0.74rem;
  text-align: right;
}

.form-status[data-tone="error"] {
  color: #fff0eb;
}

.feed-panel {
  min-height: 480px;
  padding: 32px;
  background: rgba(255, 253, 248, 0.64);
  border: 1px solid rgba(216, 216, 206, 0.9);
  box-shadow: 0 16px 45px rgba(32, 43, 35, 0.045);
}

.feed-heading {
  align-items: flex-end;
  min-height: 72px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.feed-heading .section-label {
  margin-bottom: 0.5rem;
}

.post-count {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.post-count strong {
  color: var(--ink);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.post-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-item {
  min-width: 0;
  animation: card-in 300ms ease both;
}

.post-card {
  position: relative;
  overflow: hidden;
  padding: 24px 24px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.post-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleY(0.35);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.post-card:hover {
  border-color: #c8c9bd;
  box-shadow: 0 14px 30px rgba(34, 45, 37, 0.07);
  transform: translateY(-2px);
}

.post-card:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.post-card-topline {
  margin-bottom: 17px;
}

.post-index {
  color: #9ba098;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
  font-style: italic;
}

.delete-button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: #60665f;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.delete-button span:last-child {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
}

.delete-button:hover {
  color: var(--danger);
  background: #f8e8e3;
}

.delete-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.delete-button:disabled:hover {
  color: #60665f;
  background: transparent;
}

.post-title {
  margin: 0 0 11px;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  letter-spacing: -0.035em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.post-content {
  margin: 0;
  color: #555e55;
  font-size: 0.9rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.post-meta {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #e5e4db;
}

.post-facts {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.post-time {
  color: #667066;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.post-views {
  display: inline-flex;
  align-items: center;
  color: #667066;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.post-views::before {
  width: 3px;
  height: 3px;
  margin-right: 0.7rem;
  background: #a6aaa3;
  border-radius: 50%;
  content: "";
}

.local-label {
  padding: 0.25rem 0.42rem;
  color: var(--forest);
  background: var(--forest-light);
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.empty-state {
  display: grid;
  min-height: 335px;
  place-items: center;
  padding: 42px 24px;
  text-align: center;
  border: 1px dashed #c9cabf;
  border-radius: 15px;
}

.empty-state-inner {
  max-width: 280px;
}

.empty-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  place-items: center;
  color: var(--accent);
  background: #f9e7e1;
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-style: italic;
}

.empty-state h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
  word-break: keep-all;
}

.site-footer {
  gap: 1rem;
  min-height: 78px;
  color: #626a62;
  border-top: 1px solid var(--line);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.site-footer p {
  margin: 0;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 55px 0 48px;
  }

  .intro-copy {
    max-width: 560px;
  }

  .board-layout {
    grid-template-columns: 1fr;
  }

  .composer-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 70px;
  }

  .storage-badge {
    font-size: 0;
  }

  .storage-badge::after {
    font-size: 0.68rem;
    content: "D1 저장";
  }

  .intro {
    padding: 44px 4px 38px;
  }

  .intro h1 {
    font-size: clamp(2.35rem, 12.5vw, 3.6rem);
  }

  .composer-panel,
  .feed-panel {
    padding: 24px 20px;
    border-radius: 17px;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .save-hint {
    order: 2;
    justify-content: center;
  }

  .submit-button {
    width: 100%;
  }

  .post-card {
    padding: 20px 18px 18px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
