/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── VARIABLES (disamakan dengan personal site) ── */
:root {
  --ink: #1a1a18;
  --ink-soft: #6b6b65;
  --ink-muted: #aeada6;
  --paper: #f8f7f4;
  --paper-warm: #f0ede7;
  --line: #e2dfd9;
  --accent: #c9622a;
  --accent-soft: #f0e4da;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 247, 244, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 2rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-back {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.18s;
}

.nav-back:hover { color: var(--ink); }

/* ── LAYOUT ── */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

section:last-child { border-bottom: none; }

/* ── HERO ── */
#home {
  padding-top: 4rem;
  padding-bottom: 2.5rem;
}

.hero-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

h1.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1rem;
}

h1.hero-name em {
  font-style: italic;
  color: var(--accent);
}

.hero-bio {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 440px;
}

/* ── SECTION LABEL ── */
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

/* ── FORM ── */
.shorten-form {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  display: grid;
  gap: 0.5rem;
}

.shorten-form label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

.shorten-form label:first-child { margin-top: 0; }

.label-optional {
  font-weight: 400;
  color: var(--ink-muted);
}

.shorten-form input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.18s;
}

.shorten-form input:focus { border-color: var(--ink-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
  cursor: pointer;
  border: none;
  margin-top: 0.75rem;
  width: fit-content;
}

.btn:active { transform: scale(0.96); }

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #2d2d2a; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--paper-warm);
  color: var(--ink);
  border-color: var(--ink-muted);
}

.btn-copy { margin-top: 0; padding: 7px 14px; }

#form-status {
  font-size: 12.5px;
  color: var(--ink-soft);
  min-height: 1.2em;
}

/* ── RESULT BOX ── */
.result-box {
  margin-top: 0.5rem;
  padding: 1rem 1.1rem;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.result-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

#result-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

#result-link:hover { text-decoration: underline; }

/* ── LINKS LIST ── */
.links-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.links-loading {
  background: white;
  padding: 1.5rem;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

.link-item {
  background: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.link-item:first-child { border-radius: 11px 11px 0 0; }
.link-item:last-child  { border-radius: 0 0 11px 11px; }
.link-item:only-child  { border-radius: 11px; }

.link-info { flex: 1; min-width: 0; }

.link-alias {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.link-alias:hover { text-decoration: underline; }

.link-original {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.link-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.link-clicks {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--paper-warm);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 12px;
  color: var(--ink-muted);
}

footer span { color: var(--accent); }

/* ── SKY TOGGLE (sama persis dengan personal site) ── */
.sky-toggle {
  position: relative;
  width: 54px;
  height: 28px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: #dff0fb;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: background 0.6s ease, border-color 0.6s ease;
  flex-shrink: 0;
}

.sky-toggle:hover { border-color: var(--ink-muted); }
.sky-toggle:active { transform: scale(0.93); }

body.dark .sky-toggle { background: #0f1b2d; border-color: #2a3a52; }

.sky-scene { position: absolute; inset: 0; }

.sky-sun {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
  animation: rays-rotate 10s linear infinite;
}

body.dark .sky-sun {
  opacity: 0;
  transform: translateY(-50%) scale(0.3) rotate(90deg);
  animation: none;
}

.sun-core {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5a623;
}

.sun-ray {
  position: absolute;
  width: 2px;
  height: 4px;
  background: #f5a623;
  border-radius: 2px;
  transform-origin: 50% 140%;
}

.sun-ray:nth-child(2) { transform: rotate(0deg)   translateY(-6px); }
.sun-ray:nth-child(3) { transform: rotate(60deg)  translateY(-6px); }
.sun-ray:nth-child(4) { transform: rotate(120deg) translateY(-6px); }
.sun-ray:nth-child(5) { transform: rotate(180deg) translateY(-6px); }
.sun-ray:nth-child(6) { transform: rotate(240deg) translateY(-6px); }
.sun-ray:nth-child(7) { transform: rotate(300deg) translateY(-6px); }

@keyframes rays-rotate {
  from { transform: translateY(-50%) rotate(0deg); }
  to   { transform: translateY(-50%) rotate(360deg); }
}

@keyframes blow-puff {
  0%   { opacity: 1; transform: translateY(-50%) scale(1); }
  40%  { transform: translateY(-50%) scale(1.4) rotate(20deg); opacity: 0.6; }
  100% { transform: translateY(-50%) scale(0) rotate(45deg); opacity: 0; }
}

.sky-toggle.blowing .sky-sun {
  animation: blow-puff 0.45s cubic-bezier(0.4,0,0.2,1) forwards;
}

.sky-moon {
  position: absolute;
  right: 7px;
  top: 50%;
  font-size: 13px;
  line-height: 1;
  transform: translateY(-50%) scale(0) rotate(-30deg);
  opacity: 0;
  transition: opacity 0.4s ease 0.3s, transform 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.3s;
}

body.dark .sky-moon { opacity: 1; transform: translateY(-50%) scale(1) rotate(0deg); }

.sky-star {
  position: absolute;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

body.dark .sky-star { opacity: 1; transform: scale(1); }

.s1 { top: 4px;    left: 10px; transition-delay: 0.35s; }
.s2 { top: 4px;    left: 22px; transition-delay: 0.45s; }
.s3 { bottom: 4px; left: 14px; transition-delay: 0.50s; }
.s4 { top: 6px;    left: 34px; transition-delay: 0.40s; }
.s5 { bottom: 5px; left: 30px; transition-delay: 0.55s; }

.sky-toggle::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-family: var(--font-body);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.18s, transform 0.18s;
}

.sky-toggle:hover::after { opacity: 1; transform: translateY(0); }
body.dark .sky-toggle[title]::after { content: 'kembalikan siang!'; }

/* ── DARK MODE ── */
body.dark {
  --ink: #e8e6e1;
  --ink-soft: #b8b5ae;
  --ink-muted: #6e6c67;
  --paper: #141412;
  --paper-warm: #1e1c19;
  --line: #2a2825;
  --accent: #e07840;
  --accent-soft: #2d1f14;
}

body.dark nav { background: rgba(20, 20, 18, 0.88); }

body.dark .shorten-form,
body.dark .link-item,
body.dark .links-loading { background: #1e1c19; }

body.dark .shorten-form input { background: #141412; color: var(--ink); }

body.dark .links-list { background: #2a2825; }

body.dark .result-box { background: #1e1c19; }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  nav { padding: 0 1.25rem; }
  .nav-back { display: none; }
  #home { padding-top: 2.5rem; }
  section { padding: 2.5rem 0 1.5rem; }
  .link-item { flex-direction: column; align-items: flex-start; gap: 6px; }
  .link-meta { align-self: flex-end; }
}
