/* ============================================================
   RESET
   ============================================================ */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, blockquote, pre,
a, abbr, acronym, address, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd,
fieldset, form, label, legend, table,
caption, tbody, tfoot, thead, tr, th, td {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  font-size: 100%;
  vertical-align: baseline;
  background: transparent;
}

body        { line-height: 1; }
blockquote,
q           { quotes: none; }
blockquote:before, blockquote:after,
q:before, q:after { content: ''; content: none; }
:focus      { outline: 0; }
ins         { text-decoration: none; }
del         { text-decoration: line-through; }
table       { border-collapse: collapse; border-spacing: 0; }

/* ============================================================
   FONT FACE  –  Aksara Bali
   ============================================================ */
@font-face {
  font-family: 'Vimala';
  src: local("ᬳᬓ᭄ᬲᬭᬩᬮᬶ"),
       url('../Vimala-Regular.woff2') format('woff2'),
       url('../Vimala-Regular.eot'),
       url('../Vimala-Regular.eot?#iefix') format('embedded-opentype'),
       url('../Vimala-Regular.woff') format('woff'),
       url('../Vimala-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ============================================================
   BASE
   ============================================================ */
*, ::before, ::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  background: #f5f3ff;
  color: #0A0A0A;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: #7c3aed;
}
a:hover {
  text-decoration: underline;
}

input[type="radio"] {
  accent-color: #8B5CF6;
}

/* ============================================================
   AMBIENT SPOTLIGHTS  (identik dengan porto)
   ============================================================ */
.spotlight {
  position: fixed;
  top: 25%;
  left: 65%;
  transform: translate(-50%, -50%);
  width: 560px;
  height: 560px;
  background: radial-gradient(circle at center, #8B5CF6 0%, transparent 70%);
  filter: blur(110px);
  opacity: 0.11;
  pointer-events: none;
  z-index: 0;
}

.spotlight-2 {
  position: fixed;
  top: 75%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at center, #60a5fa 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#app {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 52px 24px 100px;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.header-left {
  display: flex;
  flex-direction: column;
}

/* -- Badge (pulsing dot + label) -- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.ping-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}
.ping-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  opacity: 0.6;
  animation: ping 1.5s ease-in-out infinite;
}
.ping-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #16a34a;
}

@keyframes ping {
  0%, 100% { transform: scale(1);   opacity: 0.6; }
  50%       { transform: scale(2);  opacity: 0;   }
}

.badge-text {
  color: #8B5CF6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* -- Heading -- */
h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.92;
  margin-bottom: 0;
}

h1 .line1 {
  display: block;
  color: #0A0A0A;
}

h1 .line2 {
  display: block;
  background: linear-gradient(to right, #3b82f6, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* -- Logo -- */
.brand-logo {
  max-width: 160px;
  height: auto;
  margin-top: 4px;
}

/* ============================================================
   SUBTITLE
   ============================================================ */
.subtitle {
  margin-bottom: 32px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  max-width: 480px;
  padding-left: 20px;
  border-left: 2px solid rgba(139, 92, 246, 0.35);
}

/* ============================================================
   PANES
   ============================================================ */
.panes {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pane {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.15);
  padding: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 4px 24px rgba(139, 92, 246, 0.07),
    0 1px 4px rgba(0, 0, 0, 0.04);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.pane:focus-within {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow:
    0 4px 32px rgba(139, 92, 246, 0.13),
    0 1px 4px rgba(0, 0, 0, 0.04);
}

.pane-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 10px;
}

/* ============================================================
   TEXTAREAS
   ============================================================ */
textarea {
  flex: 1;
  min-height: 180px;
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  box-sizing: border-box;
  font-family: inherit;
  background: #fafafa;
  color: #0A0A0A;
  line-height: 1.6;
  transition: border-color 0.3s, background 0.3s;
}

textarea::placeholder {
  color: #d1d5db;
}

textarea:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.5);
  background: #ffffff;
}

/* Aksara Bali output */
#balinese-output {
  font-family: "Vimala", "Aksara Bali", serif;
  font-size: 16px;
  line-height: 1.5;
  background: #f9f7ff;
  color: #1e1240;
}

#balinese-output.has-content {
  font-size: 24px;
  line-height: 1.8;
}

.bali-font {
  font-family: "Vimala", "Aksara Bali", serif;
  line-height: 1.5;
}

.bali-font.has-content {
  font-size: 24px;
  line-height: 1.8;
}

/* ============================================================
   BOTTOM ROW  (footer note + credit)
   ============================================================ */
.bottom-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-note {
  font-size: 10px;
  color: #9ca3af;
  letter-spacing: 0.05em;
}

.credit {
  font-size: 10px;
  color: #8B5CF6;
  letter-spacing: 0.04em;
  text-align: right;
}

.credit a {
  color: #7c3aed;
  font-weight: 800;
  text-decoration: none;
}
.credit a:hover {
  text-decoration: underline;
}

.credit code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 10px;
  background: rgba(139, 92, 246, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  color: #7c3aed;
}

/* ============================================================
   FAB  –  Tombol hasil transliterasi (pojok kanan bawah)
   ============================================================ */
.result-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(139, 92, 246, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 12px;
  color: #6b7280;
  z-index: 1000;
}

.result-fab button {
  position: relative;
  overflow: hidden;
  background: #8B5CF6;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* shimmer sweep – identik dengan .btn-aggressive di porto */
.result-fab button::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.5s;
}

.result-fab button:hover:not(:disabled)::after {
  left: 160%;
}

.result-fab button:hover:not(:disabled) {
  background: #7c3aed;
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.4);
}

.result-fab button:active:not(:disabled) {
  transform: scale(0.95);
}

.result-fab button:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

#result-indicator {
  font-size: 11px;
  color: #9ca3af;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  #app {
    padding: 40px 16px 100px;
  }

  h1 {
    font-size: clamp(24px, 8vw, 36px);
  }

  .brand-logo {
    max-width: 110px;
  }

  .result-fab {
    right: 12px;
    left: 12px;
    bottom: 16px;
    justify-content: center;
  }

  .bottom-row {
    flex-direction: column;
  }

  .credit {
    text-align: left;
  }
}