/* =========================================================
   RuangLink — design tokens
   Brand: ruangaplikasi.my.id (blue → teal gradient identity)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root{
  --bg: #070c17;
  --bg-elevated: #0e1830;
  --bg-elevated-2: #121f3d;
  --border: #1f2c48;
  --border-soft: #182338;

  --blue: #3b7cff;
  --blue-soft: #6f9dff;
  --teal: #22d3b4;

  --text: #eaf1fb;
  --text-muted: #8ca0be;
  --text-faint: #5b6d8c;

  --gradient: linear-gradient(120deg, var(--blue) 0%, var(--teal) 100%);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font-display: 'Sora', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-card: 0 30px 60px -30px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 0 1px rgba(59,124,255,0.12), 0 20px 60px -20px rgba(34,211,180,0.25);
}

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

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img{ max-width: 100%; display: block; }

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

button{ font-family: inherit; cursor: pointer; }

.visually-hidden{
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- background atmosphere ---------- */
.bg-atmosphere{
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(700px 420px at 18% -8%, rgba(59,124,255,0.18), transparent 60%),
    radial-gradient(760px 480px at 88% 10%, rgba(34,211,180,0.12), transparent 55%),
    var(--bg);
}

.bg-grid{
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(700px 500px at 50% 0%, black, transparent 75%);
}

/* ---------- header ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 40px;
  background: rgba(7,12,23,0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.brand{
  display: flex;
  align-items: center;
}

.brand img{
  height: 34px;
  width: auto;
}

.main-nav{
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a{
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.main-nav a:hover{ color: var(--text); }

.header-actions{
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover{ color: var(--text); border-color: var(--blue-soft); }

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-ghost{
  color: var(--text-muted);
  background: transparent;
}
.btn-ghost:hover{ color: var(--text); }

.btn-primary{
  color: #06101f;
  background: var(--gradient);
  box-shadow: 0 12px 30px -12px rgba(59,124,255,0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 34px -12px rgba(34,211,180,0.55);
}

/* ---------- hero ---------- */
.hero{
  position: relative;
  padding: 110px 24px 90px;
  text-align: center;
  overflow: hidden;
}

.hero-ribbon{
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: min(980px, 140%);
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.eyebrow .dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}

.hero h1{
  font-family: var(--font-display);
  font-size: clamp(34px, 5.6vw, 60px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 900px;
  margin: 0 auto 22px;
}

.hero h1 .grad{
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead{
  max-width: 620px;
  margin: 0 auto 48px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.65;
}

/* ---------- shorten card ---------- */
.shorten-card{
  max-width: 780px;
  margin: 0 auto;
  padding: 28px;
  background: linear-gradient(180deg, var(--bg-elevated-2), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  text-align: left;
}

.shorten-row{
  display: flex;
  gap: 12px;
}

.input-wrap{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.input-wrap:focus-within{
  border-color: var(--blue-soft);
}

.input-wrap svg{ flex-shrink: 0; color: var(--text-faint); }

.input-wrap input{
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-mono);
  padding: 14px 0;
  min-width: 0;
}

.input-wrap input::placeholder{ color: var(--text-faint); font-family: var(--font-body); }

/* cegah browser autofill (Chrome/Edge/Safari) menimpa background jadi putih/kuning */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active{
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px var(--bg) inset !important;
  box-shadow: 0 0 0px 1000px var(--bg) inset !important;
  transition: background-color 9999s ease-in-out 0s;
}
/* Firefox */
input:autofill{
  background-color: var(--bg) !important;
  color: var(--text) !important;
}

.paste-btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  flex-shrink: 0;
}
.paste-btn:hover{ color: var(--text); }

.shorten-submit{
  flex-shrink: 0;
  padding: 0 26px;
  border-radius: var(--radius-md);
  font-size: 15px;
}

.shorten-submit svg{ width: 17px; height: 17px; }

.features-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.feature-toggle{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.feature-toggle:hover{
  border-color: var(--border-soft);
  color: var(--text);
}

.feature-toggle .icon{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-toggle span{
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.feature-toggle[data-color="blue"] .icon{ background: rgba(59,124,255,0.15); color: var(--blue-soft); }
.feature-toggle[data-color="teal"] .icon{ background: rgba(34,211,180,0.15); color: var(--teal); }
.feature-toggle[data-color="violet"] .icon{ background: rgba(167,139,250,0.15); color: #a78bfa; }
.feature-toggle[data-color="amber"] .icon{ background: rgba(251,191,36,0.15); color: #fbbf24; }

.feature-toggle.active{
  background: var(--bg-elevated-2);
  border-color: var(--blue-soft);
  color: var(--text);
}

.feature-toggle.active::after{
  content: "";
}

.feature-panel{
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  display: none;
}

.feature-panel.open{ display: flex; align-items: center; gap: 10px; }

.feature-panel input[type="text"],
.feature-panel input[type="password"],
.feature-panel input[type="date"]{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: var(--font-mono);
}

.hint-row{
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- stats bar ---------- */
.stats-bar{
  max-width: 900px;
  margin: 36px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}

.stats-bar .stat{
  padding: 26px 16px;
  text-align: center;
  border-right: 1px solid var(--border-soft);
}
.stats-bar .stat:last-child{ border-right: none; }

.stats-bar .stat .num{
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: var(--text);
}

.stats-bar .stat .label{
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 640px){
  .stats-bar{ grid-template-columns: repeat(2, 1fr); }
  .stats-bar .stat:nth-child(2){ border-right: none; }
  .stats-bar .stat:nth-child(1), .stats-bar .stat:nth-child(2){ border-bottom: 1px solid var(--border-soft); }
}

/* ---------- modal (popup) ---------- */
.modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4,8,16,0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open{
  opacity: 1;
  pointer-events: auto;
}

.modal-card{
  width: min(420px, 92vw);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s ease;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.7);
}

.modal-overlay.open .modal-card{ transform: translateY(0) scale(1); }

.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(120deg, #1a9e6f, var(--teal));
  color: #06251c;
}

.modal-head .title{
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
}

.modal-head .check{
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
}

.modal-close{
  background: transparent;
  border: none;
  color: #06251c;
  opacity: 0.75;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover{ opacity: 1; }

.modal-body{ padding: 22px 20px 26px; }

.modal-body label{
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-box{
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--blue-soft);
  word-break: break-all;
}

.copy-btn{
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gradient);
  color: #06101f;
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.copy-btn.copied{ background: var(--teal); }

/* ---------- responsive ---------- */
@media (max-width: 860px){
  .site-header{ padding: 14px 20px; }
  .main-nav{ display: none; }
  .hero{ padding: 80px 18px 60px; }
  .shorten-card{ padding: 20px; }
  .shorten-row{ flex-direction: column; }
  .shorten-submit{ padding: 14px; }
  .features-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
  html{ scroll-behavior: auto; }
}
