:root {
  --bg: #1a1a1a;
  --bg-soft: #222222;
  --text: #d4d4d4;
  --text-strong: #ededed;
  --text-muted: #888888;
  --accent: #c97f4a;
  --accent-hover: #e09660;
  --rule: #2a2a2a;
  --max-width: 1080px;
  --sidebar-width: 260px;
  --gap: 56px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ─── Layout ─── */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 56px) clamp(20px, 4vw, 56px) clamp(48px, 6vw, 80px);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: var(--gap);
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 28px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 40px);
  min-width: 0;
}

/* ─── Sidebar ─── */

/* Photo is a direct link (easter egg → Instagram). Hover lift gives the cue
   that it's clickable. */
.photo-link {
  display: block;
  width: 100%;
  margin-bottom: 20px;
  border-radius: 18px;
  transition: transform 0.28s ease-out, box-shadow 0.28s ease-out;
}

.photo-link:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid var(--bg-soft);
  object-fit: cover;
  display: block;
}

.name {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* ─── Banner / hero ─── */
.banner {
  background: linear-gradient(180deg, #232323 0%, #1e1e1e 100%);
  border-bottom: 1px solid var(--rule);
  padding: clamp(80px, 13vw, 150px) clamp(20px, 4vw, 56px) clamp(64px, 9vw, 110px);
}

.banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.banner-name {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  line-height: 1.1;
}

.banner-tagline {
  margin: 0 auto 32px;
  max-width: 760px;
  font-size: clamp(0.98rem, 1.7vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.55;
}

.banner-tagline .role-text {
  color: var(--text);
  font-weight: 500;
}

.banner-sep {
  margin: 0 8px;
  color: var(--text-muted);
  opacity: 0.6;
}

.banner-sub { color: var(--text-muted); }

.role-cursor {
  display: inline-block;
  margin-left: 1px;
  color: var(--accent);
  font-weight: 400;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .role-cursor { animation: none; opacity: 0.6; }
}

.banner-cta {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.banner-cta:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-1px);
}

@media (max-width: 639px) {
  .banner { padding: 56px 18px 44px; }
  .banner-name { letter-spacing: -0.02em; }
  .banner-tagline { font-size: 0.95rem; }
}

.affiliations {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.affiliations li {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.35;
}

.affiliations .ico-emoji {
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.affiliation-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.affiliation-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.contact {
  list-style: none;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
}

.contact li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

/* Contact: each <li> is a row. Link items wrap icon + text in <a> so the
   hover/click area is the content itself (not empty row space). The static
   Bali row keeps a plain span structure and has no hover. */

.contact a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.contact .ico {
  display: inline-flex;
  width: 18px;
  height: 18px;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.contact .ico svg {
  width: 16px;
  height: 16px;
}

/* ─── Main content ─── */

.bio p {
  margin: 0 0 12px;
  font-size: 1.02rem;
  color: var(--text);
}

/* Highlighted phrases in body prose (skills, role, degree) — orange = important */
.hl {
  color: var(--accent);
  font-weight: 500;
}

.section-h {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  letter-spacing: -0.005em;
}

.section-h .emoji {
  font-size: 1.05rem;
  line-height: 1;
}

/* News */

.news {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 6px 0;
  color: var(--text);
}

.news .date {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  font-style: italic;
}

.news .body {
  font-size: 0.97rem;
}

/* Experience / Education */

.job, .edu-entry {
  margin-bottom: 22px;
}
.job:last-child, .edu-entry:last-child { margin-bottom: 0; }

.job-title {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
}

.job-title a {
  color: var(--text-strong);
  border-bottom: 1px dotted var(--text-muted);
}
.job-title a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.job-role {
  font-weight: 400;
  color: var(--text);
}

.meta {
  margin: 0 0 8px;
  font-size: 0.87rem;
  color: var(--text-muted);
  font-style: italic;
}

.job ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.95rem;
}
.job ul li {
  margin-bottom: 4px;
  color: var(--text);
}

/* CV-style education entries: bold school + right-aligned date,
   italic degree title, bullet list below. Supports one school with
   multiple degrees nested underneath. */

.edu-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}

.edu-school {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
}

.edu-school a {
  color: inherit;
  border-bottom: 1px dotted var(--text-muted);
}
.edu-school a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.edu-date {
  font-size: 0.87rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.edu-degree + .edu-degree {
  margin-top: 14px;
}

.edu-degree-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 4px;
}

.edu-degree-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--text);
  font-style: italic;
}

.edu-degree-head .edu-degree-title {
  margin: 0;
}

.edu-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.edu-text strong {
  color: var(--text-strong);
}

/* Projects */
.project {
  margin-bottom: 18px;
}
.project:last-child { margin-bottom: 0; }

.project-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
}

