/* =========================================================
   Andi Pratama — Portfolio
   Style tokens derived from AstroPaper (dhitshine.github.io)
   ========================================================= */

:root {
  --background: #f6f1e6;
  --foreground: #2c2a29;
  --accent: #c2410c;
  --accent-foreground: #ffffff;
  --muted: #f2efea;
  --muted-foreground: #767069;
  --border: #e7e2d8;

  --font-app: "Merriweather", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --max-w: 72rem;
  --radius: 0.5rem;
  --gap: 1.5rem;
}

/* ---------- Reset & base ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-app);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-app);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

p {
  margin-bottom: 1rem;
}

section {
  padding: 3.5rem 0;
}

:target {
  scroll-margin-block: 5rem;
}

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1rem;
  width: 100%;
}

.section-head {
  margin-bottom: 2rem;
}

.section-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-head p.lead {
  color: var(--muted-foreground);
}

/* ---------- Navbar ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

nav.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-block: 1rem;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
}

.nav-links a {
  padding: 0.25rem 0.5rem;
  font-size: 0.95rem;
}

.nav-links a:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

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

.btn-outline {
  background: transparent;
}

/* ---------- Hero ---------- */
.hero {
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--gap);
  align-items: center;
}

.hero-text h1 {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

.hero-text .greeting {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-text .role {
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

/* ---------- Cards (generic) ---------- */
.card {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.identity-list {
  list-style: none;
}

.identity-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.5rem;
  border-bottom: 1px dashed var(--border);
}

.identity-list .label {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ---------- Skills ---------- */
.skills-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.skill-item .skill-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.skill-top .pct {
  color: var(--muted-foreground);
}

.bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

/* ---------- Tools ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tool-card .tool-icon {
  font-size: 1.5rem;
}

.tool-card .tool-cat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- Education / Experience ---------- */
.timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.timeline-item .meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.timeline-item .status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- Portfolio ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.project-card {
  overflow: hidden;
  padding: 0;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.project-body {
  padding: 1.25rem;
}

.project-body h3 {
  margin-bottom: 0.4rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-block: 0.75rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.gallery-grid figure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--muted);
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-grid figcaption {
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- Contact ---------- */
.contact-inner {
  text-align: center;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.footer-socials a:hover {
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .skills-list {
    grid-template-columns: 1fr 1fr;
  }

  .tools-grid {
    grid-template-columns: 1fr 1fr;
  }

  .timeline {
    grid-template-columns: 1fr 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  body {
    font-size: 18px;
  }

  .hero-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .hero-photo img {
    width: 220px;
    height: 220px;
  }

  .about-grid {
    grid-template-columns: 2fr 1fr;
  }

  .hero-text h1 {
    font-size: 3.25rem;
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
