/* Thiago Weber — CV site
   One quiet page, the way a shared Notion document reads: slim cover, small portrait,
   large serif title, properties, then sections divided by hairlines in one centred column.
   Instrument Serif for everything; hierarchy by size and italic only.
   Content lives in index.html and pt/index.html; this file is shared. */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #37352f;
  --muted: #6f6e6a;
  --hair: rgba(55, 53, 47, 0.16);
  --block: #f1f1ef;
  --tag-bg: #fbf3db;
  --tag-ink: #402c1b;
  --font: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --column: 720px;
  --gutter: 24px;
  --radius: 4px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base ----------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: #c9c8c4 var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(55, 53, 47, 0.14);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--radius);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

p,
h1,
h2,
h3,
ul,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 400;
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(55, 53, 47, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  transition: text-decoration-color 0.2s var(--ease-out);
}

a:hover {
  text-decoration-color: var(--ink);
}

hr {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 40px 0;
}

em {
  font-style: italic;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 6px 10px;
  background: var(--paper);
  z-index: 10;
}

.skip:focus {
  top: 8px;
}

/* Top bar ---------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 44px;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hair);
  font-size: 17px;
  line-height: 1;
}

.topbar a {
  text-decoration: none;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--radius);
  transition: background-color 0.2s var(--ease-out);
}

.topbar a:hover {
  background: var(--block);
}

.topbar__name {
  white-space: nowrap;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
  color: var(--muted);
}

.topbar__nav a {
  margin: 0;
  padding: 6px 8px;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.lang a,
.lang span {
  padding: 5px 7px;
  border-radius: var(--radius);
  margin: 0;
}

.lang [aria-current="true"] {
  color: var(--ink);
  background: var(--block);
}

/* Cover and column ------------------------------------------------------- */

.cover {
  height: 240px;
  overflow: hidden;
  background: var(--block);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}

.page {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 80px;
  animation: rise 0.4s var(--ease-out) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.icon {
  width: 96px;
  height: 96px;
  margin-top: -48px;
  border-radius: var(--radius);
  outline: 2px solid var(--paper);
  object-fit: cover;
  background: var(--block);
}

h1 {
  font-size: clamp(44px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-top: 24px;
}

.role {
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.4;
  font-style: italic;
  color: var(--muted);
}

/* Properties ------------------------------------------------------------- */

.props {
  margin-top: 28px;
  font-size: 17px;
  line-height: 1.5;
}

.props > div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  padding: 6px 0;
}

.props dt {
  color: var(--muted);
}

.props dd a {
  display: inline-block;
  margin: -2px -6px;
  padding: 2px 6px;
  border-radius: var(--radius);
  transition: background-color 0.2s var(--ease-out), text-decoration-color 0.2s var(--ease-out);
}

.props dd a:hover {
  background: var(--block);
}

/* Sections --------------------------------------------------------------- */

h2 {
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 20px;
}

.lead,
.entry > p,
.entry li,
.after-quote,
blockquote p {
  max-width: 70ch;
}

.lead {
  font-size: 19px;
  line-height: 1.6;
}

.lead + .lead {
  margin-top: 16px;
}

/* Entries */

.entry + .entry {
  margin-top: 36px;
}

.entry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

h3 {
  font-size: 24px;
  line-height: 1.25;
}

.when {
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
}

.tag {
  display: inline-block;
  vertical-align: 0.2em;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 15px;
  line-height: 1.4;
  background: var(--tag-bg);
  color: var(--tag-ink);
  border-radius: var(--radius);
}

.entry__role {
  margin-top: 2px;
  font-style: italic;
  color: var(--muted);
}

.entry > p:not(.entry__role) {
  margin-top: 12px;
}

.entry ul {
  margin-top: 10px;
  padding-left: 1.2em;
  list-style: disc;
}

.entry li + li {
  margin-top: 6px;
}

.entry li::marker {
  color: var(--muted);
}

/* Table (education) */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
  line-height: 1.45;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--hair);
}

.table th:first-child {
  width: 30%;
}

.table thead th {
  color: var(--muted);
  font-weight: 400;
  background: #fbfbfa;
}

.table tbody th {
  font-weight: 400;
}

.table small {
  display: block;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.table td.years {
  white-space: nowrap;
}

.table .note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

/* Skills as properties */

.skills > div {
  grid-template-columns: 200px minmax(0, 1fr);
}

/* Interests */

blockquote {
  padding-left: 18px;
  border-left: 2px solid var(--ink);
  font-size: 22px;
  line-height: 1.45;
  font-style: italic;
}

blockquote p {
  text-wrap: pretty;
}

blockquote p + p {
  margin-top: 12px;
}

.after-quote {
  margin-top: 18px;
  color: var(--muted);
}

/* Foot ------------------------------------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 24px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
}

.foot .lang {
  margin-left: 0;
  font-size: 15px;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 720px) {
  .topbar__nav > a {
    display: none;
  }

  .cover {
    height: 160px;
  }

  .icon {
    width: 72px;
    height: 72px;
    margin-top: -36px;
  }

  h1 {
    margin-top: 18px;
  }

  .role {
    font-size: 20px;
  }

  .props > div,
  .skills > div {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 0;
  }

  .props dt {
    font-size: 15px;
  }

  hr {
    margin: 32px 0;
  }

  .entry__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .when {
    white-space: normal;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
  }

  .table th,
  .table td {
    border: 0;
    padding: 0;
  }

  .table tr {
    padding: 12px 0;
    border-top: 1px solid var(--hair);
  }

  .table tr:last-child {
    border-bottom: 1px solid var(--hair);
  }

  .table td.years {
    color: var(--muted);
    margin-top: 2px;
  }
}

/* Motion preferences --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .page {
    animation: none;
  }

  a,
  .topbar a,
  .props dd a {
    transition: none;
  }
}

/* Print ------------------------------------------------------------------- */

@media print {
  .topbar,
  .skip,
  .cover {
    display: none;
  }

  .icon {
    margin-top: 0;
    outline: 0;
  }

  .page {
    animation: none;
    max-width: none;
    padding: 0;
  }

  a {
    text-decoration: none;
  }

  hr {
    margin: 24px 0;
  }
}
