:root {
  --bg: #17110c;
  --bg-alt: #1f1710;
  --card: #241b13;
  --card-border: #3a2c1c;
  --leather: #8a5a34;
  --leather-light: #c98a4b;
  --accent: #d8a54c;
  --accent-soft: rgba(216, 165, 76, 0.14);
  --cream: #f3e9d8;
  --muted: #b8a892;
  --muted-dim: #8a7c68;
  --danger: #c96a4c;
  --ok: #7a9a6a;
  --radius: 14px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --gold-gradient: linear-gradient(180deg, #f6dfa8 0%, #d8a54c 48%, #a06a2c 100%);
  --stitch-color: rgba(216, 165, 76, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--cream);
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--leather-light);
}

p {
  color: var(--muted);
  margin: 0 0 1em;
}

img, svg {
  max-width: 100%;
}

/* ---------- shared: hand-stitched leather trim ---------- */

.stitched {
  position: relative;
}
.stitched::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius) - 5px);
  border: 1.4px dashed var(--stitch-color);
  pointer-events: none;
}

/* French seam: two parallel rows of stitching just inside the edge */
.french-seam {
  position: relative;
}
.french-seam::before,
.french-seam::after {
  content: '';
  position: absolute;
  border-radius: calc(var(--radius) - 4px);
  border: 1.2px dashed var(--stitch-color);
  pointer-events: none;
}
.french-seam::before { inset: 5px; }
.french-seam::after { inset: 9px; border-color: rgba(216, 165, 76, 0.3); }

.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35));
}

/* a short stitched seam used as a decorative divider */
.seam {
  width: 64px;
  height: 10px;
  margin: 0 auto 22px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--accent) 0 8px,
    transparent 8px 14px
  );
  background-position: center;
  background-size: 100% 1.6px;
  background-repeat: no-repeat;
  position: relative;
}
.seam::before,
.seam::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}
.seam::before { left: 0; }
.seam::after { right: 0; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- leather grain backdrop ---------- */

/* real pull-up leather photo as backdrop, tiled at a fixed physical size so grain
   never gets upscaled/blown-up on large or high-DPI screens, with warm glows and a vignette on top */
.grain-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 55% 38% at 20% 15%, rgba(224, 176, 96, 0.16), transparent 62%),
    radial-gradient(ellipse 40% 32% at 76% 10%, rgba(201, 138, 75, 0.12), transparent 58%),
    radial-gradient(ellipse 50% 42% at 88% 68%, rgba(158, 104, 58, 0.14), transparent 60%),
    radial-gradient(ellipse 38% 30% at 8% 78%, rgba(216, 165, 76, 0.10), transparent 55%),
    radial-gradient(ellipse 130% 95% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(rgba(12, 9, 6, 0.5), rgba(12, 9, 6, 0.6)),
    url('/img/bg/skin-tile.jpg');
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-size: auto, auto, auto, auto, auto, auto, 420px 420px;
  background-position: center;
  background-color: var(--bg);
}
.grain-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
}

/* ---------- top nav ---------- */

.site-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 22px 0;
}
.site-nav .brand {
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
}
.brand .word {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand .mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.92rem;
}
.nav-links a.ghost {
  color: var(--muted);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.15s ease;
}
.nav-links a.ghost:hover {
  color: var(--cream);
  border-color: var(--leather-light);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  padding: 64px 0 40px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(216, 165, 76, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 0.35em;
  /* debossed / blind-stamped into leather: dark groove toward the light, warm rim-light opposite it */
  color: #cdb890;
  text-shadow:
    -1px -1.5px 0 rgba(0, 0, 0, 0.55),
    -2px -3px 4px rgba(0, 0, 0, 0.35),
    1px 1.5px 0 rgba(255, 231, 186, 0.16),
    2px 2px 3px rgba(255, 200, 130, 0.08);
}
.hero h1 .stitch {
  color: var(--accent);
}

.hero .lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 1.8em;
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--leather-light), var(--leather));
  color: #201409;
  box-shadow: var(--shadow);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 7px;
  border: 1.4px dashed rgba(32, 20, 9, 0.4);
  pointer-events: none;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 35%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
  pointer-events: none;
}
.btn-primary:hover::after {
  left: 130%;
}
.btn-primary:hover {
  transform: translateY(-1px);
  color: #201409;
}
.btn-outline {
  border-color: var(--card-border);
  color: var(--cream);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--leather-light);
  color: var(--cream);
}

/* ---------- blueprint illustration ---------- */

.blueprint-frame {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.blueprint-frame .cap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 4px 10px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 14px;
}
.blueprint-frame .cap span:nth-child(2) {
  flex: 1;
}
.dots {
  display: inline-flex;
  gap: 5px;
  flex: none;
}
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--leather-light), var(--leather));
  display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.dots i:nth-child(2) { opacity: 0.7; }
.dots i:nth-child(3) { opacity: 0.45; }

.screenshot {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

/* corner rivets on the framed screenshot cards */
.blueprint-frame,
.screen-card {
  background-color: var(--card);
  background-image:
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%);
  background-repeat: no-repeat;
  background-size: 9px 9px;
  background-position:
    9px 9px,
    calc(100% - 9px) 9px,
    9px calc(100% - 9px),
    calc(100% - 9px) calc(100% - 9px);
}

/* ---------- features ---------- */

