/* bruno brissa: one stylesheet, values from the site guide (figma). */

@font-face {
  font-family: "Alice";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/alice-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alice";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/alice-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- breakpoint values: mobile first ---------- */
:root {
  --m: 24px;            /* margin, all four sides */
  --gap: 16px;          /* column gap */
  --large: 25px;        /* site name, menu */
  --body: 20px;         /* everything on the page */
  --small: 15px;        /* footer */
  --half: 12px;         /* label to field */
  --gs: 24px;           /* small gap */
  --gl: 48px;           /* large gap */
  --hdr: 173px;         /* header row */
  --ftr: 100px;         /* footer row */
  --field: 48px;        /* field and button height */
  --menu: 0px;          /* space between menu words (not used on mobile) */
  --black: #000;
  --grey: #6b6b6b;
  --line: #8c8c8c;
  --red: #c62828;
  --slant: skewX(-40deg);
  color-scheme: light;
}
@media (min-width: 700px) {
  :root { --m: 48px; --gap: 20px; --large: 27px; --body: 22px; --small: 17px; --half: 16px; --gs: 32px; --gl: 64px; --hdr: 86px; --ftr: 72px; --field: 51px; --menu: 48px; }
}
@media (min-width: 1100px) {
  :root { --m: 80px; --gap: 24px; --large: 30px; --body: 25px; --small: 20px; --half: 20px; --gs: 40px; --gl: 80px; --hdr: 94px; --ftr: 80px; --field: 55px; --menu: 60px; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--black);
  font: 400 var(--body)/1.4 "Alice", Georgia, serif;
  font-synthesis: none;
  hyphens: manual;
  overflow-wrap: normal;
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, figure { margin: 0; }
h2 { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; cursor: pointer; }
.underline, .cv { text-decoration: underline; text-decoration-thickness: 1px; }

/* ---------- page stack ---------- */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--m);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

/* ---------- slant (hover, focus, active) ---------- */
.slant { display: inline-block; transform-origin: center; }
.slant.active { transform: var(--slant); }
.slant:focus-visible { transform: var(--slant); outline: none; }
@media (hover: hover) {
  .slant:hover { transform: var(--slant); }
}
@media (hover: hover) and (pointer: fine) {
  .slant, .contact-form button span { transition: transform 150ms ease-out; }
}

/* ---------- header ---------- */
.site-header {
  flex: none;
  height: var(--hdr);
  font-size: var(--large);
  line-height: 1.4;
}
.site-header .name { text-align: center; }
.site-header .name a:focus-visible { outline: 1px solid var(--black); outline-offset: 4px; }
.site-header nav {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
.site-header nav a:nth-child(1) { justify-self: start; }
.site-header nav a:nth-child(2) { justify-self: center; }
.site-header nav a:nth-child(3) { justify-self: end; }
@media (min-width: 700px) {
  .site-header { display: flex; justify-content: space-between; align-items: flex-start; }
  .site-header .name { text-align: left; }
  .site-header nav { margin-top: 0; display: flex; gap: var(--menu); }
}

/* ---------- footer ---------- */
.site-footer {
  flex: none;
  height: var(--ftr);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  font-size: var(--small);
  line-height: 1.4;
  color: var(--grey);
}
.site-footer .linkedin { justify-self: start; }
.site-footer .copy { justify-self: center; text-align: center; }
.site-footer .privacy { justify-self: end; }

/* ---------- short pages (contact): centred in the content area ---------- */
main.short { display: flex; align-items: center; justify-content: center; }
.short-content { width: 100%; }
@media (min-width: 700px) {
  /* 6 of 8 columns on tablet, 6 of 12 on desktop */
  .short-content { width: calc(75% - 5px); }
}
@media (min-width: 1100px) {
  .short-content { width: calc(50% - 12px); }
}

/* ---------- projects page ---------- */
main.projects { display: flex; flex-direction: column; align-items: center; gap: var(--gs); }
.project { position: relative; display: block; width: 100%; padding-top: calc(var(--body) * 1.4); }
.project img { width: 100%; }
.project .cap {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1;
  text-align: center;
}
.project .cap span { display: block; }
.project:focus-visible { outline: 1px solid var(--black); outline-offset: 4px; }
@media (min-width: 700px) { .project { width: calc(75% - 5px); } }
@media (min-width: 1100px) { .project { width: calc(50% - 12px); } }

/* ---------- project pages ---------- */
.pages { display: flex; flex-direction: column; gap: var(--gs); }
.pdf-page { position: relative; width: 100%; container-type: inline-size; }
.pdf-page img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pdf-page.spread { display: none; }
@media (min-width: 1100px) {
  .pdf-page.spread { display: block; }
  .pdf-page.half { display: none; }
}
.text-layer { position: absolute; inset: 0; }
.text-layer span {
  position: absolute;
  white-space: pre;
  line-height: 1;
  color: transparent;
  font-family: "Alice", serif;
  transform-origin: 0 0;
  cursor: text;
}
.text-layer span::selection { background: rgba(0, 90, 255, 0.25); color: transparent; }

/* ---------- about ---------- */
main.about > * + * { margin-top: var(--gs); }
main.about .photo { margin: var(--gl) 0; }
main.about .photo + p { margin-top: 0; }
.photo figcaption { display: none; }
@media (min-width: 700px) {
  main.about .photo img { width: calc(50% - 10px); margin: 0 auto; }  /* 4 of 8 columns */
}
@media (min-width: 1100px) {
  main.about {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap);
    row-gap: var(--gs);
    align-content: start;
  }
  main.about > * + * { margin-top: 0; }
  main.about > p { grid-column: 1 / 8; }
  main.about .photo {
    grid-column: 9 / 13;
    grid-row: 1 / span 5;
    align-self: center;
    margin: 0;
  }
  main.about .photo img { width: 100%; }
  .photo figcaption { display: block; margin-top: var(--half); text-align: center; }
  main.about .cv-after { display: none; }
}
main.about .photo img { aspect-ratio: 3 / 4; object-fit: cover; }

/* ---------- privacy ---------- */
main.privacy section + section { margin-top: var(--gl); }

/* ---------- contact form ---------- */
.contact-form label { display: block; margin-bottom: var(--half); }
.contact-form input, .contact-form textarea, .contact-form button {
  display: block;
  width: 100%;
  height: var(--field);
  margin: 0 0 var(--gs);
  padding: 10px;
  font: inherit;
  color: var(--black);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.contact-form textarea { height: 150px; resize: none; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--black); }
.contact-form .invalid, .contact-form .invalid:focus { border-color: var(--red); color: var(--red); }
.contact-form ::placeholder { color: var(--red); opacity: 1; }
.contact-form button { width: auto; margin: 0; padding: 0 30px; cursor: pointer; }
.contact-form button span { display: inline-block; }
.contact-form button:focus-visible { border-color: var(--black); }
.contact-form button:focus-visible span { transform: var(--slant); }
@media (hover: hover) { .contact-form button:hover span { transform: var(--slant); } }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--red); margin-top: var(--half); }
main.short { container-type: inline-size; }
.form-done {
  text-align: center;
  white-space: nowrap;
  /* never larger than body size; shrinks evenly so line 1 never breaks (11.9 = its width in em) */
  font-size: min(var(--body), calc(100cqw / 11.9));
}

/* ---------- splash ---------- */
#splash { display: none; }
html.splash body { overflow: hidden; }
html.splash #splash {
  position: fixed; inset: 0; z-index: 100;
  background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: splash-out 1s linear 3s forwards;
  cursor: default;
  /* 30 px, shrinking evenly on very narrow screens (9.9 = width of the longer text line in em) */
  font-size: min(30px, calc((100vw - 48px) / 9.9));
}
#splash .dots { display: flex; justify-content: center; gap: 0.2667em; }
#splash i { display: block; width: 0.6333em; height: 0.6333em; border-radius: 50%; background: var(--black); }
#splash .dots[data-n="1"] i:nth-child(n+2), #splash .dots[data-n="2"] i:nth-child(3) { display: none; }
#splash p { margin-top: 1.0667em; font-size: 1em; line-height: 1.4; text-align: center; white-space: nowrap; }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
html.splash.splash-skip #splash { animation: splash-out 1s linear forwards; }
@media (prefers-reduced-motion: reduce) {
  #splash .dots i { display: block !important; }
}
