/* ==========================================================================
   components.css — Komponen yang dapat dipakai ulang
   Glow hanya sebagai feedback (hover, focus, status), bukan dekorasi.
   ========================================================================== */

/* ---- Focus (jelas dan konsisten) ---- */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--accent-glow-soft);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-3);
  z-index: var(--z-skip);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus {
  top: var(--space-3);
}

/* ---- Brand ---- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.brand:hover .brand__mark {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow-soft);
}

.brand__name {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---- Tombol hamburger (hanya tampil di mobile dengan JS) ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease);
}

.nav-toggle:hover {
  border-color: var(--accent);
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6.5px) 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(-6.5px) rotate(-45deg);
}

/* ---- Local navigation ---- */
.nav-local ul {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav-local a {
  position: relative;
  display: inline-block;
  padding-block: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}

.nav-local a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}

.nav-local a:hover,
.nav-local a[aria-current] {
  color: var(--text);
}

.nav-local a:hover::after,
.nav-local a[aria-current]::after {
  transform: scaleX(1);
}

/* ---- Environment switcher ---- */
.nav-env ul {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.nav-env a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  transition: color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

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

.nav-env a[aria-disabled="true"] {
  color: var(--text-muted);
  cursor: default;
}

.nav-env a[aria-disabled="true"]:hover {
  color: var(--text-secondary);
}

.nav-env a[aria-current="true"] {
  background: var(--surface-elevated);
  color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.btn--primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 1px var(--accent-bright), 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.btn--secondary:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  box-shadow: 0 0 16px var(--accent-glow-soft);
  transform: translateY(-1px);
}

/* ---- Status (teks + titik; tidak hanya warna) ---- */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--success);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.status__dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success-glow);
}

.status__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--success);
  border-radius: 50%;
  opacity: 0;
  animation: status-pulse 2.4s var(--ease) infinite;
}

/* ---- Metadata mono dan placeholder ---- */
.meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.02em;
}

.placeholder {
  display: inline-block;
  padding: 2px var(--space-2);
  border: 1px dashed var(--warning-line);
  border-radius: var(--radius-sm);
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
}

