/* ==========================================================
   RINGKAS — design tokens
   Paper + pine + amber. Display: Space Grotesk. Body: Inter.
   Mono (for codes/urls): JetBrains Mono.
   ========================================================== */

:root {
  --paper: #f5f3ee;
  --surface: #ffffff;
  --ink: #191815;
  --ink-muted: #6b6659;
  --pine: #1f4d3b;
  --pine-light: #2d6a52;
  --amber: #e0973b;
  --amber-light: #f3b567;
  --border: #e3ddcf;
  --danger: #b5482f;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(25, 24, 21, 0.04), 0 8px 24px -12px rgba(25, 24, 21, 0.18);
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(25,24,21,0.05) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

code, .mono { font-family: var(--font-mono); }

/* ---------- layout shell ---------- */

.shell { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--pine);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 7px; right: 7px; top: 14px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}

.navlinks { display: flex; gap: 4px; }

.navlinks a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: background 0.15s, color 0.15s;
}
.navlinks a:hover, .navlinks a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

main { padding: 48px 0 96px; }

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* ---------- torn-edge signature (the "clip") ---------- */

.torn {
  position: relative;
  background: var(--surface);
}
.torn::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 10px;
  background:
    linear-gradient(135deg, var(--paper) 50%, transparent 50%) 0 0 / 16px 16px repeat-x,
    linear-gradient(-135deg, var(--paper) 50%, transparent 50%) 0 0 / 16px 16px repeat-x;
  background-position: 0 0, 8px 0;
}

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover { background: var(--pine-light); }

.btn-amber { background: var(--amber); color: #2a1a05; }
.btn-amber:hover { background: var(--amber-light); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(181, 72, 47, 0.08); }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

input, textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--pine);
  outline-offset: 1px;
}
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field { margin-bottom: 18px; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 36px;
}

.tool-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.tool-card:hover { transform: translateY(-3px); }
.tool-card .icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
}
.tool-card p { color: var(--ink-muted); font-size: 0.9rem; margin: 8px 0 0; }

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

.hero { padding: 20px 0 8px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--pine);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: inline-block;
  background: rgba(31,77,59,0.08);
  padding: 5px 10px;
  border-radius: 999px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  line-height: 1.06;
  max-width: 760px;
}
.hero .sub {
  color: var(--ink-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin-top: 16px;
}

/* the shrinking-url demo strip */
.clip-demo {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  flex-wrap: wrap;
}
.clip-demo .long {
  background: var(--surface);
  border: 1px dashed var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--ink-muted);
  text-decoration: line-through;
}
.clip-demo .scissors {
  padding: 0 10px;
  color: var(--amber);
}
.clip-demo .short {
  background: var(--pine);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-weight: 600;
}

/* ---------- table / list ---------- */

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .meta { color: var(--ink-muted); font-size: 0.82rem; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(224,151,59,0.15);
  color: #8a5a1c;
  font-size: 0.75rem;
  font-weight: 600;
}

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .navlinks a { padding: 8px 10px; font-size: 0.85rem; }
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title h2 { font-size: 1.3rem; }

/* public profile pages (microsite / shop) */
.profile-header { text-align: center; padding: 48px 0 24px; }
.avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin: 0 auto 16px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-header h1 { font-size: 1.5rem; }
.profile-header p { color: var(--ink-muted); margin-top: 8px; }

.link-btn {
  display: block;
  text-align: center;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 12px;
  transition: transform 0.12s;
}
.link-btn:hover { transform: translateY(-2px); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  display: block;
}
.product-card .thumb {
  aspect-ratio: 4/3;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  font-size: 1.6rem;
  overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 14px 16px; }
.product-card .price { color: var(--pine); font-weight: 700; margin-top: 4px; }

.qr-preview {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.helper { font-size: 0.82rem; color: var(--ink-muted); margin-top: 6px; }

.center { text-align: center; }
.stack-actions { display: flex; gap: 10px; flex-wrap: wrap; }