.section {
  position: relative;
  z-index: 1;
  padding: 56px 0;
}
.section-head {
  max-width: 60ch;
  margin: 0 auto 36px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature-card:hover {
  border-color: var(--leather-light);
  transform: translateY(-2px);
}
.feature-card .icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
  margin-bottom: 14px;
}
.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.feature-card p {
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--card-border);
  padding: 28px 0;
  margin-top: 30px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted-dim);
}
.site-footer a {
  color: var(--muted-dim);
}
.site-footer a:hover {
  color: var(--accent);
}

/* ---------- auth / app shell ---------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-main {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 40px 0 60px;
}

.auth-card {
  max-width: 380px;
  margin: 8vh auto 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.auth-card .sub {
  color: var(--muted-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.95rem;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--leather-light);
}

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.alert-error {
  background: rgba(201, 106, 76, 0.12);
  border: 1px solid rgba(201, 106, 76, 0.4);
  color: #e5a58e;
}
.alert-ok {
  background: rgba(122, 154, 106, 0.12);
  border: 1px solid rgba(122, 154, 106, 0.4);
  color: #b6d1a6;
}

/* ---------- testers dashboard ---------- */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-head h1 {
  font-size: 1.6rem;
  margin: 0;
}
.who {
  font-size: 0.88rem;
  color: var(--muted-dim);
}
.who strong {
  color: var(--cream);
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color 0.15s ease;
}
.thread-row:hover {
  border-color: var(--leather-light);
}
.thread-row .name {
  font-weight: 600;
  color: var(--cream);
}
.thread-row .preview {
  font-size: 0.85rem;
  color: var(--muted-dim);
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-unread {
  background: var(--accent);
  color: #201409;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.empty-state {
  color: var(--muted-dim);
  text-align: center;
  padding: 40px 0;
}

.thread-view {
  max-width: 720px;
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.msg {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.94rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.attachment-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: block;
}
.field input[type="file"] {
  background: var(--bg-alt);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.field input[type="file"]::file-selector-button {
  background: linear-gradient(180deg, var(--leather-light), var(--leather));
  color: #201409;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 8px 14px;
  margin-right: 12px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.field input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.5);
}

.msg .meta {
  display: block;
  font-size: 0.72rem;
  color: var(--muted-dim);
  margin-top: 6px;
}
.msg-tester {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 3px;
}
.msg-admin {
  align-self: flex-end;
  background: linear-gradient(180deg, rgba(216,165,76,0.22), rgba(138,90,52,0.18));
  border: 1px solid rgba(216, 165, 76, 0.35);
  border-bottom-right-radius: 3px;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.composer textarea {
  min-height: 90px;
  resize: vertical;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
}
.table th {
  color: var(--muted-dim);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.inline-form {
  display: inline;
}
.btn-small {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 7px;
}
.btn-danger {
  background: transparent;
  border: 1px solid rgba(201, 106, 76, 0.4);
  color: #e5a58e;
}
.btn-danger:hover {
  border-color: var(--danger);
}

.credential-box {
  background: var(--bg-alt);
  border: 1px dashed var(--leather-light);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.credential-box code {
  background: rgba(216, 165, 76, 0.15);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--accent);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.card h2 {
  font-size: 1.1rem;
}

.help-steps {
  margin: 0;
  padding-left: 1.3em;
  color: var(--muted);
}
.help-steps li {
  margin-bottom: 10px;
  line-height: 1.5;
}
.help-steps li:last-child {
  margin-bottom: 0;
}
.help-steps strong {
  color: var(--cream);
}
.help-steps code {
  background: rgba(216, 165, 76, 0.15);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  font-size: 0.9em;
}

.faq-item {
  border-top: 1px dashed var(--card-border);
  padding: 14px 0;
}
.faq-item:first-of-type {
  border-top: none;
  padding-top: 4px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--cream);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::before {
  content: '+';
  color: var(--accent);
  font-size: 1.1em;
  width: 1em;
  flex: none;
  transition: transform 0.15s ease;
}
.faq-item[open] summary::before {
  content: '–';
}
.faq-item p {
  margin: 10px 0 0 1.9em;
  font-size: 0.92rem;
}
.faq-item code {
  background: rgba(216, 165, 76, 0.15);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  font-size: 0.9em;
}

.screens-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}
.screen-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin: 0;
}
.screen-card .cap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 4px 10px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 12px;
}
.screenshot.props {
  max-height: 520px;
  object-fit: cover;
  object-position: top;
}

/* ---------- workflow: "путь выкройки" ---------- */

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.workflow-card {
  background-color: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin: 0;
  display: flex;
  flex-direction: column;
}
.workflow-card .cap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--cream);
  font-weight: 600;
  padding: 0 2px 10px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 12px;
}
.step-num {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #201409;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.workflow-shot {
  height: 190px;
  object-fit: cover;
  object-position: top;
}
.workflow-card figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted-dim);
  line-height: 1.5;
}

/* ---------- join / recruit testers ---------- */

.join-card {
  padding: 40px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.join-card h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
}
.join-card .eyebrow {
  margin-bottom: 18px;
}
.join-card p {
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}
.join-card .muted-small {
  font-size: 0.85rem;
  color: var(--muted-dim);
  margin-bottom: 26px;
}

@media (max-width: 860px) {
  .screens-grid {
    grid-template-columns: 1fr;
  }
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .workflow-grid {
    grid-template-columns: 1fr;
  }
  .join-card {
    padding: 28px 20px;
  }
  .nav-links span.hide-mobile {
    display: none;
  }
}