/* ---- Tag ---- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  padding: 2px var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ---- Text link ---- */
.link-text {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  border-bottom: 1px solid transparent;
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.link-text:hover {
  border-bottom-color: var(--accent-bright);
  color: var(--accent-bright);
}

/* ---- Card ---- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  transition: border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.card:hover,
.card:focus-within {
  border-color: var(--accent);
  background: var(--surface-elevated);
  box-shadow: 0 0 24px var(--accent-glow-soft);
  transform: translateY(-1px);
}

.project-card__category,
.project-hero__category {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
}

.project-card__title {
  margin-top: var(--space-3);
}

.project-card .tag-list {
  margin-top: var(--space-3);
}

.project-card__desc {
  margin-top: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--fs-small);
  line-height: 1.7;
}

/* Baris status + tahun (Phase 3.2) */
.project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.project-card__link {
  margin-top: auto;
  padding-top: var(--space-5);
}

/*
 * Stretched link (Phase 3.2): satu <a> di judul kartu diperluas secara
 * visual ke seluruh permukaan kartu, supaya seluruh kartu dapat diklik
 * tanpa link bersarang. .card sudah position:relative.
 */
.stretched-link {
  color: inherit;
}

.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card:hover .stretched-link,
.card:focus-within .stretched-link {
  color: var(--accent-bright);
}

/* ---- Panel (ambient) ---- */
.panel {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.panel__block {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.panel__block > .meta {
  margin-bottom: var(--space-2);
}

/* ---- Signal path (daftar fokus di Hero) ---- */
.signal-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: 1.25rem;
  line-height: 1.5;
}

.signal-list::before {
  content: "";
  position: absolute;
  top: 0.75em;
  bottom: 0.75em;
  left: 4px;
  width: 1px;
  background: linear-gradient(var(--accent), var(--border-strong));
}

.signal-list li {
  position: relative;
  padding-left: var(--space-5);
  color: var(--text);
  font-weight: 500;
}

.signal-list li::before {
  content: "";
  position: absolute;
  top: calc(0.75em - 4.5px);
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

/* ---- Node graph (SVG inline) ---- */
.node-graph {
  width: 100%;
  height: auto;
}

.node-graph__edge {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.node-graph__edge--main {
  stroke: var(--accent);
}

.node-graph__node {
  fill: var(--card);
  stroke: var(--border-strong);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.node-graph__node--main {
  stroke: var(--accent);
}

.node-graph__halo {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.35;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.node-graph__core {
  fill: var(--accent);
}

/* ---- Photo placeholder (About, rasio 4:5) ---- */
.photo-placeholder {
  position: relative;
  display: grid;
  gap: var(--space-2);
  align-content: center;
  justify-items: center;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: repeating-linear-gradient(
      135deg,
      transparent 0 11px,
      rgba(238, 242, 246, 0.025) 11px 12px
    ),
    var(--card);
  overflow: hidden;
  text-align: center;
}

.photo-placeholder::before,
.photo-placeholder::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 0 solid var(--border-strong);
}

.photo-placeholder::before {
  top: var(--space-3);
  left: var(--space-3);
  border-top-width: 1px;
  border-left-width: 1px;
}

.photo-placeholder::after {
  right: var(--space-3);
  bottom: var(--space-3);
  border-right-width: 1px;
  border-bottom-width: 1px;
}

/* ---- Daftar metadata (About) ---- */
.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.meta-list dt {
  margin-bottom: var(--space-2);
}

/* ---- Capability ---- */
.capability {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 88px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-weight: 500;
  transition: border-color var(--dur-fast) var(--ease);
}

.capability::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}

.capability:hover {
  border-color: var(--accent);
}

/* ---- Ecosystem ---- */
.eco-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.eco-panel--current {
  border-color: var(--border-strong);
}

.eco-panel__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.eco-panel__list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.eco-panel__list li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
}

.eco-panel--current .eco-panel__list li::before {
  background: var(--accent);
}

.eco-panel__foot {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.eco-panel__foot--current {
  color: var(--accent);
}

/* Konektor Signal Path antar panel: horizontal di desktop, vertikal di mobile */
.eco-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
}

.eco-link svg {
  width: 64px;
  height: 64px;
  overflow: visible;
}

.eco-link__line {
  stroke: var(--accent);
  stroke-opacity: 0.55;
  stroke-width: 1.5;
  fill: none;
}

.eco-link__node {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.eco-link__v {
  display: none;
}

/* ---- Contact tile ---- */
.contact-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  transition: border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.contact-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow-soft);
}

.contact-tile__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--accent);
}

.contact-tile__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-tile__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.contact-tile__label {
  font-weight: 600;
}

/* ---- Footer ---- */
.footer-name {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: var(--fs-small);
  transition: color var(--dur-fast) var(--ease);
}

.footer-nav a:hover,
.footer-nav a[aria-current] {
  color: var(--text);
}

.footer-nav a[aria-disabled="true"] {
  color: var(--text-muted);
  cursor: default;
}

/* ==========================================================================
   Responsive komponen
   ========================================================================== */
@media (max-width: 767px) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .nav-local ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-local li + li {
    border-top: 1px solid var(--border);
  }

  .nav-local a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding-block: 0;
    font-size: var(--fs-body);
  }

  .nav-local a::after {
    display: none;
  }

  .nav-env ul {
    width: 100%;
  }

  .nav-env li {
    flex: 1;
  }

  .nav-env a {
    padding-block: var(--space-2);
    text-align: center;
  }

  .card,
  .panel,
  .eco-panel {
    padding: var(--space-4);
  }

  .capability {
    min-height: 72px;
    padding: var(--space-3);
    font-size: var(--fs-small);
  }

  .eco-link {
    width: auto;
    height: 48px;
  }

  .eco-link svg {
    width: 48px;
    height: 48px;
  }

  .eco-link__h {
    display: none;
  }

  .eco-link__v {
    display: inline;
  }
}

@media (max-width: 479px) {
  .meta-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
