/* =========================================================
   Fonts (self-hosted, subset latin — lihat assets/fonts/)
   ========================================================= */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/Inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/Fraunces-600.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-600.woff2') format('woff2');
}

/* =========================================================
   Design tokens — tema terang "Control Panel"
   ========================================================= */
:root {
  --bg: #FAFBFC;
  --bg-alt: #F2F5F8;
  --surface: #FFFFFF;
  --border: #E1E7EE;
  --border-strong: #C9D2DC;

  --text: #17212C;
  --text-secondary: #5B6B7C;
  --text-muted: #8B96A5;

  --accent: #E8A33D;
  --accent-hover: #CE8A26;
  --accent-text: #17212C;
  --accent-soft: #FBF0DA;

  --teal: #2F7A73;
  --teal-soft: #E6F2F0;

  --live: #1F9D6E;
  --live-soft: #E4F7EE;

  --shadow-sm: 0 1px 2px rgba(23, 33, 44, 0.06);
  --shadow-md: 0 8px 24px rgba(23, 33, 44, 0.08);

  --radius: 6px;
  --radius-sm: 4px;

  --font-body: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --container-w: 1180px;
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   Layout helpers
   ========================================================= */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section-head {
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.02rem;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn--accent {
  background: var(--accent);
  color: var(--accent-text);
}
.btn--accent:hover { background: var(--accent-hover); }

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn--sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn--lg { padding: 0.9rem 1.8rem; font-size: 1.05rem; }
.btn--block { width: 100%; }

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 252, 0.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
}

.brand__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-soft);
  flex-shrink: 0;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  align-items: center;
}
.nav-toggle__bar {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem 1.5rem;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.25s ease;
}
.site-nav.is-open {
  max-height: 320px;
  visibility: visible;
}
.site-nav a {
  padding: 0.65rem 0.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.site-nav a:last-child { border-bottom: none; margin-top: 0.5rem; }
.site-nav a:hover { color: var(--accent-hover); }

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    max-height: none;
    visibility: visible;
    overflow: visible;
    background: transparent;
    border: none;
    padding: 0;
    gap: 1.75rem;
  }
  .site-nav a { border-bottom: none; padding: 0; }
  .site-nav a:last-child { margin-top: 0; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: 3.5rem 0 4rem;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.hero__content,
.hero__panel {
  min-width: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--live);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 1.5rem + 2vw, 2.85rem);
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1.1rem;
}

.hero__subtitle {
  color: var(--text-secondary);
  font-size: 1.08rem;
  max-width: 46ch;
  margin-bottom: 1.75rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero__panel {
  background: #12181F;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid #232C38;
}
.hero__panel-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 0.9rem;
  background: #1B2430;
  border-bottom: 1px solid #232C38;
}
.hero__panel-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3A4656;
}
.hero__panel-bar span:nth-child(1) { background: #E36259; }
.hero__panel-bar span:nth-child(2) { background: #E8A33D; }
.hero__panel-bar span:nth-child(3) { background: #3E7C77; }
.hero__panel-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #8B96A5;
}
.hero__panel-code {
  margin: 0;
  padding: 1.1rem 1.2rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #C3CCD6;
  overflow-x: auto;
}
.hero__panel-code .tk-ok { color: #E8A33D; }

@media (min-width: 900px) {
  .hero { padding: 5rem 0 6rem; }
  .hero__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}

/* =========================================================
   Filter tabs
   ========================================================= */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.filter-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent-hover); }
.filter-tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* =========================================================
   Portfolio grid & cards
   ========================================================= */
.portfolio { padding: 4.5rem 0; }

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
}

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.app-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.app-card.is-hidden { display: none; }

.app-card__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-soft);
  flex-shrink: 0;
}
.status-dot--live { animation: pulse-dot 2.4s ease-in-out infinite; }
.status-dot--maintenance { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status-dot--private { background: var(--text-muted); box-shadow: 0 0 0 3px var(--bg-alt); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px var(--live-soft); }
  50% { box-shadow: 0 0 0 6px var(--live-soft); }
}

.status-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.app-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.app-card__category {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.7rem;
}

.app-card__tagline {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.app-card__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
  flex-grow: 1;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.3rem;
}

.tech-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--teal-soft);
  color: var(--teal);
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
}

.empty-state {
  color: var(--text-secondary);
  padding: 2rem 0;
}

/* =========================================================
   About
   ========================================================= */
.about { padding: 3rem 0 4.5rem; background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.about__inner { max-width: 720px; }
.about__inner p { color: var(--text-secondary); margin-bottom: 1rem; font-size: 1.02rem; }
.about__inner p:last-child { margin-bottom: 0; }

/* =========================================================
   Contact
   ========================================================= */
.contact { padding: 4.5rem 0; }
.contact__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
.contact__inner > * { min-width: 0; }

.contact__cta p { color: var(--text-secondary); margin: 0.75rem 0 1.5rem; max-width: 42ch; }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-field input,
.form-field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.form-alert--success { background: var(--live-soft); color: #146B49; }
.form-alert--error { background: #FCEAEA; color: #A3312B; }
.form-alert--error ul { padding-left: 1.1rem; list-style: disc; }

@media (min-width: 900px) {
  .contact__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  background: var(--bg-alt);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
}
.site-footer__copy { color: var(--text-muted); font-size: 0.85rem; }
.site-footer__links { display: flex; gap: 1.25rem; }
.site-footer__links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.site-footer__links a:hover { color: var(--accent-hover); }

@media (min-width: 700px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
