@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&family=Noto+Sans+JP:wght@400;500;700&display=swap");

:root {
  --bg: #f4f2ed;
  --ink: #1f1f1c;
  --muted: #5f5c54;
  --line: #d8d4ca;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: #ffffff;
  --brand: #0f5d4d;
  --brand-dark: #0a483c;
  --brand-soft: #e2f1eb;
  --accent: #bb5a2d;
  --focus: #2e6ddf;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-1: 0 12px 40px rgba(35, 28, 16, 0.08);
  --shadow-2: 0 8px 24px rgba(15, 15, 10, 0.1);
  --control-font-size: clamp(0.86rem, 0.25vw + 0.82rem, 0.95rem);
  --control-min-height: 42px;
  --mobile-control-min-height: 44px;
  --mobile-nav-font-size: clamp(0.72rem, 2.8vw, 0.82rem);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  color: var(--ink);
  font-family: "Noto Sans JP", "Manrope", sans-serif;
  line-height: 1.68;
  background:
    radial-gradient(1200px 600px at 0% -10%, #ece8dc 0%, transparent 60%),
    radial-gradient(1200px 640px at 100% -6%, #ddebe6 0%, transparent 58%),
    linear-gradient(180deg, #f6f4ee 0%, var(--bg) 100%);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

body::before {
  width: 380px;
  height: 380px;
  top: -120px;
  right: -90px;
  background: radial-gradient(circle at 30% 30%, rgba(15, 93, 77, 0.18), rgba(15, 93, 77, 0));
}

body::after {
  width: 320px;
  height: 320px;
  bottom: -130px;
  left: -90px;
  background: radial-gradient(circle at 40% 40%, rgba(187, 90, 45, 0.16), rgba(187, 90, 45, 0));
}

.container {
  width: min(1080px, calc(100% - 2.2rem));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: #fff;
  border: 2px solid var(--focus);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  z-index: 999;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(216, 212, 202, 0.7);
  background: rgba(247, 245, 241, 0.86);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  display: grid;
  line-height: 1.1;
}

.brand-title {
  font-family: "Manrope", "Noto Sans JP", sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-tagline {
  margin-top: 0.1rem;
  font-size: 0.76rem;
  color: var(--muted);
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.lang-switch {
  color: var(--muted);
  font-size: 0.85rem;
  margin-right: 0.25rem;
}

nav a,
.user {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-min-height);
  padding: 0.3rem 0.76rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: var(--control-font-size);
  line-height: 1.2;
}

nav a {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #c7e0d8;
}

nav a:hover {
  background: #d5e9e1;
}

nav a.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: rgba(15, 93, 77, 0.45);
}

nav a.nav-cta {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #9d4420);
  border-color: rgba(157, 68, 32, 0.4);
  font-weight: 700;
}

nav a.nav-cta:hover {
  background: linear-gradient(135deg, #c5673b, #a44a25);
}

.user {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

main {
  padding: 1.4rem 0 3.2rem;
}

.site-footer {
  border-top: 1px solid rgba(216, 212, 202, 0.85);
  background: rgba(247, 245, 241, 0.88);
  backdrop-filter: blur(8px);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 0 1.1rem;
}

.footer-copy {
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 0.86rem;
  border: 1px solid #c7e0d8;
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 0.15rem 0.62rem;
}

.footer-links a:hover {
  background: #d5e9e1;
}

.flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.flash-list li {
  background: #fff7ee;
  border: 1px solid #efc5a7;
  border-left: 6px solid #e68a52;
  border-radius: var(--radius-md);
  padding: 0.72rem 0.9rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 0.66rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
}

.card,
.composer,
.limit-status,
.auth-card,
.card-like {
  background: var(--card);
  border: 1px solid rgba(216, 212, 202, 0.9);
  border-radius: var(--radius-lg);
  padding: 1.02rem 1.06rem;
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(4px);
  margin-bottom: 1rem;
}

.intro-panel {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.76)),
    radial-gradient(circle at 90% 20%, rgba(15, 93, 77, 0.12), rgba(15, 93, 77, 0));
}

.intro h1 {
  margin: 0 0 0.46rem;
  font-family: "Manrope", "Noto Sans JP", sans-serif;
  font-size: clamp(1.4rem, 2vw + 1rem, 2.1rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.intro p {
  margin: 0.32rem 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  margin-top: 0.56rem;
  background: rgba(15, 93, 77, 0.12);
  border: 1px solid rgba(15, 93, 77, 0.2);
  color: #0f5d4d;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 600;
  padding: 0.18rem 0.68rem;
}

.status-panel {
  height: 100%;
}

.status-row {
  margin: 0.4rem 0;
}

.status-unlock {
  display: block;
  margin-top: 0.14rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-panel h2,
.composer h2,
.timeline h2,
.auth-card h1,
.composer h1 {
  margin: 0 0 0.45rem;
  font-family: "Manrope", "Noto Sans JP", sans-serif;
  letter-spacing: 0.01em;
}

.helper,
.hint,
.notice {
  color: var(--muted);
  font-size: 0.9rem;
}

.helper {
  margin: 0 0 0.5rem;
}

.hint {
  margin: 0.48rem 0 0.88rem;
}

.hint.is-warning {
  color: #8b4d2f;
}

.field-error {
  min-height: 1.1rem;
  margin: -0.5rem 0 0.6rem;
  color: #9a2b18;
  font-size: 0.84rem;
}

.notice {
  margin-top: 0;
}

textarea,
input {
  width: 100%;
  border: 1px solid #d7d4cb;
  background: var(--card-strong);
  border-radius: 12px;
  padding: 0.72rem 0.78rem;
  font: inherit;
  margin-top: 0.3rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus,
textarea:focus {
  border-color: #7fb9ab;
  box-shadow: 0 0 0 4px rgba(15, 93, 77, 0.14);
  outline: none;
}

label {
  display: block;
  margin-bottom: 0.85rem;
}

button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-family: "Manrope", "Noto Sans JP", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: var(--control-font-size);
  min-height: var(--control-min-height);
  padding: 0.64rem 1.04rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--shadow-2);
}

button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  transform: none;
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #c9492c;
  box-shadow: 0 0 0 3px rgba(201, 73, 44, 0.16);
}

.timeline {
  margin-top: 0.8rem;
}

.timeline-only {
  margin-top: 0;
}

.timeline-list {
  display: grid;
  gap: 0.8rem;
}

.timeline-cta {
  margin-top: 0.8rem;
}

.timeline-cta h2 {
  margin-top: 0;
}

.account-delete-card {
  margin-top: 1rem;
  border-color: rgba(154, 43, 24, 0.32);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 242, 239, 0.9)),
    var(--card);
}

.danger-text {
  color: #8f2b1b;
}

button.danger-button {
  background: linear-gradient(135deg, #b53d2a, #8f2b1b);
}

button.danger-button:hover {
  filter: brightness(1.04);
}

.onboarding-card {
  margin-top: 0.9rem;
  margin-bottom: 0.95rem;
  border-color: rgba(15, 93, 77, 0.24);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(244, 250, 247, 0.88)),
    radial-gradient(circle at 90% 8%, rgba(15, 93, 77, 0.14), rgba(15, 93, 77, 0));
}

.onboarding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.onboarding-head h2 {
  margin: 0;
}

.onboarding-list {
  margin: 0.62rem 0 0;
  padding-left: 1.15rem;
}

.onboarding-list li {
  margin-bottom: 0.34rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  cursor: pointer;
  box-shadow: none;
}

.text-button:hover {
  transform: none;
  filter: none;
}

.timeline-more {
  margin: 0.85rem 0 0.2rem;
}

.timeline-more a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: 999px;
  min-height: var(--control-min-height);
  padding: 0.46rem 0.92rem;
  font-size: var(--control-font-size);
  line-height: 1.2;
  box-shadow: var(--shadow-2);
}

.timeline-more a:hover {
  filter: brightness(1.03);
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.meta a {
  color: inherit;
  text-decoration: none;
}

.meta a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-card {
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
  animation: rise-in 420ms ease both;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), rgba(15, 93, 77, 0.2));
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(32, 23, 16, 0.14);
}

.post-card.is-unread {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(233, 248, 241, 0.88)),
    var(--card);
  border-color: rgba(15, 93, 77, 0.32);
}