.project-title a {
  color: inherit;
  border-bottom: 1px dotted var(--text-muted);
}
.project-title a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.project-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

/* Empty-section placeholder */
.placeholder {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
}

/* GitHub recent activity widget */
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-list li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.activity-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.activity-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}
.activity-list a:hover { color: var(--accent); }
.activity-list a:hover .activity-msg { color: var(--accent); }

.activity-repo {
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82em;
  white-space: nowrap;
}

.activity-msg {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  transition: color 0.15s ease;
}

.activity-time {
  color: var(--text-muted);
  font-size: 0.82em;
  white-space: nowrap;
}

@media (max-width: 639px) {
  .activity-list a {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .activity-msg { white-space: normal; }
}

/* Open for collaboration paragraph */
section:last-child p {
  margin: 0;
  font-size: 1rem;
}

/* ─── Responsive ─── */

/* Tablet: collapse to single column, sidebar becomes a centered profile card */
@media (max-width: 959px) {
  .page {
    grid-template-columns: 1fr;
    gap: 36px;
    max-width: 680px;
    justify-items: center;
  }

  .sidebar {
    position: static;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 320px;
  }

  .photo {
    margin-bottom: 18px;
    /* width:100% + aspect-ratio:1 from base — fills the 320px sidebar */
  }

  .name, .role { text-align: center; }
  .affiliations { align-items: center; margin-bottom: 22px; }

  .content {
    width: 100%;
    max-width: 680px;
  }

  /* Contact becomes a horizontal chip row */
  .contact {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 18px 0 0;
    width: 100%;
    border-top: 1px solid var(--rule);
    font-size: 0.88rem;
  }

  .contact li {
    background: var(--bg-soft);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0;
    min-height: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
  }

  /* Link chips: the <a> fills the chip so the whole pill is clickable */
  .contact li:has(a) { transition: border-color 0.15s ease, background 0.15s ease; }
  .contact li:has(a):hover {
    border-color: var(--accent);
    background: #262626;
  }

  .contact a {
    display: flex;
    width: 100%;
    padding: 8px 14px;
    gap: 8px;
  }

  .contact .ico { width: 16px; height: 16px; }
  .contact .ico svg { width: 14px; height: 14px; }
}

/* Phone: tighter padding, smaller sidebar card */
@media (max-width: 639px) {
  body { font-size: 15px; }

  .page {
    padding: 32px 18px 48px;
    gap: 32px;
  }

  .sidebar { max-width: 260px; }

  .photo {
    margin-bottom: 14px;
    border-radius: 16px;
  }

  .name {
    font-size: 1.32rem;
    margin-bottom: 6px;
  }
  .role { font-size: 0.98rem; }
  .affiliations { font-size: 0.84rem; margin-bottom: 18px; }

  .contact {
    padding-top: 16px;
    font-size: 0.85rem;
  }
  .contact li { padding: 7px 12px; }

  .section-h { font-size: 1.08rem; }

  .news li {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid var(--rule);
  }
  .news li:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .bio p { font-size: 0.97rem; }
  .job ul { font-size: 0.93rem; padding-left: 18px; }
  .job ul li { margin-bottom: 6px; }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .page { padding: 24px 14px 40px; }
  .sidebar { max-width: 220px; }
  .name { font-size: 1.22rem; }
}

/* Honour reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .photo-link:hover { transform: none; box-shadow: none; }
}
