/* Denis Matějíček - Architectural Portfolio */

/* Fonts (self-hosted, SIL Open Font License) ------------------------------------------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("archivo-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("archivo-latin.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("plexmono-400-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("plexmono-400-latin.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("plexmono-500-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("plexmono-500-latin.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;
}

/* Tokens: black and white only ---------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #000000;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --wrap: 1360px;
  --gutter: 24px;
  --header-h: 64px;
  --text-col: 380px;
  --col-gap: 40px;
}

/* Base ------------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

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

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

strong { font-weight: 600; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
}
.skip-link:focus { left: 16px; top: 16px; }

/* Header ---------------------------------------------------------------------------------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--ink);
}

@media (min-width: 720px) {
  .site-header { position: sticky; top: 0; z-index: 10; }
}

.nav {
  min-height: var(--header-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 32px;
}

.brand {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1;
  padding: 12px 0;
}
.brand:hover { text-decoration: none; }

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav ul a { display: inline-block; padding: 12px 0; }

/* Hero ------------------------------------------------------------------------------------ */
.hero { padding-top: 72px; }

.hero h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(42px, 7.4vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.hero-figure { margin: 48px 0 0; }

.hero-figure img {
  width: 100%;
  height: clamp(300px, 52vw, 760px);
  object-fit: cover;
}

/* On wider screens the title sits on the visualization, in the sky. */
@media (min-width: 720px) {
  .hero { display: grid; padding-top: var(--gutter); container-type: inline-size; }
  .hero > * { grid-area: 1 / 1; }
  .hero h1 {
    z-index: 1;
    align-self: start;
    padding: 3cqw 0 0 3cqw;
    color: var(--bg);
    font-size: 4.8cqw;
  }
  .hero-figure { margin: 0; background: var(--ink); }   /* keeps the white title readable while the image loads */
}

figcaption {
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Contents -------------------------------------------------------------------------------- */
.contents { padding-top: 112px; }

.label {
  margin: 0 0 24px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.25;
}

.toc a {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ink);
}

.toc-num { font-family: var(--mono); font-size: 14px; }
.toc-sub { display: block; margin-top: 4px; font-size: 15px; }

/* Profile --------------------------------------------------------------------------------- */
.profile { padding-top: 112px; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 48px 64px;
}

.profile-left { display: flex; flex-direction: column; gap: 28px; }

.monogram {
  margin: 0;
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.leads p {
  margin: 0;
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.leads p + p { margin-top: 8px; }

.profile h3,
.page-body h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-right { display: flex; flex-direction: column; gap: 18px; }
.profile-right p { margin: 0; }
.profile-right h3:not(:first-child) { margin-top: 18px; }

.contact h3 { margin-bottom: 6px; }
.contact p { margin: 0; padding: 4px 0; }

.focus {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}

.focus-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px 40px;
  font-size: 16px;
}

/* Projects: one block per PDF page -------------------------------------------------------- */
.project { padding-top: 144px; }

.project-head,
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 32px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}

.project-head h2,
.project-head h3,
.section-head h2 {
  margin: 0;
  max-width: 22ch;
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 66px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 24px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.meta dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta dd { margin: 2px 0 0; }

/* On title pages the project data lines up with the visual below it. */
.meta[style] {
  width: var(--w, 100%);
  margin-left: var(--x, 0);
  justify-content: space-between;
}

.pdf-page { margin-top: 112px; }

.page-head h3 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.page-body {
  --cols: 1;
  max-width: calc(var(--cols) * var(--text-col) + (var(--cols) - 1) * var(--col-gap));
  margin-top: 28px;
  columns: var(--cols) 300px;
  column-gap: var(--col-gap);
}

.page-body p { margin: 0 0 1em; }
.page-body > :last-child { margin-bottom: 0; }
.page-body h4 { margin: 0 0 1em; }

/* Pages whose paragraphs stay inside their PDF column get the same columns. */
.page-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 0 var(--col-gap);
  columns: auto;
}
.page-col > :last-child { margin-bottom: 0; }

.page-body .sub {
  font-size: clamp(22px, 2.2vw, 31px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.project-head + .meta + .page-body { margin-top: 32px; }

/* Text that lines up with the visual below it (FIT_VISUAL in build.py), like .meta[style]. */
.page-body.fit-visual {
  max-width: none;
  width: var(--w, 100%);
  margin-left: var(--x, 0);
  columns: auto;
}

.quote { margin: 0 0 1em; padding: 0; }
.quote p { margin: 0; }
.quote footer { margin-top: 10px; text-align: right; }

.page-visual {
  width: var(--w, 100%);
  margin: 32px 0 0 var(--x, 0);
}

.page-visual a { display: block; cursor: zoom-in; }
.page-visual img { width: 100%; }

/* Pages with the text beside the visual: text columns and parts of the visual share one grid.
   Tracks and areas come from the PDF positions (custom properties set by build.py). Medium screens
   put the text columns side by side and the parts of the visual below them. */
.page-layout { max-width: none; columns: auto; }

@media (min-width: 720px) {
  .page-layout {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, var(--text-col))) minmax(0, 1fr);
    column-gap: var(--col-gap);
  }
  .page-layout > .page-visual { grid-column: 1 / -1; }

  /* The slide keeps its text inside the image; the HTML copy is for small screens and readers. */
  .text-in-image > .page-head,
  .text-in-image > .page-body {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .text-in-image > .page-visual { margin-top: 0; }
}

@media (min-width: 1024px) {
  .page-layout {
    grid-template-columns: var(--gtc);
    grid-template-areas: var(--gta);
    grid-template-rows: var(--gtr);
    gap: 24px 0;
    width: var(--lw);
    margin-left: var(--lx);
  }
  .page-layout > .page-col,
  .page-layout > .page-visual { grid-area: var(--area); }
  .page-layout > .page-visual { width: auto; margin: 0; align-self: start; }
}

/* Other projects -------------------------------------------------------------------------- */
.other { padding-top: 144px; }
.other-item { padding-top: 96px; }
.other-item .project-head { border-top: 0; padding-top: 0; }
.other-item .project-head h3 { font-size: clamp(28px, 3.6vw, 52px); }

/* Tables ---------------------------------------------------------------------------------- */
.table-section { padding-top: 144px; }
.table-section + .table-section { padding-top: 112px; }

.table-section .section-head { margin-bottom: 28px; }
.table-section .section-head h2 { max-width: none; font-size: clamp(26px, 3.2vw, 44px); line-height: 1.1; }

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
}
#sidework table { min-width: 900px; }

thead th {
  padding: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody th,
tbody td {
  padding: 11px 12px;
  border-top: 1px solid var(--ink);
  text-align: left;
  vertical-align: top;
}

tbody th { font-weight: 500; }
tbody td { white-space: nowrap; }
tbody td.cell-wrap { white-space: normal; }
thead th:first-child, tbody th { padding-left: 0; }
thead th:last-child, tbody td:last-child { padding-right: 0; }

/* Footer ---------------------------------------------------------------------------------- */
.site-footer { padding-top: 144px; padding-bottom: 56px; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 40px 64px;
  align-items: end;
  padding-top: 40px;
  border-top: 1px solid var(--ink);
}

.footer-grid h2 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.footer-contact { font-size: 19px; }
.footer-contact h3 {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  margin-top: 72px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.footer-bottom a { padding: 8px 0; }

/* Lightbox -------------------------------------------------------------------------------- */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--ink);
}
.lightbox::backdrop { background: var(--bg); }
.lightbox[open] { display: flex; flex-direction: column; }

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px var(--gutter);
  border-bottom: 1px solid var(--ink);
}

.lightbox-caption {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
}

.lightbox-img {
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox button {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.lightbox button:hover { background: var(--ink); color: var(--bg); }

/* Small screens --------------------------------------------------------------------------- */
@media (max-width: 719px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 16px; }
  body { font-size: 16px; }
  .hero { padding-top: 48px; }
  .hero-figure { margin-top: 32px; }
  .contents, .profile { padding-top: 80px; }
  .project, .other, .table-section, .site-footer { padding-top: 96px; }
  .pdf-page { margin-top: 72px; }
  .other-item { padding-top: 72px; }
  .page-body { max-width: none; }
  .page-body.fit-visual { width: auto; margin-left: 0; }
  .page-grid { grid-template-columns: 1fr; }
  .page-col + .page-col { margin-top: 1em; }
  .page-visual { width: 100%; margin-left: 0; margin-top: 24px; }
  .nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; width: 100%; }
  .meta,
  .meta[style] { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-left: 0; }
  .lightbox-stage { position: relative; padding: 16px 0 76px; }
  .lightbox-prev, .lightbox-next { position: absolute; bottom: 16px; }
  .lightbox-prev { left: var(--gutter); }
  .lightbox-next { right: var(--gutter); }
}