.timeline-list .post-card:nth-child(2) {
  animation-delay: 40ms;
}

.timeline-list .post-card:nth-child(3) {
  animation-delay: 80ms;
}

.content {
  margin: 0.55rem 0 0.2rem;
  white-space: pre-wrap;
  line-height: 1.72;
}

.actions {
  margin-top: 0.4rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.actions a {
  color: var(--brand-dark);
  text-decoration: none;
  text-underline-offset: 2px;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 93, 77, 0.24);
  background: rgba(226, 241, 235, 0.75);
}

.actions a:hover {
  background: #d5e9e1;
}

.badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  border: 1px solid #f2c6a9;
  background: #fff4ec;
  color: #8b4d2f;
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  font-size: 0.74rem;
}

.badge.unread-badge {
  margin-left: 0.46rem;
  border-color: rgba(15, 93, 77, 0.35);
  background: rgba(15, 93, 77, 0.12);
  color: #0a483c;
}

.ad-card {
  margin: 1rem 0 1.2rem;
  background: rgba(255, 255, 255, 0.74);
}

.ad-slot-shell {
  min-height: 180px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(242, 239, 232, 0.65), rgba(255, 255, 255, 0.92));
  border: 1px dashed rgba(95, 92, 84, 0.22);
  padding-top: 0.3rem;
}

