/* ===========================================================
   ALINE - Editorial Confidence
   Shared design system for the redesigned site.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;1,9..144,300;1,9..144,400&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --paper:        #f5f1ea;
  --paper-2:      #ede7dc;
  --ink:          #15140f;
  --ink-soft:     #3a3630;
  --ink-muted:    #5b5750;
  --ink-faint:    #8a857c;
  --rule:         rgba(21, 20, 15, 0.12);
  --rule-strong:  rgba(21, 20, 15, 0.6);
  --accent:       #2d4a2a;     /* deep sage */
  --accent-soft:  #9bbf95;
  --accent-bg:    rgba(45, 74, 42, 0.06);
  --highlight:    rgba(45, 74, 42, 0.18);

  --serif:  'Fraunces', 'Times New Roman', Georgia, serif;
  --sans:   'Inter', system-ui, -apple-system, sans-serif;
  --mono:   'JetBrains Mono', ui-monospace, monospace;

  --max:    1280px;
  --gutter: 56px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ===== UTILITIES ===== */
.serif { font-family: var(--serif); font-variation-settings: 'opsz' 144; }
.mono { font-family: var(--mono); }
.italic { font-style: italic; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}
.marker {
  background: linear-gradient(transparent 60%, var(--highlight) 60%);
  padding: 0 2px;
}
.rule { border-top: 1px solid var(--rule); }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* link underline animation */
.link { position: relative; transition: color .2s; }
.link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.link:hover::after { transform: scaleX(1); }

