/* Rifael Eurico Sitorus — portfolio */

:root {
  --ink: #18364a;
  --blue: #2d566b;
  --muted: #69767d;
  --paper: #fffdf8;
  --cream: #f3efe5;
  --line: #dddeda;
  --orange: #c8754f;
  --peach: #e5a374;
  --softblue: #e8eef0;
  --side-text: #b8c8d2;

  --sans: "Schibsted Grotesk", "Segoe UI", Arial, sans-serif;

  /* desktop frame: sidebar + content share one centred 1240px frame */
  --frame: 1240px;
  --side-inner: 360px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: fixed; top: -100px; left: 15px; z-index: 100;
  background: var(--orange); color: #fff; padding: 10px; font-size: 13px;
}
.skip-link:focus { top: 10px; }

/* =====================================================================
   Desktop (≥ 1024px): navy sidebar on the left, content on the right
   ===================================================================== */
.layout {
  display: grid;
  /* the sidebar column grows on wide screens so the 1240px frame stays centred */
  grid-template-columns: max(340px, calc((100% - var(--frame)) / 2 + var(--side-inner))) minmax(0, 1fr);
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--ink);
  color: var(--paper);
}
.side-inner {
  width: 100%;
  max-width: var(--side-inner);
  min-height: 100%;
  margin-left: auto;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.id { display: flex; flex-direction: column; gap: 22px; }
.photo {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 15%;
  filter: grayscale(1) contrast(1.05);
  border: 3px solid rgba(255, 253, 248, 0.14);
}
.side h1 {
  font-size: clamp(28px, 2.3vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.role { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--peach); }
.role span { white-space: nowrap; } /* break the line at "&", not inside a phrase */
.side-intro { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--side-text); max-width: 280px; }

.side-nav { order: 3; display: flex; flex-direction: column; margin-top: 36px; }
.side-nav a {
  padding: 7px 0 7px 14px;
  border-left: 2px solid rgba(255, 253, 248, 0.14);
  font-size: 14px;
  font-weight: 600;
  color: var(--side-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.side-nav a:hover { color: var(--paper); }
.side-nav a.active { color: var(--paper); border-left-color: var(--orange); }

.side-actions { order: 4; margin-top: 36px; }
.cv-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-radius: 6px;
  background: var(--peach);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s;
}
.cv-button:hover { background: var(--paper); }
.side-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: 13px; }
.side-links a { color: var(--side-text); text-decoration: none; transition: color .2s; }
.side-links a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- content ---------- */
.content {
  width: 100%;
  max-width: calc(var(--frame) - var(--side-inner));
  padding: 72px 48px 40px 72px;
}
.content section { margin-bottom: 88px; scroll-margin-top: 40px; }

.sec-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* about */
.about-text { display: grid; gap: 14px; max-width: 680px; }
.about-text p { font-size: 16px; line-height: 1.75; color: var(--muted); }
.about-text .lead { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.5; color: var(--ink); font-weight: 500; letter-spacing: -0.01em; }

.numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 32px;
  background: var(--cream);
  border-radius: 10px;
}
/* number on top, label under it, so the numbers line up */
.numbers > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 20px 22px; }
.numbers > div + div { border-left: 1px solid #e2dccd; }
.numbers dt { font-size: 12px; line-height: 1.45; color: var(--muted); }
.numbers dd { margin: 0; font-size: clamp(22px, 2.1vw, 28px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; white-space: nowrap; }
.numbers small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* experience */
.job, .edu {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 24px;
  padding: 20px;
  margin: 0 -20px;
  border-radius: 10px;
  transition: background-color .2s;
}
.job:hover { background: var(--softblue); }
.job-date { padding-top: 3px; font-size: 13px; font-weight: 600; color: var(--muted); }
.job h3, .edu h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.job-org { margin-top: 2px; font-size: 14px; color: var(--muted); }
.job-org a { color: var(--ink); text-decoration-color: var(--orange); text-underline-offset: 3px; }
.job-points { display: grid; gap: 6px; margin-top: 12px; }
.job-points li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.6; }
.job-points li::before { content: "–"; position: absolute; left: 0; color: var(--orange); }
.edu { margin: 8px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); border-radius: 0; }

