/*
  VINYA — design system
  Premium utilitarian minimalism. Warm monochrome canvas, editorial serif
  headlines, ultra-flat surfaces, 1px structural lines, one quiet accent.
  "As little design as possible." — D. Rams · Document-calm — Notion.
*/

:root {
  /* Canvas + surfaces */
  --bg: #fbfbfa;            /* warm bone */
  --surface: #ffffff;
  --surface-2: #f7f6f3;    /* recessed wells */

  /* Ink */
  --ink: #2f3437;          /* off-black, never #000 */
  --ink-soft: #4a4a47;
  --muted: #787774;        /* secondary text */
  --faint: #9b9a96;

  /* Structure */
  --line: #eaeaea;
  --line-soft: rgba(0, 0, 0, 0.06);

  /* Accent — scarce, deliberate */
  --accent: #37652f;       /* deep moss, the readable counterpart to the mark */
  --accent-bg: #edf3ec;    /* pale green well */
  --mark: #c8f135;         /* the brand lime, reserved for the spiral + signal */

  /* Type */
  --serif: "Newsreader", "Lyon Text", Georgia, "Times New Roman", serif;
  --sans: -apple-system, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Geist Mono", ui-monospace, monospace;

  /* Metrics */
  --maxw: 1080px;
  --pad: clamp(1.25rem, 5vw, 3.5rem);
  --radius: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* A single, very slow warm light spot for depth — never loud. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40rem 30rem at 72% -8%, rgba(200, 241, 53, 0.10), transparent 70%),
    radial-gradient(34rem 28rem at 8% 12%, rgba(47, 52, 55, 0.035), transparent 70%);
}

a { color: inherit; }

/* ---------- Layout shell ---------- */
.site-header,
.site-main,
.site-footer,
.section {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: clamp(1.25rem, 3vw, 1.9rem);
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: block;
  height: 30px;
  width: 30px;
  transition: transform 0.7s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(72deg); }

.brand-name {
  font-weight: 600;
  letter-spacing: 0.22em;
  font-size: 0.96rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.75rem);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.75rem);
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.18s var(--ease);
}
.nav a:hover { color: var(--ink); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  background: var(--surface);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mark);
  box-shadow: 0 0 0 0 rgba(200, 241, 53, 0.6);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(141, 174, 36, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(141, 174, 36, 0); }
  100% { box-shadow: 0 0 0 0 rgba(141, 174, 36, 0); }
}

/* ---------- Main rhythm ---------- */
.site-main { flex: 1; }

.section { padding-top: clamp(3.5rem, 9vw, 6.5rem); }
.section:first-child { padding-top: clamp(2.5rem, 7vw, 5rem); }

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Hero ---------- */
.headline {
  margin: 0 0 1.4rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.7rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  max-width: 16ch;
  color: var(--ink);
}
.headline em {
  font-style: italic;
  color: var(--accent);
}

.lede {
  margin: 0 0 2.5rem;
  max-width: 50ch;
  font-size: clamp(1.04rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: clamp(3rem, 7vw, 4.5rem);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 6px;
  padding: 0.72rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: #1f2426; }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.btn-link:hover { color: var(--ink); }
.arrow { transition: transform 0.18s var(--ease); }
.btn:hover .arrow,
.post-card:hover .arrow { transform: translateX(3px); }

/* ---------- Principles (bento) ---------- */
.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.principles li {
  background: var(--surface);
  padding: clamp(1.4rem, 2.5vw, 1.9rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.principle-index {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.principle-title {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.principle-body {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- Section headers ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.section-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.section-sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 48ch;
}

/* ---------- Research / blog list ---------- */
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-card {
  background: var(--surface);
  padding: clamp(1.4rem, 2.5vw, 1.9rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 200px;
  transition: background 0.18s var(--ease);
}
.post-card:hover { background: var(--surface-2); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.74rem;
  color: var(--muted);
}
.tag {
  display: inline-block;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
}
.post-date {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.post-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.22;
  letter-spacing: -0.015em;
}
.post-excerpt {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}
.post-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--accent);
}
.posts-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Waitlist ---------- */
.waitlist {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding: clamp(2.25rem, 5vw, 3.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.waitlist-title {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: -0.02em;
}
.waitlist-copy {
  margin: 0 0 1.6rem;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.98rem;
}
.waitlist-form {
  display: flex;
  gap: 0.55rem;
  max-width: 480px;
  flex-wrap: wrap;
}
.waitlist-form input {
  flex: 1 1 240px;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  padding: 0.78rem 1rem;
  border-radius: 6px;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.waitlist-form input::placeholder { color: var(--faint); }
.waitlist-form input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--surface);
}
.waitlist-form input[aria-invalid="true"] { border-color: #c0392b; }
.waitlist-form button { flex: 0 0 auto; }
.waitlist-form button:disabled { opacity: 0.55; cursor: default; transform: none; }

.form-message {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
  color: var(--muted);
}
.form-message.is-success { color: var(--accent); }
.form-message.is-error { color: #c0392b; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
  margin-top: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-note { letter-spacing: 0.005em; }

/* ---------- Blog index / article pages ---------- */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding-top: clamp(2.5rem, 6vw, 4rem);
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
}
.article-back:hover { color: var(--ink); }
.article-header { margin-bottom: 2.5rem; }
.article-header .post-meta { margin-bottom: 1rem; }
.article-title {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.article-lede {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.article-body {
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.article-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.9rem;
  color: var(--ink);
}
.article-body h3 {
  font-size: 1.18rem;
  font-weight: 600;
  margin: 1.9rem 0 0.6rem;
  color: var(--ink);
}
.article-body p { margin: 0 0 1.25rem; }
.article-body a { color: var(--accent); text-underline-offset: 3px; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem; padding-left: 1.3rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body blockquote {
  margin: 1.5rem 0;
  padding: 0.4rem 0 0.4rem 1.25rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.article-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}
.article-body pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
}
.article-body pre code { background: none; border: none; padding: 0; font-size: 0.86rem; }
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.article-footer {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Motion: scroll entry ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .principles { grid-template-columns: 1fr; }
  .nav { display: none; }
  .headline { font-size: clamp(2.2rem, 11vw, 3.1rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-dot { animation: none; }
  .brand:hover .brand-mark { transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
