/* /css/style.css */

:root {
  --paper: #F2F3F5;
  --surface: #FFFFFF;
  --ink: #12151C;
  --muted: #5B6473;
  --line: #DFE2E8;
  --line-strong: #C3C9D4;
  --accent: #1F4FE0;
  --verified: #1D9BF0;

  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D1015;
    --surface: #151921;
    --ink: #ECEFF5;
    --muted: #9AA3B4;
    --line: #252B37;
    --line-strong: #3A4252;
    --accent: #7C9BFF;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding:
    calc(48px + env(safe-area-inset-top, 0px))
    20px
    calc(40px + env(safe-area-inset-bottom, 0px));
}

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

.page { max-width: 600px; margin: 0 auto; }

/* ---------- Profil ---------- */

.profile {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.photo {
  position: relative;
  flex: none;
  width: 136px;
  aspect-ratio: 4 / 5;
}

/* bingkai garis yang bergeser keluar dari belakang foto */
.photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  transform: translate(9px, 9px);
  animation: frame-out .8s var(--ease) .55s backwards;
}

.photo img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  background: var(--line);
  animation: photo-in .9s var(--ease) backwards;
}

.profile-info { min-width: 0; padding-top: 2px; }

.name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(1.6rem, 6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.verified { width: 1.1em; height: 1.1em; flex: none; }

.handle { margin-top: 5px; font-size: .95rem; color: var(--muted); }

.bio {
  margin-top: 12px;
  max-width: 44ch;
  font-size: .98rem;
  color: var(--muted);
}

.socials { display: flex; gap: 8px; margin-top: 18px; }

.socials a {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.socials img { width: 100%; height: 100%; object-fit: cover; }
.socials a:active { transform: scale(.92); }

/* ---------- Section ---------- */

.section { margin-top: 44px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 1.1rem; font-weight: 650; letter-spacing: -.015em; }
.section-head p { font-size: .85rem; color: var(--muted); }

.grid { display: grid; gap: 10px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Tile ---------- */

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 136px;
  padding: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s var(--ease);
  animation: rise .6s var(--ease) calc(.35s + var(--d, 0) * 70ms) backwards;
}

/* garis aksen yang menyapu saat disorot */
.tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}

.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }

.tile-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }

.tile-arrow {
  width: 18px; height: 18px;
  color: var(--muted);
  transition: transform .3s var(--ease), color .2s;
}

.tile-title { display: block; font-size: .98rem; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
.tile-sub { display: block; margin-top: 3px; font-size: .8rem; line-height: 1.35; color: var(--muted); }

.tile:active { transform: scale(.98); }

@media (hover: hover) {
  .tile:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: 0 16px 24px -18px rgba(18, 21, 28, .45);
  }
  .tile:hover::after { transform: scaleX(1); }
  .tile:hover .tile-arrow { transform: translate(3px, -3px); color: var(--ink); }
  .socials a:hover { transform: translateY(-3px); box-shadow: 0 10px 16px -10px rgba(18, 21, 28, .5); }
}

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

/* ---------- Footer ---------- */

.footer {
  margin-top: 52px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
}

/* ---------- Animasi masuk (sekali, saat halaman dibuka) ---------- */

@keyframes photo-in {
  from { clip-path: inset(0 0 100% 0 round 14px); transform: scale(1.06); }
  to   { clip-path: inset(0 0 0 0 round 14px); transform: scale(1); }
}
@keyframes frame-out { from { transform: translate(0, 0); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.profile-info > * { animation: rise .6s var(--ease) calc(.2s + var(--d, 0) * 80ms) backwards; }
.section-head { animation: rise .6s var(--ease) calc(.3s + var(--d, 0) * 70ms) backwards; }

/* ---------- Responsif ---------- */

@media (max-width: 480px) {
  body { padding-top: calc(32px + env(safe-area-inset-top, 0px)); }
  .profile { gap: 24px; }
  .photo { width: 96px; }
  .photo::before { transform: translate(7px, 7px); }
  .bio { font-size: .92rem; }
  .tile { min-height: 124px; gap: 18px; }
}

@media (max-width: 360px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 .tile:last-child { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