/* "Show details" button, added by main.js, used on phones only */
.job-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.job-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--orange);
  border-bottom: 1.5px solid var(--orange);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s;
}
.job.open .job-toggle::after { transform: translateY(1px) rotate(-135deg); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags li {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--softblue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}
.job:hover .tags li { background: var(--paper); }

/* projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
/* odd number of projects: the last one fills the row instead of leaving an empty slot */
.project:last-child:nth-child(odd) { grid-column: 1 / -1; }
.project {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: 10px;
  background: var(--cream);
  border: 1px solid transparent;
  transition: transform .2s, border-color .2s;
}
.project:hover { transform: translateY(-2px); border-color: #d9d2c0; }
.project-type { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); }
.project h3 { margin-top: 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.project > p:not(.project-type) { margin-top: 8px; font-size: 14.5px; line-height: 1.65; color: var(--muted); }
.project .tags { margin-top: auto; padding-top: 16px; }
.project .tags li { background: var(--paper); }

/* awards */
.awards li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.awards li:first-child { padding-top: 0; }
.awards h3 { font-size: 16px; font-weight: 700; line-height: 1.4; }
.awards p { margin-top: 2px; font-size: 14px; color: var(--muted); }
.awards span { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.skills > div { padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; }
.skills h3 { font-size: 15px; font-weight: 700; }
.skills p { margin-top: 6px; font-size: 14px; line-height: 1.65; color: var(--muted); }

/* contact */
.contact > p { font-size: 16px; color: var(--muted); }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 12px; }
.mail {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 2px solid var(--orange);
  transition: color .2s;
}
.mail:hover { color: var(--orange); }
.copy {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  transition: background-color .2s, border-color .2s;
}
.copy:hover { border-color: var(--ink); }
.copy.done { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.foot { padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* =====================================================================
   Small laptops (1024–1199px)
   ===================================================================== */
@media (max-width: 1199px) {
  .layout { grid-template-columns: 320px minmax(0, 1fr); }
  .side-inner { padding: 40px 32px; }
  .content { max-width: none; padding: 64px 44px 40px 52px; }
}

/* =====================================================================
   Tablet (641–1023px): navy header on top, content centred below
   ===================================================================== */
@media (max-width: 1023px) {
  .layout { display: block; }
  .side { position: sticky; top: var(--stick-top, auto); z-index: 20; height: auto; overflow: visible; }
  .side-inner {
    max-width: 760px;
    min-height: 0;
    margin: 0 auto;
    padding: 40px 32px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "id     actions"
      "intro  actions"
      "nav    nav";
    column-gap: 32px;
    align-items: start;
  }
  .id { grid-area: id; flex-direction: row; align-items: center; gap: 20px; }
  .photo { width: 80px; height: 80px; }
  .side h1 { font-size: 32px; }
  .side-intro { grid-area: intro; max-width: 420px; }
  .side-actions { grid-area: actions; margin-top: 4px; display: flex; flex-direction: column; align-items: flex-end; }
  .side-links { justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
  .side-nav {
    grid-area: nav;
    flex-direction: row;
    gap: 28px;
    margin-top: 28px;
    border-top: 1px solid rgba(255, 253, 248, 0.14);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { padding: 16px 0 14px; border-left: 0; border-bottom: 2px solid transparent; }
  .side-nav a.active { border-bottom-color: var(--orange); }

  .content { max-width: 760px; margin: 0 auto; padding: 56px 32px 40px; }
  .content section { margin-bottom: 72px; scroll-margin-top: 72px; }
}

/* =====================================================================
   Phone (≤ 640px)
   ===================================================================== */
@media (max-width: 640px) {
  /* header: a profile card instead of a thin strip */
  .side-inner {
    padding: 36px 20px 0;
    grid-template-columns: 1fr;
    grid-template-areas: "id" "intro" "actions" "nav";
  }
  .id { flex-direction: column; align-items: flex-start; gap: 18px; }
  .photo { width: 84px; height: 84px; border-width: 2px; }
  .side h1 { font-size: 28px; }
  .role { margin-top: 6px; font-size: 15px; }
  .side-intro { margin-top: 12px; font-size: 14px; max-width: none; }
  .side-actions { margin-top: 24px; flex-direction: column; align-items: stretch; gap: 14px; }
  .cv-button { justify-content: center; padding: 12px 18px; }
  .side-links { margin-top: 0; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .side-links a {
    display: inline-block;
    padding: 6px 13px;
    border: 1px solid rgba(255, 253, 248, 0.2);
    border-radius: 999px;
    color: var(--paper);
  }
  .side-links a:hover { text-decoration: none; border-color: var(--paper); }
  .side-nav {
    gap: 20px;
    margin: 26px -20px 0;
    padding: 0 40px 0 20px;
    /* fade on the right edge: there is more to scroll */
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
            mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .side-nav a { padding: 14px 0 12px; font-size: 13.5px; }

  .content { padding: 44px 20px 32px; }
  .content section { margin-bottom: 60px; }
  .sec-title { margin-bottom: 18px; }

  /* about: one sentence + number tiles (the longer paragraphs repeat the Experience section) */
  .about-text p:not(.lead) { display: none; }
  .about-text .lead { font-size: 19px; }
  .numbers { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 24px; background: none; border-radius: 0; }
  .numbers > div { padding: 16px; border-radius: 12px; background: var(--cream); }
  .numbers > div + div { border-left: 0; }
  .numbers > div:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .numbers dd { font-size: 22px; }

  /* experience: one card per job, bullet points behind "Show details" */
  .jobs { display: grid; gap: 10px; }
  .job, .edu { grid-template-columns: 1fr; gap: 6px; margin: 0; padding: 18px; border-radius: 12px; background: var(--cream); }
  .job:hover { background: var(--cream); }
  .job .tags li, .job:hover .tags li { background: var(--paper); }
  .job-date { padding-top: 0; font-size: 12.5px; }
  .job h3, .edu h3 { font-size: 16.5px; }
  .job-points li { font-size: 14.5px; }
  .js .job:not(.open) .job-points { display: none; }
  .js .job-toggle { display: inline-flex; }
  .edu { margin-top: 10px; border-top: 0; }

  .awards li { flex-direction: column; gap: 2px; }
  .awards span { order: -1; font-size: 12.5px; }
  .awards span:empty { display: none; }
  .skills > div { padding: 16px 18px; }
}

/* narrow phones (≤ 380px): keep the four link buttons on one line */
@media (max-width: 380px) {
  .side-links { gap: 6px; }
  .side-links a { padding: 5px 10px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