.ad-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-card,
.composer.narrow {
  width: min(680px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.legal-page {
  width: min(860px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.legal-page h1,
.legal-page h2 {
  font-family: "Manrope", "Noto Sans JP", sans-serif;
  letter-spacing: 0.01em;
}

.legal-page h1 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.legal-page h2 {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.legal-list {
  margin: 0.4rem 0 0.2rem;
  padding-left: 1.2rem;
}

.legal-list li {
  margin-bottom: 0.24rem;
}

.user-search-panel {
  margin-top: 0.8rem;
}

.user-search-form {
  margin: 0;
}

.user-search-form label {
  margin-bottom: 0.5rem;
}

.user-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.user-search-row input {
  margin-top: 0;
}

.user-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

button.is-loading,
.timeline-more a.is-loading {
  opacity: 0.9;
  pointer-events: none;
}

button.is-loading::after,
.timeline-more a.is-loading::after {
  content: "";
  display: inline-block;
  width: 0.78rem;
  height: 0.78rem;
  margin-left: 0.42rem;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-top-color: #ffffff;
  border-radius: 999px;
  vertical-align: -0.1rem;
  animation: spin 800ms linear infinite;
}

.mobile-tabbar {
  display: none;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .status-panel {
    height: auto;
  }

  .user-search-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    display: none;
  }

  .container {
    width: min(1080px, calc(100% - 1.1rem));
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.2rem;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav a,
  .user {
    flex: 0 0 auto;
    min-height: var(--mobile-control-min-height);
    padding: 0.3rem 0.78rem;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  main {
    padding-top: 0.8rem;
    padding-bottom: 6.3rem;
  }

  button {
    min-height: 48px;
    width: 100%;
    font-size: 0.94rem;
  }

  .timeline-more {
    margin-top: 0.95rem;
  }

  .timeline-more a {
    width: 100%;
    min-height: 48px;
    font-size: 0.94rem;
  }

  .actions {
    gap: 0.38rem;
  }

  .actions a {
    min-height: 40px;
    padding: 0.24rem 0.76rem;
    font-size: 0.84rem;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.58rem 0.58rem calc(0.58rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(216, 212, 202, 0.95);
    background: rgba(247, 245, 241, 0.96);
    backdrop-filter: blur(10px);
  }

  .mobile-tabbar a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    padding: 0.26rem 0.32rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: var(--mobile-nav-font-size);
    font-weight: 700;
    color: var(--brand-dark);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 93, 77, 0.2);
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-tabbar a.is-active {
    color: #ffffff;
    border-color: rgba(15, 93, 77, 0.5);
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-tagline {
    font-size: 0.72rem;
  }

  .card,
  .composer,
  .limit-status,
  .auth-card,
  .card-like {
    border-radius: 16px;
    padding: 0.9rem;
  }
}

@media (max-width: 380px) {
  .mobile-tabbar a {
    font-size: 0.7rem;
    padding: 0.22rem 0.24rem;
  }
}