/* fade-in */
.fade { animation: fadeUp .8s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 56px;
  background: rgba(245, 241, 234, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-logo { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; letter-spacing: 0.22em; color: var(--ink); }
.nav-logo-mark {
  width: 28px; height: 28px;
  display: block;
  object-fit: contain;
}
.nav-links { display: flex; gap: 32px; font-size: 13px; color: var(--ink-muted); }
.nav-cta {
  background: var(--ink); color: var(--paper);
  padding: 10px 22px; border: none; border-radius: 100px;
  font-size: 13px; font-weight: 500;
  transition: all .2s;
}
.nav-cta:hover { background: var(--accent); transform: translateY(-1px); }
.nav-cta-group { display: inline-flex; align-items: center; gap: 10px; }
.nav-cta--join { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.nav-cta--join:hover { background: var(--ink); color: var(--paper); }
.mast-cta--web { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.mast-cta--web:hover { background: var(--ink); color: var(--paper); }
.nav-cta--app-store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-cta--app-store svg {
  margin-bottom: 1px; /* optical centering against text baseline */
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px;
  font-size: 13px; font-weight: 500;
  border-radius: 4px; border: none;
  transition: all .2s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-light { background: var(--accent-soft); color: var(--ink); }
.btn-light:hover { background: #b3d4ad; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }

/* ===== INPUTS ===== */
.input {
  padding: 14px 18px;
  background: transparent;
  border: 1px solid rgba(21, 20, 15, 0.2);
  border-radius: 4px;
  font-size: 14px; font-family: var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color .2s, background .2s;
}
.input:focus { border-color: var(--ink); background: rgba(255,255,255,0.4); }
.input::placeholder { color: var(--ink-faint); }

select.input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%2315140f' fill='none' stroke-width='1.5'/></svg>"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }

/* ===== CHIPS ===== */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid rgba(21,20,15,0.2);
  border-radius: 100px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.selected {
  background: var(--ink); color: var(--paper);
  border-color: var(--ink);
}

/* Suggestion chips: live below an input as quick-fill helpers */
.chip-suggest {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.chip-suggest .chip {
  padding: 5px 11px; font-size: 11px; letter-spacing: 0.04em;
  border-radius: 999px; border-color: var(--rule);
  color: var(--ink-muted); background: transparent;
}
.chip-suggest .chip:hover { color: var(--ink); border-color: var(--ink-soft); }
.suggest-eye {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em;
  color: var(--ink-muted); text-transform: uppercase;
  margin-right: 6px;
}

/* Intent textarea + meta row */
.intent-area { resize: vertical; min-height: 64px; line-height: 1.5; padding: 14px 16px; font-family: var(--sans); }
.intent-meta {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-top: 10px;
}
.intent-meta .chip-suggest { margin-top: 0; flex: 1; }
.char-count {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--ink-muted); white-space: nowrap; padding-top: 4px;
}

/* ===== FOOTER ===== */
footer.site-foot {
  padding: 56px;
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end;
  border-top: 1px solid var(--rule);
}
.foot-brand { display: flex; flex-direction: column; gap: 6px; }
.foot-brand-row { display: flex; align-items: center; gap: 12px; }
.foot-mark { width: 24px; height: 24px; display: block; object-fit: contain; }
.foot-name { font-size: 12px; font-weight: 500; letter-spacing: 0.22em; }
.foot-copy { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint); }
.foot-links { font-family: var(--mono); display: flex; gap: 24px; font-size: 11px; letter-spacing: 0.12em; color: var(--ink-muted); text-transform: uppercase; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px; border-radius: 100px;
  font-size: 13px; font-weight: 500;
  background: var(--ink); color: var(--paper);
  z-index: 200; opacity: 0;
  transition: all .35s ease;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(21, 20, 15, 0.15);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: #842821; }
.toast.success { background: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .nav { padding: 16px 24px; }
  .nav-links { display: none; }
  footer.site-foot { padding: 32px 24px; grid-template-columns: 1fr; }
  .foot-links { flex-wrap: wrap; }
}

/* ============================================================
   /updates page
   ============================================================ */
.page--updates { max-width: 720px; margin: 0 auto; padding: 48px 24px 96px; }
.page__hero { margin-bottom: 48px; }
.page__back { display: inline-block; font-size: 14px; color: #666; text-decoration: none; margin-bottom: 24px; }
.page__back:hover { color: #000; }
.page__title { font-size: 48px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
.page__subtitle { font-size: 18px; color: #666; margin: 0; }
.updates-timeline { border-left: 2px solid #eee; padding-left: 32px; }
.update-post { margin-bottom: 64px; position: relative; }
.update-post::before { content: ""; position: absolute; left: -41px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: #15803d; }
.update-post__header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.update-post__date { font-size: 14px; color: #666; font-weight: 500; }
.update-post__version { background: #f0f0f0; border-radius: 999px; padding: 2px 10px; font-size: 12px; color: #333; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.update-post__title { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
.update-post__summary { font-size: 17px; line-height: 1.5; color: #444; margin: 0 0 16px; }
.update-post__body h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: #888; margin: 24px 0 8px; }
.update-post__body ul { margin: 0 0 16px; padding-left: 20px; }
.update-post__body li { margin-bottom: 6px; line-height: 1.5; }
.page__footer { margin-top: 96px; padding-top: 24px; border-top: 1px solid #eee; text-align: center; font-size: 14px; color: #666; }
.page__footer a { color: #666; text-decoration: none; }
.page__footer a:hover { color: #000; }

/* ============================================================
   /press page
   ============================================================ */
.page--press { max-width: 720px; margin: 0 auto; padding: 48px 24px 96px; }
.press-post { margin-bottom: 80px; }
.press-post__header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.press-post__date { font-size: 14px; color: #666; font-weight: 500; }
.press-post__tag { background: #f0f0f0; border-radius: 999px; padding: 2px 10px; font-size: 12px; color: #333; font-family: ui-monospace, "SF Mono", Menlo, monospace; text-transform: uppercase; letter-spacing: 0.05em; }
.press-post__title { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
.press-post__summary { font-size: 17px; line-height: 1.5; color: #444; margin: 0 0 28px; }
.press-post__read { display: inline-block; color: #15803d; font-size: 15px; font-weight: 600; text-decoration: none; }
.press-post__read:hover { text-decoration: underline; }
.press-video { display: block; width: 100%; max-width: 360px; margin: 0 auto; border-radius: 18px; background: #000; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); }
.press-video-note { text-align: center; font-size: 12px; color: #888; font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; margin: 12px 0 0; }
.press-contact { margin-top: 96px; padding: 28px; border: 1px solid #eee; border-radius: 12px; }
.press-contact h2 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.press-contact p { font-size: 15px; line-height: 1.55; color: #444; margin: 0; }
.press-contact a { color: #15803d; text-decoration: none; }
.press-contact a:hover { text-decoration: underline; }

/* ============================================================
   /ideas page
   ============================================================ */
.page--ideas { max-width: 760px; margin: 0 auto; padding: 48px 24px 96px; }
.ideas-toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.ideas-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ideas-tab { background: transparent; border: 1px solid #ddd; border-radius: 999px; padding: 6px 14px; font-size: 14px; color: #444; cursor: pointer; font-family: inherit; }
.ideas-tab.is-active { background: #15803d; color: white; border-color: #15803d; }
.ideas-controls { display: flex; gap: 8px; align-items: center; }
.ideas-sort { font-family: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid #ddd; border-radius: 8px; background: white; }
.btn-primary { background: #15803d; color: white; border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.btn-primary:hover { background: #166534; }
.btn-secondary { background: white; color: #444; border: 1px solid #ddd; border-radius: 8px; padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.ideas-list { display: flex; flex-direction: column; gap: 12px; }
.idea-card { display: flex; align-items: stretch; gap: 16px; padding: 16px; border: 1px solid #e5e5e5; border-radius: 12px; background: white; }
.idea-card__vote { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; padding: 8px; border: 1px solid #e5e5e5; border-radius: 8px; background: #fafafa; cursor: pointer; font-family: inherit; transition: background 0.15s, border-color 0.15s; }
.idea-card__vote:hover { background: #f5f5f5; border-color: #ccc; }
.idea-card__vote.is-voted { background: #15803d; border-color: #15803d; color: white; }
.idea-card__vote-arrow { font-size: 14px; line-height: 1; }
.idea-card__vote-count { font-size: 16px; font-weight: 600; line-height: 1.2; }
.idea-card__body { flex: 1; min-width: 0; }
.idea-card__title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.idea-card__desc { font-size: 14px; color: #666; margin: 0 0 8px; line-height: 1.4; }
.idea-card__status { display: inline-block; background: #f0f0f0; border-radius: 999px; padding: 2px 10px; font-size: 12px; color: #333; text-transform: capitalize; }
.idea-card__status[data-status="planned"]   { background: #fef3c7; color: #92400e; }
.idea-card__status[data-status="in_progress"] { background: #dbeafe; color: #1e40af; }
.idea-card__status[data-status="shipped"]   { background: #dcfce7; color: #166534; }
.idea-card__status[data-status="closed"]    { background: #fee2e2; color: #991b1b; }
.ideas-empty { text-align: center; color: #888; padding: 48px; }
.modal { border: none; border-radius: 16px; padding: 0; max-width: 480px; width: 90vw; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.modal::backdrop { background: rgba(0,0,0,0.4); }
.modal__body { padding: 32px; }
.modal__body h2 { margin: 0 0 16px; font-size: 22px; font-weight: 600; }
.modal__label { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.modal__label input, .modal__label textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 14px; resize: vertical; box-sizing: border-box; }
.modal__hint { display: block; margin-top: 4px; font-size: 12px; color: #888; font-weight: 400; }
.modal__error { background: #fee2e2; color: #991b1b; padding: 8px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ============================================================
   /admin page
   ============================================================ */
.page--admin { max-width: 1000px; margin: 0 auto; padding: 48px 24px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px; border-bottom: 1px solid #eee; vertical-align: top; }
.admin-table th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #888; }
.admin-table__desc { font-size: 13px; color: #666; margin-top: 4px; max-width: 380px; }
.admin-table__hash { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: #888; }
.admin-table select { font-family: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid #ddd; border-radius: 6px; background: white; }
